diff options
author | Joey Hess <joey@kodama.kitenet.net> | 2008-09-11 18:41:26 -0400 |
---|---|---|
committer | Joey Hess <joey@kodama.kitenet.net> | 2008-09-11 18:41:26 -0400 |
commit | 9921a4a8a1a696ce69acce5e14943f0149d926ff (patch) | |
tree | 926ebf50f913087a99c05993a3b01e2d935c9878 /doc/ikiwiki/directive/cutpaste.mdwn | |
parent | 7d98c3d52bcdf2a3010843d176bf9fd79643207b (diff) |
Move the directive documentation into its own underlay, separate from basewiki, since it's sorta large compared to the rest of basewiki.
Diffstat (limited to 'doc/ikiwiki/directive/cutpaste.mdwn')
-rw-r--r-- | doc/ikiwiki/directive/cutpaste.mdwn | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/doc/ikiwiki/directive/cutpaste.mdwn b/doc/ikiwiki/directive/cutpaste.mdwn new file mode 100644 index 000000000..7c1d5b6cb --- /dev/null +++ b/doc/ikiwiki/directive/cutpaste.mdwn @@ -0,0 +1,56 @@ +The `copy`, `cut` and `paste` directives are supplied by the +[[!iki plugins/cutpaste]] plugin. + +With these directives you can store and recall pieces of text in a page: + + * `\[[!cut id=name text="text"]]` memorizes the text allowing to recall it + using the given ID. The text being cut is not included in the output. + * `\[[!copy id=name text="text"]]` memorizes the text allowing to recall it + using the given ID. The text being cut *is* included in the output. + * `\[[!paste id=name]]` is replaced by the previously memorized text. + +The text being cut, copied and pasted can freely include wiki markup, including +more calls to cut, copy and paste. + +You do not need to memorize the text before using it: a cut directive can +follow the paste directive that uses its text. In fact, this is quite useful +to postpone big blocks of text like long annotations and have a more natural +flow. For example: + + This plugin provides three directives: + + * \[[!toggle id="cut" text="cut"]] that cuts text + * \[[!toggle id="copy" text="copy"]] that copies text + * \[[!toggle id="paste" text="paste"]] that pastes text + + \[[!toggleable id="cut" text="\[[!paste id=cutlongdesc]]"]] + \[[!toggleable id="copy" text="\[[!paste id=copylongdesc]]"]] + \[[!toggleable id="paste" text="\[[!paste id=pastelongdesc]]"]] + + \[...some time later...] + + \[[!cut id=cutlongdesc text=""" + blah blah blah + """]] + \[[!cut id=copylongdesc text=""" + blah blah blah + """]] + \[[!cut id=pastelongdesc text=""" + blah blah blah + """]] + +This can potentially be used to create loops, but ikiwiki is clever and breaks +them. + +Since you can paste without using double quotes, copy and paste can be used to +nest directives that require multiline parameters inside each other: + + \[[!toggleable id=foo text=""" + \[[!toggleable id=bar text="\[[!paste id=baz]]"]] + """]] + + \[[!cut id=baz text=""" + multiline parameter! + """]] + +[[!meta robots="noindex, follow"]] |