koara/koara

Koara parser written in PHP

0.15.0 2017-06-06 18:32 UTC

This package is not auto-updated.

Last update: 2024-04-27 17:09:09 UTC


README

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