libbbb - markup

Home

Allows marking-up the text file with special {{marks}} that contain javascript code. The text outside these markers is converted into print(text); statements.

For example following file:

1 Some lines of
2 text. Insert some numbers:
3 {{ var a = 1; print(a); a = a + 1; print(a); }}
4     
is converted into this script:
1 print( "Some lines of\ntext. Insert some numbers:\n" );
2 var a = 1; print(a); a = a + 1; print(a);
3     
that, in turn, creates this file:
1 Some lines of
2 text. Insert some numbers:
3 12
4     
If all you want to do is place the value of a variable in the file the alternate {%var_name%} notation is available, that gets replaced with print(var_name);

Depedencies:

Related source code documentation: Markup

Home