Skip to content

Iuriiiii/TinyML

Repository files navigation

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>

About

A lightwidth markup language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published