12 releases (1 stable)

1.0.0 Nov 5, 2024
0.12.0 Oct 5, 2024
0.11.0 Sep 13, 2024
0.8.0 May 7, 2024
0.6.0 Mar 17, 2024

#138 in Template engine

Download history 10/week @ 2024-07-27 68/week @ 2024-08-31 164/week @ 2024-09-07 66/week @ 2024-09-14 17/week @ 2024-09-21 25/week @ 2024-09-28 130/week @ 2024-10-05 7/week @ 2024-10-12 123/week @ 2024-11-02 14/week @ 2024-11-09

137 downloads per month

MIT license

19KB
415 lines

Toph

Toph is an HTML generation library. It's implemented as a declarative macro, html!, that transforms your markup into imperative code to build up an HTML tree. This tree can then be converted to a string.

let _ = toph::html! {
    doctype["html"] {}
    html {
        title {
            toph::text("hello world");
        }
    }
    body {
        p[class: "intro"] {
            toph::text("This is an example of the ");
            a[href: "https://github.com/eze-works/toph"] {
                toph::text(" template language");
            }
        }
    }
};

No runtime deps