Page MenuHomePhabricator

Enhancing LST to allow transcluding section tags
Closed, DuplicatePublic

Description

Labeled Section Transclusion currently only sees section tags that appear directly in the wikitext of the transcluded page: https://www.mediawiki.org/wiki/Extension:Labeled_Section_Transclusion#Limitations
With a view to customization and cleaner wikitext, especially if the same kind of labeled section has to be created on different pages (and perhaps with some additional mark-up or surrounding text) it would be desirable to embed the section tags in a template.
To give an example, this would allow cross-page variables (now only covered by the experimental PageVariable extension) by creating a template that creates a variable (hidden labeled section) and one that retrieves its value (#lst parser function).

Ideas for implementation

Having LST go through all transcluded templates looking for section tags would be an expensive operation, and could possibly even lead to name conflicts, depending how LST is currently used on wikis. I see two other options: (1) create a transclusion modifier that tells LST there might be section tags in the (partially) transcluded page, or (2) create a second parser function that does go through all templates.
With the cross-page variables example in mind, (1) seems most interesting.

Related: T39256

Related Objects