1.0.6 ā€¢ Published 2 years ago

tinyml v1.0.6

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

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

{<!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>
body {
    <h1>This is a title</h1>
}
<body>
    &lt;h1&gt;This is a title&lt;/h1&gt;
</body>
body {
    {<h1>This is a title</h1>}
}
<body>
    <h1>This is a title</h1>
</body>
[body {
    {<h1>This is a title</h1>}
}]
<!--<body>
    <h1>This is a title</h1>
</body>-->
body {
    [{<h1>This is a title</h1>}]
}
<body>
    <!--{<h1>This is a title</h1>}-->
</body>