Looking at the documentation here, the title object does not allow access to the page's short description. Currently (on en.wiki), in order to get the short description of a page that uses a nested short description template inside of another template (such an Infobox), title.getContent() is used and then the return article text is searched in order to find the short description text. Directly accessing the value from title.getDescription() would allow for a much cleaner code. Apologizes if there is already a task like this, but I couldn't find one.
Description
Related Objects
- Mentioned In
- T380690: Allow extensions to add attributes to Lua mw.title objects
T362560: Find a way to get description information from Wikibase
T50175: Scribunto/Lua should have a built-in method for retrieving categories used on a page
T282172: Make short description work independent of Wikibase (create new short description extension)
Event Timeline
What do you mean the "page's short description"? Something provided by TextExtracts ?
I mean short description, the line of text that is associated with a page in search results and other places. I have no idea what TextExtracts, but looking at its documentation, it doesn't seem to be what I'm asking for.
Just to be clear, I'm not trying to get the description located at wikidata, but the one at the local wiki. See this page information "Local description" section.
Short description handling currently lives in Wikibase, so mw.wikibase makes sense nevertheless.
This should be reasonably easy, there's a service to return the description, it just needs some scaffolding to make it available to Lua.
Just to repeat myself, again, mw.wikibase is completely irrelevant to this, as is Wikidata. I'm not trying to access the description at Wikidata, for that I can use mw.wikibase.getDescription, which is already available. I'm trying to access the local description which can be seen either on the article itself, or in the "Page information" page. That can give a completely different description.
You can claim all you want it's not Wikidata/Wikibase, but it is. Look at the message keys used
wikibase-pageinfo-description-local is defined and used by MediaWiki-extensions-WikibaseClient
Local descriptions are not touched by the Wikidata team so adding @EvanProdromou to get it on the right people's radar.