Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement MediaWiki REST API render #1926

Closed
wants to merge 8 commits into from

Conversation

VadimKovalenkoSNF
Copy link
Collaborator

@VadimKovalenkoSNF VadimKovalenkoSNF commented Oct 11, 2023

Fixes #1601
Depends on #1929

@kelson42
Copy link
Collaborator

@VadimKovalenkoSNF Is this end-point outpout different from WikimediaDesktop? How?

@VadimKovalenkoSNF
Copy link
Collaborator Author

VadimKovalenkoSNF commented Oct 12, 2023

@kelson42
WikimediaDesktop returns the full HTML of the page (in text/html format) and MediaWiki REST API the content inside div.mw-parser-output along with headhtml property the same (but should be retrieved from json first, similar to VisualEditor response). MediaWiki REST API render does not return content optimized for mobile representation as it was with mobile-sections. This is the MediaWiki Action API that returns parsed content and headhtml

Upd: MediaWiki REST API can return articles in Parsoid HTML format: example https://en.wikipedia.org/w/rest.php/v1/page/Canada/html

@codecov
Copy link

codecov bot commented Oct 23, 2023

Codecov Report

Attention: 21 lines in your changes are missing coverage. Please review.

Comparison is base (8ebd7d0) 76.14% compared to head (d3c6f11) 75.88%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1926      +/-   ##
==========================================
- Coverage   76.14%   75.88%   -0.27%     
==========================================
  Files          37       39       +2     
  Lines        2985     3035      +50     
  Branches      653      664      +11     
==========================================
+ Hits         2273     2303      +30     
- Misses        617      634      +17     
- Partials       95       98       +3     
Files Coverage Δ
src/MediaWiki.ts 87.08% <100.00%> (+0.51%) ⬆️
src/mwoffliner.lib.ts 74.90% <100.00%> (+0.09%) ⬆️
src/renderers/abstract.renderer.ts 86.17% <ø> (ø)
src/renderers/mediawiki-rest-api.renderer.ts 100.00% <100.00%> (ø)
src/util/builders/url/api.director.ts 87.50% <100.00%> (-1.98%) ⬇️
src/util/builders/url/base.director.ts 84.21% <100.00%> (ø)
...c/util/builders/url/mediawiki-rest-api.director.ts 100.00% <100.00%> (ø)
src/util/const.ts 100.00% <100.00%> (ø)
src/Downloader.ts 70.17% <92.85%> (+1.00%) ⬆️
src/renderers/renderer.builder.ts 54.38% <40.00%> (-3.95%) ⬇️
... and 1 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@VadimKovalenkoSNF
Copy link
Collaborator Author

This PR should be closed. Current successor is PR #1947

@kelson42
Copy link
Collaborator

kelson42 commented Dec 4, 2023

Superseeded by #1947

@kelson42 kelson42 closed this Dec 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support of new Mediawiki REST API
2 participants