tinyml

1.0.6 • Public • Published

TinyML

TinyML is a lightwidth markup language to design web pages.

From TinyML

translate

Traduces TinyML-syntax to HTML-syntax.

Parameters

🔹 source: string - The TinyML-syntax source to translate to HTML-syntax. 🔹 options: TranslateOptions /* { preserveComments: boolean = true } */ - The options to use when translate.

Return

✅ The HTML.

❌ Throws error.

Examples

Input Output
{<!DOCTYPE html>}
html(lang="en") {
    head {
        title {The page title}
    }
    body {
        [ This is a comment ]
        hr;
        div(class="container") {
            h1 {My first title}
            p {
                Lorem ipsum dolor sit;br;
                amet, consectetur
            }
        }
    }
}
<!DOCTYPE html>
<html lang="en">
    <head>
        <title>The page title</title>
    </head>
    <body>
        <!-- This is a comment -->
        <hr/>
        <div class="container">
            <h1>My first title</h1>
            <p>
                Lorem ipsum dolor sit<br>
                amet, consectetur
            <p>
        </div>
    </body>
</html>
Input Output
body {
    <h1>This is a title</h1>
}
<body>
    &lt;h1&gt;This is a title&lt;/h1&gt;
</body>
Input Output
body {
    {<h1>This is a title</h1>}
}
<body>
    <h1>This is a title</h1>
</body>
Input Output
[body {
    {<h1>This is a title</h1>}
}]
<!--<body>
    <h1>This is a title</h1>
</body>-->
Input Output
body {
    [{<h1>This is a title</h1>}]
}
<body>
    <!--{<h1>This is a title</h1>}-->
</body>

Package Sidebar

Install

npm i tinyml

Weekly Downloads

2

Version

1.0.6

License

MIT

Unpacked Size

21.7 kB

Total Files

13

Last publish

Collaborators

  • iuriiiii