Melvor Idle:How to edit: Difference between revisions

From Melvor Idle
m (Ricewind moved page Melvor Wiki:How to edit to Melvor Idle:How to edit without leaving a redirect)
m (Amend version category reference)
(2 intermediate revisions by one other user not shown)
Line 9: Line 9:


Also note that if an argument is optional, you can simply append a pipe symbol after its name (be it numeric or a named keyword argument) to default to the empty string.
Also note that if an argument is optional, you can simply append a pipe symbol after its name (be it numeric or a named keyword argument) to default to the empty string.
=== Lua ===
To create and use a module, it is important to create a module within the <code>Module:</code> namespace, otherwise it will not function!
For specific help on how to use Lua (scribunto) to create modules, you can read [https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual this article]. Alternatively, you can view some Melvor Wiki specific examples [[Melvor Idle:How to edit/Lua|here]]


=== Versioning ===
=== Versioning ===
Line 14: Line 19:
* If a page is entirely populated by Lua-powered templates, then simply add {{T|V}} to the top of the page.
* If a page is entirely populated by Lua-powered templates, then simply add {{T|V}} to the top of the page.
* If a page contains a decent amount of user-written text that has the potential to change with each version, then the version number should be specified. For example, if a page is written for version 1.0 you would add {{T|V|1.0}} to the top of the page.
* If a page contains a decent amount of user-written text that has the potential to change with each version, then the version number should be specified. For example, if a page is written for version 1.0 you would add {{T|V|1.0}} to the top of the page.
Each page should have a version attached to it. Every version can be found in the [[:Category:Versions|Versions Category]]. One of the main tasks is to make sure that pages are up to date.
Each page should have a version attached to it. Every version can be found in the [[:Category:Version|Version Category]]. One of the main tasks is to make sure that pages are up to date.


You can view the versioning system in action on the top right corner of this page.
You can view the versioning system in action on the top right corner of this page.
Line 22: Line 27:
This template adds a formatted link to the main article to the page.
This template adds a formatted link to the main article to the page.


Usage: <code><nowiki>{{Main|Reference=Contributing}}</nowiki></code>
Usage: <code><nowiki>{{Main|Reference=Some Dungeon}}</nowiki></code>


{{HasGuide|page=Contributing}}
{{HasGuide|page=Melvor Idle:Contributing}}
If there is a guide for a page you're working on somewhere else, you should probably refer to it using the [[Template:HasGuide|Guide Template]]. This adds a formatted link to the guide on the page.
If there is a guide for a page you're working on somewhere else, you should probably refer to it using the [[Template:HasGuide|Guide Template]]. This adds a formatted link to the guide on the page.


Usage: <code><nowiki>{{HasGuide|page=Contributing}}</nowiki></code>
Usage: <code><nowiki>{{HasGuide|page=Some Dungeon}}</nowiki></code>


{{HasMMG|Some cool guide}}
{{HasMMG|Some cool guide}}
Line 220: Line 225:
|-
|-
| <code><nowiki>[[Contributing|Want to help write the wiki?]]</nowiki></code>
| <code><nowiki>[[Contributing|Want to help write the wiki?]]</nowiki></code>
| [[Contributing|Want to help write the wiki?]]
| [[Melvor Idle:Contributing|Want to help write the wiki?]]
|}
|}

Revision as of 16:37, 30 June 2024

Templates

We use a number of templates on the wiki for various purposes. Such as the {{Menu}} template for the menu at the bottom of the page. To access the source page of a template, as for example the Menu template, simply go to the Template:Menu page. Because these pages are templates, they will automatically be imported when referred to, and therefore do not need the prior colon. Otherwise you'd need to prepend a colon to the page name {{:Menu}} to include its content.

Templates furthermore support numeric arguments, referenced in the templates by {{{1}}}, but also named arguments. An example of this would be {{{text}}} for {{ItemIcon|Mole|text=A summon}}.

Some of the templates are simply wrappers for Lua modules, which will include {{#invoke:SomeModule|someFunction}}. To access the module source files, simply go to Module:SomeModule, and look for someFunction in there.

Also note that if an argument is optional, you can simply append a pipe symbol after its name (be it numeric or a named keyword argument) to default to the empty string.

Lua

To create and use a module, it is important to create a module within the Module: namespace, otherwise it will not function!

For specific help on how to use Lua (scribunto) to create modules, you can read this article. Alternatively, you can view some Melvor Wiki specific examples here

Versioning

We have created a system of templates to mark which pages are up to date. At the top of every page there should be a template indicating for which version the page is written. This will look like either {{V}} or {{V|1.0}}.

  • If a page is entirely populated by Lua-powered templates, then simply add {{V}} to the top of the page.
  • If a page contains a decent amount of user-written text that has the potential to change with each version, then the version number should be specified. For example, if a page is written for version 1.0 you would add {{V|1.0}} to the top of the page.

Each page should have a version attached to it. Every version can be found in the Version Category. One of the main tasks is to make sure that pages are up to date.

You can view the versioning system in action on the top right corner of this page.

Referencing other pages

If you have a bit of text in a page but have more text explaining that concept on another page, it might be a good idea to use the Main Template. This template adds a formatted link to the main article to the page.

Usage: {{Main|Reference=Some Dungeon}}


If there is a guide for a page you're working on somewhere else, you should probably refer to it using the Guide Template. This adds a formatted link to the guide on the page.

Usage: {{HasGuide|page=Some Dungeon}}


If you've made a moneymaking guide, consider adding a reference to it on its main page with the Moneymaking guide template. The template adds a formatted link to the guide.

Usage: {{HasMMG|Some cool guide}}

Icons

There are a number of icon templates which allow contributors to easily add icon formatting to links and inline with text, some examples are provided below.

For a comprehensive list of all icon templates and documentation of parameters these functions use, see Template:Icon.

{{Icon|Loot Container Stacking}} Loot Container Stacking
{{Icon|Zarrah|type=pet}} Zarrah
{{PetIcon|Zarrah}} Zarrah
{{MonsterIcon|Necromancer}} Necromancer
{{Icon|Princess|type=thieving}} Princess
{{ZoneIcon|Strange Cave}} Strange Cave
{{Skill|Mining|Rock extraction}} Rock extraction
{{PrayerIcon|Eagle Eye}} Eagle Eye
{{ItemIcon|Pig}} Pig
{{Icon|Wind Strike|type=spell}} Wind Strike
{{Icon|Weakening III|type=curse}} Weakening III
{{Icon|Fury III|type=aurora}} Fury III
{{UpgradeIcon|Golbin Crate|nolink=true}} Golbin Crate
{{ItemIcon|Lucky Herb Potion}} Lucky Herb Potion
Combat icon {{Icon|Melee|notext=true}} Combat icon
{{GP|1000.25}} 1,000.25GP
{{SC|1337}} 1,337SC
{{RC|42069}} 42,069RC

Tables

{{AreaMonsters|Spider Forest}}
Name Combat Lvl HP Max Hit Style Count
Spider 51 250 Normal Damage 72 Melee 3
Brown Spider 52 300 Normal Damage 72 Melee 2
Evil Spider 90 750 Normal Damage 102 Melee 2
Spider King 158 2,000 Normal Damage 142 Melee 1
{{CombatTriangleAdjustmentTable}} Template:CombatTriangleAdjustmentTable
{{EquipmentTableFromList|Aeris God Helmet|Aeris God Platebody|Aeris God Platelegs|Aeris God Boots|Aeris God Gloves}}
{{Obstacles/Recommended
|obs11 = Rope Climb
|obs31 = Pit Jump
|obs41 = Coal Stones
|obs51 = Rooftop Run
|obs52 = Tree Climb
}}
ObstaclePillar (most effective → least effective)
IRope Climb
IIIPit Jump
IVCoal Stones
VRooftop RunTree Climb
{{Equipment/Recommended
|helm1 = Glacia God Helmet
|helm2 = Ancient Wizard Hat
|neck1 = Fury of the Elemental Zodiacs
|neck2 = Elite Amulet of Magic
|cape1 = Skull Cape
|body1 = Glacia God Platebody
|legs1 = Glacia God Platelegs
|familiar11 = Ent
|familiar21 = Wolf
|familiar22 = Leprechaun
}}

Tables with Sticky Headers

Some of the tables on the wiki have headers which are "sticky", that is they will remain at the top of a table as the user scrolls down. See Equipment for an example of this. In order to implement this on your tables first add the class "stickyHeader" to the start of the table. E.g:

{| class="wikitable sortable"

would become:

{| class="wikitable sortable stickyHeader"

Before you start your first row of headers you then add |- class="headerRow-0" before it.

If you have a second row of headers you must add |- class="headerRow-1" before it.

As an example:

Can be generated with the following wikitext

{| class="wikitable sortable stickyHeader"
|- class="headerRow-0"
! First Column 1
! Second Column 1
! Third Column 1
|- class="headerRow-1"
! First Column 2
! Second Column 2
! Third Column 2
|-
| 1
| 2
| 3
|}


Special wiki stuff

#REDIRECT [[Currency]] A single line with this in a page, will redirect it to the given page
{{:Currency}} Includes the whole Currency page here
<nowiki>something</nowiki> Disables wiki formatting for the string inside
<onlyinclude>Hello</onlyinclude> When including the page, it will only display this text
<includeonly>Hello</includeonly> Will only include the text while transcluding it, not in the source page
<noinclude>Hello</noinclude> Removes this text when importing the page it as an include
[[Contributing]] Links to another page on the wiki
[[Contributing|Want to help write the wiki?]] Want to help write the wiki?