require 'asciidoctor' # (1)
doc = Asciidoctor::Document.new('Hello, World!') # (2)
puts doc.convert # (3)
require 'asciidoctor' # (1)
doc = Asciidoctor::Document.new('Hello, World!') # (2)
puts doc.convert # (3)
Imports the library as a RubyGem
Creates a new document
Scans the lines for known blocks
Converts the lines into blocks
Renders the document
You can write this to file rather than printing to stdout.