require 'asciidoctor' # (1)
doc = Asciidoctor::Document.new('Hello, World!') # (2)
puts doc.convert # (3)
  1. Imports the library as a RubyGem

  2. Creates a new document

    • Scans the lines for known blocks

    • Converts the lines into blocks

  3. Renders the document

    You can write this to file rather than printing to stdout.