-
-
Notifications
You must be signed in to change notification settings - Fork 13
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
Move inline JS + CSS to dedicated files + remove unused pdf_redirect.… #43
Conversation
Still a draft for now, I'm performing a scrapper run to confirm it works as intended + checking codefactor result. |
5a49cc3
to
b324547
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed status of PR to review it. Looks good to me ✅
On pdf_redirect.html
, I think it was a first iteration to support PDF by providing access to them (via an HTML redirect).
Eventually, we added PDF.js because of Orange's deployment that lacks a PDF reader (and browser doesn't include it).
I'm not convinced bundled PDF.js is perfect for all cases but we've not used kolibri enough yet. Maybe it will come back as an option at some point. It's fine to remove it now.
@benoit74 please make sure those embed content like epub and pdf work fine with kiwix-serve nightly (on both Firefox and Chrome) as we've had difficulties with iframe sandboxing recently and I'm not sure we've checked kolibri ZIM files.
I'm struggling to reproduce the issue with the ZIM originally proposed in the issue #39 (https://download.kiwix.org/zim/videos/khan-academy-videos_ar_khws-l-dd_2021-12.zim). From my tests with Kiwix-JS, I do not have any blocking points with Kiwix JS to open this archive (I'm on Kiwix JS 3.9.0 with Firefox 114.0.2 or Chrome 114.0.5735.198 on a Mac). Regarding epub and pdf, do you have a sample Channel ID with such contents ? I tried to use |
kolibri was originaly developed for libretexts. See https://farm.openzim.org/recipes/libretexts-engineering |
There is no (more ?) epub in libretexts-engineering ... any other hint ? |
I added those two new changes:
I had to rewrite all commits because the first one contained messy Tested with Kiwix JS, pwa.kiwix.org and nightly kiwixserve on MacOS, each time with Firefox and Chrome, looks good so far. Please review and merge (I do not have sufficient rights, or give them to me ^^) Btw, I found why I did not achieved to understand the case mentioned in the original issue, it's an archive created by |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 @benoit74 please push the minor change we did together (move up the option in entrypoint) then merge.
Rationale
Fix #39
Changes
document.html
,perseus_exercice.html
,epub_embed.html
have been moved to dedicated file + cleaned-up from unused variables / code blocks<style>
block inepub_embed.html
has been moved to dedicated filepdf_redirect.html
has been removed because it was not used at all in the code base, and contained javascript which was templated so complex to migrate to dedicated file (would probably have needed to adapt the generation, but without the code generating, it was ... complex ^^)--node-ids
CLI parameter to process only few nodes (useful for debugging) with sample command in the README