Skip to content

Commit

Permalink
Use HTML/JS/CSS functions extracted in zimscraperlib
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit74 committed Nov 5, 2024
1 parent 20bf43f commit e7eda21
Show file tree
Hide file tree
Showing 18 changed files with 32 additions and 4,309 deletions.
6 changes: 5 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ readme = "README.md"
dependencies = [
"warcio==1.7.4",
"requests==2.32.3",
"zimscraperlib==4.0.0",
# use zimscraperlib pinned version once content rewriting functions have been released
"zimscraperlib @ git+https://github.com/openzim/python-scraperlib@main",
"jinja2==3.1.4", # also update version in build-system above and in build_js.sh
# to support possible brotli content in warcs, must be added separately
"brotlipy==0.7.0",
Expand All @@ -24,6 +25,9 @@ dependencies = [
]
dynamic = ["authors", "classifiers", "keywords", "license", "version", "urls"]

[tool.hatch.metadata]
allow-direct-references = true

[tool.hatch.metadata.hooks.openzim-metadata]
kind = "scraper"
additional-keywords = ["warc"]
Expand Down
4 changes: 2 additions & 2 deletions rules/generate_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
import pytest
from warc2zim.url_rewriting import apply_fuzzy_rules
from zimscraperlib.rewriting.url_rewriting import ArticleUrlRewriter
from .utils import ContentForTests
Expand All @@ -156,7 +156,7 @@ def {{ rule['name'] }}_case(request):
def test_fuzzyrules_{{ rule['name'] }}({{ rule['name'] }}_case):
assert (
apply_fuzzy_rules({{ rule['name'] }}_case.input_str)
ArticleUrlRewriter.apply_additional_rules({{ rule['name'] }}_case.input_str)
== {{ rule['name'] }}_case.expected_str
)
{% endfor %}
Expand Down
Empty file.
115 changes: 0 additions & 115 deletions src/warc2zim/content_rewriting/css.py

This file was deleted.

Loading

0 comments on commit e7eda21

Please sign in to comment.