GithubHelp home page GithubHelp logo

commonmark-astcheck's Introduction

CommonMark-ASTcheck

tool to check validity of CommonMark spec AST structure read from JSON (or directly by importing the function), this will eventually be merged into CommonMark-py most likely.

note: this is extremely rough at the moemnt, i plan to add proper structure checking later but currently it just validates the variable types in the ugliest way possible (i'm sorry i've not slept ._.)

Usage

rolands@kamaji:~/utils/CommonMark-ASTcheck$ cmark.py README.md -aj | cmark-astcheck.py
## AST valid.
rolands@kamaji:~/utils/CommonMark-ASTcheck$ python3 cmark-astcheck.py README.json 
## AST valid.
rolands@kamaji:~/utils/CommonMark-ASTcheck$ python3 cmark-astcheck.py BROKEN.json 
Document.start_column is not a integer.
Document.children[0].SetextHeader.end_line is not a integer.
SetextHeader.strings[0] is not a string.
Document.children[0].SetextHeader.inline_content[1] is not a object.
Document.children[0].SetextHeader.tight is not a boolean.
Document.children[1].Paragraph.inline_content[0].bar is not a valid key.
Document.children[1].Paragraph.inline_content[1].Link.label[0].Str.last_line_blank is not a boolean.
SetextHeader.strings[0] is not a string.
Document.children[3].IndentedCode.start_column is not a integer.
## AST invalid, 9 tests failed.
rolands@kamaji:~/utils/CommonMark-ASTcheck$

commonmark-astcheck's People

Contributors

rolandshoemaker avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

gitter-badger

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.