Page MenuHomePhabricator

Allow to write proper stylesheet for ProofreadPage books
Closed, DuplicatePublic

Description

ProofreadPage Index: pages currently allows to inject some CSS to Page: pages. It would be nice to have a proper system based on TemplateStyles that allows to insert a stylesheet on Page: pages and main namespace pages that transcludes the pages from the same Index:.

Idea from: https://en.wikisource.org/wiki/Wikisource:Scriptorium/Help#Template_styles_to_reduce_calls_to_ts...

See also T200632: Allow template parameters to provide CSS to a templatestyles stylesheet

Event Timeline

Some questions / talking points :-

Would this need an additional namespace for Style: ? Or was it planned to do this as Index name/Styles/x.css?

Would it be possible to have a single Style: page that would cover multiple works? For some works which are largely standardized like US Supreme Court opinions writing essentially the same stylesheet for many Index's would be inefficient.

Multiple Style Import: On a large work, the amount of formatting is such that it would make sense to split the formatting across various Style: sub pages, doing this would need the ability to import more than style sheet with TemplateStyles and to resolve conflicts between overlapping definitions..

Puesdo elements: Wikisource uses a number of Pusedo elements (such as POEM, REF etc, and although not a priority it would be nice to have a way of applying fixed formatting to some of those elements. ( As CSS can be used with XML, styling Pusedo elements might be plausible if the backend has a way to process the extracted CSS for those elements?)

I will also cross reference https://phabricator.wikimedia.org/T200632 here. Having parameterizeable style sheets in conjunction with per Index works would be immensely powerful, as you could write various generic style sheets, and then tweak them with parameters for individual works instead of having to completely re-write largely identical stylesheets. (Not a priority though).

I think this is potentially the same as T215165?

Basically, if we had a field on the Index page for CSS sheet(s) that all pages have (both in the Page NS and when transcluded), that would avoid having to add the templatestyle call in every page or transclusion

An example page that manually brings in a style in the page body is https://en.wikisource.org/w/index.php?title=Page:Os_Lus%C3%ADadas_(Cam%C3%B5es,_tr._Burton,_1880),_Volume_1.djvu/25&oldid=9373047

It would be annoying to have to write the template style call on every single page, and if you put it in the header with the header pre-fill field, you'll have to add another one manually when transcluding.

In terms of usability at en.WS, either the Index: page needs to get the auto-content-model set (otherwise only admins can make non-Template-NS styles), or T85847 needs to be done.