Skip to content
/ chtml Public

little single header library for generating HTML code

License

Notifications You must be signed in to change notification settings

Maksasj/chtml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

CHTML

Little single header library for generating HTML code.

Original idea from this Reddit post there

Example

This is a little usage example, that generates very simple html code

#include "chtml.h"

int main() {
    HTML_BEGIN()

    HTML("lang='en'") {
        HEAD("") {
            META("charset='UTF-8'");
            // ...
        }
        BODY("") {
            H1("Hello world !");
            P("This is and CHTML example");
            
            for(int i = 0; i < 5; ++i)
                P("You also can use C code there %d like this", i);
        }
    } 

    char* string = HTML_COMPILE();
    printf("%s", string); // Result is just a html code
    free(string);

    return 0;
}

License

CHTML is free and open source library/software. All code in this repository is licensed under

About

little single header library for generating HTML code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages