Page MenuHomePhabricator

[GTWL] Include hint about excluded tables when generating a PDF
Closed, ResolvedPublic3 Story Points

Description

Problem: When rendering an article as PDF tables are left out currently (see {T73808: Support tables in PDF rendering (tracking)}). What makes this worse is that there is no hint on the page (on the rendering page and on the download page) informing the user about that fact.

Task: Add a hint to the "Download done" page that lets users know about the problem.

Details: On the special page "Rendering finished" that appears when a PDF has been printed, I want to see the following message:

Aktuell werden Tabellen nicht dargestellt, wenn die Funktionen „als PDF herunterladen“ und „Buch erstellen“ ausgewählt wurden. Über einen Umweg kannst du aber PDFs und Bücher mit Tabellen erhalten.

English version:

Currently PDF documents do not contain tables, for example when you use the functions "Download as PDF" or "Create a book". There is a work around to include tables in the PDF documents.

The second sentence (Über einen Umweg kannst du aber PDFs und Bücher mit Tabellen erhalten.) should look like a link. When clicking on the sentence, I want to get more information underneath:

Der Umweg: Unter Windows (ab 10), OSX und Linux kann über den Browser ein PDF erstellt werden. Klicke dazu den Link "Druckversion" in der Seitenleiste an. Wähle nun "Drucken" im Browser und nutze die Option zum Drucken in eine PDF-Datei. Weniger anzeigen.

English version:

The work around: With Windows (from 10 on), OSX and Linux you can use the browser to create a PDF. Click on the link "Printable version" in the side bar. Then select "Print" in the browser menu and use the option of printing a PDF document. Show less.

The second sentence (Weniger anzeigen) should look link like. When clicking on it, I want the details to disappear and to see the first version of the text again.

Expected outcome:

  • Message is on the page
  • The language is the user's language

Background: This is part of the German Community Wishlist 2015: https://de.wikipedia.org/wiki/Wikipedia:Umfragen/Technische_W%C3%BCnsche_2015/Topw%C3%BCnsche#Tabellen_in_PDFs_darstellen_.5BUmfrage_2015.5D (German)

Event Timeline

Restricted Application added subscribers: Zppix, Sadads, Aklapper. · View Herald TranscriptMay 18 2016, 11:45 AM

@Lea_WMDE, @Bmueller and probably @Jan_Dittrich need to figure out how that hint should look like exactly and what exactly it should contain.

This is the mock:

Bmueller updated the task description. (Show Details)May 19 2016, 11:54 AM
Tobi_WMDE_SW set the point value for this task to 5.
Tobi_WMDE_SW raised the priority of this task from Normal to High.May 19 2016, 4:02 PM
Lea_WMDE lowered the priority of this task from High to Normal.May 19 2016, 4:04 PM
Lea_WMDE updated the task description. (Show Details)
Lea_WMDE updated the task description. (Show Details)
Addshore updated the task description. (Show Details)May 23 2016, 1:28 PM
Addshore moved this task from Backlog to Doing on the TCB-Team-Sprint-2016-05-19 board.

Change 290395 had a related patch set uploaded (by Addshore):
Split rendering finsihed i18n messages

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

Change 290417 had a related patch set uploaded (by Addshore):
WIP DNM DRAFT Include hint about excluded tables

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

Okay, so this message now seems wrong for the extension..

The extension can talk to a configurable OCG service to render things.
That OCG service may or may not render tables.
The messages in this ticket do not make sense for both cases.

So @Addshore came up with a nice way to show the message only when OCG renderer service is not able to render tables.
But there is also a plain text rendering mode. In plain text output tables are also excluded completely. Wouldn't it make sense to cover also plain text rendering mode? For instance the message could not mention particular rendering format. Also, the suggested workaround is only valid when user asks for PDF. Or is it intended to show the message as in the task description for PDF rendering only, and not change anything for the plain text rendering?

WMDE-leszek added a comment.EditedMay 25 2016, 12:25 PM

My recent comment might not actually be a problem. I didn't notice that Wikipedias offer only links to PDF rendering.
According to https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/InitialiseSettings.php#L11718 all WM production wikis only PDF rendering is available.
And as per https://github.com/wikimedia/operations-mediawiki-config/blob/master/wmf-config/CommonSettings-labs.php#L235 all wikis on Labs (e.g. beta wikis) offer both PDF and Plain Text rendering.
There might also be non-WM wikis that use Collection extensions and WM OCG renderers, and have both PDF and plain text (and why not some other formats) rendering enabled.

Possible solutions:

  1. Do not change the message (ie. have it saying explicitly about excluded tables in PDF documents) and have it displayed whenever $wgCollectionShowRenderTableNote is true. Disadvantage: as long as this will not affect WM production wikis, it would show PDF-related message on TXT rendering on beta wikis, and possibly on non-WM wikis.
  2. Rephrase the message so it is generic enough to serve as a warning shown for other formats than PDF. I believe that "PDF workaround" could still be used but that would require some smart wording, so it would not confuse users ("I am rendering TXT, why it bothers me about some PDFs here?!").

What seems tempting is to make wgCollectionShowRenderTableNote rather some kind of PDF- and table-related flag and only show messages for PDF rendering. But as far as I know the extension doesn't really know what kind of renderer it uses (is it mwlib or OCG or whatever else), and what is the output format. So apart from hacky (and rather WM-specific) solutions like checking what is the value of writer parameter passed to the extension (for WM wikis it doesn't even contain "pdf" word in it!) which should be in my opinion avoided, it looks like it is not possible to have message shown only for PDF message.
Or do you happen to have some completely different idea @Addshore?

Making the message more general may make sense (removing the word PDF).
It might be possible to pass this through as message parameter but I feel that might be more effort than it is worth.

@Lea_WMDE what are your thoughts here. It looks like we need to reword the message a bit!

@Addshore @WMDE-leszek What do you think about:

Currently documents do not contain tables, for example when you use the functions "Download as PDF", "Download as Plain Text" or "Create a book". There is a workaround to include tables in PDF documents.

and keep the workaround part as is. We mention all cases that tables don't exist, and offer a workaround for the pdf case.

Change 290395 merged by jenkins-bot:
Split rendering finished i18n messages

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

Change 292484 had a related patch set uploaded (by Addshore):
Include optional hint about excluded tables

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

Change 292484 abandoned by Addshore:
Include optional hint about excluded tables

Reason:
This was a resubmit of https://gerrit.wikimedia.org/r/#/c/290417/ which is still failing for some reason....

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

@cscott could you please have a look at https://gerrit.wikimedia.org/r/#/c/290417/ ? That would be great!

At least we want to show a hint, that tables are not include when generating PDFs.

WMDE-Fisch changed the point value for this task from 5 to 3.

Change 290417 merged by jenkins-bot:
Optionally include extra notes after rendering

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

Change 305012 had a related patch set uploaded (by Addshore):
Add Collection render note for articles & rdf2latex

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

Change 305012 merged by jenkins-bot:
Add Collection render note for articles & rdf2latex

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

Addshore closed this task as Resolved.Aug 22 2016, 1:38 PM
Addshore moved this task from Active 🚁 to Closing ✔️ on the User-Addshore board.

Mentioned in SAL [2016-08-22T13:39:04Z] <hashar@tin> Synchronized wmf-config/CommonSettings.php: Add Collection render note for articles & rdf2latex -t - T135613 (duration: 00m 49s)

Mentioned in SAL [2016-08-22T13:40:51Z] <hashar@tin> Synchronized wmf-config/CommonSettings.php: Add Collection render note for articles rdf2latex -t - T135613 (duration: 00m 48s)