ptrofimov / inml
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
Requires
- php: >=5.4
This package is not auto-updated.
Last update: 2024-11-09 13:33:26 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
-
- Transforms paragraphs with style into HTML paragraphs with class:
.style <p class="style"> Paragraph. => Paragraph. </p>
-
- Transforms lines with style into HTML spans with class:
.style Line <span class="style"> OR => Line Line .style </span>
-
- Transforms words with style into HTML spans with class:
<span class="style"> word.style => word </span>
-
- If parser finds styles equal HTML5 tags, it transforms them to corresponding tags (not classes):
.div.style <div class="style"> Paragraph. => Paragraph. </div>
-
- 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):
Installation and usage
-
- Install composer if need.
-
- Create composer.json or add dependency:
{ "require":{ "ptrofimov/inml":"*" } }
-
- Install package:
composer install
-
- Usage example:
use \Inml\Text; use \Inml\Render\Html; $html = (new Html)->render(new Text($inml));
-
- Enjoy!