diff options
| author | Alexander Pickering <alexandermpickering@gmail.com> | 2019-01-15 19:42:45 -0500 |
|---|---|---|
| committer | Alexander Pickering <alexandermpickering@gmail.com> | 2019-01-15 19:42:45 -0500 |
| commit | a8ca001a8f811403bccffed03243954f5a52b27b (patch) | |
| tree | 03c6ac85145afd4b2fd1079dd29a3a1ad0b74974 /README.md | |
| parent | 195c332a2314305392ee2a09272e3fbd4f1b134a (diff) | |
| download | libctemplates-a8ca001a8f811403bccffed03243954f5a52b27b.tar.gz libctemplates-a8ca001a8f811403bccffed03243954f5a52b27b.tar.bz2 libctemplates-a8ca001a8f811403bccffed03243954f5a52b27b.zip | |
Spelling corrections
Corrected a bunch of spelling mistakes in the readme and the Makefile
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 27 |
1 files changed, 15 insertions, 12 deletions
@@ -18,16 +18,16 @@ instructions on creating and sending git patches [here](http://cogarr.net/source 1. [Installation](#Installation) 2. [Usage](#Usage) -3. [Quick reference](#Quick refernce) +3. [Quick reference](#Quick refrence) 4. [Examples](#Examples) <section id="Installation"></section> ## Installation Run the make file. libctemplates should compile on any system with a c99 -complaint c compiler. If you are on linux, run +complaint c compiler. If you are on linux, cd into the root directory and run - make; make install + make && make install <section id="Usage"></section> ## Usage @@ -45,8 +45,8 @@ libctemplates.a, for example: * struct TMPL\_templates Holds a template * struct TMPL\_varlist - Holds a list of variables to be used when rendering a template - loops can be held in a varlist, and varlists can be held in loops. + Holds a list of variables to be used when rendering a template. + Loops can be held in a varlist, and varlists can be held in loops. * struct TMPL\_loop Used to define things to loop through in a varlist. @@ -56,7 +56,9 @@ libctemplates.a, for example: Creates a template from the given string. This can be pretty expensive so try to only do it once for each template you need, and call render() -as many times as you need on that template. +as many times as you need on that template. If there was a problem building +the template, the returned `template->error` will be non-zero, and you can +retrive an error message with `TMPL_err()` void TMPL_free_template(struct TMPL_templates* template) @@ -171,8 +173,8 @@ For example: int main(){ /* It usually helps to seperate the template from the - C code. It does mean to need to read in a file though. - Try to only call TMPL_alloc_template once for each + C code. You need to read in a file though. + Try to only call TMPL_alloc_template() once for each template you have, and then use TMPL_render() whenever you need to use them. */ @@ -192,9 +194,10 @@ For example: /* Render the template without a variable named "varname" This will use the variable's default, if it has one. - If the variable has no default, and is not supplied a value, - it errors, and stores a message that can be retrived with - TMPL_get_error(...) + If the variable has no default and is not supplied a value, + it subsitutes an empty string and logs an error message. You + can check for error messages by checking if template->error is + non-zero. You can retrive error messages with TMPL_get_error() */ t = TMPL_alloc_template(template); vl = TMPL_alloc_varlist(); @@ -206,7 +209,7 @@ For example: /* Now render a template with a variable, use the - TMPL_add_var_to_varlist(...) to supply the template with + TMPL_add_var_to_varlist() to supply the template with variables. */ t = TMPL_alloc_template(template); |
