tinyml
Version:
Tiny Markup Language
187 lines (152 loc) ⢠2.26 kB
Markdown
# TinyML
TinyML is a lightwidth markup language to design web pages.
## From `TinyML`
### translate
Traduces TinyML-syntax to HTML-syntax.
#### Parameters
š¹ <b>source: string</b> - The TinyML-syntax source to translate to HTML-syntax.
š¹ <b>options: TranslateOptions /* { preserveComments: boolean = true } */</b> - The options to use when translate.
#### Return
ā
The HTML.
ā Throws error.
## Examples
<table>
<tr>
<th>Input</th>
<th>Output</th>
</tr>
<tr>
<td>
```
{ }
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
}
}
}
}
```
</td>
<td>
```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>
```
</td>
</tr>
</table>
<table>
<tr>
<th>Input</th>
<th>Output</th>
</tr>
<tr>
<td>
```
body {
<h1>This is a title</h1>
}
```
</td>
<td>
```html
<body>
<h1>This is a title</h1>
</body>
```
</td>
</tr>
</td>
</tr>
</table>
<table>
<tr>
<th>Input</th>
<th>Output</th>
</tr>
<tr>
<td>
```
body {
{<h1>This is a title</h1>}
}
```
</td>
<td>
```html
<body>
<h1>This is a title</h1>
</body>
```
</td>
</tr>
</table>
<table>
<tr>
<th>Input</th>
<th>Output</th>
</tr>
<tr>
<td>
```
[body {
{<h1>This is a title</h1>}
}]
```
</td>
<td>
```html
<!--<body>
<h1>This is a title</h1>
</body>-->
```
</td>
</tr>
</table>
<table>
<tr>
<th>Input</th>
<th>Output</th>
</tr>
<tr>
<td>
```
body {
[{<h1>This is a title</h1>}]
}
```
</td>
<td>
```html
<body>
<!--{<h1>This is a title</h1>}-->
</body>
```
</td>
</tr>
</table>