Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/maksasj/chtml
chtml - little single header library for generating HTML code
https://github.com/maksasj/chtml
c chtml cool html webdevelopment
Last synced: about 6 hours ago
JSON representation
chtml - little single header library for generating HTML code
- Host: GitHub
- URL: https://github.com/maksasj/chtml
- Owner: Maksasj
- License: mit
- Created: 2024-05-22T20:04:30.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-05-27T19:54:10.000Z (6 months ago)
- Last Synced: 2024-05-28T05:29:52.192Z (6 months ago)
- Topics: c, chtml, cool, html, webdevelopment
- Language: C
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# CHTML
Little single header library for generating HTML code.
> Original idea from this Reddit post [there](https://www.reddit.com/r/C_Programming/comments/11at6d8/generate_html_in_c/)## Example
This is a little usage example, that generates very simple html code```c
#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
- MIT License ([LICENSE.md](https://github.com/Maksasj/chtml/blob/master/LICENSE.md) or https://opensource.org/license/mit/)