Warning
This project is still in heavy development.
A static HTML/XML and CSS generator from Nim code. For cats (humans are tolerated).
This is the successor to my other/old HTML/XML/CSS generator websitegenerator rewritten (more like reimplemented with major changes, so like, idk how you would call that... remade?) and enhanced.
Include the following line in your .nimble file: requires "https://github.com/nirokay/CatTag"
or
git clone https://github.com/nirokay/CatTag && cd CatTag && nimble install and include required "cattag" in your .nimble file.
Feel free to explore the examples subdirectory!
This is a very basic example, only showing off HTML generation.
import cattag
var html: HtmlDocument = newHtmlDocument("index.html")
html.add(
h1(html"Cats"),
p(html"Cool stuff about cats."),
h2(html"Facts"),
ul(
li(html"cats are cool!"),
li(html"cats are the best")
)
)
html.writeFile()<!DOCTYPE html>
<html>
<head></head>
<body>
<h1>Cats</h1>
<p>Cool stuff about cats.</p>
<h2>Facts</h2>
<ul>
<li>cats are cool!</li>
<li>cats are the best</li>
</ul>
</body>
</html>- HTML/XML Generation
- CSS Generation
- HTML/XML sugar syntax
- CSS sugar syntax
- HTML QoL attribute constants (
class,lang,id, ...) - HTML QoL procs (
p("text")fornewHtmlElement("p", "text")) - CSS QoL property constants (
text-align,background-color, ...) - CSS QoL property and property value constants (
center,Red, ...) - CSS QoL procs
- DOM procs
-
HtmlElement.stylefield stuff (usage similar to typescript element style manipulation)
- HTML/XML Parsing
- CSS Parsing
This project is licenced under the GPL-3.0 license.