Module talk:Excerpt/Archive 2

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
Archive 1 Archive 2 Archive 3 Archive 4

Lua errors in portals

Here is a useful list of portal Lua errors, which I fixed occasionally by having the module handle more cases. The current crop is:

Certes (talk) 16:43, 22 May 2020 (UTC)

Thanks! Tomorrow I'll pause with the development of new features and focus on testing and debugging. Cheers! Sophivorus (talk) 18:32, 22 May 2020 (UTC)
@Certes: It seems that the only errors directly related to this module are the Longitude ones, correct? I created a test case at Template:Transclude lead excerpt/testcases2#Longitude error. As you said, it seems that for some reason the module isn't removing the infobox, but I haven't figured out why yet. Kind regards, Sophivorus (talk) 16:00, 23 May 2020 (UTC)
There may be two problems: one that causes infoboxes to be retained, and one in Module:Location map or in the way it's being used, seen even in Portal:Croatia/Indices which correctly hides the Vokovar infobox. Certes (talk) 17:25, 23 May 2020 (UTC)

Non-free files not being removed

The instructions on Template:Transclude lead excerpt indicated "Non-free images are removed." Except, they aren't. This template is now causing nearly all of the 112 non-free content violations on the daily nfcc9 report. --Hammersoft (talk) 23:42, 24 May 2020 (UTC)

Thanks for the report. This problem sounds serious and might merit temporarily reverting recent enhancements. Previous versions of the module devoted a substantial proportion of their code lines and CPU time to identifying and excluding non-free files. Certes (talk) 11:23, 25 May 2020 (UTC)
@Hammersoft and Certes: Indeed, thanks for the report. I looked into it and fixed it. What a single character can do! Sophivorus (talk) 13:14, 25 May 2020 (UTC)
Well done. That also seems to fix this report of spurious infoboxes appearing. Presumably a wanted templates lurk within the unwanted infobox. Certes (talk) 13:32, 25 May 2020 (UTC)
Thanks everyone! --Hammersoft (talk) 15:25, 25 May 2020 (UTC)

Revision history

 – * Pppery * it has begun... 23:17, 15 May 2020 (UTC)

Another issue I'm running into: excerpts don't seem to reflect accurately in revision histories, making it hard to see what an article was like at a given time. {{u|Sdkb}}talk 08:07, 8 April 2020 (UTC)

This is actually a MediaWiki core issue. If you view any page in the past, you'll notice that all the templates are transcluded as they are now, rather than as they were before. Same with files. Sophivorus (talk) 22:24, 7 May 2020 (UTC)
Yeah, I've noticed that before, but it's greatly exacerbated when excerpts come into the picture. Is it a solvable problem (i.e. should I file or find a phab ticket), or is it something that'd be technically impossible without significant changes to file storage/etc.? The issue is that changes to less-watched pages with poorer oversight have been showing up at more important pages through excerpts, and it's hard to detect them without them showing up in the revision history. {{u|Sdkb}}talk 23:06, 7 May 2020 (UTC)
A transcluded page may change several times between two adjacent entries in the edit history of the transcluding page. A page which was transcluded at the time may have been deleted. A portal which rotates content by including subpage /Selected Thing/month will transclude different pages from time to time without any edit. This may be a can of worms. Certes (talk) 23:39, 7 May 2020 (UTC)
@Certes: agreed — I recognize this is more in the "wish list" category. I guess the bigger theme I'm trying to get at is that excerpts introduce dynamics where changes to less sensitive areas can end up impacting more sensitive ones, and just as with templates, this introduces some risks for vandalism/etc. that we should be thinking about strategies to address. In my utopic vision for Wikipedia, we'd have a type of cascading protection, where you wouldn't be able to edit an excerpt unless you have the permission needed to edit the places it's excerpted. {{u|Sdkb}}talk 23:56, 7 May 2020 (UTC)
Recent research has produced old page versions processed with templates as they were at the time. (Search that link for WikiHist). Certes (talk) 20:49, 31 May 2020 (UTC)

Protection

@JJMC89: I see that you've protected this module at template-editor level. Unfortunately, that effectively ends maintenance and development on a module which was still being actively changed to handle new cases. (It parses wikitext, and a bulletproof implementation which handles every intricacy is not feasible in a Lua module.) I see no vandalism. Is pre-emptive protection at this level really necessary? Certes (talk) 11:20, 23 April 2020 (UTC)

@Certes and JJMC89: Agreed. Sophivorus, myself, and several others actively working on this are not (yet) template editors. ECP would be fine (any lower than that is a vandalism risk, given how widely transcluded this already is). - {{u|Sdkb}}talk 04:46, 24 April 2020 (UTC)
Protection does not stop development. Development should be happening in the sandbox, which is not protected. If no one working on it has the necessary rights to edit directly, then make an edit request (or request the rights if qualified). It is standard to protect modules at least the same level as a template that uses it, {{excerpt}} in this case. — JJMC89(T·C) 05:18, 26 April 2020 (UTC)
Thank you for the reply. This change does seem ironic in view of the fact that 90% of the use is in portals and we have spent the last year being constantly lectured about how portals are unimportant because no one reads them. I hope that I have provided a good start on which others can build. Certes (talk) 09:46, 26 April 2020 (UTC)
Thank you for all your work, Certes. I really appreciate this module and countless editors and readers will benefit from it, hopefully well into the future. This protection is really annoying, because although I can still edit the module per being a global interface editor, I may not always respond as quickly as required or desired. I wish and recommend you request the template editor permission. I'm not sure about the process here but you can count with my support. Cheers! Sophivorus (talk) 18:31, 28 April 2020 (UTC)
@JJMC89: thinking about it, given the potential impact disruption of the template would have, even given its somewhat modest adoption so far, TEP is probably warranted. I've been considering applying for WP:PERM/TE for a while given how active I am in the template space, and this moves me toward that. {{u|Sdkb}}talk 20:25, 28 April 2020 (UTC)

@Certes and Sdkb: Hi! I just requested the template editor permission because it seems that using my global interface editor permission for editing this template and module is misuse. Maybe you'd like to check out my request, leave a comment, and perhaps request permission yourselves? Sophivorus (talk) 13:43, 13 May 2020 (UTC)

Congratulations on obtaining the grant and thank you for the ping. I've been following events here but, as I have collected no hats beyond the automatic "extended confirmed", I doubt that my backing would carry much weight. Certes (talk) 14:06, 13 May 2020 (UTC)
@Sophivorus and Certes: Congrats on the grant, Felipe — I'm so happy to hear about that! Regarding the template editor perm, as it happens, I applied for and received that perm a few days ago, but an editor who I have disagreed with some in the past launched an ANI thread about my template editing, which was closed two hours later before I saw it with the PERM revoked. It's now awaiting additional comment below the initial close before it can be reclosed. {{u|Sdkb}}talk 14:40, 13 May 2020 (UTC)

They've even protected the sandbox now. Certes (talk) 18:28, 14 May 2020 (UTC)

@Certes: the transclusion search (here) shows the sandbox is being used on thousands of pages, so a bot protected it. Whatever is causing this should be resolved. — xaosflux Talk 19:07, 14 May 2020 (UTC)
Yeah, someone borked something - there's zero reason why the sandbox should be transcluded onto more than 3k pages. Will look into this. Primefac (talk) 19:11, 14 May 2020 (UTC)
@Primefac: Looks like this is related to Module:Excerpt/templates - @Sophivorus: why are you requiring the sandbox version in to this module? — xaosflux Talk 19:12, 14 May 2020 (UTC)
Which is getting pulled in via Template:Transclude lead excerpt and who know where else - in to thousands of pages. I don't have time to work on this right this min. — xaosflux Talk 19:14, 14 May 2020 (UTC)
Sophivorus, you've borked things good, and I don't have the time or patience to sort through everything you've done. As near as I can figure, you created Module:Excerpt/templates and then forced {{transclude lead excerpt}} to use it; the module calls Module:Excerpt/sandbox and when I removed that requirement it all went to hell. Rather than break everything, kindly get things to a point where the sandbox is not being called from Module:Excerpt/templates. Primefac (talk) 19:18, 14 May 2020 (UTC) Looks like things have been rolled back to use the main template. For what it's worth the sandbox was never more than semi-protected, but I've removed that now as well. Primefac (talk) 20:49, 14 May 2020 (UTC)
Thanks for the explanations, and sorry for opening a can of worms. Certes (talk) 22:27, 14 May 2020 (UTC)

I apologize for the unnecessary confusion. My request was declined, but no problem, it just means I'll have to request the edits like everyone else. Talking about that, since the update I was trying to make was not the simplest, and by now JJMC89, Primefac and Pppery seem most acquainted with it, may I request your help on this one? For your convenience, here's a briefing: the latest changes aim to split the module in two: one part for the general, abstract, cross-wiki functionality (the main module), and another part for the enwiki-specific functionality (the /templates submodule). To avoid any breakings during the update, my strategy was:

  1. Put the general, abstract, cross-wiki functionality in Module:Excerpt/sandbox
  2. Put the enwiki-speceific functionality in Module:Excerpt/templates
  3. Make /templates call /sandbox (temporarily)
  4. Update the templates so that they call /templates
  5. Once all the templates are calling /templates which calls /sandbox, update the main module to the latest /sandbox code (here I was when I was reverted)
  6. Finally, edit /templates to call the main module rather than /sandbox

Maybe I could have created /temp and use that instead of /sandbox and that would've prevented all this trouble? Or maybe you can come up with a better way still? If you don't feel like helping on this one, I'll understand and I can request someone else or simply forget the split, though it would be a shame since it's already coded and it would be useful. In any case, thanks for your time, gentlemen! Sophivorus (talk) 23:21, 15 May 2020 (UTC)

I think the only wrong you did was failing to revert yourself on step (4) after I reverted you on step (5), and the general strategy for rolling the change out was fine. * Pppery * it has begun... 04:05, 16 May 2020 (UTC)
@Pppery, JJMC89, Primefac, and Xaosflux: Hi! After some more debate, today I was granted the template editor permission. Thanks everyone! I'm now testing and debugging the latest features. If everything goes well, then in a couple days I'd like to deploy the changes so that editors may start to benefit. To avoid any trouble while deploying, I think I'll create staging submodules at Module:Excerpt/staging and Module:Excerpt/i18n/staging to avoid going through the sandbox. Kind regards, Sophivorus (talk) 14:33, 23 May 2020 (UTC)
You're always welcome to use a sandbox (that's what they're there for), the issue was that the "live" template ended up calling the sandbox when it shouldn't have been. Granted, you can call a "sandbox" anything you want, so I suppose carry on for now... Primefac (talk) 21:02, 23 May 2020 (UTC)

More non-production protections

FYI, I've reverted Sophivorus' protection on Module:Excerpt/i18n/staging and Module:Excerpt/staging, and asked that they no longer use GIE access. Whenever testing is done, any admin is welcome to roll tests to production and/or adjust protection levels as appropriate. — xaosflux Talk 16:11, 30 May 2020 (UTC)

@Pppery, JJMC89, Primefac, Xaosflux, and Swarm: Well, after days of testing and consensus-building, today I thought it'd be a good day for deployment. So I created the staging submodules I announced above, necessary due to breaking changes, and protected such staging submodules because during the update they were going to be live for some minutes on very high-traffic pages such as COVID-19 pandemic. I thought this would be reasonable, but it seems that protecting submodules is beyond my jurisdiction as a global interface editor. So I was reverted and asked to stop. Apologies for that, it seems my common sense was off. I don't want to screw up again, so I'd like to request someone else more familiar with the procedures of the English Wikipedia to please update the module to the latest version. I have explained above the procedure I recommend to avoid any breakings and I've done enough testing to be quite confident that the new version is stable, but please let me know if further explanations are required. Kind regards, Sophivorus (talk) 16:25, 30 May 2020 (UTC)

I consider myself too involved to implement this edit request (and I'm generally afraid of implementing large complicated edit requests), so won't do this myself, but I don't see why you can't do this yourself: you're trusted by the English Wikipedia community to edit template-protected templates, and the problems only arose when you tried to use rights you had not earned. * Pppery * it has begun... 16:35, 30 May 2020 (UTC)
I am a template editor and willing to help, but I have no familiarity with this module or the background discussions. Can someone please spell out the specific edit request (example: "Copy the contents of Module:X/sandbox to Module:X") and explain how to determine if something is broken after the request is carried out? Thanks. – Jonesey95 (talk) 17:41, 30 May 2020 (UTC)
@Pppery: No worries, I understand, I'm also scared now. @Jonesey95: Thanks! The remaining steps would simply be:
  1. Update the 6 templates using the module to their sandbox version. The sandbox version calls /templates, which in turn calls /staging which calls /i18n/staging
  2. Once all the templates are calling /templates, update /i18n to /i18n/staging
  3. Then update the main module to the latest /staging code and make it call /i18n instead of /i18n/staging
  4. Edit /templates so that it calls the main module rather than /staging
I'm confident nothing will break, but I'd check the most visited articles and portals using the templates to make sure, in particular COVID-19 pandemic and Portal:Coronavirus disease 2019. Thanks for your help, Sophivorus (talk) 19:07, 30 May 2020 (UTC)
@Jonesey95: Please hold on, I found a (minor) issue I'd like to solve, thanks. Sophivorus (talk) 19:52, 30 May 2020 (UTC)
 Bureaucrat note: @Sophivorus: please note, the injunction is only on your use of GIE permissions (such as the protect function) - you are free to make any productive edits, including edits to protected pages that your local access allows. — xaosflux Talk 21:11, 30 May 2020 (UTC)
@Pppery and Xaosflux: Very well, I'll deploy myself then after I fix an issue or two. Feel free to protect the staging submodules if you want to, since they'll be live for a few minutes. Kind regards, Sophivorus (talk) 13:39, 31 May 2020 (UTC)
@Pppery, Xaosflux, and Jonesey95: Deployment complete! Thanks everyone for your help and support. Protecting Module:Excerpt/templates would probably be a good idea since it's now used by all templates. Future deployments should be simpler and smoother. Kind regards, Sophivorus (talk) 13:42, 1 June 2020 (UTC)
I added TP to match the module. — xaosflux Talk 13:47, 1 June 2020 (UTC)

Deployment

Hi everyone! The new version is almost ready! Besides the split between the main module and the /templates submodule, the new version fixes references automatically (yay!), introduces the new (and still rather immature) tablesOnly and listsOnly features, includes considerable code restructuring aimed at making the module more modular, and other minor features and fixes. Once this new version is deployed, I'm confident that with the new separation of concerns and the improved testcases, development will become faster, easier and better than ever! But before that, we should ensure this deployment goes smoothly. All the testcases are looking good to me. The output for the new version is always identical, trivially different, or better. In some cases it may differ due to randomized content, but I think that's normal and not a problem. Tomorrow I'll do some more tests, but any additional testing by someone else would be most welcome. If everything goes well and no one objects, I'd like to deploy on Wednesday 27. Kind regards, Sophivorus (talk) 15:17, 25 May 2020 (UTC)

Hi! I'm finding some minor issues while testing the code on the Spanish Wikipedia, so I'll delay the deployment a few days until the code is stable. Kind regards, Sophivorus (talk) 16:59, 27 May 2020 (UTC)
 Done Sophivorus (talk) 14:55, 1 June 2020 (UTC)

Multilingual Templates and Modules

The following page may be of interest to editors adapting this module for use on other Wikipedias: mw:Multilingual Templates and Modules. Certes (talk) 10:00, 22 May 2020 (UTC)

Thanks, I'll do my best to follow that approach! Sophivorus (talk) 17:49, 22 May 2020 (UTC)
@Certes: Yesterday I started with this process at mw:Module:Excerpt, thanks for the heads up! Sophivorus (talk) 13:27, 8 June 2020 (UTC)

Next steps

Hi! After finally deploying the latest changes, I'd like to outline what I think will be my next steps, for the record and in case someone wants to comment or suggest changes.

  • Properly document the new features
  • Fix bugs that may arise with the new version
  • Improve the test cases of all the templates and modules using this module to ease future development
  • Refine the getTables and getLists methods to allow to get specific tables and lists
  • Encapsulate the code to get specific files and paragraphs into getFiles and getParagraphs methods
  • Continue making the module and methods more modular

So in short, I think the immediate roadmap is to improve existing functionality rather than adding new one. Due to my grant goals for June, I'll also now focus more on spreading this module to other wikis. Kind regards, Sophivorus (talk) 14:55, 1 June 2020 (UTC)

The |only= feature is neat! Right now, I'm trying to get only an infobox (taking the infobox (minus the photos) from COVID-19 pandemic to use at COVID-19 pandemic by country and territory). Any idea on how to do that? {{u|Sdkb}}talk 03:31, 12 June 2020 (UTC)
@Sdkb: I'm working on a general solution to this and other requirements. Your comment suggests I'm thinking in the right direction. Thanks for the motivation, I'll do my best to get it ready soon. Sophivorus (talk) 14:19, 12 June 2020 (UTC)

Is transclusion of the episode list rather than the lead from page Doctor Who (season 1) intentional? This was originally found at Portal:Doctor Who with template {{Transclude list item excerpts as random slideshow}}. Here's demo of plain {{Excerpt}}:

No.
story
No. in
season
Serial titleEpisode titlesDirected byWritten byOriginal air dateProd.
code
UK viewers
(millions) [1]
AI[1]
11An Unearthly Child"An Unearthly Child"Waris HusseinAnthony Coburn and
C. E. Webber (uncredited)
23 November 1963 (1963-11-23)A4.463
"The Cave of Skulls"Anthony Coburn30 November 1963 (1963-11-30)5.959
"The Forest of Fear"Anthony Coburn7 December 1963 (1963-12-07)6.956
"The Firemaker"Anthony Coburn14 December 1963 (1963-12-14)6.455
22The Daleks"The Dead Planet"Christopher BarryTerry Nation21 December 1963 (1963-12-21)B6.959
"The Survivors"Christopher Barry28 December 1963 (1963-12-28)6.458
"The Escape"Richard Martin4 January 1964 (1964-01-04)8.963
"The Ambush"Christopher Barry11 January 1964 (1964-01-11)9.963
"The Expedition"Christopher Barry18 January 1964 (1964-01-18)9.963
"The Ordeal"Richard Martin25 January 1964 (1964-01-25)10.463
"The Rescue"Richard Martin1 February 1964 (1964-02-01)10.465
33The Edge of Destruction"The Edge of Destruction"Richard MartinDavid Whitaker8 February 1964 (1964-02-08)C10.461
"The Brink of Disaster"Frank Cox15 February 1964 (1964-02-15)9.960
44Marco Polo"The Roof of the World"Waris HusseinJohn Lucarotti22 February 1964 (1964-02-22)D9.463
"The Singing Sands"Waris Hussein29 February 1964 (1964-02-29)9.462
"Five Hundred Eyes"Waris Hussein7 March 1964 (1964-03-07)9.462
"The Wall of Lies"John Crockett14 March 1964 (1964-03-14)9.960
"Rider from Shang-Tu"Waris Hussein21 March 1964 (1964-03-21)9.459
"Mighty Kublai Khan"Waris Hussein28 March 1964 (1964-03-28)8.459
"Assassin at Peking"Waris Hussein4 April 1964 (1964-04-04)10.459
55The Keys of Marinus"The Sea of Death"John GorrieTerry Nation11 April 1964 (1964-04-11)E9.962
"The Velvet Web"18 April 1964 (1964-04-18)9.460
"The Screaming Jungle"25 April 1964 (1964-04-25)9.961
"The Snows of Terror"2 May 1964 (1964-05-02)10.460
"Sentence of Death"9 May 1964 (1964-05-09)7.961
"The Keys of Marinus"16 May 1964 (1964-05-16)6.963
66The Aztecs"The Temple of Evil"John CrockettJohn Lucarotti23 May 1964 (1964-05-23)F7.462
"The Warriors of Death"30 May 1964 (1964-05-30)7.462
"The Bride of Sacrifice"6 June 1964 (1964-06-06)7.957
"The Day of Darkness"13 June 1964 (1964-06-13)7.458
77The Sensorites"Strangers in Space"Mervyn PinfieldPeter R. Newman20 June 1964 (1964-06-20)G7.959
"The Unwilling Warriors"Mervyn Pinfield27 June 1964 (1964-06-27)6.959
"Hidden Danger"Mervyn Pinfield11 July 1964 (1964-07-11)7.456
"A Race Against Death"Mervyn Pinfield18 July 1964 (1964-07-18)5.560
"Kidnap"Frank Cox25 July 1964 (1964-07-25)6.957
"A Desperate Venture"Frank Cox1 August 1964 (1964-08-01)6.957
88The Reign of Terror"A Land of Fear"Henric HirschDennis Spooner8 August 1964 (1964-08-08)H6.958
"Guests of Madame Guillotine"15 August 1964 (1964-08-15)6.954
"A Change of Identity"22 August 1964 (1964-08-22)6.955
"The Tyrant of France"29 August 1964 (1964-08-29)6.453
"A Bargain of Necessity"5 September 1964 (1964-09-05)6.953
"Prisoners of Conciergerie"12 September 1964 (1964-09-12)6.455

^† Episode is missing

References

  1. ^ a b Cite error: The named reference Doctor Who season 1 AllRatings was invoked but never defined (see the help page).

Also, the rightmost column header is displayed incorrectly by {{Transclude list item excerpts as random slideshow}}, showing up as <abbr style="color:white" title=" '"`UNIQ--nowiki-00000008-QINU`"' ">AI instead of AI. —⁠andrybak (talk) 09:33, 13 June 2020 (UTC)

@Andrybak: Doctor Who (season 1) contains <onlyinclude> tags, so a transcluding page sees only the episode list, which is therefore treated as the desired section. We could change that behaviour – it's explicitly coded that way and has caused similar queries elsewhere – but that might negatively impact other excerpts which rely on it.
I don't know what is happening to the AI column. For me, it displays correctly above but not in the portal. On my screen, the table just squeezes into the available width of of the portal column and may be overflowing slightly. {{Transclude list item excerpts as random slideshow}}, which uses a different module, may not handle horizontal scrolling well. Certes (talk) 11:03, 13 June 2020 (UTC)
Certes, thank you. The onlyinclude tags are there for generating List of Doctor Who episodes (1963–1989).
{{Transclude list item excerpts as random slideshow}} links to Module:Excerpt slideshow, which uses Module:Excerpt. I haven't looked at the code too closely, but the excerpt generation seems to be done by Module:Excerpt. —⁠andrybak (talk) 11:13, 13 June 2020 (UTC)
As elsewhere, onlyinclude presents a dilemma. A purist might argue that the selection of the episode list is specific to the 1963–1989 page, which should use labeled section transclusion or {{Excerpt}} instead so that other pages can transclude different parts of the same source pages.
I previewed the portal, replacing {{Transclude list item excerpts as random slideshow}} by {{Transclude lead excerpt | paragraphs=1-2 | files=1 | more=| Doctor Who (season 1)}}, which calls Module:Excerpt directly. The result is ugly and overflows its box on my screen (so the AI header is hidden behind another snippet in the right column) but (when I make that overlapping item semi-transparent) the AI header does render correctly. I think the problem we see in the portal must have something to do with the gallery assembly in Module:Excerpt slideshow. Certes (talk) 11:44, 13 June 2020 (UTC)

Bug reports and feature requests

As the use of excerpts multiplies, I'm starting to get some bug reports and feature requests, as well as ideas I come up with myself to improve this module. How should we track all these? For now I'm writing them down here, cheers! Sophivorus (talk) 19:48, 5 April 2020 (UTC)

  • Finish internationalization. Done at Module:Transcluder
  • Move localization to a separate JSON subpage.
  • Refine caption detection. Done at Module:Extract
  • Detect and remove self-links, especially redirects. When article A transcludes article B, if B contains a link to A, MediaWiki will detect that, mark it as a self-link and show it bold. This is fine, and the bold text can be removed via CSS. However, if article B contains a link to some redirect to article A, then MediaWiki will not detect it and the link will be shown blue, which is undesirable. The current solution is to just edit B and change the redirect for a straight link to A, but such changes are not always desirable and it would be better to detect and fix this from the module. Done at Module:Transcluder
  • Append references to the returned text, to avoid broken references. This is probably difficult to code, but fixing broken references is one of the main difficulties when using excerpts.
  • Prefix reference names with the included article's title to avoid conflicts with same-name references in the excerpting article.
  • Add a way to transclude fragments marked with <section begin=Name of fragment/> and <section end=Name of fragment/>, intended to be transcluded via the #lst parser function, in order to take advantage of all the extra goodies of this module.
  • Add a way to transclude a section including all subsections.
  • Add a way to transclude tables only, like there's a filesOnly option. Tables are excerpted quite a lot, so it would be awesome to be able to reuse them without having to worry about the text around them or having to add <section> or <includeonly> or <noinclude> tags.
  • Add a way to transclude lists only, like there's a filesOnly option. Lists are excerpted quite a lot, so it would be awesome to be able to reuse them without having to worry about the text around them or having to add <section> or <includeonly> or <noinclude> tags.
  • Improve table handling generally This is too general and difficult, it's better to improve the handling as needed.
  • Use a consistent style for naming functions, variables, etc. (some are camelCase, some are not)
  • Terminate prepended images by newline, so {|table, *list, :indent, etc. work at the start of the following excerpt.

@Certes and Sdkb: I created a Phabricator project for this module and the related templates in order to better track bug reports and feature requests. However, I'd like to ask if you also think this is the best way forward before migrating the open issues. Cheers! Sophivorus (talk) 13:54, 8 May 2020 (UTC)

@Sophivorus: I've subscribed to the project, but I barely use Phabricator myself. Certes (talk) 14:02, 8 May 2020 (UTC)
@Certes: I think in the end there was no real need or use for the Phabricator project for now. Sophivorus (talk) 14:57, 1 June 2020 (UTC)
@Certes, Sdkb, and Sophivorus: I agree that making people go to another site (where they have to create a login ID, and learn a new system) isn't how to handle template management on Wikipedia.  — SMcCandlish ¢ 😼  02:37, 17 July 2020 (UTC)

Attention! Please leave this section as-is and create new sections for bug reports and feature requests. Sophivorus (talk) 15:35, 18 July 2020 (UTC)

Transition to Module:Transcluder

Hi all! As I hinted above, I've been working on a general solution to many of the difficulties and requests I've been receiving and perceiving with excerpts: mw:Module:Transcluder (copied at Module:Transcluder) is a general-purpose transclusion engine, inspired on this module but largely rewritten to be fully abstract and cross-wiki. For a time I resisted creating a new module (I'm a big fan of reusing rather than remaking, as you may guess) but eventually I had to give up, there were just too many English and portal-specific assumptions for my skill level. The new module still lacks some functionalities and has some hacks and bugs I'm working on, but I wanted to share it already to maybe get some feedback and so that we may start discussing the best way towards a transition, if any.

My thoughts are as follows: I'm working on another submodule, which for now I call Module:Extract, which is basically an implementation of Template:Excerpt using Module:Transclude rather than Module:Excerpt. If the template is made to use that module, then that would only leave the "portal templates" (Template:Transclude lead excerpt, Template:Transclude linked excerpt, etc.) using Module:Excerpt, so I think it can be re-merged with Module:Excerpt/templates to perform the function it was originally intended to, namely to implement those templates and no more. Transitioning the portal templates to Module:Transclude is possible, but goes beyond my current capacity. I may eventually try it though.

What are the benefits of this transition to Module:Transclude? First, it would mean several new options, such as the possibility of including or excluding tables by id, templates by name, and others (see the module documentation for the full potential). But the main reason for this effort has been to make this whole idea truly cross-wiki. The new module was designed following mw:Multilingual Templates and Modules, so that users from all wikis will soon be able to collaborate on a shared module. Furthermore, the design of the new module is quite simple and "modular", which should further facilitate contributions by new developers. The transition, then, will also bring us many future benefits, fruit of the work and ingenuity of the wider community.

So anyway, thanks for reading and I look forward to your reply! Kind regards, Sophivorus (talk) 20:43, 24 June 2020 (UTC)

Hi again! The new Module:Transcluder is already live at the Spanish Wikipedia and no one noticed (that's good). Now I'm working towards the same goal here at the English Wikipedia, as explained above. I'm testing the new module by previewing articles with the new module and fixing bugs and issues as I notice them. In a few days, when I'm satisfied, I'll announce it here and give any interested user a chance to run some extra tests before deployment. Cheers! Sophivorus (talk) 16:03, 18 July 2020 (UTC)

Leading and trailing spaces

If you space apart the parameters, as many people do, e.g.: {{Excerpt| Wikipedia talk:Manual of Style/Capital letters | Concluded | subsections=no}}, then the thread name is misparsed as literally " Concluded", with a leading space. But we don't do section headings with leading spaces (if you encounter one, fix it), and this is not expected behavior of WP templates.  — SMcCandlish ¢ 😼  03:13, 17 July 2020 (UTC)
Update: It's actually worse than that, and renders as " Concluded ", with a trailing space too, which is just wrong: MW itself ignores such whitespace at the end of a section name.  — SMcCandlish ¢ 😼  03:18, 17 July 2020 (UTC)

@SMcCandlish: Thanks for the report. I just fixed it at the sandbox, as can be seen at Template:Excerpt/testcases#Sections. Soon it'll be live, hopefully. Cheers! Sophivorus (talk) 15:52, 18 July 2020 (UTC)
Huzzah!  — SMcCandlish ¢ 😼  01:10, 22 July 2020 (UTC)

Collapse templates not transcluded

I'm finding that in at least one case, this template is dropping a template from what it transcludes. At WT:NCCAPS, the top section is sectionally transcluded from the top section of WT:MOSCAPS, but it is losing the {{Collapse bottom}} at the end of it. So, the {{Excerpt}} ends up collapsing the entire WT:NCCAPS talk page after it. I had to manually put an extra, "orphan" {{Collapse bottom}} after the {{Excerpt}}, along with an HTML-comment explanation, for the interim at WT:NCCAPS. Same problem is also going to come up at WT:MOS, probably.  — SMcCandlish ¢ 😼  02:37, 17 July 2020 (UTC)
PS: This is with {{Excerpt|PageName|SectionName|subsections=yes}} format.  — SMcCandlish ¢ 😼  03:18, 17 July 2020 (UTC)

@SMcCandlish: Hi! Today I did some debugging on this issue (among others) and it looks like the new version doesn't suffer from it. Deployment should take place in a few days, hang on! Sophivorus (talk) 15:52, 19 July 2020 (UTC)
Great. Please let me know, so I can to remove the workaround {{Collapse bottom}} from that page.  — SMcCandlish ¢ 😼  01:11, 22 July 2020 (UTC)

Duplicate section names

When using {{Excerpt|PageName|SectionName|subsections=x}} format, what will this do when the page has two+ instances of the same SectionName? It would be desirable if it always used the first, because that is what MW itself does, e.g. when resolving a link to PageName#SectionName.  — SMcCandlish ¢ 😼  03:24, 17 July 2020 (UTC)

@SMcCandlish: Module:Transcluder, which aims to supersede this module, transcludes only the first section whenever there're two or more sections with the same title, as can be seen at mw:Module:Transcluder/testcases. I agree this is the desired behavior. As to the current Excerpt module, I'm not 100% sure but I think it also transcludes only the first section. If you know of any article with a repeated section name, let me know and I'd be happy to set up a test case. Sophivorus (talk) 13:34, 18 July 2020 (UTC)
It's easier to test with busy talk pages, which often have multiple sections named "Comments" and "Discussion".  — SMcCandlish ¢ 😼  01:12, 22 July 2020 (UTC)

XHTML style

Question: Does <section begin=Name of the fragment/> also work as <section begin="Name of the fragment" /> ?

The habit of doing that dies hard, and arguably should not die, for WP:REUSE reasons (parsers geared for that more detailed syntax may break without the quotes and space). This is why we tend to change <ref name=foo/> or <ref name="foo"/>, and <br> or <br/>, to (respectively) <ref name="foo" /> and <br />, even though MW's own parser does not require this.  — SMcCandlish ¢ 😼  02:48, 17 July 2020 (UTC)

@SMcCandlish: Yes, this module as well as Module:Transcluder can handle section tags with or without spaces, quotes or double quotes. Sophivorus (talk) 13:36, 18 July 2020 (UTC)
Schweet.  — SMcCandlish ¢ 😼  01:13, 22 July 2020 (UTC)

[ and ] in section titles

If the section to be sectionally transcluded by {{Excerpt}} has [ or ] characters in its heading title, there appears to be no way to use it. It barfs on the bare characters, and it also will not accept &#91; &#93; HTML character-entity escapes for them.  — SMcCandlish ¢ 😼  02:41, 17 July 2020 (UTC)
PS: This also was discovered while using {{Excerpt|PageName|SectionName|subsections=yes}} format.

@SMcCandlish: I just did a test case for this at mw:Module:Transcluder/testcases and it seems like the new version will not have this issue. If you know of any article here at the English Wikipedia that has square brackets at the title, please link me to it so I can add a test case to Template:Excerpt/testcases. Cheers! Sophivorus (talk) 14:26, 19 July 2020 (UTC)
I was seeing the problem when the section name had the characters. Not sure of page titles; might be testable in that parameter with a temporary userspace sandbox page.  — SMcCandlish ¢ 😼  01:10, 22 July 2020 (UTC)
@Sophivorus: PS – I'm not sure it's actually possible to put one of those characters in a page title, without URL-escaping it or something.  — SMcCandlish ¢ 😼  03:45, 25 July 2020 (UTC)
[ and ] can't appear in page titles, per WP:NCHASHTAG and mw:Manual:Page title. Of course, they can appear in section titles, as demonstrated in this section's header. Certes (talk) 09:22, 25 July 2020 (UTC)

New version

Hi everyone! I've been working hard on excerpts and I'd like to brief you on the situation. Thanks to Certes, I was made aware of mw:Multilingual Templates and Modules, a set of standards, conventions, techniques and tools to make modules and templates truly multilingual and cross-wiki. So after gathering some courage, I decided to rewrite excerpts to comply with said cross-wiki standards. This led me to create Module:Transcluder, a generic transclusion engine, as well as Module:Extract, a module that implements Template:Excerpt but using Module:Transcluder and complying with the cross-wiki standards.

So in a way, my goal has been to reimplement Template:Excerpt with something that on the surface does exactly the same, but on the background is fully multilingual and able to be deployed exactly the same on every wiki. The new version will also introduce several new features that you can read about in the documentation of the new modules (it would be too long to share everything here). The one key difference I should maybe mention is that the new implementation won't remove all "block level templates" by default like the current one does. Instead, undesired templates will have to be blacklisted at Module:Extract/config or through the upcoming 'templates' parameter. This will cause some output changes to some excerpts right after deployment, but I trust any inconvenience this may cause can be quickly fixed by blacklisting the offending template.

While I work on the final details, I'd like to share my preferred deployment strategy, to hopefully gather some feedback and consensus. Having Module:Excerpt, Module:Excerpt/templates and Module:Extract can be really confusing. Therefore, I'd like to merge Module:Excerpt and Module:Excerpt/templates into Module:Excerpt/portals, edit Template:Transclude lead excerpt &co to use Module:Excerpt/portals, and then move Module:Extract to Module:Excerpt. This would simplify the situation enormously.

What do you think? Thanks! Sophivorus (talk) 13:41, 24 August 2020 (UTC)

That sounds good as long as portals continue to behave as before, with the currently removed templates getting blacklisted and ideally with the special handling for awkward cases such as {{Nihongo foot}}. Thanks to Sophivorus and other contributors for all the good work. My version of Module:Excerpt was aimed solely at portals, but I agree that there are much wider applications that I didn't even attempt to address. I'm happy to treat my work as a proof of concept which I hope has provided some useful ideas for the more generic modules which can replace it. Certes (talk) 14:02, 24 August 2020 (UTC)
Indeed your work has been my guide and basis! Yes, my intention is that portals continue to behave exactly as before, cheers! Sophivorus (talk) 15:24, 24 August 2020 (UTC)
Hi again! I merged Module:Excerpt, Module:Excerpt/templates and Module:Excerpt/i18n into Module:Excerpt/portals and edited Template:Transclude lead excerpt &co to use it, all seems to have gone smoothly. Tomorrow I'll update the main Module:Excerpt to use the new version currently at Module:Extract. Kind regards, Sophivorus (talk) 18:49, 27 August 2020 (UTC)
Well, after much testing, I just started the final deployment, temporarily going through the Module:Excerpt/staging submodule. Kind regards, Sophivorus (talk) 12:41, 28 August 2020 (UTC)

Issues

Thanks for the update, Sophivorus. Unfortunately, I'm seeing some bugs still present. Looking at College_and_university_rankings#U.S. News & World Report college and university rankings, there's (a) a line-break issue that wasn't there before, (b) a non-free image being transcluded that wasn't before, and (c) possibly a displaytitle issue occurring (based on this edit that came up in my feed; Bdijkstra can hopefully clarify for us). If those things can't be resolved quickly, the new version should probably be rolled back until it's stable enough for deployment. {{u|Sdkb}}talk 19:06, 28 August 2020 (UTC)

@Sdkb: Thanks for the report, I'm on it. Sophivorus (talk) 19:28, 28 August 2020 (UTC)
The displaytitle issue was indeed fixed by that edit. I've now also added some line breaks and the image to the <noinclude> section, I hope that resolves the "bugs". --bdijkstra (talk) 19:30, 28 August 2020 (UTC)
@Bdijkstra and Sdkb: I improved Module:Transcluder so that it now filters out non-free images. I also added Template:DISPLAYTITLE and its aliases to the template blacklist at Module:Excerpt/config so that should also fix the display title issue. Let me know if you notice any other issues, I'm not able to do much testing myself right now. Sophivorus (talk) 19:37, 28 August 2020 (UTC)
Ah, the non-free image is still there. Give me a minute plz. Sophivorus (talk) 19:41, 28 August 2020 (UTC)
@Bdijkstra and Sdkb: Now yes, I think I got it. Thanks for your help and patience, and let me know if I still missed something! Sophivorus (talk) 19:53, 28 August 2020 (UTC)
@Sophivorus: There's another bug in this template: the "edit" link doesn't point to the section of the article that was transcluded. Jarble (talk) 20:04, 8 September 2020 (UTC)

Delete obsolete modules

Is there some reason that Module:Excerpt/templates and Module:Excerpt/i18n shouldn't be deleted, given that they've become unused as a consequence of this update. * Pppery * it has begun... 23:47, 5 September 2020 (UTC)

@Pppery: Yes, given that the update went well, they should be deleted, thanks! Sophivorus (talk) 00:42, 6 September 2020 (UTC)
I've tagged Module:Excerpt/templates for deletion per G7. However, Module:Excerpt/i18n was also edited significantly by Ahecht and Certes, so isn't eligible for G7 deletion unless they agree. * Pppery * it has begun... 02:13, 6 September 2020 (UTC)
My only edit is a one-line bug fix and I'm happy for its attribution to disappear. If the modules are no longer used and all of their useful code remains in other modules then let's delete them. Certes (talk) 10:33, 6 September 2020 (UTC)
If it's no longer being used, I have no issues with deletion. It took me a while to figure out that its function has basically been replaced by a combination of commons:Data:I18n/Module:Transcluder.tab and Module:Excerpt/config -- we should link to the Commons data somewhere in the documentation. --Ahecht (TALK
PAGE
) 23:26, 6 September 2020 (UTC)

list parameter

List parameter in mobile view is expanding by default. Portal:Australia.--Moxy 🍁 07:03, 13 September 2020 (UTC)

@Moxy: Hidden sections don't hide on mobile. Development for other purposes has resulted in the Lua to support portals effectively being copy-paste moved from Module:Excerpt to Module:Excerpt/portals. Can you remember how Module:Excerpt handled hidden lists on mobile? (I stopped following its progress when it became protected in April 2020.) #New version above explains the process, but I can't simulate the old version because its submodules have been deleted. That also makes it hard to see what's changed beyond reintegration of the deleted modules. Sophivorus may be able to help. Certes (talk) 10:41, 13 September 2020 (UTC)
One option is to enclose the list in some wrapper which prevents it from appearing at all on mobiles. I think <div class="navbar"> would do the job. That might be controversial, as the content is debatably not a navbar. Certes (talk) 12:24, 14 September 2020 (UTC)

Bug: Templates calling Table of Contents (TOC)

Hey, I was excerpting Ocean fertilization to Enhanced_weathering and it pulled over the template Template:TOC limit, which created a new TOC. Probably worth excluding anything that calls __TOC__ in any way. Sadads (talk) 12:02, 3 October 2020 (UTC)

@Sadads: Fixed, thanks for the report! Sophivorus (talk) 21:12, 4 October 2020 (UTC)

Denglisch bug

When I excerpted the content of International Space Station#Fleet operations to International Space Station programme#Fleet operations using the template, I found that a hatnote generated from the template is written in mixed German and English (Denglisch). Can someone fix this bug? --Soumya-8974 talk contribs subpages 06:32, 27 September 2020 (UTC)

I found the reason of this. If you add "only=paragraphs" in the template, the hatnote renders "Diese Absätze sind an excerpt from foo" instead of the intended "This paragraph is an excerpt from foo". --Soumya-8974 talk contribs subpages 09:48, 27 September 2020 (UTC)
@Soumya-8974: Fixed, thanks for the report! Sophivorus (talk) 15:13, 27 September 2020 (UTC)
Also, "Diese paragraphen sind" should be replaced with "Diese Absätze sind" to increase Germanism. --Soumya-8974 talk contribs subpages 10:27, 4 October 2020 (UTC)
Done, thanks again! Sophivorus (talk) 21:16, 4 October 2020 (UTC)

Propersal for re-styling the hatnote

I made a series of modification to improve the display the hatnote, to make it closer to {{Transcluded section}}. The new implementation was made in these steps:

  • Replace the squared brackets by rounded brackets, and add a comma and a space at the end of note and before the edit link.
  • Add additional class for styling.
  • Resize the edit link.

They are very simple changes, so feel free to apply my modification. -- Great Brightstar (talk) 05:20, 29 September 2020 (UTC)

 Not done for now: please allow a couple of days for other editors to comment on this proposal — Martin (MSGJ · talk) 10:39, 29 September 2020 (UTC)
@Great Brightstar: Thanks for the contribution! It isn't that simple because this module is now used on many wikis and it's desirable to keep cross-wiki compatibility. Please give me a few more days to evaluate your proposal and see if I can come up with a cross-wiki solution. Cheers! Sophivorus (talk) 15:15, 7 October 2020 (UTC)

7 October 2020

When I used the template and used "only=paragraphs" to excerpt no image. However, when I used "paragraphs=1" alongside this, the image becomes excerpted. It is problematic if the image is non-free. Plz fix it. --Soumya-8974 talk contribs subpages 09:37, 7 October 2020 (UTC)

@Soumya-8974: Thanks for the report! Can you link me to the problematic paragraph and file? Sophivorus (talk) 15:13, 7 October 2020 (UTC)
History of spaceflight#NASA --Soumya-8974 talk contribs subpages 15:38, 7 October 2020 (UTC)
@Soumya-8974: Fixed! Sophivorus (talk) 14:36, 8 October 2020 (UTC)

Transcluding non-free media

I just removed three WP:NFCC violations added by using this module. (Special:Diff/977651999, Special:Diff/977652158) This module should not be transcluding non-free media. — JJMC89(T·C) 04:23, 10 September 2020 (UTC)

@JJMC89: Indeed it should not. Thanks for the report and the fix, I'll look into it asap! Sophivorus (talk) 22:30, 10 September 2020 (UTC)
@JJMC89: I think I fixed this in the sandbox version. I'll deploy it over the next few days, cheers! Sophivorus (talk) 15:14, 7 October 2020 (UTC)
Deployed! Sophivorus (talk) 14:37, 8 October 2020 (UTC)

"Inline" parameter not functioning correctly

At Pomona College#Other traditions, the inline parameter is not functioning properly within a list, and is causing an unwanted line break. {{u|Sdkb}}talk 08:13, 26 October 2020 (UTC)

Jonesey95 fixed the issue by removing the bullet points, but the broader issue remains. See it at Special:Permalink/985495147#Other traditions. {{u|Sdkb}}talk 21:06, 26 October 2020 (UTC)

Provide more information to readers and editors?

Hi User:Sophivorus, I've discovered the excerpt tool now and am quite excited about it. I have two questions: (1) Would it be possible to somehow indicate where the excerpt starts and ends (i.e. not just in source editor but also visible for a normal reader)? I had that problem here, and had to insert a (non needed) section header to indicate where the excerpt ended: https://en.wikipedia.org/wiki/WASH#Diarrhea,_malnutrition_and_stunting . (2) Is it possible that for the page that is being excerpted that there is a note somehow somewhere (maybe on the talk page) to say: "this section (xxx) of this article has been excerpted to the following other articles: xxx". I think this could be useful so that if I am going to edit the lead of diarrhea then I would be made aware that the same text will also appear here. Thanks again for the work you are doing on this tool! EMsmile (talk) 01:49, 29 October 2020 (UTC)

Oh and a third question: what happens if an editor changes a section heading title and that breaks the excerpt on another page? i.e. when the excerpt doesn't take from the lead but from a section in the article. I think it would be useful if there was a warning in the article which is being excerpted so that an editor knows they have to fix also the link on the other side. E.g. if this is used: {{Excerpt|Sustainable development goals|Targets and indicators}} and then someone changes the section heading to "Targets", then the other command wouldn't work anymore. The editor wouldn't even know that they have just "broken" something. EMsmile (talk) 03:50, 29 October 2020 (UTC)
@EMsmile: Hi, I'm glad you're finding excerpts useful! (1) To mark the start and end of an excerpt, you can use either the "indicator" or "quote" parameters of the Template:Excerpt. (2) We could create a template, maybe a sidebox, to be used in the talk page of pages that are excerpted elsewhere. However I don't think it's possible to have the template automatically list all pages that transclude the page. Rather, the pages would need to be manually added as parameters to the template call (like the Template:Lua). Furthermore, the template would need to be manually added to the talk pages where you want to display it (have it magically appear on all pages being excerpted is not really possible). All this makes it rather difficult to implement and maintain, but if you want to do it anyway, go for it! Alternatively, I noticed that some users add an HTML comment to the sections that are excerpted elsewhere, to let other users know that their changes there will affect other pages. I think this may be a more effective technique, because it warns the user right on time. However, I generally dislike HTML comments in wikitext. (3) Broken excerpts get automatically added to the Category:Articles with broken excerpts. You can add the category to your watchlist to monitor and fix broken excerpts. I think this solution is proving to be quite effective! Sophivorus (talk) 16:21, 29 October 2020 (UTC)
Hi, @Sophivorus: thanks for your reply (also @Sadads:, FYI). I like the indicator option (had overlooked that earlier). I've never seen it before in action and wonder if other people would find it a distraction? I think it's useful, especially when the excerpt is within a longer section (and not its own section). I would probably argue that it should be the default option (indicator=yes as a default). But this has probably already been discussed elsewhere. The idea with the HTML comment seems to be a simple solution to let people know which parts of the article are used elsewhere. I have added it now to the article on diarrhea which is transcluded to the article on WASH. I have added it like this: <!-- FYI: The first and last paragraph of the lead are transcluded in the article on [[WASH]], see the section on health -->, is that the correct way of doing it?EMsmile (talk) 05:53, 2 November 2020 (UTC)
@Sophivorus: The other option could be a bot-added template somewhere on talk page or in sections (per EMsmiles recommendatioN), that updates using the various bits of reuse whenever something is on a page for a while. Sadads (talk) 13:08, 2 November 2020 (UTC)
After giving this some more thought, I seriously doubt most editors will read a template in the talk page before editing the transcluded section. I know I wouldn't, except maybe on very high-profile articles like COVID-19 pandemic. Thus I think the inline HTML comment is the most effective solution. That being said, I wouldn't recommend such comments by default or as a good practice, but rather as a one-off solution when the editor feels the need for them. Most edits to transcluded sections will improve the transcluding article too. Sophivorus (talk) 13:45, 4 November 2020 (UTC)

hatnotes

Sports in New York (state) has a hatnote about an incomming redirect. The lead of this is excerpted into Sports in the United States by state including the hatnote which doesn't apply or belong in this article. MB 03:08, 23 October 2020 (UTC)

@MB: I'm not 100% sure what you mean, but I just replaced all calls to #lsth in Sports in the United States by state for calls to Template:Excerpt. Did this fix what you meant? Sophivorus (talk) 14:00, 4 November 2020 (UTC)
Sophivorus, This was fixed by this edit. MB 15:43, 4 November 2020 (UTC)

Documentation length

I just added a section in the template documentation on inclusion control. I'm noting that the documentation is already so long, however, that it's pretty likely to get buried and not be read.

It might be a good idea to go through the documentation and streamline it to improve the organization and get it down to a more readable length. Some initial thoughts:

  1. The TemplateData and parameters list should be merged.
  2. The long examples make the documentation seem longer than it actually is and thus might discourage people from reading it. Do we really need to actually show e.g. the full lead for science to communicate that {{Excerpt|Science}} will transclude it?
  3. "Replacing Template:Main" and "Compared to #section" don't give a good sense of what that section is actually about. We also might want to separate the "here's the code to use to get this to work" information from the "here are good-practice editing flows to make best use of this" information.
  4. As much as the excerpt trees are cool, I'm not sure they help editors understand how to use the template, which is what the documentation is supposed to be for. We might want to move them to another page and just link that page briefly from the documentation.

Cheers, {{u|Sdkb}}talk 23:29, 22 October 2020 (UTC)

@Sdkb: Hi! I agree that the documentation is getting rather long and would be good to streamline it. However, I'm not sure about some of your proposals. (1) TemplateData is quite limited as to the amount of information it can convey. Getting rid of the parameters list would imply sacrificing a lot of useful information. (2) Here I totally agree. Maybe we could find shorter leads and examples? Or get rid of the examples section altogether? (3) Are you suggesting a simple change in the titles? (4) There used to be a Wikipedia:Excerpts page, but I merged it into this one to centralize information where it's most likely to be read by interested editors. Excerpt trees are currently a small thing here, but they are much more developed in the Spanish Wikipedia and may one day be so here too. Until then, I think giving them their own page would be giving them too much prominence, and at the same time hide them from view and thus reduce their chances of getting implemented. Overall, I think the most efficient way of reducing the documentation length would be getting rid of the examples section altogether. Maybe we could replace the links to the examples in the parameters list, with links to actual articles using the parameters? Kind regards, Sophivorus (talk) 13:35, 4 November 2020 (UTC)
1) Yeah, I wish TemplateParameters was a little better-developed. The only thing it seems to lack that the parameters list has is links to examples, though. And I saw somewhere a template that managed to find a way to include links in its TemplateParameters.
2) I think getting rid of it would be fine, or just describing what happens.
3) Title changes would help, although some deeper reorganization might be warranted.
4) Getting rid of duplicated help pages is definitely good, but I don't think it's possible to fully communicate everything we might like to about excerpts in documentation here, which is supposed to only be about the simple how-to of using the template. I just don't see how excerpt trees, even if they were more developed, aid someone considering adding their first excerpt to a page. Maybe Help:Transclusions might be a better place for it? {{u|Sdkb}}talk 19:27, 4 November 2020 (UTC)

Add a full stop to the end of the hatnote

The hatnote displayed at the top of the excerpt is a complete sentence, so I think it should end with a full stop (cf. {{About}}, {{Distinguish}} etc.). – Rummskartoffel (talk • contribs) 15:39, 6 November 2020 (UTC)

If I can jump on here, I think there could be a bunch of improvements to the hatnote. For instance, it'd be nice if specifying |hat=main or |hat=further produced an automatic {{main}} or {{further}} hatnote going to the article (and if appropriate, section) where the content was transcluded from. I do think we'll need to have some large community discussion at some point about how explicitly we want to mark excerpts for readers. {{u|Sdkb}}talk 21:05, 7 November 2020 (UTC)

only=file doesn't work with infobox images

This issue was noticed at Robotic spacecraft § SpaceX Dragon.

When Module:Excerpt is called with |files=number, where the number is greater than zero, it tries really hard to find some files. First it checks if wikitext returned by Module:Transcluder has file markup. If that didn't work, it tries to find a template, which might refer to a file, like an infobox.

However, the same thoroughness isn't applied to the calls with |only=file. The module returns too fast to report an "Lead section is empty" error. For a test, see "|only=file from an infobox" at Template:Excerpt/testcases#Files. Here's a possible fix which hasn't been thoroughly tested yet: Special:Diff/982497450/986858308. —⁠andrybak (talk) 12:09, 3 November 2020 (UTC)

@Andrybak: Thanks for the report and fix! I tested your changes on the global module and the testcases look ok. The local testcases also look fine. Gimme a day or two and I'll deploy it, cheers! Sophivorus (talk) 13:16, 4 November 2020 (UTC)
@Sophivorus: thanks for checking. I haven't spent much time thinking about it, but please pay attention to the fact that in my diff, the first changed if just checks the presence of parameter only, while the second compares it against two particular values (file or files):
if mw.text.trim(excerpt) == '' and not only ...
-- versus
if ((only == 'file' or only == 'files') ...
It's possible that the first if ought to be more strict. —⁠andrybak (talk) 15:02, 4 November 2020 (UTC)
@Andrybak: Deployed. You may be right about the first if, but I don't think it'll bring any trouble and I don't quite see the proper way to do it, so your code as-is will do for now. Cheers and thanks again! Sophivorus (talk) 13:54, 17 November 2020 (UTC)

Named references

This template doesn't transclude named references correctly if they aren't defined within the transcluded sections. See, for example User:Kennethaw88/sandbox2, which excerpts from User:Kennethaw88/sandbox3. It tries to transclude the named reference, but since the reference definition is outside of the transclusion, the markup gets corrupted. This doesn't happen if the reference is defined within the transclusion (either named or unnamed). This happened for real at Lost Cosmonauts, which transcludes a few paragraphs of Vladimir Ilyushin. My solution was to move the references around in the latter, but that's not a good long-term fix. I don't know if this is easy or even possible to fix, but should the documentation mention reference issues like this? references=no is listed as an option, but it doesn't say why it would be useful. kennethaw88talk 16:32, 17 November 2020 (UTC)

Yeah, echoing kennethaw88s concern here, this error can also be seen in the following articles using this template: Coal mining (ref #92), Climate change in China (refs #14 & 15), Botswana (refs #129 & 131), Adderall (ref #135), Alberta (ref #116), Astra (aerospace) (refs #10, 11, 12 & 13), and a slew of other articles listed in Category:Pages with citations using unsupported parameters, with Template:Excerpt and Template:Excerpt/doc being listed there as well. I also agree that moving the references around is not a good long term fix. Isaidnoway (talk) 12:00, 18 November 2020 (UTC)
@Kennethaw88, Isaidnoway, and Pppery: Thanks all. Pppery recently reverted a change done to Module:Transcluder that seems to have fixed these issues. For the record, that change was done to fix another error with references that was causing trouble in the Spanish Wikipedia, but the fix seems to have caused more issues than it solved, so the revert is ok. I'll work on a better fix eventually. Kind regards, Sophivorus (talk) 12:27, 19 November 2020 (UTC)

Facing a problem

Hi, I tried to excerpt a section from Wikipedia:Version 1.0 Editorial Team/Lanka Premier League articles by quality log in Wikipedia:WikiProject Lanka Premier League#Assessment. But failed and it shows some text like 'Section December 6, 2020 is empty'. Whereas the section isn't empty. How can I transclude this section. Thank you. Empire AS Talk! 07:51, 6 December 2020 (UTC)

The section consists entirely of subsections, which do not appear by default. I've added |subsections=yes to fix that. Certes (talk) 11:31, 6 December 2020 (UTC)
Certes, thank you for fixing that. I didn't understand that problem. Thanks again. Empire AS Talk! 11:49, 6 December 2020 (UTC)

Possible percent sign issue in reference body

Please join the discussion at Talk:Fossil fuel phase-out § Using excerpt from Wind power. —⁠andrybak (talk) 18:47, 12 December 2020 (UTC)

See also Wikipedia:Help desk#invalid capture index %2 in replacement string Chidgk1 (talk) 18:58, 12 December 2020 (UTC)
Fixed! Sophivorus (talk) 15:02, 13 December 2020 (UTC)

 You are invited to join the discussion at Wikipedia:Village pump (technical) § Bug report for {{Excerpt}}. Issue is resolved, but there's some potential need for documentation improvement. {{u|Sdkb}}talk 10:05, 23 December 2020 (UTC)

Tag for excerpt removal?

 You are invited to join the discussion at Wikipedia:Edit filter/Requested § Excerpt/transclusion removal. {{u|Sdkb}}talk 12:05, 10 January 2021 (UTC)

Error with photomontage

See https://en.wikipedia.org/w/index.php?title=User:Sdkb/sandbox/testpage&oldid=1005720223; the "File:" inappropriately displays. {{u|Sdkb}}talk 03:03, 9 February 2021 (UTC)

Bug - infoboxes are being included

Hello friends. In the documentation, it says that infoboxes aren't supposed to be included by default. However, when I have been using excerpt lately, they have been getting included. For example, here. Can you look into it and possibly fix? Thank you. –Novem Linguae (talk) 14:31, 14 February 2021 (UTC)

Never mind. This ended up being a non-infobox template displaying a bunch of stuff. I will probably use <noinclude> tags to get around it. –Novem Linguae (talk) 14:39, 14 February 2021 (UTC)

Issue with other templates

The parameter references = no doesn't remove references coded via {{r}} template. Please, fix it. Maybe the same happens with similar templates too, namely {{efn}}, {{sfn}}, {{sfnp}}. Est. 2021 (talk · contribs) 15:19, 8 February 2021 (UTC)

@Est. 2021: Thanks for the report. This is not an easy fix, but I'll add it to the backlog. In the meantime, maybe you can get around it by using the "templates" parameter to exclude the templates you don't want. Sophivorus (talk) 21:53, 22 February 2021 (UTC)

Incomplete transclusion

 Done

Pinging @Sophivorus and Matt Fitzpatrick: I noticed that excerpt has stopped accurately transcluding election boxes by omitting two rows, "Total formal votes" and "informal votes", but it is not clear to me why. This affects numerous election result articles and a random example is Electoral results for the district of Albury, which excerpts sections from multiple articles, including

Examples
1976 New South Wales state election: Albury[1]
Party Candidate Votes % ±%
Liberal Gordon Mackie 13,195 58.2 +1.5
Labor Kevin Esler 9,498 41.8 +6.8
Total formal votes 22,693 98.4 +0.1
Informal votes 361 1.6 -0.1
Turnout 23,054 92.2 -0.7
Liberal hold Swing -6.2
What the excerpt should look like is
1976 New South Wales state election: Albury[2]
Party Candidate Votes % ±%
Liberal Gordon Mackie 13,195 58.2 +1.5
Labor Kevin Esler 9,498 41.8 +6.8
Total formal votes 22,693 98.4 +0.1
Informal votes 361 1.6 -0.1
Turnout 23,054 92.2 -0.7
Liberal hold Swing -6.2

References

  1. ^ Green, Antony. "1976 Albury". New South Wales Election Results 1856-2007. Parliament of New South Wales. Retrieved 4 May 2020.
  2. ^ Green, Antony. "1976 Albury". New South Wales Election Results 1856-2007. Parliament of New South Wales. Retrieved 4 May 2020.

The election results all use templates for consistent formatting, starting with {{Election box begin}}, the relevant rows being omitted use {{Election box formal}} and {{Election box informal}}, neither of those templates have changed in years & I can't see anything different about those templates and the following {{Election box turnout}} which excerpts correctly. --Find bruce (talk) 00:46, 22 February 2021 (UTC)

@Find bruce: Hmm! It's a mysterious bug indeed, I don't see what could be going on yet. However it's very late right now and tomorrow Monday I have quite a full day, but I'll try to find time for this or else I'll look into it on Tuesday. Thanks for the report! Sophivorus (talk) 02:53, 22 February 2021 (UTC)
@Find bruce:@Pbsouthwood: I think I found what's causing both your problems. See Module:Excerpt/config. Coord is blacklisted, and formal votes/informal votes is also blacklisted (due to matching "for"). I'll fix formal votes/informal votes presently, though Coord will take some thought and maybe some discussion. Matt Fitzpatrick (talk) 05:26, 22 February 2021 (UTC)
Matt Fitzpatrick Thanks, have you seen Sophivorus's explanation and suggestion above? · · · Peter Southwood (talk): 04:01, 23 February 2021 (UTC)

Bug report: Failure to display templated content in fragment and parameter problem

See diff:

Parameter |article= does not work, but |1= causes partial transclusion of the fragment. The list text is transcluded in original bulleted format, but the geographical coordinate {{coord}} templates are all left out. The template documentation states By default all elements are transcluded., and templates are one of the elements for which an |only= parameter is mentioned, so I don't think I am misinterpreting the function when I expect the coordinates to be displayed in the transclusion. Cheers, · · · Peter Southwood (talk): 09:17, 3 February 2021 (UTC)

The article parameter was not specified
In order to fix the issue Peter Southwood mentioned, implement the change in Special:Diff/1004830694, I added an testcase on Module:Excerpt/testcases that shows the fix works (it is the second "2020 coronavirus pandemic in France" entry").--Snaevar (talk) 16:32, 4 February 2021 (UTC)
 Done Thanks! Looks like the article parameter did nothing before. Matt Fitzpatrick (talk) 02:47, 20 February 2021 (UTC)
@Pbsouthwood: Welp, that fixes |article=, but the coordinates templates are still omitted. Hmmmm. Matt Fitzpatrick (talk) 02:54, 20 February 2021 (UTC)
@Pbsouthwood and Matt Fitzpatrick: Hi! The reason why the Template:Coord is not transcluded, is because it's blacklisted at Module:Excerpt/config. This was already documented somewhere on the template documentation but I just clarified it again where you were reading. The Coord template is blacklisted because in most cases you don't want it transcluded. However if in some particular case you do want it transcluded, you can override the template blacklist by using the "templates" parameter. You can also transclude just the Coord template by setting only=template and template=Coord Hope this helps, kind regards, Sophivorus (talk) 21:50, 22 February 2021 (UTC)
Thanks Sophivorus, I wasn't expecting anything like that so did not think to look for it. I will see if I can work out how to override using the "templates" parameter. · · · Peter Southwood (talk): 03:51, 23 February 2021 (UTC)
Works fine. Not broken, just needed correction to misleading documentation. Thanks, · · · Peter Southwood (talk): 04:21, 23 February 2021 (UTC)

Suggestion - option to strip out maintenance tags

Hello. Any interest in adding a parameter to this template/module to strip out article and section maintenance tags? If an article's lead is getting excerpted, and the article has a bunch of maintenance tags, it seems to me like they would just clutter the section where excerpt is being used. Thoughts? Thanks. –Novem Linguae (talk) 14:32, 14 February 2021 (UTC)

@Novem Linguae: Do you mean things like Template:Unreferenced? If so, the some of these templates are already blacklisted at Module:Excerpt/config. If you want any other template blacklisted, just let me know, cheers! Sophivorus (talk) 21:56, 22 February 2021 (UTC)
Sophivorus, thanks for your reply. Here's some templates that might be worth blacklisting:
  • lead missing
  • lead rewrite
  • lead too long
  • lead too short
  • Campaignbox
  • 2021 storming of the United States Capitol
  • If you really have some time to burn, you could install Twinkle, open a random article, click TW->Tag, and blacklist all the tags
Hope that helps. Thanks. –Novem Linguae (talk) 07:39, 23 February 2021 (UTC)
@Novem Linguae: Done! I don't currently have that much time to burn. Adding templates reactively, as users request them, has worked fairly well until now. Cheers! Sophivorus (talk) 12:19, 24 February 2021 (UTC)

Undesirable whitespace when excerpting an article with multiple templates at the top

Please see User:Novem_Linguae/sandbox2. There is an extra line break (enter character) between "This article is an excerpt of X" and the first sentence. As a band aid fix, one can add noinclude tags around all the templates at the top of the included article. However, it would be cleaner if this worked smoothly without having to add noinclude tags to articles. Should we attempt a fix on the template side? Is there some kind of trim() function we can run on this in template code or in lua? Thank you. –Novem Linguae (talk) 05:06, 30 March 2021 (UTC)

@Novem Linguae Fixed! The Lua module was already doing the trimming. The extra line break in this case was because Template:Italic title was being silently transcluded, so I just added it to the blacklist. Thanks for the report! Sophivorus (talk) 14:10, 30 March 2021 (UTC)

Hidden anchors in section title

Thank you for this template. It seems to not recognize section titles containing template:anchor. For example. I had to move the anchor to be able to get an excerpt from Neurobiological effects of physical exercise#Exercise-induced euphoria. fgnievinski (talk) 18:54, 4 April 2021 (UTC)

@Fgnievinski In such cases, you'd need to include the wikitext of the anchor, like so: {{Excerpt|Article|{{Anchor|Foo}} Section}}, cheers! Sophivorus (talk) 20:38, 12 May 2021 (UTC)
@Sophivorus: understood, thank you! fgnievinski (talk) 20:40, 12 May 2021 (UTC)

Intentionally bold

I am looking to keep some text intentionally bold & prevent it from creating a link to the article. In the example below each of the (elected X) are intended to be bold & shouldn't be replaced with a link to the title. Using html tags <b>(elected 1)</b> works to give (elected 1) in the example below. Is this the best way or do I need to create a specific template such as {{Election box winning candidate AU party}} ? --Find bruce (talk) 21:23, 30 March 2021 (UTC)

@Find bruce Is this still an issue? I just added documentation for the "bold" parameter that can be used to preserve bold text. It doesn't prevent automatic linking though, but I can also add that functionality if requested. Let me know, cheers! Sophivorus (talk) 20:35, 12 May 2021 (UTC)
Fixing it through the module doesn't seem to me to be a priority as the replacing bold with a link is a great feature that works in the vast majority of cases and html tags appear to be working fine. Perhaps a parameter such as bold-link=no would work, but as I don't know much about modules that may create other issues. Cheers --Find bruce (talk) 21:22, 12 May 2021 (UTC)
Example
1920 New South Wales state election: Balmain
Party Candidate Votes % ±%
Quota 5,147
Labor John Storey (elected 1) 7,527 24.4
Labor John Quirk (elected 3) 3,137 10.2
Labor Robert Stuart-Robertson (elected 4) 2,821 9.1
Labor Tom Keegan (defeated) 2,603 8.4
Labor John Doyle (elected 2) 2,336 7.6
Nationalist Robert Stopford 3,911 12.7
Nationalist Albert Smith (elected 5) 3,016 9.8
Soldiers & Citizens Campbell Carmichael (defeated) 2,590 8.4
Soldiers & Citizens George Saunders 100 0.3
Soldiers & Citizens Charles Shields 28 0.1
Democratic Charles Lawlor 2,252 7.3
Socialist Labor William Corcoran 81 0.3
Socialist Labor James Moroney 59 0.2
Socialist Labor Peter Christensen 26 0.1
Socialist Labor Herbert Weston 13 0.1
Independent Arthur Griffith 165 0.5
Independent Henry Levy 93 0.3
Independent Solomon Amein 60 0.2
Independent George Nielsen 60 0.2
Total formal votes 30,878 86.4
Informal votes 4,845 13.6
Turnout 35,723 54.3
Party total votes
Labor 18,424 59.7
Nationalist 6,927 22.4
Soldiers & Citizens 2,718 8.8
Democratic 2,252 7.3
Socialist Labor 179 0.6
Independent Arthur Griffith 165 0.5
Independent Henry Levy 93 0.3
Independent Solomon Amein 60 0.2
Independent George Nielsen 60 0.2

First long paragraph

Quite often, articles start with a warning or simply an information sentence, directly in a paragraph, not in a template. It'd be interesting to have an option to select only among paragraphs greater than a specified size (in characters or words) to skip over these. E.g.:

| min=10

— 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 00:51, 18 May 2021 (UTC)

What you are suggesting will create an issue any time a person edits the target article to add or remove a word. There are at least 2 existing ways to do what you are after, by editing the target article. (1) use the tags <noinclude> and </noinclude> to exclude the sentences you don't want to excerpt or (2) use the tags <section begin=name of the fragment/> and <section end=name of the fragment/> to mark the sections you want to include & use the parameter |fragment=name of the fragment. The benefit of these ways are that they are obvious to editors in the target article. --Find bruce (talk) 01:46, 18 May 2021 (UTC)
What you are suggesting will create an issue any time a person edits the target article to add or remove a word.
Is the issue that the function will update its results accordingly (perhaps switching to an earlier or later paragraph)? That's the intention, not an issue. If I wanted to transclude tagged fragments, I'd just use good ole {{#lst}}. — 𝐆𝐮𝐚𝐫𝐚𝐩𝐢𝐫𝐚𝐧𝐠𝐚 (talk) 06:51, 18 May 2021 (UTC)

Reference parameter and related

Hi, I was trying to fix some transcusion related reference name errors at COVID-19#Transmission and noticed what seems to be a bug (I may also be missing something and guidance is welcomed in that case). "|references=yes" seems to behave in the same way as "|references=no" and still transcude a minor part of references (couldn't figure out what made them different), while no parameter at all works as expected. Also the ref giving the error is the same that is correctly transcuded before. Some simple tests can be found in the history of User:Personuser/sandbox, but using something simplier is probably better if it's a real issue. Personuser (talk) 19:56, 12 May 2021 (UTC)

@Personuser Hmm I did some tests and also couldn't figure out what's different about those references. If you or anyone else figures it out, please let me know and I'll be happy to fix it! Sophivorus (talk) 20:26, 12 May 2021 (UTC)
The references which remain seem to be one of a pair of references at the same point in the text. Single references are removed correctly. Certes (talk) 21:41, 12 May 2021 (UTC)
Thanks for the fast responses. The problem seems to be that references defined in other parts of the article are fixed/filled in, which is great, but not when you don't want to transclude references at all. A more minimalistic test (could be prettier, but it should already be a lot more readable than the previous one). The other issue is that I believe |references=yes should work the same as no parameter at all, but this seems either easier to fix or requiring just some clarification in the template page. Personuser (talk) 02:53, 13 May 2021 (UTC)
The version transcluding all refs had also some trouble with the ref "ecdcTransmission". This is defined in a not transcluded part and seems identical to "ecdcTransmission3", which is defined in the transcluded part, with the exception of some spaces. A similar duplicate ref (":10" and ":1022") didn't have problems, both were defined in the transcluded part and didn't differ by whitespace. The best solution in this cases would be merging the refs in the source article and since reproducing the issue seems viable, that's what I will soon attempt to do. Personuser (talk) 15:37, 13 May 2021 (UTC)
The problem with the duplicate refs seems to have to do only with similar ref names (at least starting the same way). Reproduced it in simple form on my Sandbox. Relevant diff (it will probably now stay this way for some time) Personuser (talk) 18:01, 13 May 2021 (UTC)

Hi. I just wanted to say that I also had problems transcluding excerpts with the reference=no parameter. There are references who don't transclude (as expected) but there were others (probably the duplicated references or the used twice) that didn't disappear as it was hoped. Thank you. Osmanvielma (talk) 03:16, 20 May 2021 (UTC)

Yes. The problem seems to be when the reference is defined in other section (and used more than once) Osmanvielma (talk) 04:08, 20 May 2021 (UTC)

excerpt vs. #section

I thought these two might be equivalent, but apparently not; see the edit summary here. I'm not after an answer here, but I thought I would mention this in case it is of interest. Wtmitchell (talk) (earlier Boracay Bill) 15:12, 21 June 2021 (UTC)

How to not transclude the infobox from the lead?

I can't figure out how to use the excerpt function when I don't want the infobox to be transcluded as well. I have tried "file=no" but this only means a normal image is not transcluded from the lead but it still transcludes the infobox. I've tried "infobox=no" but didn't work. I've also tried "template=no" and this resulted in the infobox not being transcluded but instead it gave me a reference error. You can see my attempts here. Please help?EMsmile (talk) 02:03, 22 June 2021 (UTC)

Is the lead transcluded on other articles? If not, one way of achieving your result is to edit the target article by placing the infobox inside <noinclude></noinclude> tags, which I have done for the Template:Food safety at the target page.
Another way is to name the paragraphs you want to excerpt with tags, eg <section begin=Hygiene /><section end=Hygiene /> and then excerpt using {{excerpt|Food hygiene|section=Hygiene|file=no}} --Find bruce (talk) 02:30, 22 June 2021 (UTC)
Thanks Find bruce, much appreciated! I hadn't thought of modifying the source article in that way. Hopefully this will not lead to confusion to other editors (who are unfamiliar with excerpts) later. Is there a way of checking whether a lead is transcluded on other articles? The excerpt tool is still quite novel, isn't it? Do you think it will eventually also be used for WP:FA articles or only for regular / lower quality articles? EMsmile (talk) 03:30, 22 June 2021 (UTC)
Special:Whatlinkshere shows transclusions, and can hide links and redirects to make transclusions more visible. Example. Certes (talk) 09:54, 22 June 2021 (UTC)

Ignore section hatnotes

Thanks for such a great template. I notice that it already properly ignores some section hatnotes, such as see also. Can you make it ignore template:broader, too? See an example here: List_of_passive_satellites#Dedicated_laser_ranging_satellites. Thank you. fgnievinski (talk) 21:33, 9 July 2021 (UTC)

@Fgnievinski  Done --Ahecht (TALK
PAGE
) 17:57, 10 July 2021 (UTC)

Thank you so much! fgnievinski (talk) 05:16, 11 July 2021 (UTC)

How to stop bullet points from lead to be transcluded?

I've noticed that when I use this {{excerpt|Hand washing|paragraphs=1}} it takes the first paragraphs of the lead (good) but it also takes the bullet point list that comes a bit later. As a work-around I tend to change the lead so that it has no bullet point lists but I might not always be able to do that. Could you fix it so that a bullet point list doesn't get transcluded when it's not in the paragraph that is meant to be transcluded? EMsmile (talk) 02:07, 22 June 2021 (UTC)

@EMsmile Lists are transcluded because they aren't considered paragraphs by the software. You can avoid this by adding lists=0 or alternatively by adding only=paragraphs. Cheers! Sophivorus (talk) 05:51, 11 July 2021 (UTC)

A way to stop transcluding the infobox image?

Is there any way to stop transcluding the infobox image? Aeonx (talk) 04:23, 30 July 2021 (UTC)

Aeonx, try {{Excerpt|Article name|files=0}}Novem Linguae (talk) 04:27, 30 July 2021 (UTC)
Doesn't seem to work.[1]. What i'm trying to do is remove the Pfizer vial (which is the infobox image) from automatically generating after the excerpt on COVID-19 vaccination in Australia. Aeonx (talk) 04:35, 30 July 2021 (UTC)
Aeonx, I think you may have added files=0 to the wrong excerpt. I added it to the other one and I think it's working now. Hope that helps. –Novem Linguae (talk) 05:21, 30 July 2021 (UTC)

Large excerpts

The template has been great for dealing with election results in Australia which are included as both individual election pages, eg Results of the 2019 New South Wales state election (Legislative Assembly) and electoral district pages, eg Electoral results for the district of Parramatta. A problem has arisen with pages with lots of excerpts - Parramatta for example has been around since 1856 and has 65 elections and by-elections - and currently shows 33 excerpts before giving the error message The time allocated for running scripts has expired. Any suggestions on how best to resolve the issue? --Find bruce (talk) 23:45, 9 August 2021 (UTC)

@Find bruce: For transcluding entire sections unchanged, Labeled section transclusion may achieve a similar result with fewer resources. Alternatively, each result could have its own template transcluded in both the year and district pages, as in Canada (example). Certes (talk) 23:55, 9 August 2021 (UTC)
Thanks @Certes: labelled section transclusion is a bit clunky, which is why I was pleased when this template was created. On Electoral results for the district of Parramatta it's easier to keep the template for by-elections due to reference naming issues & add in formatting to get the same appearance, but it's acceptable as a workaround - I don't think any of the pages have 30 by-elections. The template suggestion is interesting, but the idea of creating thousands of templates doesn't fill me with enthusiasm. --Find bruce (talk) 00:55, 10 August 2021 (UTC)
@Find bruce Hi! Another approach is to just make the modules more efficient. Recently @Johnuniq has made several performance improvements to Module:Transcluder that allow for more excerpts before the errors begin. There're still more improvements that could be done, as well as to Module:Excerpt, and when I resume work on the modules I'll be sure to improve performance and let you know. Cheers! Sophivorus (talk) 22:27, 12 August 2021 (UTC)

Two bug reports

  1. To be consistent with other hatnotes, the module should insert a period at the end of full sentences. For example, "This section is an excerpt from Energy in Botswana."
  2. On mobile view, this hatnote's font size is weirdly small (and below MOS:SMALL's guideline). See an example here, and compare to the "Main article: Economy of Botswana" hatnote in the section above it, which is normally sized. — Goszei (talk) 08:19, 20 August 2021 (UTC)
    @Goszei All fixed, thanks for the report! Sophivorus (talk) 14:42, 22 August 2021 (UTC)

How can I find out which other articles now include an excerpt from a particular article?

How can I find out which other articles now include an excerpt from a particular article? In particular, I'd like to know which other articles now include excerpts from ocean acidification and sea level rise? I am asking because I think knowing this could motivate content experts to help with those two articles, i.e. knowing that if I update the content in one place, it will also be updated in a dozen other articles, too. This is so important for the climate change related articles where numbers change so quickly over time. Pinging also Femkemilene, sadads. EMsmile (talk) 02:07, 19 August 2021 (UTC)

@EMsmile So you look at WhatLinksHere for transclusions: https://en.wikipedia.org/w/index.php?title=Special:WhatLinksHere/Sea_level_rise&hidelinks=1&hideredirs=1 or https://en.wikipedia.org/w/index.php?title=Special%3AWhatLinksHere&hideredirs=1&hidelinks=1&target=Ocean+acidification&namespace= . Apparently this picks up other uses of data from the page embedded in a template as well, for example from Template:Annotated_link. The other way to check is to create a Excerpt tree per the documentation at: Template:Excerpt. Sadads (talk) 03:04, 19 August 2021 (UTC)
Ah thank you, I had forgotten about that "what links to here". About the excerpt tree is that working properly though? I am surprised only 15 articles are listed there; I would have thought there are more by now. Also, it seems to have some sort of circular reference in some cases: try the ocean tree, then click on "ocean acidification", below that is "effects of climate change on oceans" and below that is again "ocean acidification". So it's an endless loop (?). Is that because the excerpt tree just looks at wikilinks, not actual excerpts? E.g. ocean acidification has no excerpt from effects of climate change on oceans and yet it is shown in the excerpt tree as if it did. EMsmile (talk) 03:39, 19 August 2021 (UTC)
@EMsmile Hi! To me, having 15 excerpt trees already is a lot, given that the concept of excerpts trees has been on the English Wikipedia for less than a year. That being said, there may be more trees around that nobody added to the list yet. As to endless loops, I can't reproduce the one you mention (maybe your recent changes to ocean acidification got rid of it) but there's nothing in the code preventing such loops, and I don't think there should be, since the whole point of the script is to help us visualize the trees and thus improve and fix them, so an endless loop is something we should be aware of. As to the fact that some articles show in the excerpt trees even though they are not excerpts, I'm afraid that's because the current script cannot distinguish annotated links from excerpts and I cannot figure out a way to do so yet (see getChildren at MediaWiki:ExcerptTree.js). Cheers! Sophivorus (talk) 12:13, 19 August 2021 (UTC)
Sophivorus Ah, half of those 15 trees could be from me, I use excerpts a lot. I absolutely love this function and think it could revolutionise Wikipedia in some areas, in particular climate change topic and environmental pollution topics where core facts and data are repeated across a range of other articles... How would someone go about adding more articles to the tree, as I am pretty sure there should be more than 15? I couldn't figure out how to edit that list in the template documentation. And yes, that circular problem that I had earlier with ocean is gone now. It must have been solved when I moved the term effects of climate change on oceans from "See also" at ocean acidification to elsewhere in the article. - Did you present information about the excerpt at Wikimania perhaps? I hope it will become more widely used in future. It could help us to become more disciplined in some areas and to reduce some waffle paragraphs and outdated data.EMsmile (talk) 12:36, 19 August 2021 (UTC)
@EMsmile I'm glad you like excerpts and excerpt trees. I agree they have huge potential in some areas. For instance, on the Spanish Wikipedia I developed huge trees rooted on articles such as Science, Philosophy and Argentina that have no parallel yet on the English Wikipedia. To add more trees to the list, simply edit the template documentation. As to Wikimania 2021, yes, I presented an on-demand program (I asked for a live lecture but didn't get it), cheers! Sophivorus (talk) 13:52, 19 August 2021 (UTC)
Portals also make widespread use of excerpts via Module:Excerpt/portals, which is essentially the original version of this module tailored for use in portals rather than articles. Certes (talk) 14:41, 19 August 2021 (UTC)

Excerpt trees

I've just added some more articles to the excerpt tree but am I doing this correctly? And couldn't we have a script that adds them automatically to that documentation page? I bet there must be hundreds more by now. Or is it a tree only when it has a lot of sub-branches? I see there is again a circular reference for water scarcity and water resource but I haven't yet gotten my had around whether that would make sense or whether it points to a logic error. I guess it could be correct if one of the excerpts doesn't take from the lead but from another section of the article. EMsmile (talk) 09:07, 21 August 2021 (UTC)

@EMsmile Hi! The idea is to list only the root article of each tree, so for example I just removed all articles related to Water resources except for the root. By the way, if I were working on that tree, eventually I'd like the article Water to have an excerpt of Water resources, and then I'd remove Water resources from the list and leave Water instead. As to your idea to automate the list of excerpt trees, I like it but it's not that easy because as you say, we'd only want to list trees that have a certain size, so the script would have to get all articles with excerpts first, build the tree for each, and decide which ones to show, which would require lots of requests to the server and would probably be very slow. As to the circular reference between Water scarcity and Water resource, indeed Water scarcity has an excerpt of a section of Water resource and that counts as an excerpt of Water resource, thus triggering the loop. This has made me think of a future version of the script that may distinguish between excerpts to leads and excerpts to sections, so thanks! Sophivorus (talk) 14:21, 22 August 2021 (UTC)
@EMsmile Good news, I just wrote the new version of the script! If you check it out now, you'll notice the following improvements: (a) excerpts are now listed in order of appearance, rather than alphabetically; (b) excerpts to sections are now shown as such; (c) excerpts to sections are now considered terminal branches, thus preventing many loops (I think this is mostly desirable but I'm not 100% sure); (d) multiple excerpts to the same article but to different sections are now listed separately; (e) excerpts are no longer confused with annotated links. Please let me know if you notice any bugs or issues, cheers! Sophivorus (talk) 17:44, 22 August 2021 (UTC)
thanks, Sophivorus, those improvements to the script are excellent! With regards to the "root article" I can think of situations where it's not clear which one the root article is. What is your definition of the root article? I think for some trees there could be more than one "root". Also there can be situations where the root article doesn't have excerpts but the articles further down the line do have excerpts. For example ecosystem doesn't have excerpts yet, but marine ecosystem does. EMsmile (talk) 12:41, 23 August 2021 (UTC)
@EMsmile I'm glad you like the improvements! I can't think of a good definition of "root articles" but in my experience it's often very "general" articles like Science, Ecosystem, Argentina, Climate change, etc. I agree that in some cases there may be trees with more than one root. For example, on the Spanish Wikipedia I built a tree that has Science as its root and Physics as one of its branches, but we could also be justified in listing Physics as a root on its own right, alongside Science. I think in the end we should do whatever turns out to be most useful (after all, the goal of the script is to help us edit). Regarding articles that don't have excerpts but with "sub-articles" that do have excerpts, see what I just came up with here. Cheers! Sophivorus (talk) 13:54, 23 August 2021 (UTC)

{{excerpt|Holodomor in modern politics|Recognition}} seems to mangle the subsections. * Pppery * it has begun... 17:47, 16 October 2021 (UTC)

It works if a blank line is inserted between each level 3 section heading and its immediately following level 4 section heading within the level 2 section being transcluded. I suspect the === terminating the level 3 heading is not being detected properly because of the following ====. Certes (talk) 20:16, 16 October 2021 (UTC)
The bug seems to lie in Module:Transcluder#L-436, which matches multiple section headings by matching (essentially) \n==Whatever==\n. If two adjacent lines both contain headings, the \n between them is slurped by the first match and is no longer available to match the second. Fixing this will need a template editor. Certes (talk) 21:48, 16 October 2021 (UTC)
@Pppery @Certes Thanks for the report and the research! I was able to fix the issue by just removing the trailing \n (it was quite unnecessary to start with). All testcases look good and I think it shouldn't cause new issues, but please let me know if you notice any. Cheers! Sophivorus (talk) 13:46, 17 October 2021 (UTC)

At time of writing, BBC controversies has an issue with {{Excerpt|"We're being pressured into sex by some trans women"}}, where it fails to transclude a reference, giving the error Cite error: The <ref> tag has too many names (see the help page). The reference is defined when used in the lead, and has a unique name (both unique to the article it's defined and transcluded in). No idea what the problem is. — Bilorv (talk) 22:34, 8 November 2021 (UTC)

checkmark Semi-done The problem is the quote marks in the article title. I fixed it using a workaround using {{refn}}. One of the great things about Excerpt is that it prevents reference conflicts by adding the article name to the reference name: the quote marks in the article title caused the reference to go from <ref name="Guardian Nov4"> to <ref name=""We're being pressured into sex by some trans women" Guardian Nov4">, hence the error. It's probably easy for Sophivorus to fix, but in the meantime the error is gone - it's not perfect in that if the article BBC Controversies also names a reference "Guardian Nov4" it will generate an error, but that seems unlikely. --Find bruce (talk) 00:38, 9 November 2021 (UTC)
Interesting, thanks for the explanation. Hopefully this can be worked into the code as an edge case, but it works for now. — Bilorv (talk) 21:52, 9 November 2021 (UTC)
@Bilorv @Find bruce Fixed! Thanks for the report and diagnosis! Sophivorus (talk) 13:28, 13 November 2021 (UTC)

Bizarre errors at Ocean

Ocean#Marine pollution is saying Lead section is empty even though the lead section of the transcluded article (Marine pollution) is clearly not empty. * Pppery * it has begun... 02:11, 12 November 2021 (UTC)

Found the problem: a recent edit to the article used User:GregU/dashes.js to change the dash character in the |pages= parameter of the excerpt. Still, using the wrong kind of dash should either work or produces a much less cryptic error message. * Pppery * it has begun... 02:15, 12 November 2021 (UTC)
wow, that's an important discovery, thanks User:Pppery. Can the excerpt module be changed so that it doesn't create an error when the different dash style is used for paragraphs=1-2 ? See this change that caused the problem. EMsmile (talk) 04:13, 12 November 2021 (UTC)
Thanks for the report. I just fixed this for portals in Module:Excerpt/portals. The same change may work in Module:Transcluder#L-72 if a TE wants to try it. Certes (talk) 12:56, 12 November 2021 (UTC)
@Certes @EMsmile @Pppery Fixed! Thanks for the report, diagnosis and example fix! Sophivorus (talk) 13:29, 13 November 2021 (UTC)

possible bug: anchor href is added to first paragraph

see how in Shizuka Miura#Discography a link to Shizuka (band) is added to Studio albums.talk@TRANSviada 21:59, 6 December 2021 (UTC)

Very early bold text is assumed to be the transcluded article's title (as in An apple is a fruit... and is linked to that article. We should probably do this only when transcluding a lead, not a section. Certes (talk) 22:08, 6 December 2021 (UTC)
@TRANSviada @Certes Fixed! Thanks for the report and for the idea on how to fix it. Sophivorus (talk) 13:21, 8 December 2021 (UTC)

To keep from running competing lists, we have tried transcluding the tornado list from Tornado outbreak of December 10–11, 2021 to the running monthly list. A normal transclusion <onlyinclude></onlyinclude> causes errors and has to be formatted one certain way to work at all. Excerpt works perfectly, but Coords are "blacklisted" apparently, and that is imperative to this transclusion. Does anyone have any ideas or suggestions? United States Man (talk) 14:54, 12 December 2021 (UTC)

@United States Man Hi! If you use the "templates" parameter, it will override the default blacklist. So for example you can set templates=-Whatever and it will exclude Template:Whatever but transclude all others, including Template:Coords. Would this work for you? Sophivorus (talk) 18:31, 12 December 2021 (UTC)
@Sophivorus Thank you so much! Works perfectly now. United States Man (talk) 21:19, 12 December 2021 (UTC)

Hatnotes in source article

I think template:excerpt should exclude hatnotes in the source article. See a counter example: Spatial_analysis#Spatial_heterogeneity. fgnievinski (talk) 04:29, 13 January 2022 (UTC)

@Fgnievinski I just added Template:Multiple issues to the blacklist at Module:Excerpt/config, thanks for the report! Sophivorus (talk) 21:50, 15 January 2022 (UTC)

Short description being transcluded

The template's documentation says that templates listed at Module:Excerpt/config will not be transcluded, and {{Short description}} appears to meet those criteria, but in this version of my sandbox, an excerpt of House clearly transcludes the short description. You can also see the short description if you feed an excerpt to Special:ExpandTemplates. I did some experimenting, and it appears that using the |templates= option with a hyphen transcludes all templates except those specifically excluded, which appears to conflict with the clause I quoted above. I have updated the documentation to match the template's current behavior. How do I specify {{Excerpt}} so that it excludes all of the templates in /config and also excludes specific templates of my choice? – Jonesey95 (talk) 21:44, 14 December 2021 (UTC)

@Jonesey95 Hi! Currently there's no way to do what you want, namely to add a template to the blacklist (unless of course you copy the entre blacklist to the parameter). However, it's a frequent request (see for example the discussion right above us) and I'd very much like to implement a solution, I just haven't come up with a good syntax yet. I'm thinking maybe introducing the + sign in some way, like for example templates=+Foo would add Template:Foo to the blacklist, but then again, using a + sign to exclude a template isn't exactly intuitive. Perhaps the ~ sign instead? Any ideas? Sophivorus (talk) 00:08, 15 December 2021 (UTC)
We could address both this request and the Coord discussion above with "+" to mean transclude and "-" to mean don't transclude. We also need a token to represent all templates not in Module:Excerpt/config: I'll use "T" here but there must be better choices. It will also be useful to have a token for all templates, even those in /config: I'll use "*". Starting with "-" implicitly transcludes all templates other than those we go on to exclude, i.e. templates=-X is short for templates=* - X. Comma means either "+" or "-": whichever appeared most recently, or "+" if neither appeared. We then have:
  • templates=T — Transclude all templates not in /config: the default value, shown only for illustration
  • templates=T + Coord — Transclude all templates not in /config; also transclude Coord
  • templates=T - Multiple image, About, Living space — Transclude all templates not in /config except Multiple image, About, Living space
  • templates=* — Transclude all templates, even those in /config
The examples in the documentation still work:
  • templates=Infobox — Transclude the template 'Infobox'
  • templates=Infobox, Navbox, Chart — Transclude the template 'Infobox', 'Navbox' and 'Chart'
  • templates=-Infobox — Transclude all templates except 'Infobox' (ignores Module:Excerpt/config)
  • templates=-Infobox, Navbox, Chart — Transclude all templates except 'Infobox', 'Navbox' and 'Chart'
Is that feasible? There will be complications, such as redirects to templates used as aliases. Certes (talk) 01:52, 15 December 2021 (UTC)
Another option (that I admittedly haven't thought through) would be to use a new operator, like ! (which I chose because it often means "not") to mean "exclude this list of templates and the blacklisted templates", so that templates=!Infobox, Navbox, Chart would work the same as templates=-Infobox, Navbox, Chart except that it would also exclude the blacklist. – Jonesey95 (talk) 06:44, 15 December 2021 (UTC)
Another gotcha to watch for with my suggestion and others is to avoid punctuation used in template names. (Does Portal-inline mean "Portal but not Inline", or {{Portal-inline}}?) There is a theoretical risk to existing uses. Certes (talk) 20:51, 15 December 2021 (UTC)
Thanks!! Your suggestions are both excellent. I'll let them sink for a few days and I'll write back when I gain some clarity. As a technical note, I think this functionality will be added to Module:Excerpt rather than Module:Transcluder. Let me know of any more ideas!! Sophivorus (talk) 19:50, 16 December 2021 (UTC)
@Certes @Jonesey95 Hi! After giving it some time and thought, I now think it may actually be enough to simply append the "templates" parameter to the default blacklist if it starts with hyphen (-) and replace it if it doesn't. After all, I can't recall of any actual cases where someone wanted to "exclude templates X and Y but include the ones in the blacklist". Do you? It's always "exclude templates X and Y as well as those in the blacklist". And if in some particular edge case someone wants to do just that, it should actually be quite easy to do by listing all the templates you DO want to transclude, since a normal intro or section usually contains less than 10. So I just finished implementing this functionality at Module:Excerpt/sandbox. Check it out at Template:Excerpt/testcases2#Templates and let me know your thoughts! Sophivorus (talk) 22:37, 20 January 2022 (UTC)
Looking at the actual usage of |templates=, assuming it's all done via {{Excerpt}}:
I think your simplified suggestion deals with all of those cases except the first one, which seems very confusing and could be done better using |templates=coord like False Bay. Certes (talk) 23:14, 20 January 2022 (UTC)
@Certes As always, thanks for your sharp eye! Looking into List of United States tornadoes in 1950, I realized I could easily solve it by setting templates=.* (meaning transclude all templates). This also gives me some ideas on how to deal with future edge cases. Thus, if no further problems arise, tomorrow I'll deploy the new version. Thanks again, cheers! Sophivorus (talk) 00:42, 21 January 2022 (UTC)
Deployed! Sophivorus (talk) 21:12, 21 January 2022 (UTC)

Should featured articles also use excerpts?

Could featured articles also use excerpts? I think yes but other editors have told me "no" because if you have the featured article on your watchlist you would not be notified if someone changed something in the transcluded article section that is embedded in the featured article. Could we make it more palatable if a change in the transcluded section results in a notification in someone's watchlist? So if e.g. climate change had transcluded the lead of climate change in Africa, and something was changed in climate change in Africa then it would pop up in my watchlist even if I only have climate change in my watchlist but not climate change in Africa? EMsmile (talk) 12:49, 23 August 2021 (UTC)

Without spilling the beans explicitly, excerpts in protected articles may also leave scope for abuse. Alternatively, they may result in excessive cascading protection. I think the benefits outweigh the problems, but wonder how closely this aspect has been considered. Certes (talk) 13:07, 23 August 2021 (UTC)
We don't use "cascading protection" on articles, and this shouldn't lead to that. Pseduo-cascade protection (where a string of transcluded pages all get manually protected) could be an issue though. — xaosflux Talk 18:54, 23 August 2021 (UTC)
Not a serious problem then. I knew I'd seen cascade-protected pages (probably templates), but hadn't realised that the protection was due to transclusion on today's main page. Certes (talk) 19:12, 23 August 2021 (UTC)
I just found there's a cascade-watching feature request on Phabricator and added excerpts as another use case. Sophivorus (talk) 18:47, 23 August 2021 (UTC)
Great. What are the chances that it will get programmed? I noticed it was first requested in 2013 and has been lingering for the last 8 years? Is there anything else we can do to lend it more support? EMsmile (talk) 00:07, 24 August 2021 (UTC)
After my comment, the task was tagged as in need of review to determine prioritization by the Growth team. I think the best we can do is add reasons why it should be prioritized. Sophivorus (talk) 01:06, 24 August 2021 (UTC)
I have added a comment on Phabricator, hope it helps. I wasn't sure if that page is similar to a talk page or how it works. Maybe it would be better to start up a new task proposal rather than trying to rekindle the one from 2013? That old task doesn't even mention excerpt in the title. It's called "Cascade-watching for transcluded pages". EMsmile (talk) 02:07, 24 August 2021 (UTC)
Great comment, it'll definitely help! As to starting a new task, per my knowledge of the software, I think that task is very much spot-on, and the fact that the original request was motivated by another use case may actually be beneficial. In fact, I just left another comment on Phabricator describing yet another use case for "cascade-watching" and tagging the Editing Team. Sophivorus (talk) 11:45, 24 August 2021 (UTC)
  • Do we allow templates on featured articles? Those have the same concerns. If templates are okay, excerpts should be, too. {{u|Sdkb}}talk 08:45, 24 August 2021 (UTC)
  • We can also consider moving the text into the FA and having its old home transclude it. However, that's not always appropriate, and certainly doesn't work when both articles are featured. Certes (talk) 09:59, 24 August 2021 (UTC)
    haha this is brilliant and may actually suffice in some cases! Sophivorus (talk) 18:11, 24 August 2021 (UTC)

@EMsmile, Sdkb, Certes, Xaosflux Hi guys! I just proposed this feature for the 2022 Wishlist. I thought you may want to know, cheers! Sophivorus (talk) 13:37, 19 January 2022 (UTC)

thanks, Sophivorus, I've placed a "support" vote on that page. Thanks for following up on this. EMsmile (talk) 10:35, 4 February 2022 (UTC)

Possible bug?

I noticed this page has a Cite error (edit: it got updated with a workaround, error shows up here). It seems to use a {{Transclude lead excerpt}} that transcludes text from Jack Ma which has a {{Efn Chinese name}} that is being included. I would expect that efn to not be included (which would get rid of the error) so I thought I'd mention it here so that this could be addressed as it might potentially be a bug.

I apologize if this is the incorrect place to mention this. I just noticed the error and found my way here by clicking the talk page on {{Transclude lead excerpt}}. Satricious (talk) 04:01, 9 February 2022 (UTC)

I'd like to note that this affects {{Efn Chinese name}} but not {{Efn}} as demonstrated by what I have set up on my sandbox here: User:Satricious/sandbox. Hope that helps. Satricious (talk) 04:43, 9 February 2022 (UTC)
@Satricious: Thanks for the report. I've fixed this in Module:Excerpt/portals, which will solve the problem in Portal: namespace, but fixing article namespace will need someone to amend Module:Excerpt. Certes (talk) 01:23, 10 February 2022 (UTC)
Great! The original error (in the portal namespace) is fixed. Cheers! Satricious (talk) 01:30, 10 February 2022 (UTC)

Is this the intended behavior?

I'll keep it brief. Please look at my sandbox as of right now and notice how when transcluding, some text is missing. Also notice how invoking the Excerpt module directly does not cause the text to go missing. Sorry for the brief report, but it's the best I can do.

EDIT: More context: The text that's not transcluded is {{As of|2015}}. Is this intentionally blacklisted? Because it might cause issues like I mentioned above.

EDIT 2: Yeah I just looked at Module:Excerpt/portals and it's there. this is not a bug, my bad. But should it really be ignored? Maybe the article transcluded is using a poor use of the template?. Satricious (talk) 02:46, 10 February 2022 (UTC)

{{As of}} produces useful text but also has side-effects which, whilst useful in the main article, may be unwanted in the extract. In particular, it adds the page to a dated maintenance category. Fortunately that only happens in mainspace, so use in portals should be OK, but it might be problematic when one article transcludes another. I'm not sure what we can do short of modifying such templates to accept a |extract=yes parameter or forking extract versions of them. Certes (talk) 11:41, 10 February 2022 (UTC)
Ah, so I see. Yeah I encountered this in the article namespace when I saw a section in an article that simply included a main link to another article. I figured it might be useful if at least the lead section of the linked article was included in the section so I attempted to transclude but that didn't work out as expected. Anyway, this doesn't seem to be much of an issue given the side-effects it would cause. Thanks for your response! Satricious (talk) 20:55, 10 February 2022 (UTC)

Citation error when transcluding from page with empty note list

I noticed today that Portal:1990s had a cite error (visible in this version). So the portal has a {{Transclude lead excerpt}} that transcludes from 1990s. Curiously, when I looked at that page I noticed it had an empty notes section which I removed (in this diff). And as you can see, the cite error is gone. I do not know if this error is related to the transclusion but I figured I'd post it here anyway. In any case this is probably a low-priority thing since most articles do not have empty note lists. Satricious (talk) 13:36, 26 February 2022 (UTC)

The error is intermittent; I saw it once in the old version but haven't been able to reproduce it to debug. The module removes templates such as {{efn}} but it's possible that some variant has slipped through. Unusually, that portal transcludes just an image and its caption with no text from the lead, then presents its own text with references. There are no references or notes in the image caption, nor were any removed recently. The intermittent nature suggests that the note is in an excerpt from another article which is occasionally transcluded elsewhere on the page at random. Please let us know if you see this problem again, so we may be able to identify the variant template and exclude it. Certes (talk) 14:13, 26 February 2022 (UTC)
I see, that really is some odd behavior. And sure, I occasionally browse Category:Pages with missing references list so if I see behavior like this again I'll happily let you guys know.
You mentioned not being able to reproduce this, I tried doing some naive testing in my sandbox and could not reproduce this either. However, I temporarily reverted my edits in 1990s (see page history if you wish), did not see any difference in the portal, purged, saw the error pop up, removed the note list, error persisted, disappeared after purging again (I know it's obvious changes should occur after purging but I'm just mentioning this as it might be useful to you).
This definitely has to do with the empty notelist. But it's really peculiar. Though I guess there is a rather unconventional dirty way of reproducing it though. Satricious (talk) 15:23, 26 February 2022 (UTC)
I think the footnote comes from {{Airreg|N|485US|,}} in USAir Flight 405 which appears randomly as selected article 5. The template isn't excluded because it produces useful text as well as an unwelcome footnote. The symptoms resemble {{Nihongo foot}}, a related disease which we cured by implementing a simplified version of that template in Module:Excerpt/portals. Airreg is more complicated, as the format depends on the first parameter: for N (U.S.) we just concatenate the parameters, but some country prefixes add a hyphen or other decoration. Certes (talk) 18:49, 26 February 2022 (UTC)
I've changed Module:Excerpt/portals to remove the footnote from Airreg. This change does not affect Module:Excerpt but should fix the portal. Certes (talk) 19:22, 26 February 2022 (UTC)
Oh wow, so I was completely wrong. I'm impressed that you managed to nail down exactly what the issue was so quickly. Props to you! I appreciate all the work you guys do to get things like this working :) Satricious (talk) 21:04, 26 February 2022 (UTC)

Template-protected edit request on 3 March 2022

In line 4 of Module:Excerpt/config, where it is:

<code>
	blacklist = {
</code>

please change to:

<code>
	blacklist = {
		'[Ff]urther', '[Ff]urther2', 
		'[Oo]utline', 
		'[Rr]efimprove',
		'[Ss]pecial[Cc]hars',
		'[Mm]erge from','[Mm]erge to',
<code>

Discussion: Module_talk:Excerpt#Suggestions_of_templates_to_blacklist. Thanks! fgnievinski (talk) 00:42, 3 March 2022 (UTC) fgnievinski (talk) 00:42, 3 March 2022 (UTC)

Cite error: Invalid <ref> tag

Hi, thanks for {{excerpt}}, I love it. I'm getting the following errors in my sandbox:

  • "Cite error: Invalid <ref> tag; no text was provided for refs named ..."
  • "Cite error: Invalid <ref> tag; refs with no name must have content"

It seems to involve a named reference ("O Globo"), defined in the transcluded section, which ended up renamed to prefix the transcluded article title. Could you please take a look or give me some pointers to debug it? Thanks! fgnievinski (talk) 00:38, 4 April 2022 (UTC)

@Fgnievinski:, it appears {{excerpt}} is very expensive. Using {{#lsth:pagename|sectionX}} might be a better option. I tried using {{#lsth:Política externa do governo Jair Bolsonaro|França}} on that page and the references show up correctly. Although I can't find an option of it supporting paragraph transclusion like what excerpt does. —Sanglahi86 (talk) 13:30, 10 April 2022 (UTC)
The module seems to be removing {{Citar web}} templates, leaving empty citations. It may possibly be connected to a bug at pt:Módulo:Excerpt/config#L-24, where the square bracket should end after Mm instead of enclosing the whole word. (The second pattern incorrectly matches "c".) Certes (talk) 14:29, 10 April 2022 (UTC)
@Certes: Brilliant, that was it -- fixed now, many thanks! fgnievinski (talk) 23:14, 10 April 2022 (UTC)

Citation error: The time allocated for running scripts has expired.

I have used {{excerpt}} twice in this page and the moment I used the second (under Telecommunications section), the error:

The time allocated for running scripts has expired.

replaced several references. There are also errors in several other pages that use {{excerpt}}. Can someone please identify the cause and fix the error? —Sanglahi86 (talk) 18:52, 6 March 2022 (UTC)

It appears this template is very expensive. I temporarily removed the second excerpt from the page. Checking the revision with the excerpt mysteriously does not show the errors, although the other pages still contain the errors.—Sanglahi86 (talk) 19:09, 6 March 2022 (UTC)
I've checked the first few "other pages" linked above and it seems the error message only appears in search results, the actual articles seem fine. fgnievinski (talk) 03:43, 11 April 2022 (UTC)

Sidebar templates

Module:Excerpt had been changed to blacklist sidebars back in 2018. But some sidebars still appear in excerpts, please see test2. fgnievinski (talk) 04:12, 11 April 2022 (UTC)

@Fgnievinski Hi again! If you visit Module:Excerpt/config you'll notice that templates are blacklisted based on their name, so unfortunately it's not possible to simply blacklist all sidebars once and for all. I just added the ones in your test page to the blacklist though. Cheers! Sophivorus (talk) 13:58, 12 April 2022 (UTC)
@Sophivorus: ah, I see; I thought it was a bug regress. thank you for the wildcards, I think they can cover the most common instances. but here's an exception: Template:Antisemitism sidebar is not being caught in the '.*[Ss]idebar.*' regex. and the 'WWII timeline' could be generalized as .*[Tt]imeline.*', see here for a broader test. thanks! fgnievinski (talk) 16:10, 12 April 2022 (UTC)
@Fgnievinski Done! Sophivorus (talk) 17:43, 12 April 2022 (UTC)
@Sophivorus: But but... you didn't fix '.*[Ss]idebar.*', you've hard-coded '[Aa]ntisemitism'; that way, I'll have to bug you every time I come across a new sidebar. I thought a better approach would be to make '.*[Ss]idebar.*' match 'Antisemitism sidebar', no? Similarly for '.*[Tt]imeline.*', which is not catching 'WWII timeline' in here. fgnievinski (talk) 17:55, 12 April 2022 (UTC)
@Fgnievinski '.*[Ss]idebar.*' does match 'Antisemitism sidebar', but The Holocaust calls 'Antisemitism' rather than 'Antisemitism sidebar', so I had to blacklist it exlplicitly. As to the WWII timeline, it is matched by '.*[Tt]imeline.*', but it shows in your test page because you call it explicitly at User:Fgnievinski/test#Start and end dates. Sophivorus (talk) 18:38, 12 April 2022 (UTC)
@Sophivorus: ah, you're right, my bad! I didn't realize sidebar might have redirects, too (for exameple). what a nightmare! I wonder what would be a sustainable long-term solution? blacklisting every sidebar manually seems a lot of work. fgnievinski (talk) 19:34, 12 April 2022 (UTC)
would it be feasible to blacklist a category of templates, such as Category:Hatnote templates? fgnievinski (talk) 19:34, 12 April 2022 (UTC)
would it be feasible to follow redirects so that we need to blacklist only non-redirect templates? fgnievinski (talk) 19:34, 12 April 2022 (UTC)
@Fgnievinski Yes it's quite an issue, but luckily it's only as serious as excerpts are popular. Blacklisting by category or auto-detecting redirects is possible in principle, but probably very expensive. I'm thinking a more reasonable solution may be to blacklist only non-redirect templates (and perhaps a few exceptions for very high-use redirects), and then document the limitation and ask users to either change the template they want to exclude to its cannonical name, or blacklist it explicitly using templates=-Antisemitism, for example. Sophivorus (talk) 20:19, 12 April 2022 (UTC)

Images in sidebar templates

it seems images included in sidebar templates are excerpted -- is that intentional? although it works well in most cases, sometimes the image is not labeled (for example, {{History of Japan}}), which looks odd. other times, it doesn't work at all, see here. fgnievinski (talk) 16:15, 12 April 2022 (UTC)

@Fgnievinski The thing is, because not all infoboxes are named according to a pattern, I use the presence of a .jpg or .png file to determine which template is the infobox and extract the image. In this case, the sidebar got picked, but it can be fixed adding files=0, cheers! Sophivorus (talk) 17:45, 12 April 2022 (UTC)
Understood, will use "files=0" when necessary. fgnievinski (talk) 19:52, 12 April 2022 (UTC)
In the case of Second Italo-Ethiopian War, it seems the problem is caused by {{multiple images}}, see here. fgnievinski (talk) 19:56, 12 April 2022 (UTC)