More actions
m →How to edit changelogs: link updated |
m added write_changelog and write_changelogs |
||
Line 13: | Line 13: | ||
Invokes are callable by wikitext, i.e. <code><nowiki>{{#invoke|Changelog|invokable_name|param1|paramN}}</nowiki></code> | Invokes are callable by wikitext, i.e. <code><nowiki>{{#invoke|Changelog|invokable_name|param1|paramN}}</nowiki></code> | ||
==invokable | ==write_changelogs== | ||
The main invokable that will be used. Given a specific tag, it outputs all relevant changelogs from all dates in a [[Template:Update history table]]. | |||
===Parameters=== | |||
* '''tag''' - Tag to search relevant changelogs for | |||
* '''num_dates''' - (OPTIONAL) Number of dates to add, recommend 3 for articles. If unprovided, defaults to all. | |||
===Examples=== | |||
For use on [[Pocket/Update history]]: | |||
<code><nowiki>{{#invoke:Changelog|write_changelogs|Pocket}}</nowiki></code> | |||
Outputs | |||
{{#invoke:Changelog|write_changelogs|Pocket}} | |||
For use on [[Pocket#Update history]]: | |||
<code><nowiki>{{#invoke:Changelog|write_changelogs|Pocket|3}}</nowiki></code> | |||
Outputs | |||
{{#invoke:Changelog|write_changelogs|Pocket|3}} | |||
=Functions= | =Functions= | ||
Line 31: | Line 50: | ||
Outputs | Outputs | ||
<!--Below is an invoke that calls the function, as functions themselves are not callable in wikitext--> | |||
{{#invoke:Changelog|invoke_date_tag_to_lines|05-03-2024|Abrams}} | {{#invoke:Changelog|invoke_date_tag_to_lines|05-03-2024|Abrams}} | ||
Line 39: | Line 58: | ||
Outputs | Outputs | ||
<!--Below is an invoke that calls the function, as functions themselves are not callable in wikitext--> | |||
{{#invoke:Changelog|invoke_date_tag_to_lines|05-03-2024|Heroes}} | |||
==write_changelog== | |||
Note the difference to the invokable "write_changelog<b>s</b>". | |||
Writes 1 changelog for a specific date for a tag. Essentially outputs a frontend format for the content of 'date_tag_to_lines'. | |||
===Parameters=== | |||
Same as date_tag_to_lines. | |||
===Examples=== | |||
<code><nowiki>invoke_write_changelog('05-03-2024', 'Abrams')</nowiki></code> | |||
Outputs | |||
<!--Below is an invoke that calls the function, as functions themselves are not callable in wikitext--> | |||
{{#invoke:Changelog|invoke_write_changelog|05-03-2024|Abrams}} | |||
The above is not readable, as its designed to be passed to [[Template:Update history table]]. For example, | |||
<pre> | |||
{{Update history table | |||
| contents = | |||
invoke_write_changelog('05-03-2024', 'Abrams') | |||
invoke_write_changelog('05-10-2024', 'Abrams') | |||
}} | |||
</pre> | |||
Outputs | |||
{{Update history table | |||
| contents = | |||
{{#invoke:Changelog|invoke_write_changelog|05-03-2024|Abrams}} | |||
{{#invoke:Changelog|invoke_write_changelog|05-10-2024|Abrams}} | |||
}} | |||
===Notes=== | ===Notes=== |