Skip to content

Commit

Permalink
docs: Render textual natively (#24)
Browse files Browse the repository at this point in the history
* docs: Render textual natively

* add textual as docs dep
  • Loading branch information
FBruzzesi authored Jun 10, 2024
1 parent 0e5f166 commit f7ae70e
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy-docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ jobs:
- name: Install dependencies and deploy
run: |
uv install mkdocs-material --system
uv install mkdocs-material textual --system
mkdocs gh-deploy --force
2 changes: 1 addition & 1 deletion .github/workflows/pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,5 +61,5 @@ jobs:
run: curl -LsSf https://astral.sh/uv/install.sh | sh
- name: Install dependencies and check docs can build
run: |
uv pip install mkdocs-material --system
uv pip install mkdocs-material textual --system
mkdocs build -v -s
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -160,3 +160,6 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/

# Cache of screenshots used in the docs
.screenshot_cache
2 changes: 2 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ clean-folders:
.pytest_cache */.pytest_cache */**/.pytest_cache \
.ruff_cache */.ruff_cache */**/.ruff_cache \
.mypy_cache */.mypy_cache */**/.mypy_cache \
.screenshot_cache \
site build dist htmlcov .coverage .tox


lint:
ruff version
Expand Down
2 changes: 1 addition & 1 deletion docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Scikit-learn smithy is a tool that helps you to forge scikit-learn compatible es

How can you use it?

- [x] Directly from the browser via our [web UI](https://sklearn-smithy.streamlit.app/){:target="_blank"} ([more info](user-guide.md/#web-ui)).
- [x] Directly from the browser via our [web UI](https://sklearn-smithy.streamlit.app/){:target="_blank"} ([more info](user-guide.md/#web-ui))
- [x] As a CLI (command line interface) in your terminal via the `smith forge` command ([more info](user-guide.md/#cli))
- [x] As a TUI (terminal user interface) in your terminal via the `smith-tui` command ([more info](user-guide.md/#tui))

Expand Down
18 changes: 8 additions & 10 deletions docs/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ TL;DR:

- [x] Available via the `smith forge` command.
- [x] It requires [installation](installation.md): `python -m pip install sklearn-smithy`
- [x] Powered by [typer](https://typer.tiangolo.com/).
- [x] Powered by [typer](https://typer.tiangolo.com/){:target="_blank"}.

Once the library is installed, the `smith` CLI (Command Line Interface) will be available and that is the primary way to interact with the `smithy` package.

Expand Down Expand Up @@ -64,13 +64,12 @@ Now the estimator template to be filled will be available at the specified path
<div class="termy">

```console
$ cat path/to/file.py
$ cat path/to/file.py | head -n 5
import numpy as np

from sklearn.base import BaseEstimator, ClassifierMixin
from sklearn.utils import check_X_y
from sklearn.utils.validation import check_is_fitted, check_array
...
```

</div>
Expand All @@ -81,14 +80,13 @@ TL;DR:

- [x] Available via the `smith-tui` command.
- [x] It requires installing [extra dependencies](installation.md#extra-dependencies): `python -m pip install "sklearn-smithy[textual]"`
- [x] Powered by [textual](https://textual.textualize.io/).
- [x] Powered by [textual](https://textual.textualize.io/){:target="_blank"}.

If you like the CLI, but prefer a more interactive and graphical way from the comfort of your terminal, you can use the TUI (Terminal User Interface) provided by the `smith-tui` command.

??? example "Screenshot"
```console
$ smith-tui
```

```console
$ smith-tui
```

![TUI](img/tui.png)
```{.textual path="sksmithy/tui/_tui.py" columns="127" lines="32"}
```
6 changes: 5 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,11 @@ markdown_extensions:
permalink: true
- pymdownx.inlinehilite
- pymdownx.snippets
- pymdownx.superfences
- pymdownx.superfences:
custom_fences:
- name: textual
class: textual
format: !!python/name:textual._doc.format_svg
- pymdownx.details
- pymdownx.tasklist:
custom_checkbox: true
Expand Down

0 comments on commit f7ae70e

Please sign in to comment.