Skip to content

koara/koara-php

Repository files navigation

Koara

Build Status Coverage Status Latest Version License

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