Module:Changelog/doc

From Deadlock Wiki
Revision as of 17:39, 16 October 2024 by Sur (talk | contribs) (→‎Examples: example replaced with write_changelogs examples)
Jump to navigation Jump to search

This is the documentation page for Module:Changelog

Overview

Generates changelog lines from data pages such as Data:Changelog_05-03-2024.json

How to edit changelogs

Each changelogs should be exactly as written on the forum post, so edits are rarely justified, below are some exceptions

  • Typos by the poster should have {{sic}} added so that readers know it was intentionally written verbosely by the wiki
  • While the written portion should be 1:1, sometimes an Ability name is old, or hyperlinks in the PageRef template calls are unnecessarily broken
    • For the line "Shadow Explosion now deals ...", note that the ability is now called "Shadow Transformation", meaning it was not picked up by the backend to have it be "{{PageRef|Shadow Transformation}} now deals...", as such, edit the line in the data page (browse changelog data pages at Changelog Dates which pulls from all dates in Data:Changelog Dates (WIP)) to be "{{PageRef|Shadow Transformation|alt=Shadow Explosion}} now deals..."
    • This will then appear as " Shadow Transformation now deals...", allowing the icon and hyperlink to Shadow Transformation page to function, while still showing it 1:1 as "Shadow Explosion"

Invokes

Invokes are callable by wikitext, i.e. {{#invoke|Changelog|invokable_name|param1|paramN}}

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: {{#invoke:Changelog|write_changelogs|Pocket}}

Outputs

Update Changes

May 10, 2024

- {{HeroIcon|Pocket}} Pocket Enchanter’s Satchel visual effects updated
- Fixed a bug where {{HeroIcon|Pocket}} Pocket’s briefcase would stop animating when the duration upgrade was taken

May 3, 2024

- Pocket's nerf gun now does.. blah blah
- Siphon Life now does.. blah blah


For use on Pocket#Update history: {{#invoke:Changelog|write_changelogs|Pocket|3}}

Outputs

Update Changes

May 10, 2024

- {{HeroIcon|Pocket}} Pocket Enchanter’s Satchel visual effects updated
- Fixed a bug where {{HeroIcon|Pocket}} Pocket’s briefcase would stop animating when the duration upgrade was taken

May 3, 2024

- Pocket's nerf gun now does.. blah blah
- Siphon Life now does.. blah blah

write_data_pages_list

Writes list of all changelog data pages. Used on Changelog Dates.

Parameters

None

Examples

{{#invoke:Changelog|write_data_pages_list}}

Outputs

Data:Changelog 05-10-2024.json
Data:Changelog 05-03-2024.json

Functions

Functions are callable by lua modules, i.e. function_name(param1, paramN)

date_tag_to_lines

Given the data of a changelog and a specific tag, output the lines / bullet points of that changelog that pertain to that tag.

Parameters

  • date - Date of the changelog, in the format 05-03-2024
  • tag - Tag to search relevant changelogs for

Examples

For use in 1 row of Abrams/Update history date_tag_to_lines('05-03-2024','Abrams')

Outputs

Script error: The function "invoke_date_tag_to_lines" does not exist.


For use on Heroes/Update history date_tag_to_lines('05-03-2024','Heroes')

Outputs

Script error: The function "invoke_date_tag_to_lines" does not exist.

write_changelog

Note the difference to the invokable "write_changelogs".

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

The following lists all changelogs for Abrams {{#invoke:Changelog|write_changelogs|Abrams}}

Outputs

Update Changes

May 3, 2024

- Base Health increased from 550 to 600
- Siphon DPS increased from 24 to 35


The following lists the last 3 changelogs for Abrams {{#invoke:Changelog|write_changelogs|Abrams|3}}

Outputs

Update Changes

May 3, 2024

- Base Health increased from 550 to 600
- Siphon DPS increased from 24 to 35

Notes

To see list of all tags, see Changelog Tags (WIP). To see all tags that aren't individual entities, see Changelogs (WIP). More notes will also be at these pages, not just a list of tags.

What are tags?

Each line in a changelog is parsed to have certain tags assigned to it. For example, if the forum post looks like Heroes: - Abrams: Shoulder Bash blah blah

The "Abrams: Shoulder Bash blah blah" line will be assigned tags, 'Shoulder Bash' since its named explicitly, and therefore 'Abilities', 'Abrams', and 'Heroes'. This will make this line added to all changelogs on pages Abrams/Update history, Shoulder Bash/Update history, Abilities/Update history, and Heroes/Update history.

Similarly, for the line "Warp Stone: Distance traveled blah blah", the tags assigned would be 'Warp Stone' since its named explicitly, along with the tags 'Items' and 'Weapon Items'.

Todo

Backend

  • Replace hyphens with asterisk to be bullet pointed by wikitext
  • Output list of all group-tags (Heroes, Abilities, Weapon Items, etc.)
  • Add functionality for a 'Weapon' tag maybe?
  • Don't remove the prefix "Mo & Krill: " from lines such as "No longer listed as a recommended new player hero" as it prevents the ability to determine the hero on pages other than Mo and Krill/Update history. Is this prefix removal necessary?
  • Switch {{Icon}} with {{PageRef}}
  • Find a non-inefficient way to expand {Icon}/{PageRef} templates for the icon and reference
  • Finish tag assignment logic to fix instances of "- Charge Shot damage increased from 95 to 105" only being assigned tags 'Heroes' and 'Grey Talon' but not 'Charge Shot' or 'Abilities'.

Frontend

  • Create a more generic icon template Template:PageRef for svg's with color inverting depending on light/dark mode, only parameter should be the entity name like 'Abrams', 'Hook', or 'Basic Magazine'.
  • Make a navbar for group-tags to be presented on Changelogs
  • Make a lua function to retrieve list of tags for Changelog Tags, no nav bar needed, this page is only really useful for editors, not viewers