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

Added support for customizing ZIM logo #37

Merged
merged 1 commit into from
Nov 13, 2024
Merged

Added support for customizing ZIM logo #37

merged 1 commit into from
Nov 13, 2024

Conversation

josephlewis42
Copy link
Collaborator

Fixes #32

This change adds a new flag --logo-format that can be used to set a logo for the ZIM from a URL or local file. It supports formatting directives. This means we can fetch files from freeCodeCamp/devdocs which does have 32x32 images (labeled as [email protected] in the repo). I didn't make this the default because they look fine but not great, but the property might still be useful with an S3 bucket or mounted volume.

devdocs2zim --output /tmp/devdocs \
  --slug=http,lua~5.4,vue~3 \
  --logo-format="https://raw.githubusercontent.com/freeCodeCamp/devdocs/refs/heads/main/public/icons/docs/{slug_without_version}/[email protected]"

I made the method that fetches and resizes the image static so I think it could be lifted up into devdocs2zim.

image

Copy link

codecov bot commented Nov 3, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 92.28%. Comparing base (9604fb8) to head (7b219f5).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #37      +/-   ##
==========================================
+ Coverage   91.85%   92.28%   +0.43%     
==========================================
  Files           4        4              
  Lines         356      376      +20     
  Branches       45       48       +3     
==========================================
+ Hits          327      347      +20     
  Misses         25       25              
  Partials        4        4              

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

@josephlewis42 josephlewis42 marked this pull request as ready for review November 3, 2024 23:49
Copy link
Contributor

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

Thank you, few comments

src/devdocs2zim/generator.py Show resolved Hide resolved
src/devdocs2zim/generator.py Outdated Show resolved Hide resolved
src/devdocs2zim/generator.py Show resolved Hide resolved
src/devdocs2zim/generator.py Outdated Show resolved Hide resolved
src/devdocs2zim/entrypoint.py Outdated Show resolved Hide resolved
Copy link
Contributor

@benoit74 benoit74 left a comment

Choose a reason for hiding this comment

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

LGTM

@benoit74 benoit74 merged commit f434258 into main Nov 13, 2024
8 checks passed
@benoit74 benoit74 deleted the jl/feat/icons branch November 13, 2024 07:53
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 for customizing ZIM illustration
2 participants