Skip to content

Commit 3050b4c

Browse files
committed
📚 DOCS: Add development guide
1 parent 279df1a commit 3050b4c

File tree

4 files changed

+65
-19
lines changed

4 files changed

+65
-19
lines changed

README.md

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,24 +39,17 @@ View the documentation in multiple themes:
3939

4040
## Comparison to sphinx-panels
4141

42-
This package is an iteration on sphinx-panels and intends to replace it.
43-
44-
- Replaces `panel` directive with top-level `grid` + children `grid-item-card`
45-
- less "bespoke" syntax
46-
- `grid-item` can be used when no card is needed
47-
- `card` can be used independently of grids
48-
- tabs changed:
49-
- top-level `tab-set`
50-
- `tabbed` -> `tab-item`
51-
- include `:sync:` option to synchronize tab selection across sets
52-
- Minimises direct use of CSS classes (encourage to not use them)
53-
- More declarative, easy to understand options, easier to validate
54-
- Easier to work with non-HTML outputs
55-
- Easier to improve/refactor
56-
- Updated Bootstrap CSS v4 -> v5
57-
- top-level grid can define both column numbers and gutter sizes
58-
- All CSS classes are prefixed with `sd-` (no clash with other theme/extension CSS)
59-
- All colors use CSS variables (customisable)
42+
This package is an iteration on [sphinx-panels](https://github.com/executablebooks/sphinx-panels) and intends to replace it.
43+
See [Migrating from sphinx-panels](./docs/get_started.md) for more information.
44+
45+
## Development
46+
47+
It is recommended to use [tox](https://tox.readthedocs.io/en/latest/) to run the tests and document builds.
48+
Run `tox -va` to see all the available tox environments.
49+
50+
To run linting, formatting and SASS compilation, use [pre-commit](https://pre-commit.com/).
51+
`pre-commit run --all css` will run the SASS compiler, for which you will need [node](https://nodejs.org) and [npm](https://www.npmjs.com/) installed,
52+
or you can directly run `npm run css`.
6053

6154
## TODO
6255

docs/get_started.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,51 @@ sd_hide_title: true
5353
- Explorer >= 12
5454

5555
(Mirrors: <https://github.com/twbs/bootstrap/blob/v5.0.2/.browserslistrc>)
56+
57+
## Migrating from sphinx-panels
58+
59+
This package arose as an iteration on [sphinx-panels](https://github.com/executablebooks/sphinx-panels), with the intention to make it more flexible, easier to use, and minimise CSS clashes wth sphinx themes.
60+
61+
Notable changes:
62+
63+
### Reduce direct use of CSS classes
64+
65+
These are replaced by the use of directive options, which are:
66+
67+
- Easier to understand
68+
- Easier to validate
69+
- Easier to work with non-HTML outputs
70+
- Easier to improve/refactor
71+
72+
### `panel` directive replaced
73+
74+
The `panel` directive is replaced by the use of the top-level `grid` directive,
75+
then using `grid-item-card` directive children, rather than delimiting cards by `---`.
76+
77+
If no card is needed, then the `grid-item` directive can be used instead
78+
and `card` can be also used independently of grids.
79+
80+
### `tabbed` directive replaced
81+
82+
The `tabbed` directive is replaced by the use of the top-level `tab-set` directive,
83+
then using `tab-item` directive children.
84+
85+
The `:sync:` option allows to synchronize tab selection across sets.
86+
87+
The `tab-set-code` directive provides a shorthand for synced code examples.
88+
89+
### `octicon` icon role
90+
91+
The default SVGs produced are now sized relative to the surrounding text (i.e. using `1em`).
92+
The syntax for specifying a custom size and adding classes is also changed.
93+
94+
This is similar for favicon icons.
95+
96+
### Improved CSS
97+
98+
Updated Bootstrap CSS from v4 -> v5,
99+
which in particular allows top-level grid to define both column numbers and gutter sizes.
100+
101+
All CSS classes are prefixed with `sd-` (no clash with other theme/extension CSS)
102+
103+
All colors use CSS variables (customisable)

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ theme_pydata =
5757
theme_rtd =
5858
sphinx-rtd-theme~=0.5.0
5959
theme_sbt =
60-
sphinx-book-theme~=0.1.1
60+
sphinx-book-theme~=0.1.2
6161

6262
[mypy]
6363
show_error_codes = True

tox.ini

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ envlist = py38
1010
usedevelop = true
1111

1212
[testenv:py{36,37,38,39}]
13+
description = Run unit tests with this Python version
1314
extras =
1415
testing
1516
deps =
@@ -19,6 +20,9 @@ deps =
1920
commands = pytest {posargs}
2021

2122
[testenv:docs-{update,clean}-{alabaster,rtd,pydata,sbt,furo}]
23+
description =
24+
clean: Run documentation build for this theme (removing existing builds)
25+
update: Run documentation build for this theme (reusing existing builds)
2226
extras =
2327
rtd
2428
rtd: theme_rtd
@@ -41,6 +45,7 @@ commands =
4145
commands_post = echo "open docs/_build/{posargs:html}/index.html"
4246

4347
[testenv:docs-live-{alabaster,rtd,pydata,sbt,furo}]
48+
description = Start documentation autobuild for this theme
4449
extras =
4550
rtd
4651
rtd: theme_rtd

0 commit comments

Comments
 (0)