Skip to content

Commit

Permalink
try fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
janosh committed Nov 4, 2023
1 parent 4f8c700 commit e9b33f0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ default_install_hook_types: [pre-commit, commit-msg]

repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
rev: v0.1.4
hooks:
- id: ruff
args: [--fix]
Expand Down
11 changes: 7 additions & 4 deletions pymatviz/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def df_to_pdf(
Defaults to "".
styler_css (bool | dict[str, str]): Whether to apply some sensible default CSS
to the pandas Styler. Defaults to True. If dict, keys are selectors and
values CSS strings. Example: {"td, th": "border: none; padding: 4px 6px;"}
values CSS strings. Example: dict("td, th": "border: none; padding: 4px;")
**kwargs: Keyword arguments passed to Styler.to_html().
"""
try:
Expand Down Expand Up @@ -272,12 +272,15 @@ def normalize_and_crop_pdf(
raise RuntimeError("Error cropping PDF margins") from exc


TABLE_SCROLL_CSS = "table { overflow: scroll; max-width: 100%; display: block; }"


def df_to_html_table(
styler: Styler,
file_path: str | Path,
inline_props: str | None = "",
script: str | None = "",
styles: str | None = "table { overflow: scroll; max-width: 100%; display: block; }",
styles: str | None = TABLE_SCROLL_CSS,
styler_css: bool | dict[str, str] = True,
**kwargs: Any,
) -> None:
Expand All @@ -293,8 +296,8 @@ def df_to_html_table(
...props to allow for Svelte props forwarding to the table element. See
source code to inspect default script. Don't forget to include '<table' in
the somewhere in the script. Defaults to "".
styles (str): CSS rules to add to the table styles. Defaults to
`table { overflow: scroll; max-width: 100%; display: block; }`.
styles (str): CSS rules to apply to the table element. Defaults to
TABLE_SCROLL_CSS (overflow: scroll; max-width: 100%; display: block;)
styler_css (bool | dict[str, str]): Whether to apply some sensible default CSS
to the pandas Styler. Defaults to True. If dict, keys are selectors and
values CSS strings. Example: {"td, th": "border: none; padding: 4px 6px;"}
Expand Down

0 comments on commit e9b33f0

Please sign in to comment.