Skip to content

opendevise/textlint-plugin-asciidoc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

textlint-plugin-asciidoc

Build Status (Travis CI)

An AsciiDoc parser designed to perform validations on AsciiDoc documents using textlint.

⚠️
Alpha warning
This plugin is currently in alpha. Do not expect it to handle all the AsciiDoc syntax correctly. Refer to the test suite to learn what syntax the parser currently supports. The AST created by this plugin is also not yet compatible with any textlint rules. That alignment is expected to happen as the plugin evolves.

Prerequisites

This plugin targets ES6 and is tested using Node (stable). Therefore, you must have at least Node 7 in order to run it.

Usage

const AsciiDocProcessor = require('textlint-plugin-asciidoc').Processor
const processor = new AsciiDocProcessor().processor('.adoc')
const ast = processor.preProcess('Build me a tree.\nI will visit its branches.', '<stdin>')
console.log(ast)
Output
{
  type: 'DocumentNode',
  raw: 'Build me a tree.\nI will visit its branches.',
  range: [ 0, 43 ],
  loc: {
    start: Position { line: 1, column: 0 },
    end: Position { line: 2, column: 26 }
  },
  children: [
    {
      type: 'ParagraphNode',
      range: [ 0, 43 ],
      loc: {
        start: Position { line: 1, column: 0 },
        end: Position { line: 2, column: 26 }
      },
      children: [...]
    }
  ]
}

Copyright © 2017-present Dan Allen and OpenDevise Inc. Free use of this software is granted under the terms of the MIT License. To see the full text of the license, refer to the LICENSE file.

About

An AsciiDoc processor for use with textlint.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published