Skip to content
Closed
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ If you want to contribute to `html2image` or run tests locally, follow these ste

4. **Install dependencies (including development tools):**
```bash
uv pip install -e ".[dev]"
uv pip install -e .[dev]
```
This installs the package in editable mode along with all dependencies needed for testing and linting.

Expand Down
26 changes: 1 addition & 25 deletions html2image/html2image.py
Original file line number Diff line number Diff line change
Expand Up @@ -421,29 +421,6 @@ def _prepare_html_string(html_body, css_style_string):
"""
return dedent(prepared_html)

@staticmethod
def _prepare_css_str(css_file):
""" Creates a basic string fromatted from a css file.

Parameters
----------
- `css_file`: str

Returns
-------
- str
The contents of each css file.

"""
css_str = ""
for css in css_file:
temp_css_str = ''
with open(css, "r") as fd:
temp_css_str = fd.read()
css_str += temp_css_str + '\n'

return css_str

def screenshot(
self,
html_str=[], # html_str: Union[str, list] = [],
Expand Down Expand Up @@ -538,8 +515,7 @@ def screenshot(
base_name, _ = os.path.splitext(name)
html_filename = base_name + '.html'
content = Html2Image._prepare_html_string(
html, css_style_string if css_style_string != '' else Html2Image._prepare_css_str(
css_file)
html, css_style_string
)
self.load_str(content=content, as_filename=html_filename)
self.screenshot_loaded_file(
Expand Down
Loading