aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorRafael G. Martins <rafael@rafaelmartins.eng.br>2015-04-15 02:49:54 -0300
committerRafael G. Martins <rafael@rafaelmartins.eng.br>2015-04-15 02:49:54 -0300
commit43c6988922e484f2c89a93b92ed11b83a092f0bb (patch)
tree1500e67f3419ea5e4522decc51c270c5798386c5 /README.md
parent935b7f70da657ebd6cf62da03310bbcc10693ee2 (diff)
downloadblogc-43c6988922e484f2c89a93b92ed11b83a092f0bb.tar.gz
blogc-43c6988922e484f2c89a93b92ed11b83a092f0bb.tar.bz2
blogc-43c6988922e484f2c89a93b92ed11b83a092f0bb.zip
more random design notes updates
Diffstat (limited to 'README.md')
-rw-r--r--README.md11
1 files changed, 9 insertions, 2 deletions
diff --git a/README.md b/README.md
index 956ce00..da3d2d4 100644
--- a/README.md
+++ b/README.md
@@ -9,9 +9,16 @@ The main idea is simple: a source file is read by the compiler, and a result fil
The source file must provide (almost) all the data needed to build the result file, including any variables. The result file is built using a template, that defines how the information provided by the source file should be used to generate a reasonable result file.
-The compiler will always generate a single file, no matter how many source files are provided to it. If more than one source file is provided, the template must know how to convert them to a single result file.
+The compiler will always generate a single file, no matter how many source files are provided. If more than one source file is provided, the template must know how to convert them to a single result file.
-The templates can define blocks. If something is defined outside of blocks, it should be used for any source. If it is inside a block, it should only be used if the block matches the compiler argument expectations, e.g.: ``single_source`` should be used if just one source file is provided, ``multiple_sources`` should be used if more than one source file is provided, being used once for each source file, and ``multiple_sources_once`` should be used if more than one source file is provided, but only once. Templates blocks can't be nested.
+The templates can define blocks. These are the block rules:
+
+- If something is defined outside of blocks, it should be always used.
+- If something is defined inside a block, it should only be used if the block matches the compiler argument expectations, e.g.:
+ - ``single_source`` should be used if just one source file is provided.
+ - ``multiple_sources`` should be used if more than one source file is provided, being used once for each source file.
+ - ``multiple_sources_once`` should be used if more than one source file is provided, but only once.
+- Template blocks can't be nested.
The variables defined in the source file are only available inside of blocks. If something does not depends on the source files, and is global, it must be hardcoded in the template, for the sake of simplicity.