diff options
Diffstat (limited to 'Cool/README.md')
| -rw-r--r-- | Cool/README.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/Cool/README.md b/Cool/README.md new file mode 100644 index 0000000..3c9f770 --- /dev/null +++ b/Cool/README.md @@ -0,0 +1,44 @@ +# Cool + +Build server-side components with C! Use the single-header library as a standalone HTML formatter +or use the transpiler to convert `.cool` files into `.c` files that you can include directly! + +## Example + +Write something like so: + +```code +COOL void Api(char *name, char *func, char *desc) { + <div class="api-card"> + <h3 class="api-name">{ name }</h3> + <code class="language-c">{ func } </code> + <div class="api-description"> + { desc } + </div> + </div> +} +``` + +Call `compiler.py` to get `view.cool.c` and include it into your code. + +```c +#include "views.cool.c" // include server side components directly + +int main() { + char func_name[256]; + char func_decl[256]; + char *comment_text = NULL; + /* ... */ + /* call you view directly! */ + if (feel_like_it) { + Api(func_name, func_decl, comment_text); + } + return 0; +} + +``` + +## Contributing + +This is one of the few open source projects where I'm very open to contribution. +Web is not my area of expertise. And this idea deserves fome fleshing out. |
