User:Chao: Difference between revisions

17,076 editsJoined 5 November 2017
m (Easy Gallery Project | Template Tradeoffs)
m (Easy Gallery Project | example Gallery)
Line 1: Line 1:
I'm gonna use this page as a scratchpad for what I'm gonna call the <u><b>Easy Gallery Project</b></u>, a project that aims to make Galleries on this wiki easy to use, maintain, and update through the use of templates and DPL (the DynamicPageList extension).
<pre><nowiki>{{subst:#invoke:Gallery|gallery|Kagura Mutsuki}}</nowiki></pre> Produces:


{{TOC}}
<hr>
<hr>
<hr>


==Progress==
<p>{{TOC}}
<h2>Main Artwork</h2>
<gallery>
File:BlazBlue Chrono Phantasma Kagura Mutsuki Main.png
</gallery><h2>Sprites
</h2><h3>Battle</h3>
<gallery>
File:BlazBlue Central Fiction Kagura Mutsuki Sprite Idle.gif
</gallery></p>


<!--<span style="color:#009000; font-size:30px">COMPLETE!!!</span>-->
<hr>
<span style="color:#FF0000; font-size:30px">IN PROGRESS, still untested</span>
<hr>
<hr>
<!--
 
== Useful References ==


<span style="color:#FF0000; font-size:24px">Need to: explain & consider tradeoffs</span>
===Modules===
* [https://www.mediawiki.org/wiki/Lua_scripting Overview of WikiMedia Lua]
* [https://www.mediawiki.org/wiki/Extension:Scribunto/Lua_reference_manual Getting Started with MediaWiki Lua]
* [https://en.wikipedia.org/wiki/Wikipedia:Lua Basic Guide to Wikipedia Lua]
* [https://www.mediawiki.org/wiki/Manual:Coding_conventions/Lua How to Write Readable Code]
* [https://en.wikipedia.org/wiki/Help:Lua_debugging Debugging Lua]


==Notes to Self==
===Semantic MediaWiki===
* [https://github.com/SemanticMediaWiki/SemanticScribunto/blob/master/docs/mw.smw.ask.md Documentation for the Lua Module"s implementation of #ask, <b>mw.smw.ask</b>]
* [https://www.semantic-mediawiki.org/wiki/Help:Selecting_pages How to use SMW (#ask) to sort and query unions of categories]
* [https://www.semantic-mediawiki.org/wiki/Help:Search_value_substitution How to use arbitrary variables in an SMW (#ask) query] ie <nowiki>{{FULLPAGENAME}}</nowiki>


<b><u>List of handy DPL references:</u></b>
===DPL===
* https://en.wikinews.org/wiki/Wikinews:DynamicPageList
* https://en.wikinews.org/wiki/Wikinews:DynamicPageList
* https://www.mediawiki.org/wiki/Extension:DynamicPageList_(Wikimedia)
* https://www.mediawiki.org/wiki/Extension:DynamicPageList_(Wikimedia)
* http://followthescore.org/dpldemo/index.php?title=DPL:FAQ
* http://followthescore.org/dpldemo/index.php?title=DPL:FAQ


<b><u>Is DPL really the right choice?</u></b>
<u>Templated DPL (DynamicPageList) Example:</u>
* <span style="color:#FF0000>It could slow the wiki down.</span>
** (supposedly - test this to see if the slowdown is acceptable)
** <span style="color:#009000>allowing DPL to cache results also greatly speeds up load times</span>, especially if the content is largely static (unchanging), which it should be.
* <span style="color:#009000>It greatly reduces maintenance work.</span>
* <span style="color:#009000>It simplifies modification work.</span>
 
<b><u>Are templates really the right choice?</u></b>
* <span style="color:#009000;">Simple to write, simple to read (if it's a template), maintains itself.</span>
* <span style="color:#009000;">easy to change multiple pages all at once</span>
* <span style="color:#009000;">keeps format & any changes consistent across pages.</span>
* <span style="color:#FF0000>Abstracts the purpose of the page - hides how things are done.</span>
** <span style="color:#009000;">The Fix:</span> add easily accessible documentation on both Template:Gallery Page and on Template:Gallery_By_Category
** (easily noticeable link(s) to "how to use galleries" or "how to add categories" on the page or something)
* <span style="color:#FF0000>Stiff</span>: Not clean to add unique categories in the middle (ie to add Mantenbo only to Litchi's gallery)
* <span style="color:#FF0000>Can't deal with captions</span>
 
<b><u>What if someone wants to:</u></b>
* <span style="color:#009000;"><u>add a new gallery category for files (ie for BlazBlue: Cross Tag Battle or Artbook scans).</u></span>
1. Create the new category
2. Add the file(s) into the new category
3. Add the category to Template:Gallery_Page so all relevant pages will now use it.
* <span style="color:#FF0000><u>rearrange the gallery</u></span>: can't manually rearrange items, can only resort by alphabet or by "time last updated"
* <span style="color:#009000;"><u>change how many items per row are shown in the galleries</u></span>: easy, edit the perrow parameter on Template:Gallery_By_Category
* <span style="color:#FF0000><u>change a specific gallery's number of items per row</u></span>: not supported unless you rewrite/manually write the gallery
* <span style="color:#FF0000><u>add captions:</u></span> (as seen in [[Izayoi/Gallery]]) can't use the template to do it.
* <span style="color:#FF0000><u>Add categories unique to a single page:</u></span> (as suggested in [[Mantenbo]]'s history): can't use the template to do it, or else add the page to the template and bloat the template with irrelevant code.
 
<b><u>How much maintenance is needed?</u></b>
 
<b><u>How hard is it to add the code that's needed for a suggested change?</u></b>
 
<b><u>Alternatives?</u></b>
* try to change to a more manually flexible method? What are the tradeoffs?
** ie "when creating a gallery, copy/paste this code and remove unnecessary categories. Then, to add an automatic gallery copy/paste this code. To add a gallery with captions add this code." or something.
 
Note: I believe it's good wikimedia practice to use only ==H2== and beyond (in essence, to avoid using =H1=)
 
<b><u>Other things to look into later:</u></b>
* CategoryTree extension
* https://meta.wikimedia.org/wiki/Help:Category
 
==Template:Gallery Page==
 
<b><u>Idea:</u></b> automatically check if each gallery is empty or not & if empty, skip the header.
* ie for Bullet, skip <b>XBlaze Code:Embryo</b> under <b>Story</b> since she doesn't have any pictures in that category.
* how to do this across all categories on a Gallery Page without making the template impossible to read?
* how do you do this with DPL? -> you don't. Count them with <nowiki>{{#ask}}</nowiki> <b>GO TEST THIS</b>
** <nowiki> {{#ask: [[Category:{{{1}}}]] | format = count}}</nowiki> returns a number that I can use?
 
<pre><nowiki>
would an if statement like this work?? (this is pseudocode)
{{#if: get page count | do nothing | else show header and query DPL for the gallery }}
</nowiki></pre>
 
===Usage===
<pre><nowiki>
{{Gallery Page | Character}}
</nowiki></pre>
 
===Template===
<pre><nowiki><includeonly>
{{TOC}}
 
{{#if: page count of {{{1}}} and Main Artwork = 0 | /*do nothing*/ | /*else*/
==Main Artwork==
{{Gallery By Category|{{{1}}}|Main Artwork}}
}}
 
==Sprites==
===Battle===
===Palette References===
===Lobby Avatar===
 
==Character Crest==
 
==Arcade==
("Arcade Endings" on Noel's page)
===Calamity Trigger===
===Continuum Shift===
===Chrono Phantasma===
===Central Fiction===
 
==Story==
===Portraits===
===Calamity Trigger===
===Continuum Shift===
===Chrono Phantasma===
===Central Fiction===
===Clone Phantasma===
===XBlaze Code: Embryo===
===XBlaze Lost: Memories===
 
==Novels==
===BlazBlue: Calamity Trigger — Part 1===
===BlazBlue: Calamity Trigger — Part 2===
===BlazBlue: Continuum Shift — Part 1===
===BlazBlue: Continuum Shift — Part 2===
 
==Artwork==
===Promotional===
===Birthday===
===Special===
===Chibi===
===Unlimited VS===
===Wallpapers===
===Stickers===
 
==Production Art==
===Model Sheets===
===Early Designs===
===Storyboards===
</includeonly></nowiki></pre>
 
==Template:Gallery By Category==
 
===Usage===
 
<pre><nowiki>
{{Gallery | Cat1 | Cat2 }}
</nowiki></pre>
 
Example:
<pre><nowiki>
{{Gallery | Touya Kagari | Early Designs }}
</nowiki></pre>
 
===Template===
<pre><nowiki>
<pre><nowiki>
{{#tag:DynamicPageList|
{{#tag:DynamicPageList|
Line 159: Line 54:
</nowiki></pre>
</nowiki></pre>


<b><u>Other things to look into later:</u></b>
* CategoryTree extension
* https://meta.wikimedia.org/wiki/Help:Category
* categories of categories
Note: I believe it"s good wikimedia practice to use only ==H2== and beyond (in essence, to avoid using =H1=)


<!--
==Easy Gallery Project==
==DPL (Dynamic Page List)==
 
Welcome to the planning page of the <u><b>Easy Gallery Project</b></u>, a project that aims to make Galleries on this wiki easy to use, maintain, and update.
 
The idea is to leverage the wiki"s categories and various automation tools to simplify the making and maintaining of galleries. Eventually, the average wiki editor should only have to tag an image properly, and the relevant galleries will automatically update themselves.
 
===Why Modules?===
 
The other option: Templated DPL (DynamicPageList)
* DPL could slow the wiki down, especially if caching is disallowed
* Templates are not scalable - they become difficult to read and maintain as they grow larger.
* With DPL/Templates, what you can do is restricted:
** Can"t rearrange pictures in a gallery
** Can"t change a specific gallery"s number of items per row
** Can"t add captions
** It"s messy to add unique galleries for a page (ie [[Mantenbo]] for Litchi"s gallery)
 
However, modules:
* Do everything that templates & DPL do: They...
** are self-maintaining (they update automatically)
** keep pages consistent (allow changes to be made in only one place, but affect all galleries)
** make it easy to add new categories
* AND they provide more options:
** can add captions
** can change specific gallery"s items per row
** it"s easy and clean to add a unique gallery for a page
* However, there is a bit of a learning curve (since it"s written in Lua)
** good documentation and clean code will help solve this.


<DynamicPageList>
===Progress===
category=Touya_Kagari
namespace=file
galleryshowfilename=no
imagesperrow=7
gallerycaption=No caption
mode=gallery
</DynamicPageList>


<DynamicPageList>
<span style="color:#009000; font-size:30px">COMPLETE!!!</span>
category=Touya_Kagari
<span style="color:#FF0000; font-size:30px">IN PROGRESS</span>
namespace=File
format=<gallery>,%PAGE%|[[%PAGE%|%TITLE%]]\n,,</gallery>
allowcachedresults = true
</DynamicPageList>
-->
-->

Revision as of 01:31, 8 November 2017

{{subst:#invoke:Gallery|gallery|Kagura Mutsuki}}

Produces:




Main Artwork

Sprites

Battle