Based on cebe/markdown, add color and MathJax support.

1.0.0 2017-04-18 15:08 UTC

This package is not auto-updated.

Last update: 2024-04-28 01:45:16 UTC


README

Based on cebe/markdown, add color and MathJax support.

Requirements

Installation

# checkout src
git clone https://github.com/QwertyJack/cmd.git

# install dependencies
php composer.phar update

Usage

  • http (use curl for example)
curl <url/to/parser.php> -d text='{red **Hello World**}'

This will generate {red Hello World}.

See also index.html and static/my.js

  • cli
cat demo.md | php parser.php

or

php parser.php demo.md
  • parser for terminal
cat demo.md | php cli.php

or

php cli.php demo.php

A playground is HERE.

Known Bugs

  • The terminal parser fail to parse list begin with *.
  • Nested inline color make a mess.
  • Color blocks make the following table cells not parsed correctly.

TODO

  • Sanitizing; maybe ircmaxell/Stauros.
  • Beautify tables in terminal.
  • Find a nearest color for unknown ones in terminal instead of just ignore it.

Acknowledgement

HAVE FUN !!!