<commit_before># JSIN - Javascript Include

Template engine for use at server and client side.

## Features

- Well-known PHP-like template tags.
- Accurate quote parsing.
- Asynchronous compiling of templates on the fly.
- Pre-compiling for use in browser.
- Supports includings and layoutings.

## Usage

### Syntax

Constructions:

- `<?js /* any javascript code */ ?>`
- `<?= /* print value or result of expression */ ?>`
- `<?h= /* print value or result of expression with escaped html special chars <>&" */ ?>`
- `<?s= /* print value or result of expression with backslashed script special chars \\n\r"' */ ?>`

Functions:

- `print(string)`
- `include(template, [data])`
- `layout(template, [data], callback)`
- `contents()`

### Example

```html
<!-- mytemplate.jsin -->
<h1>Example</h1>
<p>
    <?= "Check ?>'\" special chars and variable " + boo ?>
<p>
    <?h= "Check html escaping &<>\"" ?>
<p>
    <?s= "Check script escaping \\\n\r\"\'" ?>
</p>
<p>
    <?js if (1 === 1) { ?>
        1 === 1<commit_msg>added html & script escapings<commit_after># JSIN - Javascript Include

Template engine for use at server and client side.

## Features

- Well-known PHP-like template tags.
- Accurate quote parsing.
- Asynchronous compiling of templates on the fly.
- Pre-compiling for use in browser.
- Supports includings and layoutings.

## Usage

### Syntax

Constructions:

- `<?js /* any javascript code */ ?>`
- `<?= /* print value or result of expression */ ?>`
- `<?h= /* print value or result of expression with escaped html special chars <>&" */ ?>`
- `<?s= /* print value or result of expression with backslashed script special chars \\n\r"' */ ?>`

Functions:

- `print(string)`
- `printh(string)`
- `prints(string)`
- `include(template, [data])`
- `layout(template, [data], callback)`
- `contents()`

### Example

```html
<!-- mytemplate.jsin -->
<h1>Example</h1>
<p>
    <?= "Check ?>'\" special chars and variable " + boo ?>
<p>
    <?h= "Check html escaping &<>\"" ?>
<p>
    <?s= "Check script escaping \\\n\r\"\'" ?>
</p>
<p>
    <?js if (1 === 1) { ?>
        1 === 1
{'fraction_non_alphanumeric': 0.1910919540229885, 'fraction_numerical': 0.005747126436781609, 'mean_word_length': 3.22020202020202, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '996183', 'n_tokens_mistral': 724, 'n_tokens_neox': 682, 'n_words': 230}