cattag

Static HTML/XML and CSS generator.

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.10
License GPL-3.0-only
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Authors

  • nirokay

Installation

nimble install cattag
choosenim install cattag
git clone https://github.com/nirokay/CatTag

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
cattag - - - - - - -

Dependencies

Package Version Optional
nim >= 2.2.2 No

Source

Repository https://github.com/nirokay/CatTag
Homepage https://github.com/nirokay/CatTag
Registry Source nimble_official

README

CatTag

[!WARNING] This project is still in heavy development.

About

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.

Installation

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.

Examples

Feel free to explore the examples subdirectory!

Basic example

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>

Roadmap

Planned features

  • [x] HTML/XML Generation
  • [x] CSS Generation
  • [x] HTML/XML sugar syntax
  • [x] CSS sugar syntax
  • [x] HTML QoL attribute constants (class, lang, id, ...)
  • [x] HTML QoL procs (p("text") for newHtmlElement("p", "text"))
  • [x] CSS QoL property constants (text-align, background-color, ...)
  • [ ] CSS QoL property and property value constants (center, Red, ...)
  • [x] CSS QoL procs
  • [x] DOM procs
  • [ ] HtmlElement.style field stuff (usage similar to typescript element style manipulation)

Distant future ideas

  • [ ] HTML/XML Parsing
  • [ ] CSS Parsing

License

This project is licenced under the GPL-3.0 license.