Giter Site home page Giter Site logo

mdown-parse-pegjs's Introduction

Markdown parser with PegJS

A Markdown parser written in JavaScript, generated with PEG grammar. Currently, in progress.

This is a component of xtd project, but I plan to finish developing it separately and then merge the result there. (So, the most part of its development history is located there).

In fact, it is a translation of PegC Markdown parser to JavaScript. But in the end, there are a lot differences in the sources and result.

The both C variant and JS (this) variant build a tree of parsed document elements, including their offsets and additional data required for generating some HTML result or hightlighting a syntax in some JavaScript implementation.

Sources

The Development State

Finished

  • Inlines: Strong, Em, Code
  • Html Blocks, Html entities
  • Headings
  • Horizontal Rules
  • Paragraphs
  • Top-level Lists
  • Top-level verbatims
  • Links, all modifications
  • Images, all modifications
  • Oh, all that stuff except complex lists

Not finished

(They were working some not ideal way, but I am currently refactoring this part)

So currently, the lists are parsed ok, but I plan to modify their rules to support complex indentations.

Which Way the Result Looks Like

When parsing a MarkDown document, you get a JavaScript Object containing the document tree in Markdown terms. I'll make a detailed description when I'll finish an implementation.

Competitors

Just a JS-ones:

To Develop

Install last node.js version (v0.5.8+)

Install npm

Run in node directory (or with -g):

npm install pegjs
npm install [email protected] # or higher

cd ~/Worktable # (for example)
git clone [email protected]:shamansir/pegjs.git
cd ./pegjs
jake build
node test/run
ln -sf ~/Worktable/pegjs <nodejs-location>/lib/node_modules
ln -s <nodejs-location>/lib/node_modules ./node_modules # optional, if pegjs module not found
cd ~/Workspace # (for example) 
git clone [email protected]:shamansir/mdown-parse-pegjs.git
cd ./mdown-parse-pegjs
node ./test-mdown-parser-with-node.js

mdown-parse-pegjs's People

Contributors

shamansir avatar

Stargazers

George N. Gergis avatar Nathan Hollis avatar Kazuki UMEMOTO avatar Takahiro Kojima avatar  avatar Joshua M. Moore avatar Mirko Kiefer avatar Andrew Wooldridge avatar Alex Hu avatar Anders Olsen avatar  avatar Philip Thrasher avatar Lan Qingyong avatar Hady Mahmoud avatar Angus H. avatar David Baumgartner avatar  avatar Tomas Brambora avatar James Thornton avatar Paul Sawaya avatar John Beppu avatar Bo Jeanes avatar Thomas Weiser avatar Wouter Soudan avatar Brad Pillow avatar Matthew Cook avatar Tom avatar Atsuhiro Kubo avatar Emily Marigold Klassen avatar Niels Joubert avatar Nikita Dudnik avatar  avatar Hiroki Sato avatar Neil Cowburn avatar Sirn Thanabulpong avatar

Watchers

 avatar

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.