StarCitizenTools / mediawiki-extensions-TabberNeue

A MediaWiki extension that allows wiki to create tabs.
https://www.mediawiki.org/wiki/Extension:TabberNeue
GNU General Public License v3.0
13 stars 15 forks source link

Feature request: Wikitext for tab name or otherwise style the tab name text? #35

Closed Fyren closed 6 months ago

Fyren commented 2 years ago

A wiki I contribute to color codes a lot of text using a template that wraps text in a span and uses the article path to pick between different colors. Specifically, if it helps explain, doing something like {{color|1|some text}} where the 1 is a color code will maybe color the given text red for the article Foo/1 or Foo/2 but blue for Bar/3 or Bar/4. A user wanted to use our template as part of a tab name, but TabberNeue doesn't pass the given value to be parsed and uses it as plain text.

Is parsing the tab name as wikitext reasonable? I guess this would also allow things like putting images in the tab header, but I wouldn't be surprised if there'd be output that doesn't make sense to stick inside the HTML TabberNeue generates for the tabs.

Is there any other reasonable way to style portions of the text?

alistair3149 commented 2 years ago

Is parsing the tab name as wikitext reasonable? Is there any other reasonable way to style portions of the text?

It is possible to parse the tab name but it would cause performance issues that is not worth it if you want to style the text. You can always target the tab names with CSS since they all have unique id attributes assigned.

Fyren commented 2 years ago

I did specify potions of the name because they wanted to do something like foo {{color|1|bar}} baz and not style the whole thing. Would passing the tab name to be parsed as wikitext have significant overhead compared to if the same text were just straight inside the article?

alistair3149 commented 2 years ago

I will explore adding a config to allow wikitext parsing in tab header. There will be additional overhead but I don't have a measurement for now.