User:Chao: Difference between revisions

17,076 editsJoined 5 November 2017
(Easy Gallery Project | Skeleton of Thoughts)
m (fixing some wrong commands lmao)
 
(135 intermediate revisions by the same user not shown)
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).


{{TOC}}
==Notes==
{| class="wikitable mw-collapsible mw-collapsed"
! Adding BBDW Audio Files to the Quotes Page
|-
|
* Add audio files that were uploaded in bulk to the character's BBDW quotes page.
* The idea is to grab the filenames from the contribution list (or file upload list) so we have the real filenames used on the wiki, and then to format them accordingly.
* This works better (is more efficient) the more files we have to apply this to at once. Can even be files for multiple characters.
* These instructions assume the use of Sublime Text 3, or another advanced text editor that supports multiple selections and searches with regular expressions.
|-
| style="text-align:left;" | Steps:
* Select and copy into a new document the contribs page text for the user who uploaded the files.
It'll look something like this:
<pre><nowiki>
    03:22, 4 June 2022 diff hist +359‎ N File:BBDW Avenge 026b.ogg ‎ Uploaded a work by Arc System Works from BlazBlue Alternative: Dark War with UploadWizard current Tag: Upload Wizard
    03:22, 4 June 2022 diff hist +359‎ N File:BBDW Avenge 026a.ogg ‎ Uploaded a work by Arc System Works from BlazBlue Alternative: Dark War with UploadWizard current Tag: Upload Wizard
</nowiki></pre>


==Progress==
* In the text editor, pull up the search bar (Ctrl+F) and search for: (make sure using regular expressions (regex) is selected)
<pre>File:[A-Za-z0-9 ]*\.ogg</pre>


<!--<span style="color:#009000; font-size:30px">COMPLETE!!!</span>-->
* Click the "Find All" button on the far right (or <code>Alt</code> + <code>Enter</code>) to select all occurrences in current document
<span style="color:#FF0000; font-size:30px">IN PROGRESS, still untested</span>
* Cut (Ctrl + X) or copy (Ctrl + C) all selections.
* Open a new document (or Ctrl + N) and paste (Ctrl + V) the selections.


==Notes to Self==
This extracts all "File:<filename>.ogg" from the copied text. It should look like this:
<pre><nowiki>
File:BBDW Avenge 026b.ogg
File:BBDW Avenge 026a.ogg
</nowiki></pre>


<b><u>List of handy DPL references:</u></b>
* Go to Edit > Sort Lines to sort them alphabetically:
* https://en.wikinews.org/wiki/Wikinews:DynamicPageList
<pre><nowiki>
* https://www.mediawiki.org/wiki/Extension:DynamicPageList_(Wikimedia)
File:BBDW Avenge 026a.ogg
* http://followthescore.org/dpldemo/index.php?title=DPL:FAQ
File:BBDW Avenge 026b.ogg
 
</nowiki></pre>
<b><u>Is DPL really the right choice?</u></b>
* <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>What if someone wants to:</u></b>
* add a category for files (ie for BlazBlue: Cross Tag Battle or Artbook scans).
* add a corresponding subcategory on all gallery pages.
* rearrange the gallery
* change how many items per row are shown in the galleries
* change a specific gallery's number of items per row
* sort the gallery differently (ie by timestamp, alphabetical order, reverse alphabetical, etc)
 
<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>
 
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?


* Add the header and footer text around the text
<pre><nowiki>
<pre><nowiki>
would an if statement like this work?? (this is pseudocode)
==Other==
{{#if: get page count | do nothing | else show header and query DPL for the gallery }}
{{Quotes Header}}
File:BBDW Avenge 026a.ogg
File:BBDW Avenge 026b.ogg
{{Quotes Footer}}
</nowiki></pre>
</nowiki></pre>


===Usage===
* Search for all the part b files (026b etc) with this regex:
<pre>b\.ogg$</pre>
 
* ALT+ENTER to select all occurrences of matched text.
* Press <code>HOME</code> on the keyboard to move each cursor to the beginning of each selected line.
* <code>BACKSPACE</code> to put each "b" quote on the previous line (with the "a" line)
* Add a comma and a space to get the following:
<pre><nowiki>
<pre><nowiki>
{{Gallery Page | Character}}
==Other==
{{Quotes Header}}
File:BBDW Avenge 026a.ogg, File:BBDW Avenge 026b.ogg
{{Quotes Footer}}
</nowiki></pre>
</nowiki></pre>


* <span style="color:#009000;">Simple, I like it!</span>
* Select all lines beginning with "File:" (search for)
* <span style="color:#FF0000>Abstracts the purpose of the page - hides how things are done.</span>
<pre>^File:</pre>
** <span style="color:#009000;">The Fix:</span> add DOCUMENTATION that's EASILY ACCESSIBLE on both Template:Gallery Page and on Template:Gallery_By_Category
** (easily noticeable link(s) to "HOW TO USE THIS GALLERY" or "HOW TO ADD A CATEGORY" on the page or something)


===Template===
* <code>HOME</code> to move each cursor to the beginning of each selected line.
<pre><nowiki><includeonly>
* Copy the following wikitext template, then navigate back to the text editor (do NOT click inside the text editor but click the icon on the menu bar or ALT+TAB back to it, else you will lose your selection)
{{TOC}}
* Paste
 
<pre><nowiki>
{{#if: page count of {{{1}}} and Main Artwork = 0 | /*do nothing*/ | /*else*/
{{Quotes
==Main Artwork==
  |rowspan=2
{{Gallery By Category|{{{1}}}|Main Artwork}}
  |situation=
  |text=
  |lang=en
}}
{{Quotes
  |rowspan=0
  |situation=
  |text=
  |audio=
  |lang=ja
}}
}}
</nowiki></pre>


==Sprites==
Next is the cool part about Sublime Text...
===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===


We should now have the following text, with the cursor before every <code>File:</code> after the wikitext template we just pasted.
* <code>SHIFT</code>+<code>END</code> to select from every cursor to the end of its line.
<pre><nowiki>
<pre><nowiki>
{{Gallery | Cat1 | Cat2 }}
==Other==
{{Quotes Header}}
{{Quotes
  |rowspan=2
  |situation=
  |text=
  |lang=en
}}
{{Quotes
  |rowspan=0
  |situation=
  |text=
  |audio=
  |lang=ja
}}File:BBDW Avenge 026a.ogg, File:BBDW Avenge 026b.ogg
{{Quotes Footer}}
</nowiki></pre>
</nowiki></pre>
 
* Cut, then navigate WITH the arrow keys on the keyboard (not the mouse), and it will move every cursor accordingly.
Example:
* Move to the <code>|audio=</code> part of the template above it, and paste.
<pre><nowiki>
<pre><nowiki>
{{Gallery | Touya Kagari | Early Designs }}
==Other==
{{Quotes Header}}
{{Quotes
  |rowspan=2
  |situation=
  |text=
  |lang=en
}}
{{Quotes
  |rowspan=0
  |situation=
  |text=
  |audio=File:BBDW Avenge 026a.ogg, File:BBDW Avenge 026b.ogg
  |lang=ja
}}
{{Quotes Footer}}
</nowiki></pre>
</nowiki></pre>


===Template===
* <code>END</code> to navigate to the end of each audio line.
* <code>CTRL</code> + Left arrow key twice to move the cursor before the ".ogg" file extension
* <code>CTRL</code> + <code>SHIFT</code> + arrow keys to select <code>026</code> (without the a/b letter suffix)
* Copy (CTRL+C)
* Navigate with arrow keys up to the <code>|situation=</code> part and paste, then up to the first <code>|situation=</code> and paste again
<pre><nowiki>
<pre><nowiki>
{{#tag:DynamicPageList|
==Other==
category = {{{1}}}
{{Quotes Header}}
category = {{{2}}}
{{Quotes
namespace = file
  |rowspan=2
ordermethod = sortkey
  |situation=026
order = ascending
  |text=
galleryshowfilename=no
  |lang=en
imagesperrow=7
gallerycaption=No caption
mode=gallery
}}
}}
{{Quotes
  |rowspan=0
  |situation=026
  |text=
  |audio=File:BBDW Avenge 026a.ogg, File:BBDW Avenge 026b.ogg
  |lang=ja
}}
{{Quotes Footer}}
</nowiki></pre>
</nowiki></pre>


* Finally, remove File: prefix - search for the following
<code>File:</code>
* ALT+ENTER to select all
* BACKSPACE to delete all selections


<!--
And now we're done and can copy/paste the text into the bottom of the [[:Category:Quotes_Subpage|character's quotes page]].
==DPL (Dynamic Page List)==
<pre><nowiki>
 
==Other==
<DynamicPageList>
{{Quotes Header}}
category=Touya_Kagari
{{Quotes
namespace=file
  |rowspan=2
galleryshowfilename=no
  |situation=026
imagesperrow=7
  |text=
gallerycaption=No caption
  |lang=en
mode=gallery
}}
</DynamicPageList>
{{Quotes
 
  |rowspan=0
<DynamicPageList>
  |situation=026
category=Touya_Kagari
  |text=
namespace=File
  |audio=BBDW Avenge 026a.ogg, BBDW Avenge 026b.ogg
format=<gallery>,%PAGE%|[[%PAGE%|%TITLE%]]\n,,</gallery>
  |lang=ja
allowcachedresults = true
}}
</DynamicPageList>
{{Quotes Footer}}
-->
</nowiki></pre>
|}

Latest revision as of 17:55, 4 June 2022

Notes

Adding BBDW Audio Files to the Quotes Page
  • Add audio files that were uploaded in bulk to the character's BBDW quotes page.
  • The idea is to grab the filenames from the contribution list (or file upload list) so we have the real filenames used on the wiki, and then to format them accordingly.
  • This works better (is more efficient) the more files we have to apply this to at once. Can even be files for multiple characters.
  • These instructions assume the use of Sublime Text 3, or another advanced text editor that supports multiple selections and searches with regular expressions.
Steps:
  • Select and copy into a new document the contribs page text for the user who uploaded the files.

It'll look something like this:

    03:22, 4 June 2022 diff hist +359‎ N File:BBDW Avenge 026b.ogg ‎ Uploaded a work by Arc System Works from BlazBlue Alternative: Dark War with UploadWizard current Tag: Upload Wizard
    03:22, 4 June 2022 diff hist +359‎ N File:BBDW Avenge 026a.ogg ‎ Uploaded a work by Arc System Works from BlazBlue Alternative: Dark War with UploadWizard current Tag: Upload Wizard
  • In the text editor, pull up the search bar (Ctrl+F) and search for: (make sure using regular expressions (regex) is selected)
File:[A-Za-z0-9 ]*\.ogg
  • Click the "Find All" button on the far right (or Alt + Enter) to select all occurrences in current document
  • Cut (Ctrl + X) or copy (Ctrl + C) all selections.
  • Open a new document (or Ctrl + N) and paste (Ctrl + V) the selections.

This extracts all "File:<filename>.ogg" from the copied text. It should look like this:

File:BBDW Avenge 026b.ogg
File:BBDW Avenge 026a.ogg
  • Go to Edit > Sort Lines to sort them alphabetically:
File:BBDW Avenge 026a.ogg
File:BBDW Avenge 026b.ogg
  • Add the header and footer text around the text
==Other==
{{Quotes Header}}
File:BBDW Avenge 026a.ogg
File:BBDW Avenge 026b.ogg
{{Quotes Footer}}
  • Search for all the part b files (026b etc) with this regex:
b\.ogg$
  • ALT+ENTER to select all occurrences of matched text.
  • Press HOME on the keyboard to move each cursor to the beginning of each selected line.
  • BACKSPACE to put each "b" quote on the previous line (with the "a" line)
  • Add a comma and a space to get the following:
==Other==
{{Quotes Header}}
File:BBDW Avenge 026a.ogg, File:BBDW Avenge 026b.ogg
{{Quotes Footer}}
  • Select all lines beginning with "File:" (search for)
^File:
  • HOME to move each cursor to the beginning of each selected line.
  • Copy the following wikitext template, then navigate back to the text editor (do NOT click inside the text editor but click the icon on the menu bar or ALT+TAB back to it, else you will lose your selection)
  • Paste
{{Quotes
  |rowspan=2
  |situation=
  |text=
  |lang=en
}}
{{Quotes
  |rowspan=0
  |situation=
  |text=
  |audio=
  |lang=ja
}}

Next is the cool part about Sublime Text...

We should now have the following text, with the cursor before every File: after the wikitext template we just pasted.

  • SHIFT+END to select from every cursor to the end of its line.
==Other==
{{Quotes Header}}
{{Quotes
  |rowspan=2
  |situation=
  |text=
  |lang=en
}}
{{Quotes
  |rowspan=0
  |situation=
  |text=
  |audio=
  |lang=ja
}}File:BBDW Avenge 026a.ogg, File:BBDW Avenge 026b.ogg
{{Quotes Footer}}
  • Cut, then navigate WITH the arrow keys on the keyboard (not the mouse), and it will move every cursor accordingly.
  • Move to the |audio= part of the template above it, and paste.
==Other==
{{Quotes Header}}
{{Quotes
  |rowspan=2
  |situation=
  |text=
  |lang=en
}}
{{Quotes
  |rowspan=0
  |situation=
  |text=
  |audio=File:BBDW Avenge 026a.ogg, File:BBDW Avenge 026b.ogg
  |lang=ja
}}
{{Quotes Footer}}
  • END to navigate to the end of each audio line.
  • CTRL + Left arrow key twice to move the cursor before the ".ogg" file extension
  • CTRL + SHIFT + arrow keys to select 026 (without the a/b letter suffix)
  • Copy (CTRL+C)
  • Navigate with arrow keys up to the |situation= part and paste, then up to the first |situation= and paste again
==Other==
{{Quotes Header}}
{{Quotes
  |rowspan=2
  |situation=026
  |text=
  |lang=en
}}
{{Quotes
  |rowspan=0
  |situation=026
  |text=
  |audio=File:BBDW Avenge 026a.ogg, File:BBDW Avenge 026b.ogg
  |lang=ja
}}
{{Quotes Footer}}
  • Finally, remove File: prefix - search for the following

File:

  • ALT+ENTER to select all
  • BACKSPACE to delete all selections

And now we're done and can copy/paste the text into the bottom of the character's quotes page.

==Other==
{{Quotes Header}}
{{Quotes
  |rowspan=2
  |situation=026
  |text=
  |lang=en
}}
{{Quotes
  |rowspan=0
  |situation=026
  |text=
  |audio=BBDW Avenge 026a.ogg, BBDW Avenge 026b.ogg
  |lang=ja
}}
{{Quotes Footer}}