There is no license information available for the latest version (dev-master) of this package.

inML - inline markup language

dev-master 2012-12-25 21:41 UTC

This package is not auto-updated.

Last update: 2024-10-26 13:22:07 UTC


README

inML is concise and intuitive markup language. This repository contains description of inML markup language and PHP-written library and example script in order to render inML-formatted text into HTML and Text formats.

Basic inML -> HTML transformation rules

    1. Transforms paragraphs with style into HTML paragraphs with class:
.style            <p class="style">
Paragraph.   =>       Paragraph.
                  </p>
    1. Transforms lines with style into HTML spans with class:
.style Line        <span class="style">
OR            =>       Line
Line .style        </span>
    1. Transforms words with style into HTML spans with class:
                  <span class="style">
word.style   =>       word
                  </span>
    1. If parser finds styles equal HTML5 tags, it transforms them to corresponding tags (not classes):
.div.style        <div class="style">
Paragraph.   =>       Paragraph.
                  </div>
    1. You can define your own styles right in the document. Parser will automatically recognise type of style. For example, you can make a hyperlink by defining your own style with url:
inML.link is intuitive markup language.        
                                          =>   <a href="https://github.com/ptrofimov/inml">inML</a>
#link https://github.com/ptrofimov/inml            is intuitive markup language.

Example with screenshots

inML-formatted text:

.h1 inML - inline markup language

.i
inML.b is simple and compact markup
that could be easily transformed into HTML.b

.b Key points:

.ul
.li Easy text formatting
.li Traditional embedded HTML.b styles
.li Ability to add user styles

transforms into HTML:

<p>
    <h1>inML - inline markup language</h1>
</p>
<i>
    <b>inML</b> is simple and compact markup
        that could be easily transformed into <b>HTML</b>
</i>
<p>
    <b>Key points:</b>
</p>
<ul>
    <li>Easy text formatting</li>
    <li>Traditional embedded <b>HTML</b> styles</li>
    <li>Ability to add user styles</li>
</ul>

and looks like this (with predefined CSS styles):

Example inML to HTML transformation

Installation and usage

    1. Install composer if need.
    1. Create composer.json or add dependency:
{
   "require":{
       "ptrofimov/inml":"*"
   }
}
    1. Install package:
composer install
    1. Usage example:
use \Inml\Text;
use \Inml\Render\Html;

$html = (new Html)->render(new Text($inml));
    1. Enjoy!