Skip to content

Commit 7940667

Browse files
authored
docs: Update README.md (#11)
* docs: Update `black`, `ruff` references * docs: Update `hatch` commands * docs: Tweak formatting/whitespace * docs: Update refs to use `"Vega-Altair"`
1 parent cc6330f commit 7940667

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

README.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# sphinxext-altair
2-
**sphinxext-altair** provides the directive `altair-plot` to insert live-rendered Altair plots within your Sphinx documentation:
2+
**sphinxext-altair** provides the directive `altair-plot` to insert live-rendered Vega-Altair plots within your Sphinx documentation:
33

44
```python
5-
.. altair-plot::
6-
import altair as alt
7-
from vega_datasets import data
5+
.. altair-plot::
6+
import altair as alt
7+
from vega_datasets import data
88

99

10-
cars = data.cars()
10+
cars = data.cars()
1111

12-
alt.Chart(cars).mark_point().encode(
13-
x='Horsepower',
14-
y='Miles_per_Gallon',
15-
color='Origin',
16-
shape='Origin'
17-
)
12+
alt.Chart(cars).mark_point().encode(
13+
x='Horsepower',
14+
y='Miles_per_Gallon',
15+
color='Origin',
16+
shape='Origin'
17+
)
1818
```
1919

2020
<img src="https://raw.githubusercontent.com/altair-viz/sphinxext-altair/main/images/example_screenshot.png" width="70%">
@@ -29,15 +29,14 @@ extensions = [
2929
]
3030
```
3131

32-
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).
32+
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).
3333

3434
You can install the extension with:
3535

3636
```bash
3737
pip install sphinxext-altair
3838
```
3939

40-
4140
# Contributing
4241
It's recommended to use a virtual environment for development:
4342

@@ -47,17 +46,20 @@ python -m venv .venv
4746
pip install -e '.[dev]'
4847
```
4948

50-
`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:
49+
`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.
50+
All of these tools can be executed by running:
5151

5252
```bash
53-
hatch run test
53+
hatch test
5454
```
5555

56-
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:
56+
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.
57+
58+
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:
5759

5860
```bash
59-
hatch run build-test-docs
60-
hatch run serve-test-docs
61+
hatch run doc:clean-build-html
62+
hatch run doc:serve
6163
```
6264

6365
The test documentation can now be viewed at [http://localhost:8000](http://localhost:8000).

0 commit comments

Comments
 (0)