User:Alien333/transclude
User:Alien333/transclude.js is a script to transclude pages.
Check the arguments carefully every time you use this script. If you made a mistake, reload/close the page you started it from to stop it. You are responsible for all edits made using this script. It is highly recommended to check the first few pages on each run, to find anomalies. |
Use
[edit]Takes input (from any editing box in userspace) in the form:
Rootpage(required)|index(default extrapolated from rootpage)|extension(default djvu) Author(required)|author2(default none) ... Name(required)/...;include(required) fromsection(default none) tosection(default none);... ...
You don't have to put the separators for empty arguments, if all that follow at the same level are also empty, e.g. "title/42 b" means the same as "title/42 b ", but "title/42 a" (with two spaces) is not the same as "title/42 a".
It will create the pages as follows:
{{header
| title = [Rootpage]
[1]
| author = [author]
[2]
| author2 = [author2]
[3]
| translator =
[4]
| section = [Name]
[1]
| previous = [Name of previous row]
[1]
| next = [Name of following row]
[1]
| notes =
[4]
}}
<pages index="[index].[extension]" include=[include1] fromsection=[fromsection1 tosection=[tosection1 />
[5]
with a new pages tag for each ;-delimited segment of the second half of a line (after the /), separated by a {{ppb}}.
- ↑ 1.0 1.1 1.2 1.3 Page (root & sub) titles should be entered with dab parentheticals and {{ld}}, where applicable. The actual page names will include the parentheticals, but {{ld}} will be replaced by three em dashes. The titles will be piped with the parentheticals hidden and {{ld}} left as-is.
- ↑ The |author= will be replaced by |author1= if author2 is used
- ↑ Only if given
- ↑ 4.0 4.1 not implemented yet
- ↑ Fromsection and tosection will each be omitted when the corresponding argument is not given (or is empty).
Technical stuff
[edit]To avoid ApiRateLimit, only creates a page every .7 seconds. That is above the rate usually recommended for API usage, but as it's only for one or two minutes a day, at the utmost, with no use on most days, I think it's fine.
In case anyone cares, it does them in the reverse of the order given (more convenient for recursion).