Anonymous user
General usage and invocation syntax: Difference between revisions
m
Make it clear here that the manual is being switched to being mostly in parser function method, since one of the complaints of the manual prior was that people didn’t know how to convert things easily because it was mostly done in parser extension method, when many more use cases need the parser function method. Also, I don’t want to have to explain or remind every example or page that the block quotes are not part of the output.
imported>FrozenPlum (class=) |
imported>FrozenPlum m (Make it clear here that the manual is being switched to being mostly in parser function method, since one of the complaints of the manual prior was that people didn’t know how to convert things easily because it was mostly done in parser extension method, when many more use cases need the parser function method. Also, I don’t want to have to explain or remind every example or page that the block quotes are not part of the output.) |
||
Line 15:
;Example syntax
<pre>
<dpl>
category = cat1|cat2
Line 21:
linksto = myPage
</dpl>
;Parsing procedure
Line 36:
* Generally the syntax looks fairly simple and intuitive as it doesn't contain special characters (except for the two embracing tags).
* Tag case doesn't matter, so it can also be written <code><nowiki><dpl></nowiki></code>.
* In many cases, there is no need to have macro expansion within the parameter list
* In the example above, the pipe character (which is used to define a logical OR between the two categories) can be written as it is. The name of the page (''myPage''), however, must be a hard-coded constant.
==Parser function method==
Line 42 ⟶ 43:
;Example syntax
<pre>
{{#dpl: category = cat1{{!}}cat2 | linksto = {{{1}}} }}
or
<pre>
{{#dpl:
|category = cat1¦cat2
|linksto = {{{1}}}
}}
;Parsing procedure
Line 66 ⟶ 67:
* What was said before regarding explicit line breaks also holds true for parser function syntax, i.e., the special symbols <code>\n</code> or <code>¶</code> must be used to insert an explicit linefeed character into the wiki output stream if wiki symbols are used which must stand at the beginning of a line.
The second example is not literally equivalent to the first one, as there is an additional pipe character before the first parameter. Technically, this creates an additional empty parameter, but as empty parameters are silently ignored by DPL it makes no difference.
Line 128 ⟶ 129:
==Syntax used in this manual==
Most of the manual deals with the explanation of individual parameters. This is independent of the choice between the two variants described above. So, if you read something like
Line 139 ⟶ 140:
==Interaction between your wiki text and DPL3 output==
As mentioned before, DPL3 will insert its output exactly at the position where you placed the DPL3 call. This means that you can put wiki syntax around your DPL call, like e.g.,:
<pre
{| class="wikitable"
|a table field
Line 149 ⟶ 150:
|...
|}
You could also use HTML syntax to surround DPL output, as in the following example:
<pre
<ul>
<li>Item1</li>
Line 161 ⟶ 162:
</li>
</ul>
==Special note on ''Self References''==
Line 189 ⟶ 190:
This means that every page containing a DPL statement will automatically create a link to [[:Template:Extension DPL]]. You should create this Template in your wiki. We suggest that you copy the source code from [[:Template:Extension DPL|our version]]. The idea is that via this connection, you can easily find out which pages in a wiki contain DPL calls.
==Debugging a DPL statement==
|