The Wayback Machine - https://web.archive.org/web/20201123200719/https://github.com/nilesr/cerb
Skip to content
master
Go to file
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
vim
 
 
 
 
 
 
 
 
 
 
 
 

readme.md

erb but for c

For use with kore

Make a views directory outside your source directory, and put example.cerb in it. Then run cerb, and use it like this

	#include <views.h>
	// ...
	char* result = Cerb(example, Local(test, "some value"));
	http_response(req, 200, result, strlen(result));
	// do NOT free result here
	return KORE_RESULT_OK;

It should look something like this

You can use an inline struct ((cerb_local) {"test", "value"}) instead of the Local macro for the same effect, or for dynamically generated local names.

You'll have to rerun cerb every time you change your view

About

Fast templating engine in C

Topics

Resources

Releases

No releases published

Packages

No packages published
You can’t perform that action at this time.