Page MenuHomePhabricator

Wikisource Export: allow manual download buttons for other pages
Open, Needs TriagePublic

Description

It would be helpful to allow placing download buttons manually on pages that point to *other* pages. The primary use of this at enWS would be download buttons next to items on the main page.

Spun out from T271869#6802322, where a parser function like {{#wikisource:download|page=Foo}} was suggested.

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Inductiveload renamed this task from Ws export: all manual download buttons for other pages to Ws export: allow manual download buttons for other pages.Feb 17 2021, 11:31 AM

I wonder if this could be the open-in system as well, for displaying the download button on a page that otherwise wouldn't get it. Gives us more flexibility. Parameters could be:

{{#wikisource:download
 | page = Foo
 | location = [here|header]
 | font = Font name
}}

Then subpages (e.g. in the {{header}} template) could set their download button to point to the main page.

Samwilson renamed this task from Ws export: allow manual download buttons for other pages to Wikisource Export: allow manual download buttons for other pages.Mar 16 2021, 7:55 AM
Samwilson added a subscriber: ifried.

What would actually be required to implement this (in broad technical strokes for someone vaguely familiar with PHP and Mediawiki, but not this extension specifically)?

@Inductiveload It'd require creating a parser function in the Wikisource extension, and refactoring \MediaWiki\Extension\Wikisource\HookHandler\ArticleViewHeaderHandler::onArticleViewHeader() so that the two hook handlers (the new parser function one and the existing ArticleViewHeaderHandler one) could call the same button-creating code (but with different parameters). Possibly a single hook handler class should be used, that implements both hooks; or maybe moving the button out into its own class would enater.

If you want to take this on, I can help with code review etc.