User talk:Abyssal/Multi image converter

Latest comment: 5 years ago by Abyssal in topic Progress report

Missing comments edit

@Abyssal: Let's discuss the new task on this talk page.

As before, the hard part for a regular expression is working out where each caption stops, since a caption may contain wikilinks, pipe characters and even, sometimes, nested template calls. Before, I was relying on each caption ending with a comment, eg <!-- [[Mastodon]] -->. In the "example inputs", some of the captions have a comment, but some don't. I've had a quick look through List of the Paleozoic life of Idaho, and found comments after every caption. If I devise a method that relies on those comments being present, will that be good enough? -- John of Reading (talk) 16:39, 4 April 2019 (UTC)Reply

@John of Reading: Ah. OK. I didn't think of that. The captions that don't end in comments are the ones meant to be one-offs rather than sourced from the big caption repository. Easily 99% have the ending comments but will the remainder actively screw anything up for you? Abyssal (talk) 16:48, 4 April 2019 (UTC)Reply
@Abyssal: Give me a day or two to think, and then I'll try something out. -- John of Reading (talk) 19:21, 4 April 2019 (UTC)Reply
@John of Reading:Alrighty. See you then. Abyssal (talk) 00:40, 5 April 2019 (UTC)Reply

Progress report edit

@Abyssal: I've made an edit at List of the Paleozoic life of Idaho, updating seven calls to {{multiple image}}. Comments:

  • One call was not updated since one of its captions lacks a trailing HTML comment. Search for "width1" to find it. Hopefully there won't be many of these.
  • I noticed you'd left several extra ]] pairs visible, so I cleaned those up as well.
  • In your "Example 3 image output" you haven't followed your own instruction, as you've sensibly not added a second dot at the end of the caption that had one already. I've coded an extra step to avoid this.
  • Yes, since the "footer" has embedded HTML comments before and after each caption, I should be able to copy new captions in from User:Abyssal/Image captions to use with only a little extra coding effort.

All comments welcome, otherwise I'm waiting for your permission to try updating all the other articles. -- John of Reading (talk) 09:37, 5 April 2019 (UTC)Reply

@John of Reading:That looks really good. You can go ahead and run this and the original caption updating operation (I've updated the size of many images) across the whole list of articles. Would it be possible for me to create a generic "caption end" template so that we could run this again and clean up the templates that get missed even if we can't update their captions? Abyssal (talk) 14:46, 5 April 2019 (UTC)Reply

@Abyssal: That's   Done the bulk of it, I hope.

  • I added <!-- end of caption --> comments by hand where they were needed; there weren't that many.
  • I found and fixed lots of mismatched ]] pairs and a few other mismatched brackets. AWB warns me about unmatched square brackets, but gets confused when the name of one of the images contains an unmatched round bracket, so I still might have missed some.
  • File:Megalodon scale.svg comes with alt text from somewhere, which confused both the previous scripts and today's. I'll keep a special lookout for it next time.
  • I'll re-run the "vanilla" caption updater, on Tuesday if not before, and fix up the "multiple image" caption updater to work with the new format.

-- John of Reading (talk) 17:18, 5 April 2019 (UTC)Reply

Thank you! Excellent work. Fixing up those multi-image templates made an even bigger difference than I expected. Abyssal (talk) 17:30, 5 April 2019 (UTC)Reply
@Abyssal: I've updated both kinds of captions. I've made an edit to User:Abyssal/Image captions to use so that next time goes more smoothly. -- John of Reading (talk) 07:27, 8 April 2019 (UTC)Reply
@John of Reading: Thanks, John. Unfortunately, the vast majority of the changes I made to User:Abyssal/Image captions to use don't seem to have been implemented in this run. Abyssal (talk) 17:41, 8 April 2019 (UTC)Reply
@Abyssal: These things happen! Please post the name of an image and the name of an article where it wasn't updated, so that I can debug. -- John of Reading (talk) 18:28, 8 April 2019 (UTC)Reply

@John of Reading:Check out List of the Paleozoic life of Arizona. I noticed the images for the following taxa hadn't updated. Abyssal (talk) 19:46, 8 April 2019 (UTC)Reply

  • Elrathia
  • Euomphalus
  • Gnathorhiza
  • Kootenia
  • Pagiophyllum
  • Phlegethontia
  • Triodus
@Abyssal: OK, I've fixed the problem. I've made an edit to List of the Paleozoic life of Arizona and will run through the list again tomorrow. -- John of Reading (talk) 21:10, 8 April 2019 (UTC)Reply
@John of Reading: Thanks! Could you bulk insert a " | perrow = " field under the total width field in all the multiple image templates that don't have one? Also, could you run the caption updater again? I'm shrinkig all the image so that they'll be less distracting from the main text, prone to clutter, and more similar to the sizes used in the multi image templates. Sorry to be putting you through the ringer so much lately. Abyssal (talk) 18:54, 9 April 2019 (UTC)Reply
@Abyssal:   Done, I hope. Two of the entries in User:Abyssal/Image captions to use were changed from upright=1.5 to upright.5 during your search+replace. I've ignored those two, this time round; if you fix them up then the next run will deal with them. I've also taken more care, this time, to make sure that an update wasn't missed because "Image:" didn't match "File:". -- John of Reading (talk) 13:21, 10 April 2019 (UTC)Reply
@John of Reading:Good catch. I'll get to filling in those perrow fields now. Abyssal (talk) 14:51, 10 April 2019 (UTC)Reply