https://github.com/joaogsleite/mustag
Mustache templating with custom HTML tags
https://github.com/joaogsleite/mustag
handlebars html html-components html-template mustache templating
Last synced: about 1 month ago
JSON representation
Mustache templating with custom HTML tags
- Host: GitHub
- URL: https://github.com/joaogsleite/mustag
- Owner: joaogsleite
- License: mit
- Created: 2019-10-29T14:18:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-11-25T11:11:36.000Z (over 6 years ago)
- Last Synced: 2025-08-09T11:31:30.325Z (11 months ago)
- Topics: handlebars, html, html-components, html-template, mustache, templating
- Language: JavaScript
- Homepage:
- Size: 8.79 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Mustag
CLI tool to parse html custom components with mustache sintax to pure html views
![node][node]
[![npm version][npm-badge]][npm]
[![dependencies Status][dependencies-badge]][dependencies]
[![devDependencies Status][dev-dependencies-badge]][dev-dependencies]
[![PRs Welcome][prs-badge]][prs]
[![GitHub][license-badge]][license]
## Example
Place multiple HTML components inside a folder:
* top-menu.html
```
```
* menu-item.html
```
{{name}}
```
Create a view that uses the custom HTML components:
```
...
...
```
Run this tool to parse your view and generate this HTML:
```
...
...
```
## Install
* inside your project
```
npm install --save-dev mustag
```
* globally
```
npm install -g mustag
```
## Using
```
mustag --components --views
```
* components folder should include sub-folders with the name of the components
* each sub-folder must include a html file with the same name
* do not choose component names equal to reserved html tags
* views folder must should include html files that use the custom html tags
* the compiled views will be saved inside dist folder
```
...
"scripts": {
...
"mustag": "mustag --components ./components --views ./views ./dist",
...
},
...
```
[node]: https://img.shields.io/node/v/mustag.svg
[npm-badge]: https://badge.fury.io/js/mustag.svg
[npm]: https://badge.fury.io/js/mustag
[dependencies-badge]: https://david-dm.org/joaogsleite/mustag/status.svg
[dependencies]: https://david-dm.org/joaogsleite/mustag
[dev-dependencies-badge]: https://david-dm.org/joaogsleite/mustag/dev-status.svg
[dev-dependencies]: https://david-dm.org/joaogsleite/mustag?type=dev
[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg
[prs]: http://makeapullrequest.com
[license-badge]: https://img.shields.io/github/license/joaogsleite/mustag.svg
[license]: https://github.com/joaogsleite/mustag/blob/master/LICENSE