Hi there, just noticed a bit of oddness when using subst:
| This module does not require a rating on Wikipedia's content assessment scale. It is of interest to the following WikiProjects: | ||||||||
| ||||||||
Hi there, just noticed a bit of oddness when using subst:
{{#invoke:GetShortDescription|main |name=Brazil |only=explicit}} → table{{#invoke:GetShortDescription|main |name=Brazil}} → table{{subst:#invoke:GetShortDescription|main |name=Brazil |only=explicit}} →{{subst:#invoke:GetShortDescription|main |name=Brazil}} → country in South AmericaOlivaw-Daneel (talk) 10:19, 23 January 2023 (UTC)
Fred Gandt · talk · contribs 10:57, 23 January 2023 (UTC){{subst:User:Fred Gandt/sandbox/Get short description |name=Brazil |only=explicit }} → tableFred Gandt · talk · contribs 11:06, 23 January 2023 (UTC)
Fred Gandt · talk · contribs 11:09, 23 January 2023 (UTC)Fred Gandt · talk · contribs 13:04, 23 January 2023 (UTC)
{{annotated link}} which is already horrible to maintain and will only get worse, so eventually that template will being using this module anyway 😁 Substituting is always a pain; the existence of various kludges to get around the issue is proof of it; safesubst, subst and all kinds of weird breaking of inclusion tags... The removal of preprocessing from the module will improve performance anyway, so it's good to do even if not for fixing the substitution issue. Fred Gandt · talk · contribs 04:44, 24 January 2023 (UTC)Fixed in my test Module; needs more testing before pushing
{{subst:#invoke:User:Fred Gandt|main |name=Brazil |only=explicit}} → Country in South America{{subst:#invoke:User:Fred Gandt|main |name=Brazil}} → Country in South AmericaFred Gandt · talk · contribs 09:26, 24 January 2023 (UTC)
Pushed to release; nice little performance boost too:
Old NewPP limit report Parsed by mw1351 Cached time: 20230124093803 Cache expiry: 1814400 Reduced expiry: false Complications: [vary‐revision‐sha1, vary‐page‐id, show‐toc] CPU time usage: 0.276 seconds Real time usage: 0.339 seconds Preprocessor visited node count: 566/1000000 Post‐expand include size: 20103/2097152 bytes Template argument size: 744/2097152 bytes Highest expansion depth: 14/100 Expensive parser function count: 7/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 4974/5000000 bytes Lua time usage: 0.208/10.000 seconds Lua memory usage: 15322087/52428800 bytes Number of Wikibase entities loaded: 0/400
NewNewPP limit report Parsed by mw1478 Cached time: 20230124094020 Cache expiry: 1814400 Reduced expiry: false Complications: [vary‐revision‐sha1, vary‐page‐id, show‐toc] CPU time usage: 0.184 seconds Real time usage: 0.237 seconds Preprocessor visited node count: 566/1000000 Post‐expand include size: 20103/2097152 bytes Template argument size: 744/2097152 bytes Highest expansion depth: 14/100 Expensive parser function count: 7/500 Unstrip recursion depth: 0/20 Unstrip post‐expand size: 4974/5000000 bytes Lua time usage: 0.138/10.000 seconds Lua memory usage: 15322564/52428800 bytes
Number of Wikibase entities loaded: 0/400
Fred Gandt · talk · contribs 09:44, 24 January 2023 (UTC)
For the record: there's still a problem; it's just a different problem. Fred Gandt · talk · contribs 12:50, 24 January 2023 (UTC)
I think I fixed it; it's plugged into Module:Annotated link and the results are pretty nifty:
Code: {{#invoke:Annotated link|main |name=The Partisan |quote=yes |only=wikidata |desc_first_letter_case=upper |wedge=from the album ''[[Songs from a Room]]'' |aka=La Complainte du partisan |aka_lang=fr }}
Result: "The Partisan", also known as La Complainte du partisan, from the album Songs from a Room
And yes, it works if it's substed 😉 Fred Gandt · talk · contribs 21:28, 24 January 2023 (UTC)
{{#invoke:GetShortDescription|main |name=Oceania |only=explicit}} → table{{#invoke:GetShortDescription|main |name=Oceania}} → table{{subst:#invoke:GetShortDescription|main |name=Oceania |only=explicit}} →{{subst:#invoke:GetShortDescription|main |name=Oceania}} → geographic region that includes Australasia, Melanesia, Micronesia and PolynesiaFred Gandt · talk · contribs 07:42, 26 January 2023 (UTC)Fred Gandt · talk · contribs 10:30, 26 January 2023 (UTC)I see "Result: table" a couple of times in the documentation - is that intentional? Olivaw-Daneel (talk) 05:31, 8 February 2023 (UTC)
Fred Gandt · talk · contribs 05:38, 8 February 2023 (UTC)I see a lot of talk discussing the term "table" being the only thing returned from this, which is the problem I've run into. I see the discussion last was mentioned in February. Any progress, resolution, workaround, or tool that can get just the description returned from an annotated link? Thanks! GeogSage (⚔Chat?⚔) 22:06, 1 December 2023 (UTC)
Fred Gandt · talk · contribs 14:23, 2 December 2023 (UTC)
{|class="wikitable sortable" style="width:99%;"
! style="text-align:center;"|Title
! stype="text-align:center;"|Year first published
! style="text-align:center;"|Short Description
! style="text-align:center;"|Notes
|-
| [[Concepts and Techniques in Modern Geography ]
| 2022
| Series of geography publications
|
|-
|}
{|class="wikitable sortable" style="width:99%;"
! style="text-align:center;"|Title
! stype="text-align:center;"|Year first published
! style="text-align:center;"|Short Description
! style="text-align:center;"|Notes
|-
| [[Concepts and Techniques in Modern Geography ]
| 2022
| {#invoke:GetShortDescription|main |name=Concepts and Techniques in Modern Geography |only=explicit}
|
|-
|}
|stringify=True it returns text. Olivaw-Daneel (talk) 20:33, 2 December 2023 (UTC)
Fred Gandt · talk · contribs 22:57, 2 December 2023 (UTC)
I think it would be better if the invokable version of this module always returned a string rather than a table, because it is not possible to work with tables in wikicode. When requiring it in other modules, than the current table output would be useful — Martin (MSGJ · talk) 14:24, 21 August 2024 (UTC)
How does this differ from the older Module:Get short description? Should the two be merged? Dpleibovitz (talk) 00:55, 1 March 2024 (UTC)
{{short description}} template (a <div>...</div> tag), extracts the description and is done.{{short description}} wikitext. Usually that is the first template in an article per WP:SDPLACE. Sometimes, the template name in wikitext is a redirect so the sandbox repeats the search for each known redirect until a short description template is found or it runs out of redirects.I think this module will follow redirects, which may not always be desirable. For example {{#invoke:GetShortDescription|main|name=Liam Ashley|stringify=true}} gives "2006 murder in Auckland" which is the short description of Murder of Liam Ashley, but I would prefer it take the Wikidata label from Liam Ashley (Q129493533) which is "murder victim" — Martin (MSGJ · talk) 14:17, 21 August 2024 (UTC)
This module is used by {{annotated link}} to retrieve short descriptions from articles, but one of the modules involved appears to be unable to retrieve infobox-generated short descriptions. Please see this template talk page discussion, and the longer, meandering discussion above it, for details. If anyone can help, possibly by teaching one of the modules to retrieve the short description shown on "Page information", that would be helpful. – Jonesey95 (talk) 20:06, 9 July 2025 (UTC)
Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.