Module:Coderef/doc

From NetHackWiki
Jump to navigation Jump to search

This is the documentation page for Module:Coderef

This module aims to replace the entirely template-based code powering the overly complex Template:Sourcecode and Template:Refsrc (and their friends, Template:Function and Template:Reffunc). The eventual goal is to make those templates merely invoke this module.

Keep in mind that as this is a work in progress, this should not be used outside of testing/example pages yet.

Usage

Source Output
{{#invoke:Coderef|line|allmain.c|42}} allmain.c, line 42
{{#invoke:Coderef|line|allmain.c|42|game=slashem|version=SLASH'EM 0.0.7E7F2}} allmain.c in SLASH'EM 0.0.7E7F2, line 42
{{#invoke:Coderef|line|allmain.c|42|dir=src|game=unnethack|rev=30a07ee}} allmain.c in UnNetHack revision 30a07ee, line 42
{{#invoke:Coderef|lineref|allmain.c|42}} [1]
{{#invoke:Coderef|lineref|allmain.c|42|game=slashem|version=SLASH'EM 0.0.7E7F2}} [2]
{{#invoke:Coderef|lineref|allmain.c|42|comment=interesting comment goes here}} [3]
{{#invoke:Coderef|lineref|allmain.c|42|name=magic_cookie}} [4]
<ref name='magic_cookie'/> [4]

Example references