User:Gorgon/Sandbox/Sandbox Alpha: Difference between revisions
m (Test of nesting transcludesection <onlyinclude>.) |
m (Forgot <onlyinclude> ignores <nowiki> tags.) |
||
Line 14: | Line 14: | ||
=== Extensions that would make this work better [My wish list] === | === Extensions that would make this work better [My wish list] === | ||
* [http://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion Extension:Labeled Section Transclusion] - Allows '''selective''' transclusion of marked-off sections of text. | * [http://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion Extension:Labeled Section Transclusion] - Allows '''selective''' transclusion of marked-off sections of text. | ||
** [[Wikipedia:Wikipedia:Transclusion#Without_using_the_labeled_section_method | Wikipedia:Selective transclusion without using the labeled section method]] - This works here with | ** [[Wikipedia:Wikipedia:Transclusion#Without_using_the_labeled_section_method | Wikipedia:Selective transclusion without using the labeled section method]] - This works here with onlyinclude and includeonly, so transcludesection=SECTIONNAME parameters are doable if [http://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion Extension:Labeled Section Transclusion] isn't added. | ||
* [http://www.mediawiki.org/wiki/Extension:DynamicPageList_(third-party) Extension:DynamicPageList (third-party)] - Enhanced version of [http://www.mediawiki.org/wiki/Extension:DynamicPageList_(Wikimedia) Extension:DynamicPageList (Wikimedia)] | * [http://www.mediawiki.org/wiki/Extension:DynamicPageList_(third-party) Extension:DynamicPageList (third-party)] - Enhanced version of [http://www.mediawiki.org/wiki/Extension:DynamicPageList_(Wikimedia) Extension:DynamicPageList (Wikimedia)] | ||
** [http://semeb.com/dpldemo/index.php?title=DPL:Overview DPL:Overview] - Generate dynamic reports based on category members and selective included info from each (Extension:Labeled Section Transclusion above would really help there). | ** [http://semeb.com/dpldemo/index.php?title=DPL:Overview DPL:Overview] - Generate dynamic reports based on category members and selective included info from each (Extension:Labeled Section Transclusion above would really help there). | ||
Line 27: | Line 27: | ||
* I think [[User:Buddha|Buddha]] had the right idea with his discussion on the [[Avlis_Wiki_talk:Categories#Categorizing_Spells | Categories page]] about reformatting how we categorize spells. The current [[Magic:Spell_List | Spell List]] page (and its various subversions) all rely on manual updating when any new changes happen to it, like a new spell being added. Revisions to this template will improve how each spell is displayed, and categorized (even without new extensions), so moving to category listings that update dynamically makes a lot of sense. | * I think [[User:Buddha|Buddha]] had the right idea with his discussion on the [[Avlis_Wiki_talk:Categories#Categorizing_Spells | Categories page]] about reformatting how we categorize spells. The current [[Magic:Spell_List | Spell List]] page (and its various subversions) all rely on manual updating when any new changes happen to it, like a new spell being added. Revisions to this template will improve how each spell is displayed, and categorized (even without new extensions), so moving to category listings that update dynamically makes a lot of sense. | ||
** If the suggested [http://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion Labeled Section Transclusion] extension is added, then short spell descriptions and other info can be dynamically added/updated to manually updated lists, like [[Magic:Cleric_Spells:Level-1 | Cleric Spells:Level-1]], even without moving to categories. | ** If the suggested [http://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion Labeled Section Transclusion] extension is added, then short spell descriptions and other info can be dynamically added/updated to manually updated lists, like [[Magic:Cleric_Spells:Level-1 | Cleric Spells:Level-1]], even without moving to categories. | ||
*** [[Wikipedia:Wikipedia:Transclusion#Without_using_the_labeled_section_method | Wikipedia:Selective transclusion without using the labeled section method]] - This works here with | *** [[Wikipedia:Wikipedia:Transclusion#Without_using_the_labeled_section_method | Wikipedia:Selective transclusion without using the labeled section method]] - This works here with onlyinclude and includeonly (see above), so a workaround without [http://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion Labeled Section Transclusion]. | ||
** The [http://www.mediawiki.org/wiki/Extension:DynamicPageList_(third-party) Dynamic Page List (third-party)] extension would allow one page to display all variations in any sort of table, sortable and filterable by any useful criteria. Spells would be automatically categorized by this template, but one page would use those categories and/or the template parameters, to display whatever output is requested by the user. Combine this with Labeled Section Transclusion, and any results are updated as each spell gets edited. | ** The [http://www.mediawiki.org/wiki/Extension:DynamicPageList_(third-party) Dynamic Page List (third-party)] extension would allow one page to display all variations in any sort of table, sortable and filterable by any useful criteria. Spells would be automatically categorized by this template, but one page would use those categories and/or the template parameters, to display whatever output is requested by the user. Combine this with Labeled Section Transclusion, and any results are updated as each spell gets edited. | ||
Revision as of 23:52, 25 January 2017
Anything up to/including the Template start heading will not be included in transclusion of this template (or any part of the trailing documentation section either, though that will eventually be formalized template documentation, with transcluded categories at the end).
I love to over-comment my code, so why change things here...
Test version of Template:Spell
Extensions that would make this work better [My wish list]
- Extension:Labeled Section Transclusion - Allows selective transclusion of marked-off sections of text.
- Wikipedia:Selective transclusion without using the labeled section method - This works here with onlyinclude and includeonly, so transcludesection=SECTIONNAME parameters are doable if Extension:Labeled Section Transclusion isn't added.
- Extension:DynamicPageList (third-party) - Enhanced version of Extension:DynamicPageList (Wikimedia)
- DPL:Overview - Generate dynamic reports based on category members and selective included info from each (Extension:Labeled Section Transclusion above would really help there).
- DPL:Template:Catlist - Picture this totally reformatted as filter/sort options up top of the Spell List page, as a dynamic table. It starts showing all spells, but sortable with one click by level, school, class, or any other useful Template:Spell parameter/category used by them. Then add in the ability to filter results to only certain kinds/combinations (e.g, Show only cleric evocation spells, sorted by level, with the option of showing specific domain ones as well).
- I doubt anyone else besides me would use this (except maybe the occasional dabbler), but it would really be useful for spells, and maybe a few other things eventually. Revamping all spells via this template is a huge undertaking (and my main goal for wiki updating, now that I can verify/test spells again), so adding this extension for that work alone would make a huge difference.
- After looking into the more recent version of Extension:DynamicPageList (Wikimedia) (the one used by most Wikimedia projects, not the "enhanced - 3rd party one"), it may be just as useful (or better), since it allows more sort options. Need to see both in practical use before deciding anything.
- Extension:TemplateData - See the documentation section below.
Revision notes
- Still in pre-work thought mode here, and wanting extensions to make life easier. Made a few changes to automate very basic parameter stuff, but more can be done. Template:Spell on the NWN Wiki has some ideas, but not quite what I had in mind either.
- I think Buddha had the right idea with his discussion on the Categories page about reformatting how we categorize spells. The current Spell List page (and its various subversions) all rely on manual updating when any new changes happen to it, like a new spell being added. Revisions to this template will improve how each spell is displayed, and categorized (even without new extensions), so moving to category listings that update dynamically makes a lot of sense.
- If the suggested Labeled Section Transclusion extension is added, then short spell descriptions and other info can be dynamically added/updated to manually updated lists, like Cleric Spells:Level-1, even without moving to categories.
- Wikipedia:Selective transclusion without using the labeled section method - This works here with onlyinclude and includeonly (see above), so a workaround without Labeled Section Transclusion.
- The Dynamic Page List (third-party) extension would allow one page to display all variations in any sort of table, sortable and filterable by any useful criteria. Spells would be automatically categorized by this template, but one page would use those categories and/or the template parameters, to display whatever output is requested by the user. Combine this with Labeled Section Transclusion, and any results are updated as each spell gets edited.
- If the suggested Labeled Section Transclusion extension is added, then short spell descriptions and other info can be dynamically added/updated to manually updated lists, like Cleric Spells:Level-1, even without moving to categories.
Can the "Name" template parameter be taken from the page name automatically?
- Maybe as a default if not given as a parameter?
- Might need some page renaming, but should work.
- Keeping the template from categorizing itself as a spell might be annoying, unless namespace checking or other validation is done.
More to come...
Template start
School: [[Magic:{{{School}}}|{{{School}}}]]
Level: {{{Level}}}
Innate Level: {{{Innate Level}}}
Component(s): {{{Components}}}
Casting Time: {{{Casting Time}}}
Range: {{{Range}}}
Target: {{{Target}}}
Duration: {{{Duration}}}
Counter(s): {{{Counters}}}
Saving Throw: {{{Saving Throw}}}
Spell Resistance: {{{Spell Resistance}}}
Metamagic: {{{Metamagic}}}
Energy Substitution: {{{Energy Substitution}}}
{{{Description}}}
Non-transcluded template documentation [eventually an included doc subpage or <templatedata>]
Magic:Spell_Format should be here as documentation, instead of that hard to find page.
Add template documentation here, or include a doc subpage (see: How to create a documentation subpage).
- A {{Documentation}} sub-template would be useful for all templates on this wiki, since they need usage documentation (stripped down version, without the dozens of other templates).
- Extension:TemplateData would work better on its own, keeping things simple.
- It should install a "Manage TemplateData" button for the edit gui, but I am not sure what else that needs (probably VisualEditor, which is a slow pig, so pass on that). See: TemplateData editor.
- Below is what might be the beginning of the spell template documentation as an example (using <templatedata></templatedata> tags), if it is done manually. I have the "Name" as "required": false because I may try grabbing it from the page title, if it isn't given.
== Usage == <templatedata> { "description": "Spells Template", "params": { "Name": { "label": "Spell Name", "description": "Name of the Spell (Uses the page title if not defined)", "required": false, "suggested": true, "default": {{SUBPAGENAME}}, "type": "string", "example": "Name = Freedom of Movement" }, "School": { "label": "Spell School", "description": "School of magic the spell belongs to. Must be one of: Abjuration, Conjuration, Divination, Enchantment, Evocation, Illusion, Necromancy, Transmutation or Universal.", "required": true, "type": "string", "example": "School = Abjuration" }, "Subschool": { "label": "Spell Subschool", "description": "Subschool of the spell.", "required": false, "type": "string", "example": "Subschool = " }, "Descriptors": { "label": "Spell Descriptors", "description": "Descriptors of the spell.", "required": false, "type": "string", "example": "Descriptors = " }, "Bard Level": { "label": "Bard Level", "description": "Level of spell for Bards (if it is a Bard spell).", "required": false, "type": "number", "example": "Bard Level = " }, "Cleric Level": { "label": "Cleric Level", "description": "Level of spell for Clerics (if it is a Cleric spell).", "example": "Cleric Level = 4", "inherits": "Bard Level" }, "Druid Level": { "label": "Druid Level", "description": "Level of spell for Druids (if it is a Druid spell).", "example": "Druid Level = 4", "inherits": "Bard Level" }, "Paladin Level": { "label": "Paladin Level", "description": "Level of spell for Paladins (if it is a Paladin spell).", "example": "Paladin Level = 4", "inherits": "Bard Level" }, "Ranger Level": { "label": "Ranger Level", "description": "Level of spell for Rangers (if it is a Ranger spell).", "example": "Ranger Level = 4", "inherits": "Bard Level" }, "Arcane Level": { "label": "Sorcerer/Wizard Level", "description": "Level of spell for Sorcerers/Wizards (if it is an Arcane spell).", "example": "Arcane Level = 4", "inherits": "Bard Level" }, "Domain": { "label": "Domain (1) Name", "description": "1st Domain name of spell for Clerics (if it is a Domain spell).", "required": false, "type": "string", "example": "Domain = Travel" }, "Domain Level": { "label": "Domain (1) Level", "description": "1st Domain Level of spell for Clerics (if it is a Domain spell).", "required": false, "type": "number", "example": "Domain Level = 3" }, "Domain 2": { "label": "Domain (2) Name", "description": "2nd Domain name of spell for Clerics (if it is a Domain spell).", "example": "Domain 2 = ", "inherits": "Domain" }, "Domain 2 Level": { "label": "Domain (2) Level", "description": "2nd Domain Level of spell for Clerics (if it is a Domain spell).", "example": "Domain 2 Level = ", "inherits": "Domain Level" } }, "paramOrder": [ "Name", "School", "Subschool", "Descriptors", "Bard Level", "Cleric Level", "Druid Level", "Paladin Level", "Ranger Level", "Arcane Level", "Domain", "Domain Level", "Domain 2", "Domain 2 Level" ] } </templatedata>
Obviously I've added more parameters for class and domain spells, similar to the NWN Wiki version of Template:Spell. Their full parameter list is below (they don't use Subschool, and I used proper case with spaces for all parameters):
- Spell levels:
- bardlevel — The level of this spell when cast by a bard. Optional
- clericlevel — The level of this spell when cast by a cleric. Optional
- druidlevel — The level of this spell when cast by a druid. Optional
- paladinlevel — The level of this spell when cast by a paladin. Optional
- rangerlevel — The level of this spell when cast by a ranger. Optional
- magelevel — The level of this spell when cast by a sorcerer or wizard. Optional
- domain — The clerical domain that grants access to this spell. Optional
- domainlevel — The level of this spell when granted by this domain. Required if domain is specified
- domain2 — A second clerical domain that grants access to this spell. Optional
- domain2level — The level of this spell when granted by the second domain. Required if domain2 is specified
- domain3 — A third clerical domain that grants access to this spell. Optional
- domain3level — The level of this spell when granted by the third domain. Required if domain3 is specified
- domain4 — A fourth clerical domain that grants access to this spell. Optional
- domain4level — The level of this spell when granted by the fourth domain. Required if domain4 is specified
- innatelevel — The innate level of this spell.
- Lines of spells:
- line — a name for the spell line this spell belongs to. Optional, but if not set then line0 through line9 are ignored
- line0 through line9 — names of spells (not linked) that are considered in the same "line" of spells as the current spell. Use the parameter corresponding to the spell's innate level. Include the current spell. Optional, but some should be used if "line" is set
- linebreach — set this (to "yes") to get a table for the breach line of spells. (This is a hack to accommodate disjunction having two spell lines.) Optional
- Other:
- area — The area affected by this spell. The values "small", "medium", "large", "huge", "gargantuan", "colossal", and "spellcone" should be used when appropriate.
- areanote — Additional information about the area of effect (e.g. a limit on the number of targets in a colossal area). Optional
- conesize — This can override the default length of "10" for spell cones.
- components — "V", "S", or "VS" indicating the components this spell utilizes. Optional
- counters — Additional counterspells, preferably linked. Optional
- duration — The duration of the spell.
- immunity — The descriptor (immunity type) of this spell. Optional
- range — "p", "t", "s", "m", or "l" indicating the range of the spell.
- save — The save allowed for this spell, preferably linked. Optional
- school — The spell school of this spell, preferably linked.
- spellcraft — The spellcraft requirement (for epic spells). Optional, epic only
- spellresistance — Should be "yes" if spell resistance can bock this spell. Should be "yes*" if the BioWare description says spell resistance can block this spell, but it does not actually do so. Optional
- area — The area affected by this spell. The values "small", "medium", "large", "huge", "gargantuan", "colossal", and "spellcone" should be used when appropriate.
- desc — The spell's in-game description.
- icon — The name of the image (icon) for this spell. Optional