Open pddzaic opened 5 years ago
Very little work is needed, as asciidoctor
extensions are registered as soon as the relative gem is require
d.
This means that you can simply run ruby my_script_a.rb
on
# my_script_a.rb
require 'asciidoctor'
require 'asciidoctor-bibliography'
Asciidoctor.convert_file('my_first_document.adoc')
Alternatively, you can run ruby -r asciidoctor-bibliography my_script_b.rb
on
# my_script_b.rb
require 'asciidoctor'
Asciidoctor.convert_file('my_first_document.adoc')
In fact, the -r
flag is equivalent to requiring the passed library before executing the script.
@paolobrasolin sounds like we should add this to the README. Could you help? Thanks!
How to use asciidoctor-bibliography from the CMD is very well described:
$ asciidoctor -r asciidoctor-bibliography my_first_document.adoc
But what is the way directly in ruby? Here my starting point: