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

Fix inclusion of custom CSS in warc2zim2 #264

Merged
merged 2 commits into from
May 21, 2024
Merged

Conversation

benoit74
Copy link
Collaborator

@benoit74 benoit74 commented May 21, 2024

Fix #263

Changes:

  • Fix and simplify custom CSS injection
    • Pass the HTML code for CSS injection as stuff to be rendered (we need to compute the relative ZIM path based on current page location)
    • directly create a ZIM record instead of faking a WARC record (simplification and less error-prone)
    • store custom CSS at _zim_static/custom.css instead of magic URL warc2zim.kiwix.app/custom.css
  • Not related to Custom CSS URL is not rewritten #263 but a slight enhancement of Revisit decoding of documents from binary to string #260 changes: do not log issues about encoding when only concern is that no content-type was passed in HTTP headers

@benoit74 benoit74 self-assigned this May 21, 2024
@benoit74 benoit74 requested a review from rgaudin May 21, 2024 09:40
@benoit74 benoit74 marked this pull request as ready for review May 21, 2024 09:40
Copy link
Member

@rgaudin rgaudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

src/warc2zim/items.py Outdated Show resolved Hide resolved
- pass the CSS as stuff to be rendered (we need to compute the relative
  ZIM path based on current page location)
- directly create a ZIM record instead of faking a WARC record
  (simplification and less error-prone)
- store custom CSS at `_zim_static/custom.css` instead of magic URL `warc2zim.kiwix.app/custom.css`
@benoit74 benoit74 merged commit 5acf76b into warc2zim2 May 21, 2024
4 checks passed
@benoit74 benoit74 deleted the fix_custom_css branch May 21, 2024 11:13
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.

2 participants