Page MenuHomePhabricator

cxserver page fetch api: Wrap translatable sections in <section> tags
Closed, ResolvedPublic

Description

CX2 wraps every source and target translatable sections in <section> tag. Currently this wrapping is done at client side. It would be ideal if the /page/:language/:title/:revision? api does this in cxserver itself.

Also, Parsoid is planning to do section wrapping for the HTML output as documented at https://www.mediawiki.org/wiki/Parsing/Notes/Section_Wrapping. This section wrapping is different from the section concept of CX. In CX, basically every immediate child of body is section - headings, paragraphs, images, tables etc. They make the CX translation units. To make CX abstract this difference, cxserver should unwrap the parsoid added sections and add the sections to match CX's concept of sections.

CX1 Does not know about sections at all. So we should be careful not to break CX1.

  • Refactor pageloader so that page fetch, segmentation, parsoid section strip, CX section wrapping can be grouped to a single class
  • Strip section tags from parsoid. CX1 and CX2 does not need these tags
  • Wrap every immediate child of body under CX section tag - For CX2 alone. Might require api versioning

Event Timeline

santhosh created this task.Oct 9 2017, 9:56 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptOct 9 2017, 9:56 AM

Parsoid's patch for section wrapping https://gerrit.wikimedia.org/r/#/c/364933/
Quoting from commit message:

Since ContentTranslation (CX) currently uses <section> tags internally,
to ensure that CX can distinguish between its internal use with
Parsoid-provided <section> tags, we need to add a distinguishing
attribute to our section tags and so this patch adds the
data-section-number attribute to all <section> tags
Arrbee triaged this task as Normal priority.Oct 10 2017, 7:05 AM
Arrbee assigned this task to santhosh.
Arrbee moved this task from Backlog to In Progress on the Language-2017-Oct-Dec board.
santhosh updated the task description. (Show Details)Oct 10 2017, 9:30 AM

Change 383329 had a related patch set uploaded (by Santhosh; owner: Santhosh):
[mediawiki/services/cxserver@master] Remove parsoid generated section tags if any from the parsed page content

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

santhosh updated the task description. (Show Details)Oct 10 2017, 10:05 AM

Change 383329 merged by jenkins-bot:
[mediawiki/services/cxserver@master] Remove parsoid generated section tags if any from the parsed page content

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

santhosh raised the priority of this task from Normal to Needs Triage.
santhosh moved this task from Apr.–June 2017 to CX2 on the ContentTranslation board.

Change 392831 had a related patch set uploaded (by Esanders; owner: Esanders):
[mediawiki/services/cxserver@master] 'data-section-number' -> 'data-mw-section-id'

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

Change 392831 merged by jenkins-bot:
[mediawiki/services/cxserver@master] 'data-section-number' -> 'data-mw-section-id'

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

santhosh updated the task description. (Show Details)Dec 5 2017, 5:31 AM
santhosh triaged this task as Normal priority.

Wrap every immediate child of body under CX section tag - For CX2 alone. Might require api versioning

https://gerrit.wikimedia.org/r/#/c/392790/

Arrbee moved this task from In Progress to QA on the Language-2017-Oct-Dec board.Dec 12 2017, 7:20 AM
santhosh moved this task from Backlog to QA on the Language-2018-Jan-Mar board.
Etonkovidova closed this task as Resolved.Mar 16 2018, 9:29 AM
KartikMistry moved this task from QA to Done on the Language-2018-Jan-Mar board.Mar 19 2018, 8:34 AM