aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQrius <[email protected]>2025-05-06 11:12:47 +0200
committerQrius <[email protected]>2025-05-06 11:12:50 +0200
commite3642c513084a202ee2195dab902d77a0e9575cc (patch)
tree68f0ee015533bd8408ac6dad511dd5ad0cfb3656
parentb8dc70cf90a7d9cf44075ffdb63c5721e5077061 (diff)
downloadskaldpress-e3642c513084a202ee2195dab902d77a0e9575cc.tar.gz
skaldpress-e3642c513084a202ee2195dab902d77a0e9575cc.zip
Add info on code blocks and strings
-rw-r--r--smp.135
1 files changed, 35 insertions, 0 deletions
diff --git a/smp.1 b/smp.1
index 33a96dc..40942ad 100644
--- a/smp.1
+++ b/smp.1
@@ -94,6 +94,41 @@ Passes the rest of the file as content to the \fBtemplate\fR-macro.
.IP "\fB@html_from_markdown\fR"
Passes the rest of the file as content to the \fBhtml_from_markdown\fR-macro.
+.SS "\fBStrings\fR"
+This macro processor is generally recursive, meaning all macros will process it's arguments normally before using them.
+To make this easier to deal with, strings are differentiated between opening and closing.
+
+Opening is \fB%"\fR, closing is \fB"%\fR.
+
+.SS "\fBCode\fR"
+You can run arbitrary (python) code in the files, which operates in the same environment as the macros.
+This means you can from the python code call all builtin macros directly (you will need to manually provide the macro_processor reference).
+It also means all definitions you make, are available outside as macro tokens.
+Code blocks are opened with \fB%(\fR and closed with \fB)%\fR.
+
+
+
+.PP
+.nf
+.RS
+%(
+def A():
+ return "test"
+)%
+A
+%"A"%
+.RE
+.fi
+.PP
+Returns
+.PP
+.nf
+.RS
+test
+A
+.RE
+.fi
+.PP
.SS "\fBBuiltin macro options\fR"
There are some macros flags that can enable/disable features,