Description

HTML-like markup language for the single line layouts.

Package Information

Version0.9.8 (2017-Apr-13)
Repository https://github.com/georgy7/lineml
LicenseBSL-1.0
AuthorsГеоргий Устинов
Registered byGeorge U.
Dependencies

pegged

fluent-asserts:core

Installation

To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Readme

LineML

Dub version Build Status Coverage Status

1. As the shortened HTML/XML

This is just a side effect of the main functionality (see the section #2).

For example, you can parse this:

#d(#z, #f(.item, .item, .item, .item, .item))

or this:

#d(#z, #f(.item:5))

and transform

auto result = lmlToHtml(input, LmlHtmlFormat.SPACES_4);

into this:

<div id="d">
    <div id="z"></div>
    <div id="f">
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div class="item"></div>
    </div>
</div>

So, the language does not support

  • tag content,
  • custom attributes.

More examples

LineML:

#d(#z, #f(.qw, .item:2, #ds, .sdsdfs))

XML:

<div id="d">
    <div id="z"></div>
    <div id="f">
        <div class="qw"></div>
        <div class="item"></div>
        <div class="item"></div>
        <div id="ds"></div>
        <div class="sdsdfs"></div>
    </div>
</div>

LineML:

#d(#z, #f(.qw, .item:3(.asd)))

XML:

<div id="d">
    <div id="z"></div>
    <div id="f">
        <div class="qw"></div>
        <div class="item">
            <div class="asd"></div>
        </div>
        <div class="item">
            <div class="asd"></div>
        </div>
        <div class="item">
            <div class="asd"></div>
        </div>
    </div>
</div>

2. Generating custom trees

You can parse your markup without making HTML.

LineMLNode result = lmlToNode!LineMLNode(input);

But the main purpose of the package is to use LineMLNode subclasses to generate the trees. Then, you can populate the objects and use them programmatically anyway you want it.

License

Boost

Available versions

0.9.8 0.9.0 ~master