miki-template 1.3.3 → 1.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.json +16 -0
- package/.github/release-notes/v1.3.1.md +55 -55
- package/.github/release-notes/v1.3.3.md +77 -0
- package/.github/workflows/ci.yml +38 -54
- package/.github/workflows/release.yml +106 -0
- package/AGENT.md +71 -71
- package/API_REFERENCE.md +314 -314
- package/CHANGELOG.md +173 -169
- package/CODE_OF_CONDUCT.md +14 -14
- package/CONTRIBUTING.md +27 -27
- package/README.md +342 -321
- package/ROADMAP.md +40 -40
- package/benchmarks/report.json +16 -16
- package/benchmarks/run.js +49 -49
- package/benchmarks/stress.mjs +647 -647
- package/benchmarks/templates/large.dtpl +7 -7
- package/benchmarks/templates/medium.dtpl +3 -3
- package/benchmarks/templates/small.dtpl +7 -7
- package/context/component.md +109 -109
- package/context/prd.md +131 -131
- package/context/project-structure.md +33 -33
- package/dir/base.html +22 -22
- package/dir/cmpnt.html +10 -10
- package/dir/footer.html +2 -2
- package/dir/home.html +80 -80
- package/dir/index.html +80 -0
- package/dir/navbar.html +8 -8
- package/docs/README.md +18 -18
- package/docs/advanced_usage.md +71 -71
- package/docs/api.md +119 -119
- package/docs/filters.md +708 -708
- package/docs/installation.md +106 -106
- package/docs/overview.md +79 -57
- package/docs/partialdef.md +70 -70
- package/docs/security.md +27 -27
- package/docs/tags.md +673 -673
- package/docs/usage.md +646 -646
- package/eslint.config.mjs +42 -42
- package/ex.mjs +34 -32
- package/live-test/package-lock.json +915 -0
- package/live-test/package.json +9 -0
- package/live-test/server.js +14 -0
- package/live-test/views/base.html +8 -0
- package/live-test/views/child.html +7 -0
- package/live-test/views/index.html +1 -0
- package/miki-template-extension/.github/workflows/ci.yml +116 -116
- package/miki-template-extension/.vscodeignore +7 -7
- package/miki-template-extension/CHANGELOG.md +99 -99
- package/miki-template-extension/LICENSE +21 -21
- package/miki-template-extension/README.md +273 -273
- package/miki-template-extension/extension.js +1013 -1013
- package/miki-template-extension/icon.svg +10 -10
- package/miki-template-extension/package.json +280 -280
- package/miki-template-extension/snippets/miki-template.json +717 -717
- package/miki-template-extension/syntaxes/language-configuration.json +114 -114
- package/miki-template-extension/syntaxes/miki-template.tmLanguage.json +355 -355
- package/miki-template-extension/tests/grammar-tests.json +162 -162
- package/miki-template-extension/tests/run-grammar-tests.js +82 -82
- package/package.json +40 -34
- package/sample-app/package-lock.json +901 -0
- package/sample-app/package.json +9 -0
- package/sample-app/server.js +14 -0
- package/sample-app/views/index.html +1 -0
- package/scripts/build-vsix.js +129 -129
- package/scripts/build-vsix.ps1 +15 -15
- package/snippets/miki-template.json +177 -177
- package/src/asyncRender.js +20 -20
- package/src/cache.js +80 -80
- package/src/context.js +126 -126
- package/src/context_processors.js +48 -48
- package/src/esm.mjs +89 -84
- package/src/filters.js +975 -975
- package/src/i18n.js +171 -171
- package/src/index.js +1112 -940
- package/src/lexer.js +114 -114
- package/src/libraries.js +371 -371
- package/src/parser.js +270 -270
- package/src/security.js +53 -53
- package/src/tags/control.js +719 -719
- package/src/tags/extra.js +154 -154
- package/src/tags/helpers.js +26 -26
- package/src/tags/i18n.js +256 -256
- package/src/tags/inheritance.js +335 -335
- package/src/tags/registry.js +18 -18
- package/src/tags/util.js +400 -400
- package/src/types.d.ts +107 -107
- package/syntaxes/language-configuration.json +26 -26
- package/syntaxes/miki-template.tmLanguage.json +146 -146
- package/tests/asyncRender.test.js +17 -17
- package/tests/base.html +6 -6
- package/tests/child.html +3 -3
- package/tests/context_processors.test.js +13 -13
- package/tests/esm.test.mjs +61 -61
- package/tests/filters.test.js +254 -254
- package/tests/finder-appdirs.test.js +19 -0
- package/tests/finder.test.js +17 -0
- package/tests/fixtures/views/nested/index.html +1 -0
- package/tests/fixtures/views/partial.html +1 -0
- package/tests/fixtures/views/sub/deepfile.html +1 -0
- package/tests/fixtures/views-appdirs/product/site/detail.html +1 -0
- package/tests/include_security.test.js +9 -9
- package/tests/integration/README.md +32 -32
- package/tests/integration/features.test.cjs +1681 -1681
- package/tests/integration/features.test.mjs +1697 -1697
- package/tests/integration/finder.esm.test.mjs +13 -0
- package/tests/integration/templates/base.miki +6 -6
- package/tests/integration/templates/child.miki +6 -6
- package/tests/integration/templates/index.html +17 -17
- package/tests/lexer.test.js +45 -45
- package/tests/parser.test.js +57 -57
- package/tests/partial.html +1 -1
- package/tests/partialdef.test.js +79 -79
- package/tests/production_checks.js +57 -57
- package/tests/security.test.js +28 -28
- package/tests/tags.test.js +233 -233
package/docs/api.md
CHANGED
|
@@ -1,119 +1,119 @@
|
|
|
1
|
-
# API Reference
|
|
2
|
-
|
|
3
|
-
This document lists the public API exported by **miki-template** for developers to integrate the engine into their projects.
|
|
4
|
-
|
|
5
|
-
| Function / Export | Signature | Description | Example |
|
|
6
|
-
|---|---|---|---|
|
|
7
|
-
| `compile(templateStr, options?)` | `compile(string, object?) → { render, asyncRender, renderBlock, renderPartial }` | Compiles a template string into a renderable object. Optional `options` can include `views` directories, custom tags/filters, etc. | `const tpl = compile('Hello {{ name }}');` |
|
|
8
|
-
| `render(templateStr, context?, options?)` | `render(string, object?, object?) → string` | One‑off rendering of a template string with the provided context. | `render('Hello {{ name }}', { name: 'World' });` |
|
|
9
|
-
| `asyncRender(templateStr, context?, options?)` | `asyncRender(string, object?, object?) → Promise<string>` | Asynchronous rendering (useful with async helpers). | `await asyncRender(tpl, ctx);` |
|
|
10
|
-
| `__express(filePath, options, callback)` | `__express(string, object, function)` | Express view engine adapter – reads the file at `filePath` and renders it. Honors `view#partial` suffixes for HTMX-style partial responses. | `app.engine('html', miki.__express);` |
|
|
11
|
-
| `__expressAsync(filePath, options)` | `__expressAsync(string, object) → Promise<string>` | Async Express 5+ view engine adapter. Returns a Promise that resolves to rendered HTML. Also honors `view#partial` suffixes. | `app.engine('html', miki.__expressAsync);` |
|
|
12
|
-
| `express(options?)` | `express(object?) → function` | Factory that returns a view-engine function suitable for `app.engine(...)`. Honors `view#partial` selectors. | `app.engine('html', miki.express());` |
|
|
13
|
-
| `setupExpress(app, opts?)` | `setupExpress(expressApp, object?) → void` | **One-line Express integration.** Wires `app.engine(...)`, `app.set('views')`, and patches `res.render` so `res.render('view#partial', ...)` returns just that partial. Options: `{ extension?, views?, async? }`. | `miki.setupExpress(app, { extension: 'html', views: './views' });` |
|
|
14
|
-
| `expressPartialRenderer()` | `expressPartialRenderer() → function` | Express middleware that adds `res.renderPartial(view, locals)`. Useful as a drop-in HTMX helper without the full `setupExpress` shim. | `app.use(miki.expressPartialRenderer());` |
|
|
15
|
-
| `renderPartialFromFile(filePath, partialName, context?, options?)` | `renderPartialFromFile(string, string, object?, object?) → string` | Load a file from disk and render only the named `{% partialdef %}`. | `miki.renderPartialFromFile('views/home.html', 'card', { user });` |
|
|
16
|
-
| `renderPartialFromSource(source, partialName, context?, options?)` | `renderPartialFromSource(string, string, object?, object?) → string` | Render a single named partial directly from a template string. Walks the AST (and `extends` chain) to discover partials nested inside blocks. | `miki.renderPartialFromSource(src, 'card', ctx, { views });` |
|
|
17
|
-
| `stripExpressContext(options)` | `stripExpressContext(object) → object` | Remove Express framework keys (`_locals`, `settings`, `cache`) from an options object. | `const ctx = stripExpressContext(res.locals);` |
|
|
18
|
-
| `clearCache()` | `clearCache() → void` | Clear the in-memory compiled template cache. | `clearCache();` |
|
|
19
|
-
| `registerTag(name, parserFn)` | `registerTag(string, function)` | Register a custom tag parser. Must be called before compiling templates. | `registerTag('mytag', parserFn);` |
|
|
20
|
-
| `registerFilter(name, fn)` | `registerFilter(string, function)` | Register a custom filter. | `registerFilter('reverse', str => str.split('').reverse().join(''));` |
|
|
21
|
-
| `getFilter(name)` | `getFilter(string) → function` | Retrieve a registered filter function by name. | `const upper = getFilter('upper');` |
|
|
22
|
-
| `registerHelper(name, fn)` | `registerHelper(string, function)` | Register a helper function available inside templates. | `registerHelper('upper', s => s.toUpperCase());` |
|
|
23
|
-
| `registerContextProcessor(fn)` | `registerContextProcessor(function)` | Add a context processor that mutates the rendering context before each render. | `registerContextProcessor(ctx => ({ ...ctx, csrf_token: '123' }));` |
|
|
24
|
-
| `registerTranslation(lang, messages)` | `registerTranslation(string, object) → void` | Register translation messages for a language. | `registerTranslation('fr', { 'Hello': 'Bonjour' });` |
|
|
25
|
-
| `setLanguage(lang)` | `setLanguage(string) → void` | Set the active language for all subsequent renders. | `setLanguage('fr');` |
|
|
26
|
-
| `getLanguage()` | `getLanguage() → string` | Get the currently active language. | `const lang = getLanguage();` |
|
|
27
|
-
| `setFallbackLanguage(lang)` | `setFallbackLanguage(string) → void` | Set the fallback language for missing translations. | `setFallbackLanguage('en');` |
|
|
28
|
-
| `getAvailableLanguages()` | `getAvailableLanguages() → string[]` | List all registered language codes. | `const langs = getAvailableLanguages();` |
|
|
29
|
-
| `registerLibrary(name, def)` | `registerLibrary(string, object) → void` | Register a plugin library of tags, filters, and helpers. | `registerLibrary('humanize', { filters: { intcomma } });` |
|
|
30
|
-
| `registerLibraryFromPath(name, path)` | `registerLibraryFromPath(string, string) → object` | Load a library from a JS file on disk. | `registerLibraryFromPath('myLib', './libs/my-lib.js');` |
|
|
31
|
-
| `activateLibrary(name)` | `activateLibrary(string) → void` | Activate a registered library (makes its tags/filters available). | `activateLibrary('humanize');` |
|
|
32
|
-
| `SafeString` | `class SafeString` | Wrapper class for values that should bypass auto‑escaping. Returned by `markSafe`. |
|
|
33
|
-
| `markSafe(value)` | `markSafe(any) → SafeString` | Marks a value as safe, preventing HTML escaping. |
|
|
34
|
-
| `isSafe(value)` | `isSafe(any) → boolean` | Checks if a value is a `SafeString`. |
|
|
35
|
-
| `escapeHtml(str)` | `escapeHtml(string) → string` | Escapes HTML special characters. Used internally for auto‑escaping. |
|
|
36
|
-
|
|
37
|
-
All of the above are exported from `src/index.js` and can be imported via:
|
|
38
|
-
|
|
39
|
-
### CommonJS
|
|
40
|
-
```js
|
|
41
|
-
const {
|
|
42
|
-
compile,
|
|
43
|
-
render,
|
|
44
|
-
asyncRender,
|
|
45
|
-
__express,
|
|
46
|
-
__expressAsync,
|
|
47
|
-
express,
|
|
48
|
-
setupExpress,
|
|
49
|
-
expressPartialRenderer,
|
|
50
|
-
renderPartialFromFile,
|
|
51
|
-
renderPartialFromSource,
|
|
52
|
-
stripExpressContext,
|
|
53
|
-
clearCache,
|
|
54
|
-
registerTag,
|
|
55
|
-
registerFilter,
|
|
56
|
-
getFilter,
|
|
57
|
-
registerHelper,
|
|
58
|
-
registerContextProcessor,
|
|
59
|
-
clearContextProcessors,
|
|
60
|
-
registerTranslation,
|
|
61
|
-
setLanguage,
|
|
62
|
-
getLanguage,
|
|
63
|
-
setFallbackLanguage,
|
|
64
|
-
getAvailableLanguages,
|
|
65
|
-
registerLibrary,
|
|
66
|
-
registerLibraryFromPath,
|
|
67
|
-
activateLibrary,
|
|
68
|
-
SafeString,
|
|
69
|
-
markSafe,
|
|
70
|
-
isSafe,
|
|
71
|
-
escapeHtml
|
|
72
|
-
} = require('miki-template');
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
### ES Modules (ESM)
|
|
76
|
-
```js
|
|
77
|
-
import {
|
|
78
|
-
compile,
|
|
79
|
-
render,
|
|
80
|
-
asyncRender,
|
|
81
|
-
__express,
|
|
82
|
-
__expressAsync,
|
|
83
|
-
express,
|
|
84
|
-
setupExpress,
|
|
85
|
-
expressPartialRenderer,
|
|
86
|
-
renderPartialFromFile,
|
|
87
|
-
renderPartialFromSource,
|
|
88
|
-
stripExpressContext,
|
|
89
|
-
clearCache,
|
|
90
|
-
registerTag,
|
|
91
|
-
registerFilter,
|
|
92
|
-
getFilter,
|
|
93
|
-
registerHelper,
|
|
94
|
-
registerContextProcessor,
|
|
95
|
-
clearContextProcessors,
|
|
96
|
-
registerTranslation,
|
|
97
|
-
setLanguage,
|
|
98
|
-
getLanguage,
|
|
99
|
-
setFallbackLanguage,
|
|
100
|
-
getAvailableLanguages,
|
|
101
|
-
registerLibrary,
|
|
102
|
-
registerLibraryFromPath,
|
|
103
|
-
activateLibrary,
|
|
104
|
-
SafeString,
|
|
105
|
-
markSafe,
|
|
106
|
-
isSafe,
|
|
107
|
-
escapeHtml
|
|
108
|
-
} from 'miki-template';
|
|
109
|
-
|
|
110
|
-
// Or import all as default
|
|
111
|
-
import miki from 'miki-template';
|
|
112
|
-
const { render: mikiRender, setupExpress } = miki;
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
For detailed usage, refer to the corresponding sections in the documentation:
|
|
116
|
-
- **Usage** – `docs/usage.md`
|
|
117
|
-
- **Tags** – `docs/tags.md`
|
|
118
|
-
- **Filters** – `docs/filters.md`
|
|
119
|
-
- **Security** – `docs/security.md`
|
|
1
|
+
# API Reference
|
|
2
|
+
|
|
3
|
+
This document lists the public API exported by **miki-template** for developers to integrate the engine into their projects.
|
|
4
|
+
|
|
5
|
+
| Function / Export | Signature | Description | Example |
|
|
6
|
+
|---|---|---|---|
|
|
7
|
+
| `compile(templateStr, options?)` | `compile(string, object?) → { render, asyncRender, renderBlock, renderPartial }` | Compiles a template string into a renderable object. Optional `options` can include `views` directories, custom tags/filters, etc. | `const tpl = compile('Hello {{ name }}');` |
|
|
8
|
+
| `render(templateStr, context?, options?)` | `render(string, object?, object?) → string` | One‑off rendering of a template string with the provided context. | `render('Hello {{ name }}', { name: 'World' });` |
|
|
9
|
+
| `asyncRender(templateStr, context?, options?)` | `asyncRender(string, object?, object?) → Promise<string>` | Asynchronous rendering (useful with async helpers). | `await asyncRender(tpl, ctx);` |
|
|
10
|
+
| `__express(filePath, options, callback)` | `__express(string, object, function)` | Express view engine adapter – reads the file at `filePath` and renders it. Honors `view#partial` suffixes for HTMX-style partial responses. | `app.engine('html', miki.__express);` |
|
|
11
|
+
| `__expressAsync(filePath, options)` | `__expressAsync(string, object) → Promise<string>` | Async Express 5+ view engine adapter. Returns a Promise that resolves to rendered HTML. Also honors `view#partial` suffixes. | `app.engine('html', miki.__expressAsync);` |
|
|
12
|
+
| `express(options?)` | `express(object?) → function` | Factory that returns a view-engine function suitable for `app.engine(...)`. Honors `view#partial` selectors. | `app.engine('html', miki.express());` |
|
|
13
|
+
| `setupExpress(app, opts?)` | `setupExpress(expressApp, object?) → void` | **One-line Express integration.** Wires `app.engine(...)`, `app.set('views')`, and patches `res.render` so `res.render('view#partial', ...)` returns just that partial. Options: `{ extension?, views?, async? }`. | `miki.setupExpress(app, { extension: 'html', views: './views' });` |
|
|
14
|
+
| `expressPartialRenderer()` | `expressPartialRenderer() → function` | Express middleware that adds `res.renderPartial(view, locals)`. Useful as a drop-in HTMX helper without the full `setupExpress` shim. | `app.use(miki.expressPartialRenderer());` |
|
|
15
|
+
| `renderPartialFromFile(filePath, partialName, context?, options?)` | `renderPartialFromFile(string, string, object?, object?) → string` | Load a file from disk and render only the named `{% partialdef %}`. | `miki.renderPartialFromFile('views/home.html', 'card', { user });` |
|
|
16
|
+
| `renderPartialFromSource(source, partialName, context?, options?)` | `renderPartialFromSource(string, string, object?, object?) → string` | Render a single named partial directly from a template string. Walks the AST (and `extends` chain) to discover partials nested inside blocks. | `miki.renderPartialFromSource(src, 'card', ctx, { views });` |
|
|
17
|
+
| `stripExpressContext(options)` | `stripExpressContext(object) → object` | Remove Express framework keys (`_locals`, `settings`, `cache`) from an options object. | `const ctx = stripExpressContext(res.locals);` |
|
|
18
|
+
| `clearCache()` | `clearCache() → void` | Clear the in-memory compiled template cache. | `clearCache();` |
|
|
19
|
+
| `registerTag(name, parserFn)` | `registerTag(string, function)` | Register a custom tag parser. Must be called before compiling templates. | `registerTag('mytag', parserFn);` |
|
|
20
|
+
| `registerFilter(name, fn)` | `registerFilter(string, function)` | Register a custom filter. | `registerFilter('reverse', str => str.split('').reverse().join(''));` |
|
|
21
|
+
| `getFilter(name)` | `getFilter(string) → function` | Retrieve a registered filter function by name. | `const upper = getFilter('upper');` |
|
|
22
|
+
| `registerHelper(name, fn)` | `registerHelper(string, function)` | Register a helper function available inside templates. | `registerHelper('upper', s => s.toUpperCase());` |
|
|
23
|
+
| `registerContextProcessor(fn)` | `registerContextProcessor(function)` | Add a context processor that mutates the rendering context before each render. | `registerContextProcessor(ctx => ({ ...ctx, csrf_token: '123' }));` |
|
|
24
|
+
| `registerTranslation(lang, messages)` | `registerTranslation(string, object) → void` | Register translation messages for a language. | `registerTranslation('fr', { 'Hello': 'Bonjour' });` |
|
|
25
|
+
| `setLanguage(lang)` | `setLanguage(string) → void` | Set the active language for all subsequent renders. | `setLanguage('fr');` |
|
|
26
|
+
| `getLanguage()` | `getLanguage() → string` | Get the currently active language. | `const lang = getLanguage();` |
|
|
27
|
+
| `setFallbackLanguage(lang)` | `setFallbackLanguage(string) → void` | Set the fallback language for missing translations. | `setFallbackLanguage('en');` |
|
|
28
|
+
| `getAvailableLanguages()` | `getAvailableLanguages() → string[]` | List all registered language codes. | `const langs = getAvailableLanguages();` |
|
|
29
|
+
| `registerLibrary(name, def)` | `registerLibrary(string, object) → void` | Register a plugin library of tags, filters, and helpers. | `registerLibrary('humanize', { filters: { intcomma } });` |
|
|
30
|
+
| `registerLibraryFromPath(name, path)` | `registerLibraryFromPath(string, string) → object` | Load a library from a JS file on disk. | `registerLibraryFromPath('myLib', './libs/my-lib.js');` |
|
|
31
|
+
| `activateLibrary(name)` | `activateLibrary(string) → void` | Activate a registered library (makes its tags/filters available). | `activateLibrary('humanize');` |
|
|
32
|
+
| `SafeString` | `class SafeString` | Wrapper class for values that should bypass auto‑escaping. Returned by `markSafe`. |
|
|
33
|
+
| `markSafe(value)` | `markSafe(any) → SafeString` | Marks a value as safe, preventing HTML escaping. |
|
|
34
|
+
| `isSafe(value)` | `isSafe(any) → boolean` | Checks if a value is a `SafeString`. |
|
|
35
|
+
| `escapeHtml(str)` | `escapeHtml(string) → string` | Escapes HTML special characters. Used internally for auto‑escaping. |
|
|
36
|
+
|
|
37
|
+
All of the above are exported from `src/index.js` and can be imported via:
|
|
38
|
+
|
|
39
|
+
### CommonJS
|
|
40
|
+
```js
|
|
41
|
+
const {
|
|
42
|
+
compile,
|
|
43
|
+
render,
|
|
44
|
+
asyncRender,
|
|
45
|
+
__express,
|
|
46
|
+
__expressAsync,
|
|
47
|
+
express,
|
|
48
|
+
setupExpress,
|
|
49
|
+
expressPartialRenderer,
|
|
50
|
+
renderPartialFromFile,
|
|
51
|
+
renderPartialFromSource,
|
|
52
|
+
stripExpressContext,
|
|
53
|
+
clearCache,
|
|
54
|
+
registerTag,
|
|
55
|
+
registerFilter,
|
|
56
|
+
getFilter,
|
|
57
|
+
registerHelper,
|
|
58
|
+
registerContextProcessor,
|
|
59
|
+
clearContextProcessors,
|
|
60
|
+
registerTranslation,
|
|
61
|
+
setLanguage,
|
|
62
|
+
getLanguage,
|
|
63
|
+
setFallbackLanguage,
|
|
64
|
+
getAvailableLanguages,
|
|
65
|
+
registerLibrary,
|
|
66
|
+
registerLibraryFromPath,
|
|
67
|
+
activateLibrary,
|
|
68
|
+
SafeString,
|
|
69
|
+
markSafe,
|
|
70
|
+
isSafe,
|
|
71
|
+
escapeHtml
|
|
72
|
+
} = require('miki-template');
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### ES Modules (ESM)
|
|
76
|
+
```js
|
|
77
|
+
import {
|
|
78
|
+
compile,
|
|
79
|
+
render,
|
|
80
|
+
asyncRender,
|
|
81
|
+
__express,
|
|
82
|
+
__expressAsync,
|
|
83
|
+
express,
|
|
84
|
+
setupExpress,
|
|
85
|
+
expressPartialRenderer,
|
|
86
|
+
renderPartialFromFile,
|
|
87
|
+
renderPartialFromSource,
|
|
88
|
+
stripExpressContext,
|
|
89
|
+
clearCache,
|
|
90
|
+
registerTag,
|
|
91
|
+
registerFilter,
|
|
92
|
+
getFilter,
|
|
93
|
+
registerHelper,
|
|
94
|
+
registerContextProcessor,
|
|
95
|
+
clearContextProcessors,
|
|
96
|
+
registerTranslation,
|
|
97
|
+
setLanguage,
|
|
98
|
+
getLanguage,
|
|
99
|
+
setFallbackLanguage,
|
|
100
|
+
getAvailableLanguages,
|
|
101
|
+
registerLibrary,
|
|
102
|
+
registerLibraryFromPath,
|
|
103
|
+
activateLibrary,
|
|
104
|
+
SafeString,
|
|
105
|
+
markSafe,
|
|
106
|
+
isSafe,
|
|
107
|
+
escapeHtml
|
|
108
|
+
} from 'miki-template';
|
|
109
|
+
|
|
110
|
+
// Or import all as default
|
|
111
|
+
import miki from 'miki-template';
|
|
112
|
+
const { render: mikiRender, setupExpress } = miki;
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
For detailed usage, refer to the corresponding sections in the documentation:
|
|
116
|
+
- **Usage** – `docs/usage.md`
|
|
117
|
+
- **Tags** – `docs/tags.md`
|
|
118
|
+
- **Filters** – `docs/filters.md`
|
|
119
|
+
- **Security** – `docs/security.md`
|