Skip to content

Commit

Permalink
Use scraperlib content rewriting code
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Oct 18, 2024
1 parent 9842509 commit 5f1960d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion scraper/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ readme = "../README.md"
dependencies = [
"yt-dlp", # youtube-dl should be updated as frequently as possible
"jinja2==3.1.4",
"zimscraperlib==4.0.0",
#"zimscraperlib==4.0.0",
"zimscraperlib @ git+https://github.com/openzim/python-scraperlib@content_rewriting",
"requests==2.32.3",
"types-requests==2.32.0.20240914",
"kiwixstorage==0.9.0",
Expand Down
12 changes: 6 additions & 6 deletions scraper/src/libretexts2zim/processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@
stream_file, # pyright: ignore[reportUnknownVariableType]
)
from zimscraperlib.image import resize_image
from zimscraperlib.rewriting.css import CssRewriter
from zimscraperlib.rewriting.url_rewriting import (
ArticleUrlRewriter,
HttpUrl,
ZimPath,
)
from zimscraperlib.zim import Creator
from zimscraperlib.zim.filesystem import validate_zimfile_creatable
from zimscraperlib.zim.indexing import IndexData
Expand All @@ -22,12 +28,6 @@
LibreTextsMetadata,
)
from libretexts2zim.constants import LANGUAGE_ISO_639_3, NAME, ROOT_DIR, VERSION, logger
from libretexts2zim.content_rewriting.css import CssRewriter
from libretexts2zim.content_rewriting.url_rewriting import (
ArticleUrlRewriter,
HttpUrl,
ZimPath,
)
from libretexts2zim.ui import (
ConfigModel,
PageContentModel,
Expand Down

0 comments on commit 5f1960d

Please sign in to comment.