README (980B)
1 stacinhtml 2 ========== 3 4 Static C in HTML is a page generator wrote in C99 initially for my webpage. 5 This is a simple "compiler" that takes HTML with nested C code on input, and 6 produces HTML on output. Input and nesting C code was inspired by node.c 7 created by Tsoding (https://github.com/tsoding/node.c). 8 9 Usage 10 ===== 11 generate (generate.c) takes minimum one argument: 12 * first argument is a file with content. 13 * second, optional argument is a template. Optional, because content can 14 contain template variable. 15 16 generate is used by Makefile 17 18 Structure 19 ========= 20 Content is just content, but it can also contain variables. Variable is 21 a line starting with @, followed by variable name (single word) and variable 22 content (anything until new line). 23 Examples: 24 @title My title 25 @template blog 26 27 Template is HTML code, but can write nested code surrounded by `%` signs. 28 For example, this will print "Hello!" 255 times: 29 30 <!DOCTYPE html> 31 %for (int i = 0; i < 255; ++i) {% 32 Hello! 33 %}%