From 971ea7d275f8a8b82121c75ac50d8c9d7ce8af85 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Wed, 28 Aug 2024 09:52:51 +0100 Subject: [PATCH 1/4] docs: Update `black`, `ruff` references --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8950c27..1b5a928 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ python -m venv .venv pip install -e '.[dev]' ``` -`sphinxext-altair` uses [black](https://github.com/psf/black) for code formatting, [mypy](https://github.com/python/mypy) for static type checking, [ruff](https://github.com/charliermarsh/ruff) for various linting rules, and [pytest](https://github.com/pytest-dev/pytest) for testing. All these tools can be executed by running: +`sphinxext-altair` uses [ruff](https://github.com/astral-sh/ruff) for code formatting and linting rules, [mypy](https://github.com/python/mypy) for static type checking, and [pytest](https://github.com/pytest-dev/pytest) for testing. All these tools can be executed by running: ```bash hatch run test From d5d9dd7f4e9e02574921976ab64cfe1479b48feb Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Wed, 28 Aug 2024 09:53:21 +0100 Subject: [PATCH 2/4] docs: Update `hatch` commands --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 1b5a928..82c6690 100644 --- a/README.md +++ b/README.md @@ -50,14 +50,14 @@ pip install -e '.[dev]' `sphinxext-altair` uses [ruff](https://github.com/astral-sh/ruff) for code formatting and linting rules, [mypy](https://github.com/python/mypy) for static type checking, and [pytest](https://github.com/pytest-dev/pytest) for testing. All these tools can be executed by running: ```bash -hatch run test +hatch test ``` As part of those tests, a Sphinx documentation is built at `tests/roots/test-altairplot`. You can manually build this documentation and view it which is very useful during development of a new feature. For example, if you want to add a new option to the `altair-plot` directive, you can add another example in the file `tests/roots/test-altairplot/index.rst` and then build and view the documentation by running: ```bash -hatch run build-test-docs -hatch run serve-test-docs +hatch run doc:clean-build-html +hatch run doc:serve ``` The test documentation can now be viewed at [http://localhost:8000](http://localhost:8000). From 3d61cbe33c753d02dcd956206b4e86438af9c851 Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Wed, 28 Aug 2024 09:59:45 +0100 Subject: [PATCH 3/4] docs: Tweak formatting/whitespace --- README.md | 28 +++++++++++++++------------- 1 file changed, 15 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 82c6690..019af6f 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,19 @@ **sphinxext-altair** provides the directive `altair-plot` to insert live-rendered Altair plots within your Sphinx documentation: ```python - .. altair-plot:: - import altair as alt - from vega_datasets import data +.. altair-plot:: + import altair as alt + from vega_datasets import data - cars = data.cars() + cars = data.cars() - alt.Chart(cars).mark_point().encode( - x='Horsepower', - y='Miles_per_Gallon', - color='Origin', - shape='Origin' - ) + alt.Chart(cars).mark_point().encode( + x='Horsepower', + y='Miles_per_Gallon', + color='Origin', + shape='Origin' + ) ``` @@ -37,7 +37,6 @@ You can install the extension with: pip install sphinxext-altair ``` - # Contributing It's recommended to use a virtual environment for development: @@ -47,13 +46,16 @@ python -m venv .venv pip install -e '.[dev]' ``` -`sphinxext-altair` uses [ruff](https://github.com/astral-sh/ruff) for code formatting and linting rules, [mypy](https://github.com/python/mypy) for static type checking, and [pytest](https://github.com/pytest-dev/pytest) for testing. All these tools can be executed by running: +`sphinxext-altair` uses [ruff](https://github.com/astral-sh/ruff) for code formatting and linting rules, [mypy](https://github.com/python/mypy) for static type checking, and [pytest](https://github.com/pytest-dev/pytest) for testing. +All of these tools can be executed by running: ```bash hatch test ``` -As part of those tests, a Sphinx documentation is built at `tests/roots/test-altairplot`. You can manually build this documentation and view it which is very useful during development of a new feature. For example, if you want to add a new option to the `altair-plot` directive, you can add another example in the file `tests/roots/test-altairplot/index.rst` and then build and view the documentation by running: +As part of those tests, a Sphinx documentation is built at `tests/roots/test-altairplot`. You can manually build this documentation and view it which is very useful during development of a new feature. + +For example, if you want to add a new option to the `altair-plot` directive, you can add another example in the file `tests/roots/test-altairplot/index.rst` and then build and view the documentation by running: ```bash hatch run doc:clean-build-html From d47cee78995da68f1f4ba3f20a18eda079c7033f Mon Sep 17 00:00:00 2001 From: dangotbanned <125183946+dangotbanned@users.noreply.github.com> Date: Wed, 28 Aug 2024 10:00:34 +0100 Subject: [PATCH 4/4] docs: Update refs to use `"Vega-Altair"` --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 019af6f..1c7ec72 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # sphinxext-altair -**sphinxext-altair** provides the directive `altair-plot` to insert live-rendered Altair plots within your Sphinx documentation: +**sphinxext-altair** provides the directive `altair-plot` to insert live-rendered Vega-Altair plots within your Sphinx documentation: ```python .. altair-plot:: @@ -29,7 +29,7 @@ extensions = [ ] ``` -You can find all available options in the docstring of `sphinxext_altair/altairplot.py`. For more examples on how to use this extension, see the test Sphinx documentation in `tests/roots/test-altairplot` or the official [Altair documentation](https://github.com/altair-viz/altair/tree/master/doc). +You can find all available options in the docstring of `sphinxext_altair/altairplot.py`. For more examples on how to use this extension, see the test Sphinx documentation in `tests/roots/test-altairplot` or the official [Vega-Altair documentation](https://github.com/vega/altair/tree/main/doc). You can install the extension with: