Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/reesporte/html-compile
dead simple html component transpiler
https://github.com/reesporte/html-compile
Last synced: 3 days ago
JSON representation
dead simple html component transpiler
- Host: GitHub
- URL: https://github.com/reesporte/html-compile
- Owner: reesporte
- Created: 2021-09-14T02:24:28.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2021-09-14T18:34:35.000Z (about 3 years ago)
- Last Synced: 2024-06-20T16:44:18.595Z (5 months ago)
- Language: Go
- Homepage:
- Size: 20.5 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# html-compile
`html-compile` is a dead simple HTML component translating compiler that lets you write modular components, but in vanilla HTML / JS / CSS!## Installation
```bash
go get -u github.com/reesporte/html-compile
go install github.com/reesporte/html-compile@latest
```## What it does
If it finds a self-closing tag with the label "app-", it attempts to replace that tag with the HTML file with the same name. Comments are not included in the compiled file. It will copy all HTML, CSS, and JS files from the input directory, and recursively copy all directories in the input directory named "html", "js", or "css" to the output directory.It can also be used to prettify HTML, but won't fix HTML errors, just make existing HTML have consistent indentation.
### Component transpiling:
1. Set up a directory with an `index.html` file.
2. Then, to create a component, make a `COMPONENT.html` file and put it in a `components` directory which is on the same level as your `index.html`. Then, to use your component, put the tag `` in your `index.html` file where you want to use the component.
3. To compile your HTML, just run `html-compile --in `.### Prettify HTML inplace:
```bash
html-compile --prettify --out
```### Prettify a file in the current directory:
```bash
html-compile --prettify file.html --out .
```