2017 © Pedro Peláez
 

library haik-markdown

PHP haik Markdown parser

image

toiee/haik-markdown

PHP haik Markdown parser

  • Wednesday, April 16, 2014
  • by hokuken
  • Repository
  • 3 Watchers
  • 0 Stars
  • 90 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 3 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

haik Markdown

PHP haik Markdown parser based on PHP Markdown Extra., (*1)

This markdown parser has pluggable interface., (*2)

by Hokuken [http://www.hokuken.com] (http://www.hokuken.com/ "Hokuken Inc."), (*3)

based on [PHP Markdown] (https://github.com/michelf/php-markdown "michelf/php-markdown"), (*4)

Requirement

This library package requires PHP 5.3 or later., (*5)

About plugin

Markdown text can include special syntax for haik-markdown plugins. These syntaxes are inline and convert ., (*6)

Inline plugin

In below example, See /[...](deco red) and /(br), they parse to <span style="color:red">...</span> and <br>\n ., (*7)

Lorem ipsum dolor sit amet, /[consectetur](deco red) adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua./(br) Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.

Convert plugin

One line call

The example text are converted to <button class="btn btn-block"> ., (*8)

::: button :::

Contains body

In below example, See ::: section . they wrap plugin body by specified tags <div class="haik-section">...</div> ., (*9)

::: section
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.
:::

Contains parameters

Plugin body can contain YAML parameters up to 3 hyphens line., (*10)

::: section
Lorem ipsum dolor sit amet, consectetur adipisicing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna
aliqua. Ut enim ad minim veniam, quis nostrud exercitation
ullamco laboris nisi ut aliquip ex ea commodo consequat.

---
bg-color: #fefefe
color: #333
:::

Usage

With basic plugins

// Preparation to use
use \Hokuken\HaikMarkdown;
$parser = new HaikMarkdown();
$plugin_repository = new Hokuken\HaikMarkdown\Plugin\Basic\PluginRepository($parser);
$parser->registerPluginRepository($plugin_repository);

// Parsing markdown text
$html = $parser->transform($markdown_text);

With Twitter Bootstrap plugins

// Preparation to use
use \Hokuken\HaikMarkdown;
$parser = new HaikMarkdown();
$plugin_repository = new Hokuken\HaikMarkdown\Plugin\Bootstrap\PluginRepository($parser);
$parser->registerPluginRepository($plugin_repository);

// Parsing markdown text
$html = $parser->transform($markdown_text);

The Versions

16/04 2014

dev-master

9999999-dev

PHP haik Markdown parser

  Sources   Download

MIT

The Requires

 

The Development Requires

markdown haik

16/04 2014

0.4.0

0.4.0.0

PHP haik Markdown parser

  Sources   Download

MIT

The Requires

 

The Development Requires

markdown haik

16/04 2014

0.5.1

0.5.1.0

PHP haik Markdown parser

  Sources   Download

MIT

The Requires

 

The Development Requires

markdown haik

16/04 2014

0.6.0

0.6.0.0

PHP haik Markdown parser

  Sources   Download

MIT

The Requires

 

The Development Requires

markdown haik

28/03 2014

dev-add-nav-plugin

dev-add-nav-plugin

PHP haik Markdown parser

  Sources   Download

MIT

The Requires

 

The Development Requires

markdown haik

28/03 2014

0.2.0

0.2.0.0

PHP haik Markdown parser

  Sources   Download

MIT

The Requires

 

The Development Requires

markdown haik