Skip to content

QwertyJack/cmd

Repository files navigation

Colored Markdown

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 !!!