Extension:ZeroPortal/Documentation

Be sure to see Extension:ZeroPortal for general information about the structure of zerowiki.

Development
Pretty much all development of ZeroPortal is done on-wiki, regretfully. The following sections will go over the purpose and location of several major files. The backend of the portal is written primarily in Lua via files within the "Module" namespace while most Javascript and CSS is handled within the "MediaWiki" namespace.

Modules
There are four main Modules worth worrying about: Dashboard, Portal, Utils, and URL. Dashboard controls the main dashboard most users are presented with upon logging in. Portal is the main router. It handles most state changes and decides which templates to render. It simulates "staging" and "production" servers by keeping a list of all "beta templates" and overriding their production counterpart when an administrator switches to the staging branch from within the dashboard. Utils and URL are supporting modules. The former contains many useful utility functions and the latter eases creation of URLs (since they become quite complicated due to the way state works).

Javascript & CSS
Since all the code lives on-wiki, there aren't many places available to store Javascript and CSS files. Javascript lives primarily in Common.js, but also shows up in a few articles for more specific local scripts. CSS *should* all be stored in Common.css and has, at point of writing, generally been outputted locally from a series of LESS files and then copied manually to the wiki editor. Yes, the process was as awful as it sounds.

Articles/Templates
Since all content is viewed from the dashboard (and the landing page for anonymous users), all articles work as templates. Most are written in plain wikitext while others are a combination of wikitext and HTML. See Special:AllPages for a list of all templates (any articles in the main namespace).