lineml 0.9.0

HTML-like markup language for the single line layouts.


To use this package, run the following command in your project's root directory:

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 subclass LineMLNode, then generate the trees of the objects of this custom class. Then, populate the objects as you want, and then to use the tree programmatically anyway you want it.

License

Boost

Authors:
  • Георгий Устинов
Dependencies:
fluent-asserts:core, pegged
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

Score:
0.3
Short URL:
lineml.dub.pm