Skip to content

Move Anchovy CSS parser to its own package (#32) #48

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

Merged
merged 1 commit into from
Aug 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 0 additions & 89 deletions examples/css_transformer.py

This file was deleted.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ markdown = [
# include as part of [base] via rich anyways.
"Pygments>=2.12.0",
]
css = ["tinycss2>=1.1.1"]
css = ["anchovy_css>=0.1.1"]
pretty = ["rich>=12.5.1"]
pillow = ["Pillow>=9.2.0"]
minify = ["lightningcss>=0.1.1,<1.0", "minify-html-onepass>=0.11.1"]
Expand Down
8 changes: 4 additions & 4 deletions src/anchovy/css/__init__.py → src/anchovy/css.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

from pathlib import Path

from ..core import Step
from ..dependencies import PipDependency
from .core import Step
from .dependencies import PipDependency


class AnchovyCSSStep(Step):
Expand All @@ -15,13 +15,13 @@ class AnchovyCSSStep(Step):
@classmethod
def get_dependencies(cls):
return {
PipDependency('tinycss2'),
PipDependency('anchovy_css'),
}

def __call__(self, path: Path, output_paths: list[Path]):
if not output_paths:
return
from .parser import process
from anchovy_css import process
processed = process(path.read_text(self.encoding))
for target_path in output_paths:
target_path.parent.mkdir(parents=True, exist_ok=True)
Expand Down
Loading