Skip to content

Commit

Permalink
fix #385 use ipython notebook to maintain docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemia committed Apr 9, 2024
1 parent b302287 commit 7c8d58f
Show file tree
Hide file tree
Showing 4 changed files with 314 additions and 1 deletion.
307 changes: 307 additions & 0 deletions docs/usage/how_to_use-1.ipynb

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ nav:
- Get Started:
- Overview: index.md
- Usage:
- How to Use: usage/how_to_use.md
- How to Use: usage/how_to_use-1.ipynb
- API Documentation:
- ffmpeg: src/base.md
- types: src/types.md
Expand Down Expand Up @@ -110,6 +110,7 @@ markdown_extensions:

plugins:
- search
- mknotebooks
- mkdocstrings:
handlers:
python:
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ mkdocstrings-python = "^1.8.0"
pymdown-extensions = "^10.7"
griffe_inherited_docstrings = "*"
black = "*"
ipykernel = "^6.29.4"

[tool.mypy]
exclude = "^(migrations|commands|sandbox|samples|sdk)/"
Expand Down
4 changes: 4 additions & 0 deletions src/ffmpeg/dag/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@ def view(self, format: Literal["png", "svg", "dot"] = "png") -> str:

return view(self.node, format=format)

def _repr_png_(self) -> bytes:
with open(self.view(format="png"), "rb") as f:
return f.read()

Check warning on line 70 in src/ffmpeg/dag/schema.py

View check run for this annotation

Codecov / codecov/patch

src/ffmpeg/dag/schema.py#L69-L70

Added lines #L69 - L70 were not covered by tests


@dataclass(frozen=True, kw_only=True)
class Node(HashableBaseModel, ABC):
Expand Down

0 comments on commit 7c8d58f

Please sign in to comment.