kongou-ae
12/26/2016 - 10:17 AM

gistfile1.log

$ more README.2.adoc 
= レベル1

レベル1本文

$ more test.js
var asciidoctor = require('asciidoctor.js')();
var doc = asciidoctor.loadFile('README.2.adoc')
console.log(doc.parse().reader)

$ node test.js
$PreprocessorReader {
  '$$id': 570,
  document: 
   $Document {
     '$$id': 544,
     document: [Circular],
     context: 'document',
     node_name: 'document',
     attributes: 
      $Hash {
        '$$smap': [Object],
        '$$map': {},
        '$$keys': [Object],
        '$$none': undefined,
        '$$proc': undefined },
     passthroughs: $Hash { '$$smap': {}, '$$map': {}, '$$keys': [] },
     content_model: 'compound',
     subs: [],
     default_subs: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     blocks: [ [Object] ],
     id: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     title: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     caption: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     style: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     level: 0,
     next_section_index: 0,
     next_section_number: 1,
     source_location: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     parent_document: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     references: $Hash { '$$smap': [Object], '$$map': {}, '$$keys': [Object] },
     callouts: $Callouts { '$$id': 548, lists: [Object], list_index: 1, co_index: 1 },
     attribute_overrides: $Hash { '$$smap': [Object], '$$map': {}, '$$keys': [Object] },
     safe: 20,
     compat_mode: false,
     sourcemap: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     converter: 
      $Html5Converter {
        '$$id': 562,
        xml_mode: false,
        void_element_slash: [Object],
        stylesheets: [Object] },
     extensions: 
      $Registry {
        '$$id': 566,
        groups: [Object],
        docinfo_processor_extensions: [Object],
        include_processor_extensions: [Object],
        postprocessor_extensions: [Object],
        treeprocessor_extensions: [Object],
        preprocessor_extensions: [Object],
        inline_macro_extensions: [Object],
        block_macro_extensions: [Object],
        block_extensions: [Object],
        document: [Circular] },
     parsed: true,
     header: 
      $Section {
        '$$id': 580,
        parent: [Circular],
        document: [Circular],
        context: 'section',
        node_name: 'section',
        attributes: [Object],
        passthroughs: [Object],
        content_model: 'compound',
        subs: [],
        default_subs: [Object],
        blocks: [],
        id: [Object],
        title: 'レベル1',
        caption: [Object],
        style: [Object],
        level: 0,
        next_section_index: 0,
        next_section_number: 1,
        source_location: [Object],
        numbered: false,
        special: false,
        index: 0,
        number: 1 },
     counters: $Hash { '$$smap': {}, '$$map': {}, '$$keys': [] },
     attributes_modified: $Set { '$$id': 550, hash: [Object] },
     options: 
      $Hash {
        '$$smap': [Object],
        '$$map': {},
        '$$keys': [Object],
        '$$none': undefined,
        '$$proc': undefined },
     docinfo_processor_extensions: $Hash { '$$smap': {}, '$$map': {}, '$$keys': [] },
     base_dir: '/home/ubuntu/workspace/asciidoctor',
     max_attribute_value_size: 4096,
     backend: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
     reader: [Circular],
     doctype: 'article',
     outfilesuffix: '.html',
     header_attributes: 
      $Hash {
        '$$smap': [Object],
        '$$map': {},
        '$$keys': [Object],
        '$$none': undefined,
        '$$proc': undefined } },
  file: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] },
  dir: '/home/ubuntu/workspace/asciidoctor',
  path: '<stdin>',
  lineno: 5,
  lines: [],
  source_lines: [ '= レベル1', '', 'レベル1本文' ],
  eof: true,
  look_ahead: 0,
  process_lines: true,
  unescape_next_line: false,
  maxdepth: 
   $Hash {
     '$$smap': { abs: 64, rel: 64 },
     '$$map': {},
     '$$keys': [ 'abs', 'rel' ] },
  include_stack: [],
  includes: 
   $Set {
     '$$id': 546,
     hash: 
      $Hash {
        '$$smap': {},
        '$$map': {},
        '$$keys': [],
        '$$none': [Object],
        '$$proc': [Object] } },
  skipping: false,
  conditional_stack: [],
  include_processor_extensions: NilClass_alloc { '$$id': 4, apply: [Function], call: [Function] } }