Skip to content
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
6 changes: 3 additions & 3 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,14 @@ jobs:
uses: actions/setup-python@v4
- name: Install dependencies
run: |
pip install -r docs/requirements.txt
pip install -r docs_sphinx/requirements.txt
- name: Sphinx build
run: |
sphinx-build docs/source docs/build
sphinx-build docs_sphinx/source docs_sphinx/build
- name: Deploy to GH Pages
uses: peaceiris/actions-gh-pages@v3
with:
publish_branch: gh-pages
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/build/
publish_dir: docs_sphinx/build/
force_orphan: true
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ repos:
rev: v0.902
hooks:
- id: mypy
exclude: "tests/|docs/"
exclude: "tests/|docs/|docs_sphinx/"
4 changes: 2 additions & 2 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ build:

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py
configuration: docs_sphinx/source/conf.py

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
- requirements: docs_sphinx/requirements.txt
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ Construct Directed Acyclic Graph (DAG) from list, dictionary, and pandas DataFra
These functions are not standalone functions.
Under the hood, they have the following dependency,

.. image:: https://github.com/kayjan/bigtree/raw/master/assets/sphinx/dag_construct.png
:target: https://github.com/kayjan/bigtree/raw/master/assets/sphinx/dag_construct.png
.. image:: https://github.com/kayjan/bigtree/raw/master/assets/docs/dag_construct.png
:target: https://github.com/kayjan/bigtree/raw/master/assets/docs/dag_construct.png
:alt: DAG Constructor Dependency Diagram

.. automodule:: bigtree.dag.construct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ To add attributes to existing tree,
These functions are not standalone functions.
Under the hood, they have the following dependency,

.. image:: https://github.com/kayjan/bigtree/raw/master/assets/sphinx/tree_construct.png
:target: https://github.com/kayjan/bigtree/raw/master/assets/sphinx/tree_construct.png
.. image:: https://github.com/kayjan/bigtree/raw/master/assets/docs/tree_construct.png
:target: https://github.com/kayjan/bigtree/raw/master/assets/docs/tree_construct.png
:alt: Tree Constructor Dependency Diagram

.. automodule:: bigtree.tree.construct
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ All other methods calls these 2 methods directly.
Tree Modification Illustration
----------------------------------

.. image:: https://github.com/kayjan/bigtree/raw/master/assets/sphinx/modify_shift_and_copy.png
:target: https://github.com/kayjan/bigtree/raw/master/assets/sphinx/modify_shift_and_copy.png
.. image:: https://github.com/kayjan/bigtree/raw/master/assets/docs/modify_shift_and_copy.png
:target: https://github.com/kayjan/bigtree/raw/master/assets/docs/modify_shift_and_copy.png
:width: 80%
:align: center
:alt: Shift and Copy Example
Expand Down Expand Up @@ -126,8 +126,8 @@ Tree Modification Illustration
- "/a/b/c"
- Shift/copy node `c`, skip if "/a/c" cannot be found

.. image:: https://github.com/kayjan/bigtree/raw/master/assets/sphinx/modify_advanced.png
:target: https://github.com/kayjan/bigtree/raw/master/assets/sphinx/modify_advanced.png
.. image:: https://github.com/kayjan/bigtree/raw/master/assets/docs/modify_advanced.png
:target: https://github.com/kayjan/bigtree/raw/master/assets/docs/modify_advanced.png
:alt: Advanced Shift Example

.. list-table:: Sample Tree Modification (Advanced)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ g = BinaryNode(7, parent=c)
h = BinaryNode(8, parent=d)

graph = tree_to_dot(a, node_colour="gold")
graph.write_png("assets/docs/demo_binarytree.png")
graph.write_png("assets/demo/binarytree.png")
```

![Sample DAG Output](https://github.com/kayjan/bigtree/raw/master/assets/docs/demo_binarytree.png)
![Sample DAG Output](https://github.com/kayjan/bigtree/raw/master/assets/demo/binarytree.png)

### 2. From list

Expand Down
4 changes: 2 additions & 2 deletions docs/source/demo/dag.md → docs_sphinx/source/demo/dag.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ h = DAGNode("h")
g = DAGNode("g", parents=[c], children=[h])

graph = dag_to_dot(a, node_colour="gold")
graph.write_png("assets/docs/demo_dag.png")
graph.write_png("assets/demo/dag.png")
```

![Sample DAG Output](https://github.com/kayjan/bigtree/raw/master/assets/docs/demo_dag.png)
![Sample DAG Output](https://github.com/kayjan/bigtree/raw/master/assets/demo/dag.png)

### 2. From list

Expand Down
16 changes: 8 additions & 8 deletions docs/source/demo/tree.md → docs_sphinx/source/demo/tree.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ root.hshow()
# └─ c

graph = tree_to_dot(root, node_colour="gold")
graph.write_png("assets/docs/demo_tree.png")
graph.write_png("assets/demo/tree.png")
```

![Sample Tree Output](https://github.com/kayjan/bigtree/raw/master/assets/docs/demo_tree.png)
![Sample Tree Output](https://github.com/kayjan/bigtree/raw/master/assets/demo/tree.png)

{emphasize-lines="8-10"}
```python
Expand Down Expand Up @@ -908,11 +908,11 @@ tree_to_dataframe(
from bigtree import tree_to_dot

graph = tree_to_dot(root, node_colour="gold")
graph.write_png("assets/docs/demo_dot.png")
graph.write_png("assets/demo/dot.png")
```
- demo_dot.png
- dot.png

![Sample Dot Image Output](https://github.com/kayjan/bigtree/raw/master/assets/docs/demo_dot.png)
![Sample Dot Image Output](https://github.com/kayjan/bigtree/raw/master/assets/demo/dot.png)

### 6. Export to Pillow (and png)

Expand All @@ -921,11 +921,11 @@ graph.write_png("assets/docs/demo_dot.png")
from bigtree import tree_to_pillow

pillow_image = tree_to_pillow(root)
pillow_image.save("assets/docs/demo_pillow.png")
pillow_image.save("assets/demo/pillow.png")
```
- demo_pillow.png
- pillow.png

![Sample Pillow Image Output](https://github.com/kayjan/bigtree/raw/master/assets/docs/demo_pillow.png)
![Sample Pillow Image Output](https://github.com/kayjan/bigtree/raw/master/assets/demo/pillow.png)

### 7. Export to Mermaid Flowchart (and md)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ c = WeightedNode("c", parent=root, weight=2)
d = WeightedNode("d", parent=b, weight=3)

graph = tree_to_dot(root, node_colour="gold", edge_attr="edge_attr")
graph.write_png("assets/sphinx/weighted_tree.png")
graph.write_png("assets/docs/weighted_tree.png")
```

![Sample DAG Output](https://github.com/kayjan/bigtree/raw/master/assets/sphinx/weighted_tree.png)
![Sample DAG Output](https://github.com/kayjan/bigtree/raw/master/assets/docs/weighted_tree.png)
File renamed without changes.
File renamed without changes.
File renamed without changes.
25 changes: 19 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,24 @@ dependencies = [
]

[tool.hatch.envs.docs.scripts]
html = "sphinx-build -M html docs/source docs/build"
coverage = "sphinx-build -v -b coverage docs/source docs/build/coverage"
doctest = "sphinx-build -v -b doctest docs/source docs/build/doctest"
clean = "sphinx-build -M clean docs/source docs/build"
clean-html = "sphinx-build -M html docs/source docs/build & sphinx-build -M clean docs/source docs/build"
html = "sphinx-build -M html docs_sphinx/source docs_sphinx/build"
coverage = "sphinx-build -v -b coverage docs_sphinx/source docs_sphinx/build/coverage"
doctest = "sphinx-build -v -b doctest docs_sphinx/source docs_sphinx/build/doctest"
clean = "sphinx-build -M clean docs_sphinx/source docs_sphinx/build"
clean-html = "sphinx-build -M html docs_sphinx/source docs_sphinx/build & sphinx-build -M clean docs_sphinx/source docs_sphinx/build"

[tool.hatch.envs.mkdocs]
dependencies = [
"mkdocs",
"IPython",
"pandas",
"pydot",
"Pillow",
]

[tool.hatch.envs.mkdocs.scripts]
build = "mkdocs build"
serve = "mkdocs serve"

[[tool.hatch.envs.test.matrix]]
python = ["37", "38", "39", "310", "311"]
Expand All @@ -111,7 +124,7 @@ exclude_lines = [
[tool.flake8]
ignore = """E501, W503"""
per-file-ignores = """
docs/source/conf.py: E402
docs_sphinx/source/conf.py: E402
bigtree/__init__.py: F401
"""

Expand Down