lineml 0.9.8

HTML-like markup language for the single line layouts.


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

dub.json
dub.sdl

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

Authors:
Георгий Устинов
Dependencies:
pegged, fluent-asserts:core
Versions:
0.9.8 2017-Apr-13
0.9.0 2017-Apr-13
~master 2017-May-27
Show all 3 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 0 downloads total