Asciidoctor Defmastership module is dedicated to preprocess asciidoctor files which have specific lines as follows:
-
For comment lines do nothing
-
For other lines check line against a vector of regexp and for each match replace the parsed lines with new content
-
Follows a list of noticeable transformations, for a complete list refers to spec/unit/asciidoctor/def_mastership/preprocessor_spec.rb
-
Lines like [define,requirement,XXYY] add title XXYY, anchor point and call style define.requirement located in stylesheet of renderer
-
Add a dedicated style to checksums and option for visibility or not
-
Add attribute to requirements
The style inserted by preprocessor can then be parsed whith appropriate stylesheet : * html ⇒ CSS * pdf ⇒ xsl+sty dblatex (ie docbook + latex)
Installation
Add this line to your application’s Gemfile:
gem 'asciidoctor-defmastership'
And then execute:
$ bundle
Or install it yourself as:
$ gem install asciidoctor-defmastership
Usage
If my_document.adoc
contains definitions blocks
$ asciidoctor -r asciidoctor-defmastership my_document.adoc
Development
Require asciidoctor module for preprocessor hooking
Require defmastership for REGEXP collections
-
bin : minimal applications (console + setup) to test module
-
lib : asciidoctor/defmastership, asciidoctor/defmastership/preprocessor is the main module
Preprocessor architecture :
-
Process : Main entry point for parsing and replacing lines
After checking out the repo, run bin/setup
to install dependencies. Then, run rake spec
to run the tests. You can also run bin/console
for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install
. To release a new version, update the version number in version.rb
, and then run bundle exec rake release
, which will create a git tag for the version, push git commits and tags, and push the .gem
file to [rubygems.org](https://rubygems.org).
Contributing
Bug reports and pull requests are welcome on GitLab at https://gitlab.com/defmastership/asciidoctor-defmastership.