Other parameters: Difference between revisions

Content added Content deleted
(repaired cross-reference links)
(Fixed and aligned some <pre> and <code>)
Line 9: Line 9:
Syntax:
Syntax:


<code>updaterules=
updaterules=
<i>rule</i>;
<i>rule</i>;
...
...
<i>rule</i>;
<i>rule</i>;
</code>


Where rule is one of the following:
Where rule is one of the following:


* rules for batch update of articles
* rules for batch update of articles
replace ''pattern'';
replace ''pattern'';
by ''replacement'';
by ''replacement'';
before ''pattern'';
before ''pattern'';
insert ''text'';
insert ''text'';
after ''pattern'';
after ''pattern'';
insert ''text'';
insert ''text'';


* rules for interactive update of articles
* rules for interactive update of articles
template ''template name'';
template ''template name'';
legend ''legend article name'';
legend ''legend article name'';
table ''table format'';
table ''table format'';
editform ''form parameters'';
editform ''form parameters'';
action ''form action'';
action ''form action'';
hidden ''value'';
hidden ''value'';
submit ''submit button'';
submit ''submit button'';
commit ''commit button'';
commit ''commit button'';
parameter ''parameter name'';
parameter ''parameter name'';
value ''value'';
value ''value'';
format ''display format'';
format ''display format'';
tooltip ''text'';
tooltip ''text'';
optional ''value'';
optional ''value'';
afterparm ''parameter name'';
afterparm ''parameter name'';


* common rules
* common rules
summary ''edit summary text'';
summary ''edit summary text'';
exec ''value'';
exec ''value'';


The first group of rules is intended for batch updates of articles. A DPL query can select a group of articles and perform updates like inserting a piece of text at a certain position or changing text portions based on regular expressions.
The first group of rules is intended for batch updates of articles. A DPL query can select a group of articles and perform updates like inserting a piece of text at a certain position or changing text portions based on regular expressions.
Line 74: Line 73:


A DPL statement may contain replacement, insertion before and after at the same time.
A DPL statement may contain replacement, insertion before and after at the same time.
replace /([a-z]+])-cat/;
replace /([a-z]+])-cat/;
by \1-dog;
by \1-dog;
before foo;
before foo;
insert bar;
insert bar;
after foo;
after foo;
insert bar2;
insert bar2;


Only one 'replace'-'by' sequence, one insertion 'before' and one insertion 'after' can be specified. 'replace' is always executed first, followed by 'insert before' and 'insert after', regardless of the sequence in which the rules appear in the DPL source ´text.
Only one 'replace'-'by' sequence, one insertion 'before' and one insertion 'after' can be specified. 'replace' is always executed first, followed by 'insert before' and 'insert after', regardless of the sequence in which the rules appear in the DPL source ´text.
Line 92: Line 91:


a regular expression
a regular expression
after ''pattern'';
after ''pattern'';
insert ''text'';
insert ''text'';
replace ''pattern'';
replace ''pattern'';
by ''replacement'';
by ''replacement'';


For safety reasons the update statements will only be performed if "exec yes" is specified. So, leaving this away, you can check what would happen if the update were to be executed.
For safety reasons the update statements will only be performed if "exec yes" is specified. So, leaving this away, you can check what would happen if the update were to be executed.
Line 114: Line 113:
}}
}}


<code>deleterules=
deleterules=
reason <i>text</i>;
reason <i>text</i>;
exec true;
exec true;
</code>


This command is experimental at the moment.
This command is experimental at the moment.
Line 192: Line 190:
Example:
Example:
<pre><nowiki>
<pre><nowiki>
[[Category:Q Cat]] linking to [[Q Link]] and showing [[Image:Q Image]] and using {{Q Template}}
[[Category:Q Cat]] linking to [[Q Link]] and showing [[Image:Q Image]] and using {{Q Template}}
... DPL query which includes contents from other articles.
... DPL query which includes contents from other articles.
assuming that this contents contains links and images,
assuming that this contents contains links and images,
that it uses templates and thatthe articles are part of one or more categories
that it uses templates and thatthe articles are part of one or more categories
RESET statement at the end of the DPL query with one or more of 'categories,templates,images,links'
RESET statement at the end of the DPL query with one or more of 'categories,templates,images,links'
...
...
</nowiki></pre>
</nowiki></pre>


Line 291: Line 289:
<pre><nowiki>
<pre><nowiki>
{{#dpl:
{{#dpl:
|namespace=Media
| namespace = Media
|debug=0
| debug = 0
|namespace=Special
| namespace = Special
}}
}}
</nowiki></pre>
</nowiki></pre>