summaryrefslogtreecommitdiff
path: root/ikiwiki/directive/cutpaste.mdwn
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2010-10-14 13:38:43 +0200
committerJonas Smedegaard <dr@jones.dk>2010-10-14 13:38:43 +0200
commite990b132016f231ef150085597d02e2eb4883a1f (patch)
tree4220bd4d1a026353c7c6f74aa438aef9c6a10ff4 /ikiwiki/directive/cutpaste.mdwn
Sync with ikiwiki 3.20100926.HEADmasterikiwiki
Diffstat (limited to 'ikiwiki/directive/cutpaste.mdwn')
-rw-r--r--ikiwiki/directive/cutpaste.mdwn50
1 files changed, 50 insertions, 0 deletions
diff --git a/ikiwiki/directive/cutpaste.mdwn b/ikiwiki/directive/cutpaste.mdwn
new file mode 100644
index 0000000..ca580e5
--- /dev/null
+++ b/ikiwiki/directive/cutpaste.mdwn
@@ -0,0 +1,50 @@
+The `copy`, `cut` and `paste` directives are supplied by the
+[[!iki plugins/cutpaste desc=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:
+
+ \[[!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"]]