Forum:Bracket list shortcuts?

From Yugipedia
Jump to: navigation, search

I am wondering if there are any shortcuts to appending entire lists with brackets and asterisk bullet points. I have thought about writing a program, but my skills are a little rusty there.--Azul120 (talkcontribs) 16:38, September 25, 2011 (UTC)

I'm not sure just what you're referring to; could you point to an example? (are you perhaps referring to the lists of sets on card pages?) ディノ千?!? · ☎ Dinoguy1000 22:59, September 25, 2011 (UTC)
Exactly. I'm referring to card lists. i. e. * [[example card]] --Azul120 (talkcontribs) 01:51, September 26, 2011 (UTC)
I still don't know what you're talking about (you seem to be talking about something other than what I mentioned above, though); it would help me a lot if you just linked to an example. ディノ千?!? · ☎ Dinoguy1000 03:58, September 26, 2011 (UTC)
Here's an example of one of the pages: Test of Luck. I mean, I can do it line by line, but a quicker method would be preferable. --04:13, September 26, 2011 (UTC)Azul120 (talkcontribs)
Okay, now I see what you mean. No, there's no template to automatically format lists of cards into bulleted, linked lists; any such template would have more overhead (both from an editor perspective and a server perspective) then simply using the list and link wikimarkup. Advanced text editors such as Notepad++ offer search-and-replace functionality which would allow you to almost completely automate such edits, though (regrettably, it's not possible in Windows Notepad, since its search-and-replace function does not allow finding or inserting newlines), and if you know how to use regexes, there are a myriad of online tools that could also be used. ディノ千?!? · ☎ Dinoguy1000 04:28, September 26, 2011 (UTC)
Can the functions append any alphanumeric string? --Azul120 (talkcontribs) 05:15, September 26, 2011 (UTC)
Pretty much, yes. Despite my prior disparaging of it, Windows Notepad is actually a pretty good place to start cutting your teeth on how search-and-replace generally works: here it is simply called "Replace...", and can be found under the "Edit" menu (or, if you're a keyboard jockey, you can just hit CTRL + H to open the replace interface). I actually use this tool a lot to perform certain edits, since it's very simple and straightforward, and Windows Notepad is a very low-footprint program that opens very quickly. ディノ千?!? · ☎ Dinoguy1000 05:33, September 26, 2011 (UTC)
That's how I've been doing it. --Azul120 (talkcontribs) 05:35, September 26, 2011 (UTC)
Aah, okay. So then, are you needing any help with more advanced replaces or something? ディノ千?!? · ☎ Dinoguy1000 05:46, September 26, 2011 (UTC)
If you view the source code of the page, you can replace the <p> and </p> tags with * [[ and ]] respectively. Depending on your browser, you can probably view the source code from the tools or view menu or simply hitting Ctrl + U. Unfortunately MediaWiki puts the line breaks in a weird position, so you'll still need to adjust the line breaks manually after your find and replace. -- Deltaneos (talk) 23:20, September 26, 2011 (UTC)
Actually this can be done using arraymap. Put {{subst:#arraymap: before the list and |\n\n|$$$|* [[$$$]]|\n}} after the list. It will automatically convert it to a bulleted list when you save the page. e.g.
{{subst:#arraymap: 
Blowback Dragon

Dark Master - Zorc

Dice Jar

Gatling Dragon

Snipe Hunter
|\n\n
|$$$
|* [[$$$]]
|\n
}}
becomes...
* [[Blowback Dragon]]
* [[Dark Master - Zorc]]
* [[Dice Jar]]
* [[Gatling Dragon]]
* [[Snipe Hunter]]
when you save the page. -- Deltaneos (talk) 19:20, September 27, 2011 (UTC)
Right, I didn't even think of substitution. =P I'll have to keep that in mind to see if I can better automate other types of cleanup in the future. ディノ千?!? · ☎ Dinoguy1000 19:43, September 27, 2011 (UTC)