Koara is a modular lightweight markup language. This project is the core koara parser written in PHP.
If you are interested in converting koara to a specific outputFormat, please look the Related Projects section.
-
Download ZIP file
-
Composer
$ composer require koara/koara
<?php
require_once __DIR__ . '/vendor/autoload.php';
use Koara\Parser;
$parser = new Parser();
$result1 = $parser->parse("Hello World!"); // parse a string
$result2 = $parser->parseFile('hello.kd'); // parse a file
?>
You can configure the Parser:
-
setHardWrap($hardWrap)
Default:false
Specify if newlines should be hard-wrapped (return-based linebreaks) by default.
-
setModules($modules)
Default:array("paragraphs", "headings", "lists", "links", "images", "formatting", "blockquotes", "code")
Specify which parts of the syntax are allowed to be parsed. The rest will render as plain text.
- koara / koara-php-html: Koara to Html renderer written in PHP
- koara / koara-php-xml: Koara to Xml renderer written in PHP