Skip to content
This repository has been archived by the owner on Sep 18, 2020. It is now read-only.
/ lineml Public archive

Experimental HAML-like markup language.

License

Notifications You must be signed in to change notification settings

georgy7/lineml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

  • 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 any way you want.

License

Boost