Page MenuHomePhabricator

Explicit Definition for TextExtracts Content
Open, Needs TriagePublic

Description

Text Extracts currently generates an extract by default from the first paragraphs of a page. An option to exclude elements from this auto-generation exists using the "noexcerpt" class, but there's no equivalent feature that allows explicit definition of the text to be used for the extract.

We propose a new feature to explicitly define the content for Text Extracts on a page. If this explicit definition is present, it should be used as the sole source for generating the text extract. If not, Text Extracts would revert to its default behavior.

There are two suggested methods for implementing this definition:

  • Using a dedicated class, e.g., text-extracts-excerpt. The content inside an HTML element with this class would be used for the extract.
  • Introducing a new MediaWiki parser function, like {{#textextracts:description=The text to extract here.}}. This would allow the user to directly define the extract within the wikitext of the page.

This feature would allow for more flexible and precise control over the content of the extracts, especially in cases where the initial paragraphs may not provide the best summary of the page.