WARFRAME Wiki
Advertisement
WARFRAME Wiki

The Development Guide aims to help community developers get up to speed on contributing to this wiki's codebase. Mostly this pertains to back-end scripts in module pages as they are the most accessible, but contributions to front-end scripts may be allowed if you ask an administrator for permission.

Last updated: Fri, 03 Dec 2021 23:39:48 +0000 (UTC) by User:Cephalon Scientia

Resources[]

If you are new to programming on a MediaWiki-based wiki or come from different programming backgrounds, here are some resources to help you get started with understanding the Lua programming language, what libraries are available to use, wikitext basics, and the architecture in which code gets deployed to be used within wiki articles:

Lua

As a scripting language, Lua has similar features and paradigms as JavaScript and Python. If you are familiar with the latter, Lua is relatively quick to learn.

Wikitext markup

Wiki markup is another type of a high-level markup language the renders content to HTML to display on webpages.

Glossary[]

Wiki Terminology[]

These terms are applicable to almost any MediaWiki-based wiki, especially on the Fandom site, and are not exclusively used in context of the WARFRAME Wiki.

Terms Explanation
API Refers to MediaWiki's Action API (https://warframe.fandom.com/api.php) or third-party ones such as those maintained by Warframe Community Developers (https://github.com/WFCD)
AWB AutoWikiBrowser, a tool for making semi/fully automatic edits on the wiki
Backend In the context of wiki editors, refers to pages/Lua scripts in the Module namespace.
Cargo Refers to Extension:Cargo which adds support for structured data on wikis, allowing database queries on wiki pages through parser functions. This is not available to be requested on Fandom wikis as of 18:28, 21 October 2021 (UTC) and is only enabled on some Gamepedia wikis like w:c:Terraria.
CSS Refers to the wiki's styling spreadsheet on MediaWiki:Common.css
Expand (a template) Refers to the recursive practice of turning a template call into its raw wikitext or HTML equilvalent through Special:ExpandTemplates
Database An informal term that refers to any /data subpage of module pages, containing Lua tables that act as NoSQL databases of WARFRAME's contents. Any data in /data subpages will be rebuilt every time a page is loaded as these are not "true" databases and are executable Lua programs instead. As such, there is no support for features like transactions or data caching.
Docbunto Module:Docbunto, the auto-documentation generator for Lua modules; this wiki's fork of the module can be found here
DPL Extension:DynamicPageList, a parser function used for querying pages in certain categories or namespaces
Frame Frame object
Frontend In the context of wiki editors, refers to pages/JavaScript scripts/CSS stylesheets in the MediaWiki namespace.
Invoke (a module) Calling a module's function through this syntax: {{#invoke:<module_name>|<function_name>|<param_1>|<param_2>|...}}
Luafication/Luafying Informal term to describe the porting of a template page to a module to build wikitext. Instead of transcluding a template, there will be an invoke call to a module's function.
M:<module_name> Shorthand for Module:<module_name>
Memory The memory allocated server-side for running back-end Lua scripts on Module pages (default 50MB)
Module Refers to a module page or the Lua package on the wiki that is in the module page; module, package, and library may be used interchangably
mw MediaWiki, the wiki engine that this wiki is built on, written in PHP. May also refer to the MediaWiki namespace if stylized as "MW".
NewPP Preprocessor report on wikitext preprocessing/rendering performance
Null edit Publishing an edit that makes no changes to the page to forcefully refresh the page so it can show all properly linked articles: Wikipedia:Purge#Null_edit. Commonly used to force pages to show up on the appropriate category page.
OOUI MediaWiki library that is used to create repsonsive UI elements in JavaScript. See mw:OOUI for more details.
Parser function A function that can be called on pages typically used in the syntax of {{#functionname:arg1|arg2|...}}. They are backed by a PHP callback function that works closely with the wikitext parser for generating robust content on the wiki, extending the wikitext markup language. See Manual:Parser_functions for more details.
PortableInfobox Fandom's implementation of an infobox that can display on both desktop and mobile platforms. See Portable_Infoboxes for more details.
RegEx Regular expressions; in the context of Lua, they can also refer to patterns which are similar to RegEx, but have syntactic differences. See Extension:Scribunto/Lua_reference_manual#Patterns for more details.
Sandbox A test page for experimenting with wikitext and modules; e.g. User:Cephalon Scientia/Sandbox
Scribunto The MediaWiki extension that allows Lua scripting on the wiki; Extension:Scribunto
Skin The customizable user interface of the wiki. As of 2021-06-25, Fandom offers Oasis (soon to be sunsetted/unsupported) and FandomDesktop skins by default. See Manual:Skins for more details.
Submodule A module page that is a subpage of another module, sometimes called the "main" module. An example is Module:Weapons/infobox being a submodule of Module:Weapons.
Substitution The act of converting transcluded content on pages to their wikitext equilvalent when the page is saved. Can be thought of as "template substitution" to make page content independent from the template(s) used. See Help:Substitution for more details.
T:<template_name> Shorthand for Template:<template_name>
Tabber <tabber> tags that allows for tabbed content. See Extension:Tabber for more details.
Transclusion The action of including content from other pages by reference. See Transclusion for more details.
Purge
PWB Pywikibot, Python library for automating edits
Unpacking Refers to the extraction of arguments in a table/array/dictionary to be passed into a function using unpack()

Fandom Terminology[]

Terms Explanation
Discussions API Fandom's API for accessing warframe.fandom.com/f
Fandom (stylized as FANDOM sometimes) The company that hosts this wiki, develops the platform the wiki is built on, provides community support, and hosts development tools through https://dev.fandom.com/wiki/Fandom_Developers_Wiki
Fandom Design System Framework of Fandom's visual language for consistent user experience and interface throughout the Fandom branding. See https://fandomdesignsystem.com/?path=/story/introduction--page for more details.
FandomDesktop The desktop wiki skin that is being used on UCP since June 2021 (previously used Oasis skin, and before that, Hydra), featuring light/dark themes, expanded articles, table of contents button, and other features. See community:Help:FandomDesktop.
FandomMobile The mobile wiki skin that is being used on UCP since Feburary 2021, featuring light/dark themes, better galleries, table of contents button, and other features. See community:Help:FandomMobile.
Gamepedia Wiki hosting service for video games owned by Curse LCC before being acquired by Fandom in December 2018.
Modal Refers to the Modal JS library which helps in creating overlay elements on Fandom wikis to display to the user (modal boxes/windows)
UCP Unified Community Platform, the official name of the platform that Fandom and Gamepedia wikis are running on. See Help:Unified Community Platform for more details.
Wikia The name of Fandom wikis and the company before their rebranding in October 2016.

Warframe Terminology[]

Main article: Glossary
Terms Explanation
Mobile Export WARFRAME's mobile API used by Warframe Nexus and other services; sample endpoint: http://content.warframe.com/MobileExport/Manifest/ExportWeapons.json
Public Export Another name for Mobile Export
WFCD Warframe Community Developers GitHub group at https://github.com/WFCD for tools accessing WARFRAME's APIs
World State WARFRAME's API for accessing the state of the Star Chart

Development Checklist[]

  1. Does your code follow WARFRAME Wiki:Programming Standards?
  2. Did you purge an article's cache before reviewing changes?
    • Sometimes changes to the codebase will not be applied immediately due to page caching. Add the ?action=purge query string to the URL to access purge cache button.
  3. Did you have another person review your code before pushing big changes?
  4. Does your code pass all unit tests whenever applicable?
  5. Did you create new unit tests whenever applicable? If your functions output wikitext, make sure to test them out on a page to find visual errors.
  6. Did you consider accessibility on mobile platforms and FANDOM app if applicable? As of 23:10, 23 November 2021 (UTC), about 45% of traffic to this wiki are from mobile users.
    • Add ?mobileaction=toggle_view_mobile and ?mobileaction=toggle_view_desktop query strings to toggle between desktop and mobile browser views on desktop
    • There is no easy way to view page experience in the FANDOM app without logging in and going directly to the pages where a module is invoked.
  7. If making a new module:
  8. If deleting or refactoring a function:
    • Did you null edit all the possible pages it may be used to double check if there are script errors anywhere?
  9. If dealing anything related to the presentation of content, did you look at the site as an anonymous (logged out) user? This is to ensure that the site is readable without custom user CSS.
  10. For front-end scripts, did you test to see what happens if a user has JavaScript disabled in their browser? Ensure basic functionality still works (like a static text rather than an animated one) or leave a notice mentioning to enable JavaScript to get the feature.
  11. Did you check generated content in other browsers? Sometimes Chromium-based browsers render HTML/CSS differently from other browsers. As of 23:06, 23 November 2021 (UTC), the top 4 web browsers that visit this wiki are:
    1. Google Chrome (~72%)
    2. Safari (~16%)
    3. Firefox (~8%)
    4. Microsoft Edge (~5%)

Modules List[]

Best Practices[]

Style Guide[]

Main article: WARFRAME Wiki:Programming Standards

See WARFRAME Wiki:Programming Standards for more details on code styling and best practices on developing on this wiki.

User Experience Guidelines[]

  • Do not communicate to the reader with only color, make sure there is additional text as fallback and use different shape designs for color/visual accessibility reasons.
    • Examples include denoting different classes of items such as "tiers" or "rarities".
  • Do not use hover overs or collapsible content for important information to the reader. These features should be used to enhance the user experience, not to detract from it.
    • Collapsibles are appropriate for long tables (to lessen the amount of scrolling) or detailed content that explains concepts in-depth to the reader outside of general practicality (e.g. explanations of math formulas; most people do not want to know the calculus behind results)
  • Frontend scripts should be responsive and enhance the user experience, not slowing down performance. Any content that is derived from these scripts should be available on the appropriate pages for users to manually deduce. For example, the formula used in the enemy health scaling slider on Template:Enemy is available for readers on Enemy Level Scaling.
  • Any content that is auto-generated from modules should be available on the appropriate pages for users to manually deduce. For example, the formula used in the DPS calculations on Weapon Comparison is available for readers on Damage#Final Calculations.
  • Mobile users will lose some features from desktop such as frontend scripts. Ensure the site is still usable when JavaScript is turned off.
  • All content must be readable on both the wiki's light and dark themes. However, we do not expect nor guarantee the same for custom user themes so use them at your discretion.
  • For images that are flat black in color, for visibility on dark theme, wrap them around an element with class="icon" or if using wikitext [[File:]] syntax, add class=icon argument. This is so a CSS rule can target these elements for the invert filter.
    • For example [[File:ShadowsOfTheDead130xDark.png|class=icon]] produces ShadowsOfTheDead130xDark.png
  • Hover over content/text is denoted by a 2px thick dotted underline below content/text like so: I am a hover over
  • Avoid using colored text in articles outside of hyperlinks. Colored text is usually unreadable on either light or dark theme. If color must be presented:
    • For inline text, use a colored square with the name of the color beside it (e.g. purple)
    • For tables, designate a table column for presenting colors, using background-color CSS property to set the color of a particular table cell, and desginate another table column for describing the color like so:
Sortie Rarity Classification
Rarity Weight Approx. Color Scheme Hex Code Drop Percentage
(rounded two decimals)
IconCommon.png Common #bd9177 55.91%
IconUncommon.png Uncommon #d1d0d1 33.91%
IconRare.png Rare #ece175 10.00%
IconLegendary.png Legendary #b996db 0.18%
Total 100%

Examples[]

Best Better Bad
Viral DamageDmgViralSmall64.png Viral Viral or Viral or DmgViralSmall64.png N/A
BansheeIcon272.png
Banshee

BaruukIcon272.png
Baruuk

N/A BansheeIcon272.png
Banshee

BaruukIcon272.png
Baruuk

Using colored text with high enough contrast on the respective theme for readability:

For light theme

Mod TT 20px.png Redirection 0.7587% 🥉
Mod TT 20px.png Revenge 0.7587% 🥉
Mod TT 20px.png Quickdraw 0.7587% 🥉
Mod TT 20px.png Razor Shot 0.3318% 🥈
50 Endo 0.3318% 🥈
Mod TT 20px.png Thunderbolt 0.0201% 🥇
Mod TT 20px.png Crossing Snakes 0.0201% 🥇
Mod TT 20px.png Undying Will 0.0201% 🥇

For dark theme

Mod TT 20px.png Redirection 0.7587% 🥉
Mod TT 20px.png Revenge 0.7587% 🥉
Mod TT 20px.png Quickdraw 0.7587% 🥉
Mod TT 20px.png Razor Shot 0.3318% 🥈
50 Endo 0.3318% 🥈
Mod TT 20px.png Thunderbolt 0.0201% 🥇
Mod TT 20px.png Crossing Snakes 0.0201% 🥇
Mod TT 20px.png Undying Will 0.0201% 🥇

Using different colored emojis with items grouped by rarity:

Mod TT 20px.png Redirection 0.7587% 🥉
Mod TT 20px.png Revenge 0.7587% 🥉
Mod TT 20px.png Quickdraw 0.7587% 🥉
Mod TT 20px.png Razor Shot 0.3318% 🥈
50 Endo 0.3318% 🥈
Mod TT 20px.png Thunderbolt 0.0201% 🥇
Mod TT 20px.png Crossing Snakes 0.0201% 🥇
Mod TT 20px.png Undying Will 0.0201% 🥇

Colored text and unsorted, unreadable on light theme:

Mod TT 20px.png Redirection 0.7587%
Mod TT 20px.png Revenge 0.7587%
Mod TT 20px.png Quickdraw 0.7587%
Mod TT 20px.png Thunderbolt 0.0201%
Mod TT 20px.png Razor Shot 0.3318%
Mod TT 20px.png Crossing Snakes 0.0201%
Mod TT 20px.png Undying Will 0.0201%
50 Endo 0.3318%

  • Damage appears by default in white.
  • Critical hits and stealth attacks are in yellow.
  • Orange crits, appear in orange. These are stronger than yellow crits.
  • Red crits, as their name suggests, appear in red. These are stronger than orange crits.
  • Damage against shields appears in blue, regardless of other factors such as critical hits.
  • Damage against overshields appears in purple, regardless of other factors such as critical hits.
  • Attempts to damage an invulnerable enemy appear in grey.
N/A
  • Damage appears by default in white.
  • Critical hits and stealth attacks are in yellow.
  • Orange crits, appear in orange. These are stronger than yellow crits.
  • Red crits, as their name suggests, appear in red. These are stronger than orange crits.
  • Damage against shields appears in blue, regardless of other factors such as critical hits.
  • Damage against overshields appears in purple, regardless of other factors such as critical hits.
  • Attempts to damage an invulnerable enemy appear in grey.

Stylesheets[]

Main article: community:Help:FandomDesktop conversion guide#Theming variables
View light theme CSS variables
:root {
	--theme-body-dynamic-color-1: #1e0c1b;
	--theme-body-dynamic-color-1--rgb: 30,12,27;
	--theme-body-dynamic-color-2: #3a3a3a;
	--theme-body-dynamic-color-2--rgb: 58,58,58;
	--theme-page-dynamic-color-1: #1e0c1b;
	--theme-page-dynamic-color-1--rgb: 30,12,27;
	--theme-page-dynamic-color-1--inverted: #fff;
	--theme-page-dynamic-color-1--inverted--rgb: 255,255,255;
	--theme-page-dynamic-color-2: #3a3a3a;
	--theme-page-dynamic-color-2--rgb: 58,58,58;
	--theme-sticky-nav-dynamic-color-1: #fff;
	--theme-sticky-nav-dynamic-color-1--rgb: 255,255,255;
	--theme-sticky-nav-dynamic-color-2: #e6e6e6;
	--theme-sticky-nav-dynamic-color-2--rgb: 230,230,230;
	--theme-link-dynamic-color-1: #fff;
	--theme-link-dynamic-color-1--rgb: 255,255,255;
	--theme-link-dynamic-color-2: #e6e6e6;
	--theme-link-dynamic-color-2--rgb: 230,230,230;
	--theme-accent-dynamic-color-1: #fff;
	--theme-accent-dynamic-color-1--rgb: 255,255,255;
	--theme-accent-dynamic-color-2: #e6e6e6;
	--theme-accent-dynamic-color-2--rgb: 230,230,230;
	--theme-body-background-color: #ffffff;
	--theme-body-background-color--rgb: 255,255,255;
	--theme-body-background-image: url(https://static.wikia.nocookie.net/warframe/images/b/b5/Site-background-light/revision/latest?cb=20210617231242);
	--theme-body-text-color: #1e0c1b;
	--theme-body-text-color--hover: #66295c;
	--theme-sticky-nav-background-color: #061212;
	--theme-sticky-nav-text-color: #fff;
	--theme-sticky-nav-text-color--hover: #cccccc;
	--theme-page-background-color: #eeeeee;
	--theme-page-background-color--rgb: 238,238,238;
	--theme-page-background-color--secondary: #e4e3e3;
	--theme-page-text-color: #3a3a3a;
	--theme-page-text-color--rgb: 58,58,58;
	--theme-page-text-color--hover: #6d6d6d;
	--theme-page-text-mix-color: #949494;
	--theme-page-text-mix-color-95: #e5e5e5;
	--theme-page-accent-mix-color: #989898;
	--theme-page-headings-font: 'Rubik';
	--theme-link-color: #0148c2;
	--theme-link-color--rgb: 1,72,194;
	--theme-link-color--hover: #00225c;
	--theme-link-label-color: #fff;
	--theme-accent-color: #424242;
	--theme-accent-color--rgb: 66,66,66;
	--theme-accent-color--hover: #757575;
	--theme-accent-label-color: #fff;
	--theme-border-color: #c1c1c1;
	--theme-border-color--rgb: 193,193,193;
	--theme-alert-color: #bf0017;
	--theme-alert-color--rgb: 191,0,23;
	--theme-alert-color--hover: #59000a;
	--theme-alert-label: #fff;
	--theme-warning-color: #ca6f1b;
	--theme-warning-label: #1e0c1b;
	--theme-success-color: #0c742f;
	--theme-success-color--rgb: 12,116,47;
	--theme-success-label: #fff;
	--theme-message-color: #753369;
	--theme-message-label: #fff;
	--theme-community-header-color: #0e191a;
	--theme-community-header-color--hover: #31585c;
	--theme-background-image-opacity: 100%;
}

.skin-fandomdesktop .CodeMirror {
	--codemirror-yellow: #9e8500;
	--codemirror-light-blue: #008ae7;
	--codemirror-blue: #0085f9;
	--codemirror-green: #290;
	--codemirror-red: #ef4f00;
	--codemirror-dark-red: #a11;
	--codemirror-purple: #80c;
	--codemirror-pink: #ed00ed;
	--codemirror-light-gray: #858585;
	--codemirror-gray: #6b8a8a;
}

.mw-highlight {
	--pygments-background: #e4e3e3;
	--pygments-err: #ef0000;
	--pygments-c: #408080;
	--pygments-k: #008000;
	--pygments-o: #666;
	--pygments-ch: #408080;
	--pygments-cm: #408080;
	--pygments-cp: #a26900;
	--pygments-cpf: #408080;
	--pygments-c1: #408080;
	--pygments-cs: #408080;
	--pygments-gd: #a00000;
	--pygments-gr: #ef0000;
	--pygments-gh: #000080;
	--pygments-gi: #008600;
	--pygments-go: #767676;
	--pygments-gp: #000080;
	--pygments-gu: #800080;
	--pygments-gt: #04d;
	--pygments-kc: #008000;
	--pygments-kd: #008000;
	--pygments-kn: #008000;
	--pygments-kp: #008000;
	--pygments-kr: #008000;
	--pygments-kt: #b00040;
	--pygments-m: #666;
	--pygments-s: #ba2121;
	--pygments-na: #6b7c23;
	--pygments-nb: #008000;
	--pygments-nc: #00f;
	--pygments-no: #800;
	--pygments-nd: #a2f;
	--pygments-ni: #757575;
	--pygments-ne: #d2413a;
	--pygments-nf: #00f;
	--pygments-nl: #777700;
	--pygments-nn: #00f;
	--pygments-nt: #008000;
	--pygments-nv: #19177c;
	--pygments-ow: #a2f;
	--pygments-w: #767676;
	--pygments-mb: #666;
	--pygments-mf: #666;
	--pygments-mh: #666;
	--pygments-mi: #666;
	--pygments-mo: #666;
	--pygments-sa: #ba2121;
	--pygments-sb: #ba2121;
	--pygments-sc: #ba2121;
	--pygments-dl: #ba2121;
	--pygments-sd: #ba2121;
	--pygments-s2: #ba2121;
	--pygments-se: #b26120;
	--pygments-sh: #ba2121;
	--pygments-si: #b4577d;
	--pygments-sx: #008000;
	--pygments-sr: #b4577d;
	--pygments-s1: #ba2121;
	--pygments-ss: #19177c;
	--pygments-bp: #008000;
	--pygments-fm: #00f;
	--pygments-vc: #19177c;
	--pygments-vg: #19177c;
	--pygments-vi: #19177c;
	--pygments-vm: #19177c;
	--pygments-il: #666;
}
View dark theme CSS variables
:root {
	--theme-body-dynamic-color-1: #fff;
	--theme-body-dynamic-color-1--rgb: 255,255,255;
	--theme-body-dynamic-color-2: #e6e6e6;
	--theme-body-dynamic-color-2--rgb: 230,230,230;
	--theme-page-dynamic-color-1: #fff;
	--theme-page-dynamic-color-1--rgb: 255,255,255;
	--theme-page-dynamic-color-1--inverted: #1e0c1b;
	--theme-page-dynamic-color-1--inverted--rgb: 30,12,27;
	--theme-page-dynamic-color-2: #e6e6e6;
	--theme-page-dynamic-color-2--rgb: 230,230,230;
	--theme-sticky-nav-dynamic-color-1: #fff;
	--theme-sticky-nav-dynamic-color-1--rgb: 255,255,255;
	--theme-sticky-nav-dynamic-color-2: #e6e6e6;
	--theme-sticky-nav-dynamic-color-2--rgb: 230,230,230;
	--theme-link-dynamic-color-1: #1e0c1b;
	--theme-link-dynamic-color-1--rgb: 30,12,27;
	--theme-link-dynamic-color-2: #3a3a3a;
	--theme-link-dynamic-color-2--rgb: 58,58,58;
	--theme-accent-dynamic-color-1: #fff;
	--theme-accent-dynamic-color-1--rgb: 255,255,255;
	--theme-accent-dynamic-color-2: #e6e6e6;
	--theme-accent-dynamic-color-2--rgb: 230,230,230;
	--theme-body-background-color: #000000;
	--theme-body-background-color--rgb: 0,0,0;
	--theme-body-background-image: url();
	--theme-body-text-color: #fff;
	--theme-body-text-color--hover: #cccccc;
	--theme-sticky-nav-background-color: #666666;
	--theme-sticky-nav-text-color: #fff;
	--theme-sticky-nav-text-color--hover: #cccccc;
	--theme-page-background-color: #222222;
	--theme-page-background-color--rgb: 34,34,34;
	--theme-page-background-color--secondary: #434343;
	--theme-page-text-color: #e6e6e6;
	--theme-page-text-color--rgb: 230,230,230;
	--theme-page-text-color--hover: #b3b3b3;
	--theme-page-text-mix-color: #848484;
	--theme-page-text-mix-color-95: #2c2c2c;
	--theme-page-accent-mix-color: #444444;
	--theme-page-headings-font: 'Rubik';
	--theme-link-color: #88aaee;
	--theme-link-color--rgb: 136,170,238;
	--theme-link-color--hover: #e1e9fa;
	--theme-link-label-color: #1e0c1b;
	--theme-accent-color: #666666;
	--theme-accent-color--rgb: 102,102,102;
	--theme-accent-color--hover: #999999;
	--theme-accent-label-color: #fff;
	--theme-border-color: #535353;
	--theme-border-color--rgb: 83,83,83;
	--theme-alert-color: #e2001b;
	--theme-alert-color--rgb: 226,0,27;
	--theme-alert-color--hover: #fe485e;
	--theme-alert-label: #fff;
	--theme-warning-color: #cf721c;
	--theme-warning-label: #1e0c1b;
	--theme-success-color: #0d8134;
	--theme-success-color--rgb: 13,129,52;
	--theme-success-label: #fff;
	--theme-message-color: #aa4a98;
	--theme-message-label: #fff;
	--theme-community-header-color: #FFFFFF;
	--theme-community-header-color--hover: #cccccc;
	--theme-background-image-opacity: 100%;
}

.skin-fandomdesktop .CodeMirror {
	--codemirror-yellow: #ffd700;
	--codemirror-light-blue: #adf;
	--codemirror-blue: #08f;
	--codemirror-green: #290;
	--codemirror-red: #f50;
	--codemirror-dark-red: #dd1616;
	--codemirror-purple: #a900fe;
	--codemirror-pink: #e0e;
	--codemirror-light-gray: #eee;
	--codemirror-gray: #84a0a0;
}

.mw-highlight {
	--pygments-background: #434343;
	--pygments-err: #fe6b6b;
	--pygments-c: #54a8a8;
	--pygments-k: #00b800;
	--pygments-o: #9b9b9b;
	--pygments-ch: #54a8a8;
	--pygments-cm: #54a8a8;
	--pygments-cp: #d58a00;
	--pygments-cpf: #54a8a8;
	--pygments-c1: #54a8a8;
	--pygments-cs: #54a8a8;
	--pygments-gd: #ff6d6d;
	--pygments-gr: #fe6b6b;
	--pygments-gh: #8f8fff;
	--pygments-gi: #00b400;
	--pygments-go: #9c9c9c;
	--pygments-gp: #8f8fff;
	--pygments-gu: #ff42ff;
	--pygments-gt: #6c99fe;
	--pygments-kc: #00b800;
	--pygments-kd: #00b800;
	--pygments-kn: #00b800;
	--pygments-kp: #00b800;
	--pygments-kr: #00b800;
	--pygments-kt: #fe639c;
	--pygments-m: #9b9b9b;
	--pygments-s: #e77c7c;
	--pygments-na: #91a72f;
	--pygments-nb: #00b800;
	--pygments-nc: #8e8efe;
	--pygments-no: #ff6969;
	--pygments-nd: #cb78ff;
	--pygments-ni: #9b9b9b;
	--pygments-ne: #e1817c;
	--pygments-nf: #8e8efe;
	--pygments-nl: #a0a000;
	--pygments-nn: #8e8efe;
	--pygments-nt: #00b800;
	--pygments-nv: #9492ea;
	--pygments-ow: #cb78ff;
	--pygments-w: #bbb;
	--pygments-mb: #9b9b9b;
	--pygments-mf: #9b9b9b;
	--pygments-mh: #9b9b9b;
	--pygments-mi: #9b9b9b;
	--pygments-mo: #9b9b9b;
	--pygments-sa: #e77c7c;
	--pygments-sb: #e77c7c;
	--pygments-sc: #e77c7c;
	--pygments-dl: #e77c7c;
	--pygments-sd: #e77c7c;
	--pygments-s2: #e77c7c;
	--pygments-se: #dc8742;
	--pygments-sh: #e77c7c;
	--pygments-si: #ca89a3;
	--pygments-sx: #00b800;
	--pygments-sr: #ca89a3;
	--pygments-s1: #e77c7c;
	--pygments-ss: #9492ea;
	--pygments-bp: #00b800;
	--pygments-fm: #8e8efe;
	--pygments-vc: #9492ea;
	--pygments-vg: #9492ea;
	--pygments-vi: #9492ea;
	--pygments-vm: #9492ea;
	--pygments-il: #9b9b9b;
}
  • Default on Fandom wikis (for reference):
View Fandom default light theme CSS variables
:root {
    --theme-body-dynamic-color-1: #1e0c1b;
    --theme-body-dynamic-color-1--rgb: 30, 12, 27;
    --theme-body-dynamic-color-2: #3a3a3a;
    --theme-body-dynamic-color-2--rgb: 58, 58, 58;
    --theme-page-dynamic-color-1: #1e0c1b;
    --theme-page-dynamic-color-1--rgb: 30, 12, 27;
    --theme-page-dynamic-color-1--inverted: #fff;
    --theme-page-dynamic-color-1--inverted--rgb: 255, 255, 255;
    --theme-page-dynamic-color-2: #3a3a3a;
    --theme-page-dynamic-color-2--rgb: 58, 58, 58;
    --theme-sticky-nav-dynamic-color-1: #fff;
    --theme-sticky-nav-dynamic-color-1--rgb: 255, 255, 255;
    --theme-sticky-nav-dynamic-color-2: #e6e6e6;
    --theme-sticky-nav-dynamic-color-2--rgb: 230, 230, 230;
    --theme-link-dynamic-color-1: #fff;
    --theme-link-dynamic-color-1--rgb: 255, 255, 255;
    --theme-link-dynamic-color-2: #e6e6e6;
    --theme-link-dynamic-color-2--rgb: 230, 230, 230;
    --theme-accent-dynamic-color-1: #fff;
    --theme-accent-dynamic-color-1--rgb: 255, 255, 255;
    --theme-accent-dynamic-color-2: #e6e6e6;
    --theme-accent-dynamic-color-2--rgb: 230, 230, 230;
    --theme-body-background-color: #ffc500;
    --theme-body-background-color--rgb: 255, 197, 0;
    --theme-body-background-image: url(https://static.wikia.nocookie.net/dev/images/b/b5/Site-background-light/revision/latest?cb=20210803135441);
    --theme-body-text-color: #1e0c1b;
    --theme-body-text-color--hover: #66295c;
    --theme-sticky-nav-background-color: #520044;
    --theme-sticky-nav-text-color: #fff;
    --theme-sticky-nav-text-color--hover: #cccccc;
    --theme-page-background-color: #ffffff;
    --theme-page-background-color--rgb: 255, 255, 255;
    --theme-page-background-color--secondary: #f4f3f4;
    --theme-page-text-color: #3a3a3a;
    --theme-page-text-color--rgb: 58, 58, 58;
    --theme-page-text-color--hover: #6d6d6d;
    --theme-page-text-mix-color: #9d9d9d;
    --theme-page-text-mix-color-95: #f5f5f5;
    --theme-page-accent-mix-color: #afbdbd;
    --theme-page-headings-font: 'Rubik';
    --theme-link-color: #520044;
    --theme-link-color--rgb: 82, 0, 68;
    --theme-link-color--hover: #000000;
    --theme-link-label-color: #fff;
    --theme-accent-color: #5f7a7b;
    --theme-accent-color--rgb: 95, 122, 123;
    --theme-accent-color--hover: #93abac;
    --theme-accent-label-color: #fff;
    --theme-border-color: #cecece;
    --theme-border-color--rgb: 206, 206, 206;
    --theme-alert-color: #bf0017;
    --theme-alert-color--rgb: 191, 0, 23;
    --theme-alert-color--hover: #59000a;
    --theme-alert-label: #fff;
    --theme-warning-color: #cf721c;
    --theme-warning-label: #1e0c1b;
    --theme-success-color: #0c742f;
    --theme-success-color--rgb: 12, 116, 47;
    --theme-success-label: #fff;
    --theme-message-color: #753369;
    --theme-message-label: #fff;
    --theme-community-header-color: #0e191a;
    --theme-community-header-color--hover: #31585c;
    --theme-background-image-opacity: 100%;
}

Database Design Guidelines[]

Database design guidelines can be found on WARFRAME Wiki:Updating Databases#For Developers.

Advanced[]

Debugging[]

Error Tracing and Null Edits[]

  • Locating pages with broken scripts: Category:Pages with script errors
    • error() and assert() functions will transclude an error message with a simple stack trace for runtime errors:
      Lua error in Module:Icon at line 112: p._Pol(iconname, color, imagesize): 
      Invalid icon name "" [[Category:Icon Module error]].
      
      Backtrace:
      
          [C]: in function "assert"
          Module:Icon:112: in function "_Pol"
          Module:Weapons:2809: in function "buildMeleeComparisonString"
          Module:Weapons:2857: in function "chunk"
          mw.lua:518: ?
          [C]: ?
    • Use NewPP parser report (F12 and CTRL+F "NewPP") to view statistics on the resources used to render page and what scripts are using the most allocated time or memory. FANDOM wikis have a maximum limit of 7 second script runtime and 50 MB usage.
    • Transclusion expansion time report shows how long it took for page transclusion to happen
    • If you cannot find an error on the page, go to inspect element and search for these HTML tags: <strong class="error"><span class="scribunto-error" id="mw-scribunto-error-0">
      • Sometimes script errors are hidden behind tooltips whose HTML tags are located within <div id="tooltip-storage"> near the bottom of the page's article content container.
    • Use https://dev.fandom.com/wiki/MassNullEdit to null edit multiple pages in Category:Pages with script errors. Null edits force the server to rebuild the page using new data instead of relying on caching.
      • Uses MediaWiki's API to submit page edits that do not modify page contents: https://warframe.fandom.com/api.php?action=help&modules=edit
      • This is one way to check where module functions are used. If performing a major refactoring of code, deleting/refactoring a function and null editing all the possible pages it may be used in can be used to double check if there are script errors anywhere.
  • It may be helpful to disable custom stylesheets and custom scripts when debugging:
    ?useuserjs=0 to end of URL to temporarily disable personal JS
    ?useusercss=0 to temporarily disable personal CSS
    ?useusercss=0&useuserjs=0 for both
    ?usesitecss=0 to disable wiki's locally defined CSS in MediaWiki namespace
    ?usesitejs=0 to disable wiki's locally defined JS in MediaWiki namespace
    ?safemode=1 to load page without on-site CSS and JS

Viewing Module Output and Purging Cache[]

  • If you want to print things out to the console, use mw.log() for general use or mw.logObject() for tables.
    • Outputs can be viewed in the SourceEditor on articles in the "Parser profiling data" section or in the debug console when editing modules.
    • Make sure to remove these calls or comment them out from live code as they do take up allocated Lua memory and time.
  • mw.dumpObject() may be helpful in outputing table contents to a human-readable format in error() or assert().
  • If a function outputs wikitext to be rendered by the frame, then it may be helpful to add a unique category link to the output to see what pages that function is used around the wiki.
  • Visual errors are harder to detect and usually require manually going to pages and reviewing generated content by modules.
    • Special:ExpandTemplates can be helpful in rendering the raw wikitext and HTML returned by a function.
    • Add the ?action=purge query string to the URL to purge the page's cache server-side to ensure latest edits are persisted and are used for rendering the page.

NewPP Report and Performance[]

NewPP parser report provides additional performance details on rendering wikitext on articles.

  • FANDOM wikis have a maximum limit of 7-second Lua script runtime and 50 MB of memory usage per page. This limit is not per {{#invoke:}} on a page. Multiple {{#invoke:}} calls on a single page will contribute towards the same time and resource limit.
  • Fastest way to find NewPP report is by opening up the browser's developer tool (F12) and CTRL+F for NewPP in DOM and Style Inspector. Alternative ways include:
    • Scrolling to the bottom of the element containing the article's content as NewPP will always be appended when wikitext is parsed (<div class="mw-parser-output">)
    • In SourceEditor, click "Show Preview" and scroll down to "Parser profiling data:"
  • Sometimes Lua profiles are not clear about the function(s) that take up the most time. Any function names that start with mw are from base Lua libraries that are included in the Scribunto extension. See the GitHub repo of Extension:Scribunto.
  • Module performance can be measured using os.time() and os.difftime() functions.[1]

Example report for Weapon Comparison page when Lua time usage exceeds 7 seconds (see Wikipedia:Template_limits for more details one what each line means):

NewPP limit report
Cached time: 20210806221243
Cache expiry: 1209600
Dynamic content: false
CPU time usage: 10.012 seconds
Real time usage: 10.020 seconds
Preprocessor visited node count: 1980/1000000
Preprocessor generated node count: 0/1000000
Post‐expand include size: 734758/2097152 bytes
Template argument size: 64/2097152 bytes
Highest expansion depth: 8/40
Expensive parser function count: 0/100
Unstrip recursion depth: 1/20
Unstrip post‐expand size: 1561684/5000000 bytes
Lua time usage: 7.006/7.000 seconds
Lua memory usage: 36.13 MB/50 MB
Lua Profile:
    <mw.lua:683>                                                    1680 ms       24.0%
    upper                                                            680 ms        9.7%
    Scribunto_LuaSandboxCallback::formatNum                          640 ms        9.1%
    type                                                             520 ms        7.4%
    contains <Module:Table:144>                                      440 ms        6.3%
    (for generator) <mw.lua:665>                                     360 ms        5.1%
    <mw.lua:695>                                                     340 ms        4.9%
    _getVersion <Module:Version:49>                                  340 ms        4.9%
    assert                                                           340 ms        4.9%
    <mw.language.lua:62>                                             280 ms        4.0%
    [others]                                                        1380 ms       19.7%
ExtLoops count: 0

Query Strings and Action API[]

Internationalization and Localization[]

Since the wiki's modules are being forked and used in our sister wikis in other languages, our modules should be internationalized (i18n) as much as possible so that content can be easily localized (l10n) in other wikis' locale.

  • i18n is primarily done through Module:I18n. Import this module to the module you want to i18n and load messages through loadMessages(pageName) where pageName is the full page name where messages are stored. Then use i18n:msg(messageKey) to get a localized message based on its key. See w:c:dev:Global_Lua_Modules/I18n for more details and full documentation on the module.
  • Translation menu can be found on Special:BlankPage/I18nEdit.

Using an External Text Editor[]

External editors will have to use MediaWiki's API to fetch page content and update pages. Use at your own risk. The wiki is not responsible for any problems these third-party software may cause. You must have Lua binaries and executable installed to run Lua scripts on your local machine.

Technology Stack[]

The technology stack of the wiki from the perspective of script editors (disregarding hosting services, actual databases, and things in the scope of Fandom developers):

Module Dependency Graph[]

As of 06:15, 7 August 2021 (UTC), our codebase's module dependencies look like this:

EN WARFRAME Wiki Dependency Graph.png

See Module:DependencyGraph for the DOT file that produces this graph.

External Links[]

Further Reading[]

References[]

Advertisement