Page MenuHomePhabricator

Don't show download button on subpages, and opt-out for top-level pages
Open, Needs TriagePublic

Description

As a Wikisource user, I don't want the download button to show on subpages, so that I don't encounter the situation of attempting to download a whole book and yet only download a section of a book.

Background: The download button (added in T271869) should only be shown on top-level pages. Two magic words should be added:

  • __WIKISOURCEDOWNLOAD__ to force the display of the button (e.g. on work title subpages for multi-work volumes); and
  • __NOWIKISOURCEDOWNLOAD__ to prevent it (e.g. on disambiguation pages).

Relevant links:

Acceptance Criteria:

  • Don't show on disambiguation pages
  • Don't show on subpages (but can manually opt-in)
  • Can opt-out for top-level pages

Event Timeline

Restricted Application added a subscriber: Aklapper. · View Herald Transcript

Not very good idea. There are works like encyclopedias or periodicals with thousands of subpages.
This solutions would need to add magic word to every subpage.

Not very good idea. There are works like encyclopedias or periodicals with thousands of subpages.
This solutions would need to add magic word to every subpage.

At least on enWS, this kind of work will typically have a work-specific template of some kind in which the magic word can be added. And where that is not already the case it is relatively straightforward to bulk-add such a template to those kinds of works.

I'm now wondering if this should be implemented as a parser function, so it can take extra parameters, e.g.:

{{#wikisource:export|title=Foo|display=button}}
  • title to export a different page (e.g. could be used on some subpages to default to the main work).
  • display could be title for the standard button next to the page title; no to override the default and not show a button next to the title; button for the same button located wherever the parser function is called; or link for a plain link.
  • font to set an embedded font (useful for works such as those identified in T274997 where an English text contains non-English characters)

There are different types of works with subpages:

  • cycle of poems - export of single poem is possible
  • alamanac - export of single part is possible
  • encyclopedia - export of single entry is possible
  • periodical - export of single article is possible
  • book with chapters - export of single chapter is not possible (but why not?).
  • some more works - ???

So download button is not wanted in only one of many types of works.

@JAnD I'm not sure what you're saying — does the proposed idea of being able to opt out and in not work for these types of work? Or do you mean the button should always be shown, and then only selectively hidden?

  • book with chapters - export of single chapter is not possible (but why not?).

I think this is probably the original impetus for this task: readers clicking on 'Download' while they're viewing a chapter are perhaps thinking they'll be downloading the whole work — they'll be surprised to only get one chapter. I guess the balance is: are there more subpages that usually aren't wanted as exports, or more that are?

Anyway, regardless of when the button is shown by default, we do need some mechanics for changing it's behaviour.

I mean - all pages should be defaultly downloadable.
And there might be possibility to disable download of some pages.

Maybe if this is subpage, there should be checkbox

do you want to download 
* actual subpage (x)
* whole work ()

en.wikisource maybe probably have many books.

On cs.wikisource there are 1/2 of all pages articles from encyclopedias (23k/50k) and many more pages are news articles and poem from almanacs. Classic books with chapters are only minority, maybe 2% of all pages

If we want to mark every subpage which should be downloadable, we must edit about 40k pages

This task seems to be getting more complex by the day. I wonder if it might be better to just keep it simple and disable the download button for disambiguation pages, as that case is unambiguously needed. This could be done with the existing __DISAMBIG__ magic word via a hook handler in the Disambiguator extension. I would hate to see a solution that creates a lot more curation work for Wikisource, as en.wikisource (at least) already has lots of curation backlogs. Just some thoughts to consider.

We have a disambiguation template, can't that just add __NOWIKISOURCEDOWNLOAD__ (also {{versions}})?

I agree, it's good to keep it simple. But I sort of think that {{#wikisource:export|display=no}} is much the same complexity as __NOWIKISOURCEDOWNLOAD__ but also gives us the opportunity later to extend it to be able to do things like T275003: Wikisource Export: allow manual download buttons for other pages.

@Samwilson my point was more that it's pretty easy to disable the download button on-wiki (edit to two templates). I don't really mind what the sysntax is - it's just slug of text that "does stuff" once it's in a template.

Though it would probably make sense to hook into __DISAMBIG__ as well so it's automagic on all wikis. And then that can be overridden/extended/pointed elsewhere manually where needed.

Change 937576 had a related patch set uploaded (by Samwilson; author: Samwilson):

[mediawiki/extensions/Wikisource@master] Don't show WS Export download button on disambigation pages

https://gerrit.wikimedia.org/r/937576

Change 937576 merged by jenkins-bot:

[mediawiki/extensions/Wikisource@master] Don't show WS Export download button on disambigation pages

https://gerrit.wikimedia.org/r/937576