]> oss.titaniummirror.com Git - webber.git/blobdiff - in/macros.md
Merge branch 'upstream'
[webber.git] / in / macros.md
index 211de19abb71e501299b61afa2bd1666953b86ad..757e7adc2f48bb870e72a1fc2da8292bce9fc2d3 100644 (file)
@@ -1,14 +1,15 @@
 title: Macros
 parent: Webber
+lang: en
 ctime: 2009-06-24
-
-= Calling macros =
+mtime: 2009-06-26
 
 Macros are executed whenever the sequence
-"<code>[</code><code>[!name]]</code>" or
-"<code>[</code><code>[!name args]]</code>" is in the source-file.
+"<code>[</code><code>[!name]]</code>" or "<code>[</code><code>[!name
+arg1="1" arg2="2"...]]</code>" is found in a [[source page|pageformat]].
 
-Webber itself doesn't define any macros.
+Webber itself doesn't define any macros, that's your task. Use custom
+[[Plugins]] for this.
 
 
 = Defining macros =
@@ -24,13 +25,17 @@ to be decorated with "`@set_macro(name)`". There's an example in
                        print "in macro skeleton.sample_macro, params:", params
                return "{ output of sample macro }"
 
-If you call this macro, you'll see the output "[[!sample]]".
+If you call this macro, the returned text "`{
+output of sample macro }`" will end up in your HTML file.
+
+Inside the macro, you can access this parameters:
 
 * "`params.name`" contains the name of the macro
 * "`params.file`" contains the current "`class File`" object
 
-You can submit additional string arguments, e.g. "<code>[</code><code>[!sample
-arg1="string"]]</code>". This will yield
+You can submit additional string arguments, e.g. with
+"<code>[</code><code>[!sample arg1="string"]]</code>". Now you get
+additionally:
 
 * "`params.arg1`" contains "`string`"