This repository contains Asciidoctor extensions made by Neo4j for processing and publishing AsciiDoc content.
The Ruby gem contains 6 distinct extensions:
A postprocessor that adds attributes about a course on the Document
.
🔥
|
This extension is tightly coupled to the course publishing project and should not be used for other purposes |
require 'neo4j/asciidoctor/extensions/course_document_attributes'
A tree processor that adds a role on code blocks using "cypher-syntax" as a language.
A postprocess that generates a metadata file (in YAML format) from a list of document attributes.
require 'neo4j/asciidoctor/extensions/document_metadata_generator'
:document-metadata-attrs-include: author,slug,parent-path,tags*,taxonomies*<>
:tags: intro,course
:taxonomies: os=linux,programming_language=java,neo4j_version=3-5;3-6
:slug: intro-neo4j-4-0
:parent_path: /intro
slug: intro-neo4j-4-0
parent_path: /intro
author:
name: Michael Hunger
first_name: Michael
last_name: Hunger
email: [email protected]
tags:
- intro
- course
taxonomies:
- key: os
values:
- linux
- key: programming_language
values:
- java
- key: neo4j_version
values:
- 3-5
- 3-6
Inline syntax highlighter based on Rouge.
It applies syntax highlighting on both monospaced text cypher and src
inline macro:
A tree process that "flatten" a reveal.js presentation to use a linear navigation. By default, the reveal.js converter will use a vertical navigation for the second levels of section titles (and below). This extension will effectively prevent that by using only first level section titles.
A tree processor that aggregates multiple [.notes]
blocks in a section (slide).
A tree processor that update an attribute depending on a given rule.
In the example below, we update the value of the slug
attribute depending on the stage
attribute:
require 'asciidoctor/extensions'
require 'neo4j/asciidoctor/extensions/attribute_update/extension'
Asciidoctor::Extensions.register do
ext = Neo4j::AsciidoctorExtensions::AttributeUpdateTreeProcessor
tree_processor ext.new attr_name: 'slug',
update_rule: lambda { |document, value|
case document.attr('stage')
when 'production'
value
when 'development'
"_dev_#{value}"
else
"_test_#{value}"
end
}
end
The release process is automated and relies on GitHub Actions.
We are using the 🤖 neo4j-oss-build
account to publish on https://rubygems.org/gems/neo4j-asciidoctor-extensions.
The RUBYGEMS_API_KEY
secret is configured on GitHub.
See the .github/workflows/release.yml
file for details.
The release will be performed when a tag is pushed, the procedure is:
-
Edit
neo4j-asciidoctor-extensions.gemspec
and update the version numbers.version
-
Run
bundle exec rake
to make sure that everything is working -
Commit both
neo4j-asciidoctor-extensions.gemspec
andGemfile.lock
files -
Tag the version using
git tag vx.y.z
(don’t forget thev
prefix and replacex.y.z
with an actual version) -
Push your changes with the tag:
git push origin master --tags