2017 © Pedro Peláez
 

library commonmark

Object-oriented and extensible PHP 5.4+ CommonMark spec-compliant Markdown parser

image

fluxbb/commonmark

Object-oriented and extensible PHP 5.4+ CommonMark spec-compliant Markdown parser

  • Thursday, April 9, 2015
  • by franzliedke
  • Repository
  • 4 Watchers
  • 16 Stars
  • 464 Installations
  • PHP
  • 5 Dependents
  • 3 Suggesters
  • 1 Forks
  • 5 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

An extensible CommonMark parser for PHP

Latest Stable Version Build Status License, (*1)

An object oriented, fully extensible CommonMark parser for PHP 5.4 and above., (*2)

CommonMark spec, (*3)

Requirements

  • PHP 5.4+
  • Composer

Installation

Add the library to your Composer dependencies:, (*4)

composer require fluxbb/commonmark

Next, use Composer to install the library and its dependencies:, (*5)

composer install

Usage

Parsing

use FluxBB\CommonMark\Parser;

$parser = new Parser();
$html = $parser->render('Markdown is **awesome**');

// 

Markdown is awesome, (*6)

Rendering

The parser renders XHTML by default., (*7)

Command Line Interface

Usage

Basic usage: (Outputs result to STDOUT), (*8)

bin/markdown /path/to/file.md

The following command saves results to a file:, (*9)

bin/markdown /path/to/file.md > /path/to/file.html

Or using pipe (does not work on Windows):, (*10)

echo "Markdown is **awesome**" | bin/markdown

Command Line Options

    --compress (-c)       Remove whitespace between HTML tags
    --lint (-l)           Syntax check only (lint)

Using PHAR version

You can also use a single phar file, (*11)

markdown.phar /path/to/file.md

If you prefer access this command globally, download markdown.phar and move it into your PATH., (*12)

mv markdown.phar /usr/local/bin/markdown

Testing

Install or update dev dependencies., (*13)

php composer.phar update --dev

and run phpunit, (*14)

License

The MIT License, (*15)

Contributing

Feel free to fork this repository and send pull requests. Take a look at who has contributed so far., (*16)

Author

A big thanks to Kazuyuki Hayashi (@kzykhys), who originally created this library., (*17)

The Versions

09/04 2015

dev-master

9999999-dev

Object-oriented and extensible PHP 5.4+ CommonMark spec-compliant Markdown parser

  Sources   Download

MIT

The Requires

 

The Development Requires

by Kazuyuki Hayashi

parser markdown commonmark