X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=in%2Fmacros.md;fp=in%2Fmacros.md;h=757e7adc2f48bb870e72a1fc2da8292bce9fc2d3;hb=07e692ef713a7d0d65296cd62b978539ac1ed683;hp=abf96347f77eacc45256be2b681ff37a7f86075d;hpb=648cef7debdd1b5b96dc00db31445206c0de0f48;p=webber.git diff --git a/in/macros.md b/in/macros.md index abf9634..757e7ad 100644 --- a/in/macros.md +++ b/in/macros.md @@ -4,13 +4,12 @@ lang: en ctime: 2009-06-24 mtime: 2009-06-26 -= Calling macros = - Macros are executed whenever the sequence -"[[!name]]" or -"[[!name args]]" is in the source-file. +"[[!name]]" or "[[!name +arg1="1" arg2="2"...]]" 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 = @@ -26,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. "[[!sample -arg1="string"]]". This will yield +You can submit additional string arguments, e.g. with +"[[!sample arg1="string"]]". Now you get +additionally: * "`params.arg1`" contains "`string`"