Module talk:Excerpt
![]() | Module:Excerpt is permanently protected from editing because it is a heavily used or highly visible module. Substantial changes should first be proposed and discussed here on this page. If the proposal is uncontroversial or has been discussed and is supported by consensus, editors may use {{edit template-protected}} to notify an administrator or template editor to make the requested edit.
|
This is the talk page for discussing improvements to the Excerpt module. |
|
Archives: 1, 2, 3, 4Auto-archiving period: 160 days ![]() |
![]() | Portals ![]() | |||||||||
|
![]() | To help centralise discussions and keep related topics together, the talk pages for all the transclude excerpt templates redirect here (as of 15 May 2020 UTC): |
New tool and grant ideas
[edit]Hi guys! Tonight I had an idea for a new tool, called ExcerptHunter (inspired in CitationHunt). It's basically a semi-automatic tool for doing Template:Excerpt#Replacing summary section with excerpt of child article. I wrote a small demo to help explain. First add the following to your common.js:
mw.loader.load('//wiki.riteme.site/wiki/User:Sophivorus/ExcerptHunter.js?action=raw&ctype=text/javascript');
Then visit User:Sophivorus/ExcerptHunter and you should see the interface. Note that clicking Publish doesn't work yet, but I think the interface already conveys the idea. What do you think? The tool could grow in many ways. For example, by allowing users to limit articles to a category or topic of interest, by showing a live preview next to the wikitext, by working in other wikis, etc.
However, this new tool idea, along with some bugs and feature requests that have been piling up, and other ideas I have in mind (such as generalizing Module:Transcluder into a regex-based Module:WikitextParser) all add up to more than I'm able to handle in my volunteer time.
Therefore, I'm thinking on requesting a Rapid Grant to help me develop ExcerptHunter, WikitextParser, as well as any ideas you come up with and generally catching up and giving a boost to everything excerpt-related. What do you think? Would you support such a grant? Would you like more details, or request some specific work to be done? Looking forward to your reply! Kind regards, Sophivorus (talk) 04:28, 3 December 2023 (UTC)
- @Certes @Aidan9382 I should also mention that it would be a pleasure and an honor to to present a shared grant with you, in case you're interested!!! Sophivorus (talk) 13:40, 4 December 2023 (UTC)
- Please please don't do this in a widespread or semiautomated way, or add tools that make it easier for others to do. The excerpt template is one of the most harmful (reader- and especially author-hostile) changes to Wikipedia in recent years, and its significant proliferation will do dramatic damage to the encyclopedia project. –jacobolus (t) 19:18, 10 December 2023 (UTC)
- Well, I guess the silence and concern expressed imply my proposal wouldn't be welcome. Oh well... Sophivorus (talk) 16:54, 18 December 2023 (UTC)
- I completely agree with @Jacobolus's comment above. It usually does more harm than good. Clayoquot (talk | contribs) 18:44, 13 May 2024 (UTC)
- Well, I guess the silence and concern expressed imply my proposal wouldn't be welcome. Oh well... Sophivorus (talk) 16:54, 18 December 2023 (UTC)
Reference error
[edit]I just wanted to notify that there is, currently, a reference error with the excerpt in in this article (ref 153). I thought it was related to the fact that it uses a specific template called "Cite Moulin 2004". So I modified the transcluded reference to use a more generic format, but it doesn't appear to have solved the issue. Alenoach (talk) 02:45, 22 March 2024 (UTC)
- This seems to be an issue with
|templates=0
causing the {{Cite book}} inside the reference to be removed, making the reference content empty and causing an error. Aidan9382 (talk) 07:29, 22 March 2024 (UTC)- Ok, thanks. I fixed it by whitelisting reference templates with the excerpt parameter "templates=Cite". Alenoach (talk) 01:37, 23 March 2024 (UTC)
- Actually, sometimes you need a more comprehensive whitelist, like e.g. templates=Cite,cite,Citation,rp Alenoach (talk) 03:00, 23 March 2024 (UTC)
Ref error ruwiki
[edit]Hi. I tried to excerpt the lead from ru:Отравление Алексея Навального here - [1] and ref 4 is giving me a reference error. Does anyone know why and how to fix it? Renat 05:53, 22 March 2024 (UTC)
Excerpt a paragraph, less its bundled citation with an embedded list
[edit]Having a bundled citation with an embedded bullet list for several different sources is not unusual. I tried excluding a bundled ref at the end of the first paragraph of 2023 Brazilian Congress attack using |references=no
and got a weird result, so added |lists=no
on top of that, but still doesn't look right:
excerpt paragraph #1 of 2023 Brazilian Congress attack minus the refs:
|
---|
On 8 January 2023, following the defeat of then-president Jair Bolsonaro in the 2022 Brazilian general election and the inauguration of his successor Luiz Inácio Lula da Silva, a mob of Bolsonaro's supporters attacked Brazil's federal government buildings in the capital, Brasília. The mob invaded and caused deliberate damage to the Supreme Federal Court, the National Congress Palace and the Planalto Presidential Palace in the Praça dos Três Poderes (English: Three Powers Square), seeking to violently overthrow the democratically elected president Lula, who had been inaugurated on 1 January. Many rioters said their purpose was to spur military leaders to launch a "military intervention" (related to a misinterpretation of the 142nd article of the Brazilian constitution and an euphemism for a coup d'état) and disrupt the democratic transition of power.<ref>Phillips, Tom (8 January 2023). "Jair Bolsonaro supporters storm Brazil's presidential palace and supreme court". The Guardian. Archived from the original on 8 January 2023. |
The final text I want to see in the excerpt is, "...and disrupt the democratic transition of power." I want to keep the |inline=yes
so I can tack on my own ref instead of the bundle. Anything I'm missing here? Mathglot (talk) 06:55, 15 April 2024 (UTC)
- Something odd is going on. In my (now undone) rev. 1219016229, I attempted a fix by adding a second test after the first, adding param
|templates:-cite=
. What happened was that the two tests showed the same result, an improvement over the first attempt, where now there is only a hanging <ref> tag (and no citation content or anything else: just the opening ref tag itself) after the desired text. But the top test in that revision is unchanged from the (only) test in the previous revision (and current revision, after the undo's). So, somehow, the addition of test two in rev. 1219016229 is affecting the result of test 1 in that revision, even though I didn't change that one (afaik). Very odd. Mathglot (talk) 07:15, 15 April 2024 (UTC) - Also tried:
{{excerpt|2023 Brazilian Congress attack |paragraphs=1 |hat=no |references=no |lists=no |inline=yes|templates=-cite web,cite news}}
but no go. Mathglot (talk) 07:19, 15 April 2024 (UTC)- Module:Transcluder is getting very confused by this scenario. It appears to be including the list objects from later paragraphs (specifically
*{{Cite web |title=Bolsonaro deixa o [...]
and*{{Cite web |title=Brazil: Germany [...]
), becausegetParagraphs
seems to think the list objects (which in this case are actually the bundled citations) are unrelated to the paragraph, and therefore not removing them along with said paragraph. This also consumes the references' starting ref tag, so it doesn't get removed later on. Thats why, when you try to do{{Excerpt|2023 Brazilian Congress attack|references=no|paragraphs=1}}
(so not specificying no lists), you get the 2 bullet points from the next 2 paragraphs leaking out instead. Aidan9382 (talk) 07:45, 15 April 2024 (UTC) - Also,
|lists=no
is probably failing because it then removes the ending ref tag to the starting ref tag (the first reference won't be on a newline so it doesnt get picked up as a list by Transcluder, but then the rest of the bundled citation gets consumed). Aidan9382 (talk) 07:47, 15 April 2024 (UTC)
- Module:Transcluder is getting very confused by this scenario. It appears to be including the list objects from later paragraphs (specifically
New Template doc section Incompatibilities
[edit]I started a new template doc section, § Incompatibilities, to hold a description (or perhaps a bullet list?) of incompatibilities between Excerpt and other templates, modules, or functions. Please add entries to it that you know of. Thanks, Mathglot (talk) 01:27, 13 June 2024 (UTC)
2 points
[edit]first of all, in TemplateData, I believe the default for onlyfreefiles is supposed to be "yes", not "no". Secondly, can anyone help me understand why the template isn't working for me- here' my code:
{{excerpt|Calvin Coolidge|only=files|hat=no}}
it's not returning any files when the 'only' parameter is set, but it does return files without it. I see the code has support for searching infoboxes, maybe that's bugged? JoeJShmo💌 03:29, 24 July 2024 (UTC)
- The default for onlyfreefiles is indeed "yes", so I've corrected the templatedata there. The issue with
only=files
is that, since the template gets removed by Module:Transcluder, this module then doesn't see any infobox template to search for images in, so it doesn't find them. Not sure of a fix so far. Aidan9382 (talk) 06:57, 24 July 2024 (UTC)- Got it, thanks. do you know another way to extract a specific file from an article? I came up with a longer findinpage+find function that works, save for the fact that I don't know how to use the article itself as the string in the 'find' function. JoeJShmo💌 10:07, 24 July 2024 (UTC)