koara / koara
Koara parser written in PHP
Installs: 2 617
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=5.4.0
Requires (Dev)
- phpunit/phpunit: ~4.8 || ~5.1
This package is not auto-updated.
Last update: 2024-04-27 17:09:09 UTC
README
Koara-php
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.
Getting started
-
Download ZIP file
-
Composer
$ composer require koara/koara
Usage
<?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 ?>
Configuration
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.
Related Projects
- koara / koara-php-html: Koara to Html renderer written in PHP
- koara / koara-php-xml: Koara to Xml renderer written in PHP