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):
|
Hello, Is it possible to transcude :
Thank you, Angelicadia ( talk) 09:08, 4 October 2023 (UTC)
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('//en.wikipedia.org/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)
The article War crimes during the War in Sudan (2023–present) (child article) is excerpted into War in Sudan (2023–present) (parent article). The parent article has citations labeled <ref name=":2"> and <ref name=":4">. The excerpted section in the child article also has references to <ref name=":2" /> and <ref name=":4 /">. This appears to cause some sort of conflict which is visible in citations #346 and 364 in the parent article. I was able to fix this issue by changing the child article in the edit here. But I undid that edit to illustrate this error and report here for a more systemic fix. --- C& C ( Coffeeandcrumbs) 15:02, 14 January 2024 (UTC)
fixReferences = true
option. It's working for a lot of other citations in that extract, for example 347 (ref 2 in the donor article) which is defined right next to 346 in the donor's lead and reused in the section.
Certes (
talk) 17:48, 14 January 2024 (UTC)
:27
from the excerpt's body when looking for :2
and therefore deciding no rescuing needs to take place. The issue appears to be with the
refBody regex, which has entirely optional conditions after the refName up until the [^>/]*
, meaning any ref starting with :2
can match. Not sure how to immediately fix this one.
Aidan9382 (
talk) 18:07, 14 January 2024 (UTC)
[^>/]*
? Would something like %s*
work equally well, and correctly fail to match "7"?
Certes (
talk) 20:54, 14 January 2024 (UTC)
[^>/]*
existed was for when there was another property of the reference after the name (E.g. group=abc
) while still making sure its not a self-finishing tag (/>
)
Aidan9382 (
talk) 07:39, 15 January 2024 (UTC)
["' >
. It isn't the prettiest looking capture group to follow on with, but this guarantees that either the name gets finished with a quote (<ref name="abc"group="xyz">
), a space (<ref name=abc group=xyz>
), or that the ref tag ends there (<ref name=abc>
), while still supporting a later occurance of a group or other properties. Would that reasonably fit the potential cases?
Aidan9382 (
talk) 12:26, 15 January 2024 (UTC)
The configuration page has a very long (and probably incomplete) list of templates that transclude {{ Ambox}} and {{ Navbox}} and {{ Sidebar}}. Can we automatically generate this list instead of listing all of these templates manually?
It ought to be possible to retrieve a list of templates from Category:Navigational boxes using a Lua module, but I don't know how to do this. Jarble ( talk) 20:46, 21 January 2024 (UTC)
Please, add for first span element style element to have left padding/margin (e.g. ' style="padding:0 0 0 0.5em;"
'). --
109.175.38.135 (
talk); 11:06, 25 January 2024 (UTC)
style="padding-left:0.5em;"
is equivalent, and easier to read.
Mathglot (
talk) 03:36, 26 January 2024 (UTC)The section
2020s in Asian political history § 2022 Mahsa Amini protests has an unusual case where it's hard-coding [[File: Protestors on Keshavarz Boulevard
Bottom: Protestors at Amir Kabir University }}|thumb|]]
from the infobox.
Is this a parsing issue, since that text is part of the caption on
Mahsa Amini protests, not actual images? Or maybe due to the use of the {{multiple image}}
template? =
paul2520
💬 18:11, 31 January 2024 (UTC)
{{Excerpt|Yellow}}
) also displays this behaviour, just without the incorrect trimming on-top. The module should probably try detect if the image value is a template and, if so, either ignore it or treat it differently.
Aidan9382 (
talk) 19:03, 31 January 2024 (UTC)
I see markup errors when I try to include excerpts of pages that use this template. Should it be added to the list of excluded templates? Jarble ( talk) 04:43, 7 February 2024 (UTC)
@ Certes @ Aidan9382 Hi! Today I added a new getTags method to Module:Transcluder/sandbox. The regexes are still rather simple and probably fail in many edge cases, but once it's more robust it can help us get things like galleries, blockquotes, divs, etc. Furthermore, it could be used in other methods to extract stuff like <noinclude> tags and perhaps even <ref> tags. One thing that it should handle though are self-closing tags such as <references /> and <ref name="foo" />. I hope you find this idea promising! Sophivorus ( talk) 14:23, 7 February 2024 (UTC)
@ Certes @ Aidan9382 Hi again! As I mentioned before, I'm thinking on generalizing Module:Transcluder into Module:WikitextParser (Transcluder would then require and use WikitextParser). I think such a module would be more useful, easier to maintain and extend, and more likely to attract new developers. Thoughts? Sophivorus ( talk) 14:30, 7 February 2024 (UTC)
One of the subsections in this article is transcluded even if
subsections=yes
is not included as a parameter. This only happens when the section heading is in this format:
= History and motivations =
The section appears to be included in this excerpt:
{{excerpt|Computational sustainability}}
Should this section not be transcluded in this case? Jarble ( talk) 16:37, 7 March 2024 (UTC)
A single = is styled as the article title and should not be used within an article.Changing to == should fix the problem and potentially fix other problems with the article too. Certes ( talk) 23:31, 7 March 2024 (UTC)
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)
|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)
Hi. I tried to excerpt the lead from ru:Отравление Алексея Навального here - [2] 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)
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 Luis 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 building and the Planalto Presidential Palace in the Praça dos Três Poderes (English:Three Powers Plaza), 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)
|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){{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)
*{{Cite web |title=Bolsonaro deixa o [...]
and *{{Cite web |title=Brazil: Germany [...]
), because getParagraphs
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)|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: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):
|
Hello, Is it possible to transcude :
Thank you, Angelicadia ( talk) 09:08, 4 October 2023 (UTC)
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('//en.wikipedia.org/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)
The article War crimes during the War in Sudan (2023–present) (child article) is excerpted into War in Sudan (2023–present) (parent article). The parent article has citations labeled <ref name=":2"> and <ref name=":4">. The excerpted section in the child article also has references to <ref name=":2" /> and <ref name=":4 /">. This appears to cause some sort of conflict which is visible in citations #346 and 364 in the parent article. I was able to fix this issue by changing the child article in the edit here. But I undid that edit to illustrate this error and report here for a more systemic fix. --- C& C ( Coffeeandcrumbs) 15:02, 14 January 2024 (UTC)
fixReferences = true
option. It's working for a lot of other citations in that extract, for example 347 (ref 2 in the donor article) which is defined right next to 346 in the donor's lead and reused in the section.
Certes (
talk) 17:48, 14 January 2024 (UTC)
:27
from the excerpt's body when looking for :2
and therefore deciding no rescuing needs to take place. The issue appears to be with the
refBody regex, which has entirely optional conditions after the refName up until the [^>/]*
, meaning any ref starting with :2
can match. Not sure how to immediately fix this one.
Aidan9382 (
talk) 18:07, 14 January 2024 (UTC)
[^>/]*
? Would something like %s*
work equally well, and correctly fail to match "7"?
Certes (
talk) 20:54, 14 January 2024 (UTC)
[^>/]*
existed was for when there was another property of the reference after the name (E.g. group=abc
) while still making sure its not a self-finishing tag (/>
)
Aidan9382 (
talk) 07:39, 15 January 2024 (UTC)
["' >
. It isn't the prettiest looking capture group to follow on with, but this guarantees that either the name gets finished with a quote (<ref name="abc"group="xyz">
), a space (<ref name=abc group=xyz>
), or that the ref tag ends there (<ref name=abc>
), while still supporting a later occurance of a group or other properties. Would that reasonably fit the potential cases?
Aidan9382 (
talk) 12:26, 15 January 2024 (UTC)
The configuration page has a very long (and probably incomplete) list of templates that transclude {{ Ambox}} and {{ Navbox}} and {{ Sidebar}}. Can we automatically generate this list instead of listing all of these templates manually?
It ought to be possible to retrieve a list of templates from Category:Navigational boxes using a Lua module, but I don't know how to do this. Jarble ( talk) 20:46, 21 January 2024 (UTC)
Please, add for first span element style element to have left padding/margin (e.g. ' style="padding:0 0 0 0.5em;"
'). --
109.175.38.135 (
talk); 11:06, 25 January 2024 (UTC)
style="padding-left:0.5em;"
is equivalent, and easier to read.
Mathglot (
talk) 03:36, 26 January 2024 (UTC)The section
2020s in Asian political history § 2022 Mahsa Amini protests has an unusual case where it's hard-coding [[File: Protestors on Keshavarz Boulevard
Bottom: Protestors at Amir Kabir University }}|thumb|]]
from the infobox.
Is this a parsing issue, since that text is part of the caption on
Mahsa Amini protests, not actual images? Or maybe due to the use of the {{multiple image}}
template? =
paul2520
💬 18:11, 31 January 2024 (UTC)
{{Excerpt|Yellow}}
) also displays this behaviour, just without the incorrect trimming on-top. The module should probably try detect if the image value is a template and, if so, either ignore it or treat it differently.
Aidan9382 (
talk) 19:03, 31 January 2024 (UTC)
I see markup errors when I try to include excerpts of pages that use this template. Should it be added to the list of excluded templates? Jarble ( talk) 04:43, 7 February 2024 (UTC)
@ Certes @ Aidan9382 Hi! Today I added a new getTags method to Module:Transcluder/sandbox. The regexes are still rather simple and probably fail in many edge cases, but once it's more robust it can help us get things like galleries, blockquotes, divs, etc. Furthermore, it could be used in other methods to extract stuff like <noinclude> tags and perhaps even <ref> tags. One thing that it should handle though are self-closing tags such as <references /> and <ref name="foo" />. I hope you find this idea promising! Sophivorus ( talk) 14:23, 7 February 2024 (UTC)
@ Certes @ Aidan9382 Hi again! As I mentioned before, I'm thinking on generalizing Module:Transcluder into Module:WikitextParser (Transcluder would then require and use WikitextParser). I think such a module would be more useful, easier to maintain and extend, and more likely to attract new developers. Thoughts? Sophivorus ( talk) 14:30, 7 February 2024 (UTC)
One of the subsections in this article is transcluded even if
subsections=yes
is not included as a parameter. This only happens when the section heading is in this format:
= History and motivations =
The section appears to be included in this excerpt:
{{excerpt|Computational sustainability}}
Should this section not be transcluded in this case? Jarble ( talk) 16:37, 7 March 2024 (UTC)
A single = is styled as the article title and should not be used within an article.Changing to == should fix the problem and potentially fix other problems with the article too. Certes ( talk) 23:31, 7 March 2024 (UTC)
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)
|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)
Hi. I tried to excerpt the lead from ru:Отравление Алексея Навального here - [2] 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)
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 Luis 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 building and the Planalto Presidential Palace in the Praça dos Três Poderes (English:Three Powers Plaza), 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)
|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){{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)
*{{Cite web |title=Bolsonaro deixa o [...]
and *{{Cite web |title=Brazil: Germany [...]
), because getParagraphs
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)|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)