User:PhantomCaleb/Showcase

From Zelda Wiki, the Zelda encyclopedia
Jump to navigation Jump to search

The following is a list of a few of the contributions that I am most proud to have made in my time here at Zelda Wiki. This page is linked in my resumé and my LinkedIn profile. If you are a ZW editor seeking gainful employment, I encourage you to do the same! Your experiences here may be more career-relevant than you realize.

If you are one of my prospective employers or clients and are not familiar with the MediaWiki platform, you may wish to read the glossary below before diving in.

Glossary
  • MediaWiki is the wiki software that this wiki is running on.
  • Templates are MediaWiki's mechanism for extending its markup syntax. They're a bit like React components, in the sense that you give them attribute values and get back a bundle of HTML and CSS.
  • Modules are bundles of Lua code that can implement template APIs.

CSS and UX Design

Main Page

The current main page was a collaborative effort between User:GoldenChaos, User:Yumil1988, User:MannedTooth, and myself. GoldenChaos and Yumil came up with the original design. I gathered the feedback from the rest of the staff team and drove the implementation over the finish line. MannedTooth made some nice post-hoc improvements such as the animations on the game tiles.

Site CSS

At the time of writing, I'm responsible for most of the site's CSS. In the MediaWiki:Gadget-Variables.css file I implemented the concept of design tokens. Most of the ideas were borrowed from Shopify's Polaris design system.

Unfortunately, many of the CSS selectors are messy due to the fact that MediaWiki's CSS and HTML does not adhere to many industry best practices. It's been frustrating at times, but I try to remind myself that they're a massive open source project that predates many of the current best practices in web development.

Lua and API Design

Module:MM Schedule

This module implements Template:MM Schedule, which generates visualizations of directed acyclic graphs where each node is a list of tuples. The DAG is usually a binary tree, but there are exceptions.

Majora's Mask (MM) is a time-based game such that each character has a schedule that they follow: at time A they are at location X, then at time B move to location Y, and so on. This schedule can change based on whether or not a player completes certain actions. It is therefore desirable for this wiki to describe every possible schedule that can occur for a given character. Kafei#Schedule is an example of one of the more complex schedules in the game.

MediaWiki is limited in terms of what kind of data you can give a template. Basically, a template can only accept a flat list of key-value string pairs. It was quite a challenge to figure out how to represent the DAG of schedules using only key-value string pairs, and make it simple enough for non-technical editors to author.

Module:Documentation and Module:UtilsArg

These two modules consume Lua data objects serving as "specs" for MediaWiki templates and Lua functions. Unit tests, parameter documentation, and argument parsing/validation logic is derived from these specs. The fact that documentation comes from the same source of truth as tests and parsing logic provides a runtime guarantee that the documentation is up to date, which I find pretty neat.

Some notable examples of such tests/documentation include:

Module:UtilsTable

Basically a Lua clone of Lodash. Lua doesn't come with batteries and the open source libraries that exist don't work well with the subset of Lua that MediaWiki supports. So I built my own.

Template:Data Table

Table syntax is a notoriously difficult problem for markup languages—even Markdown's syntax is limited in terms of usability and features. Though it's not perfect, I'm quite proud of the custom solution I've built for Zelda Wiki.

Template:Data Table can do several things that normal MediaWiki table syntax cannot:

Template:Wares

This template displays the prices of items offered by in-game shops and merchants.

In the most common (and simplest) use case, shop data is just a list of 3-ary tuples—item name, price, description. However, shop data can get rather complicated when certain items are offered at a discount under certain conditions, or have limited stock with a specific restocking condition, or are offered at some locations but not others, etc.

I'm proud of how I was able to add support for all these use cases without complicating the simple use case.

Technical Writing