Skip to content

Commit 9e1095d

Browse files
committed
Improve documentation
1 parent d2626ff commit 9e1095d

File tree

8 files changed

+99
-40
lines changed

8 files changed

+99
-40
lines changed

CHANGES.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Change Log
22

3-
## v0.0.0 - 2023-07-16
3+
## v0.1.0 - 2023-07-19
44

5+
- Add "grid table" element, using directives `sd-table`, `sd-row`, `sd-item`
6+
- Add "info card" element, using directive `info-card`
7+
- Add "tag(s)" shortcuts, using roles `tag` and `tags`

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,13 @@ high-level elements on top.
3838

3939
## Development
4040

41-
In order to set up the project in development mode, visit the [](#development)
42-
documentation.
41+
In order to learn how to set up the project in development mode, please visit the
42+
[development documentation].
4343

4444

4545

4646
[Changelog]: https://github.com/panodata/sphinx-design-elements/blob/main/CHANGES.md
47+
[development documentation]: https://sphinx-design-elements.readthedocs.io/en/latest/sandbox.html
4748
[Documentation]: https://sphinx-design-elements.readthedocs.io/
4849
[Issues]: https://github.com/panodata/sphinx-design-elements/issues
4950
[License]: https://github.com/panodata/sphinx-design-elements/blob/main/LICENSE

docs/get_started.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
# Getting Started
44

55
```{article-info}
6-
:author: "[Panodata Developers](https://github.com/panodata)"
6+
:author: "[The Panodata Developers](https://github.com/panodata)"
77
:date: "{sub-ref}`today`"
88
:read-time: "1 min read"
99
```
1010

1111

1212
## Setup
1313

14-
The basic installation supports documentation authoring using the [reStructuredText]
15-
syntax. You can optionally support the Markdown syntax by enabling the [Markedly
16-
Structured Text] (MyST) syntax.
14+
The basic installation supports documentation authoring using the [reStructuredText] (rST)
15+
syntax. You can optionally support an extended [Markdown] syntax by installing and enabling
16+
the [Markedly Structured Text] (MyST) extension.
1717

18-
### Setup with reStructuredText
18+
### Use reStructuredText
1919

2020
Install the package.
2121
```shell
@@ -33,7 +33,7 @@ extensions = [
3333
```
3434

3535

36-
### Setup with Markdown
36+
### Use Markedly Structured Text
3737

3838
Install the packages.
3939
```shell
@@ -76,6 +76,7 @@ would like to share with others, do not hesitate to submit patches, in order to
7676
add them to the collection.
7777

7878

79+
[Markdown]: https://daringfireball.net/projects/markdown/syntax
7980
[Markedly Structured Text]: https://myst-parser.readthedocs.io/
8081
[reStructuredText]: https://docutils.sourceforge.io/rst.html
8182
[Sphinx]: https://www.sphinx-doc.org/

docs/gridtable.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@
77

88
_sd-table -- Tables with sphinx{design}_.
99

10-
A generic, beautiful, yet efficient table element based on a [grid layout](inv:sd#grids),
11-
with top-down configuration capabilities.
10+
A beautiful and generic table element based on a [sphinx{design} grid layout](inv:sd#grids),
11+
with top-down configuration features.
1212

13-
It provides the Sphinx directives `sd-table`, `sd-row`, and `sd-item`,
13+
It implements the Sphinx directives `sd-table`, `sd-row`, and `sd-item`,
1414
and a few convenience directive options and flags on them.
1515

1616

@@ -20,9 +20,9 @@ The idea of this element is to implement a table based on a grid layout, which c
2020
be parameterized using directives on the table level, so that styling details will
2121
not clutter the leaf nodes (row and item) too much.
2222

23-
To goal is to provide a table element as an alternative to the `list-table` and
24-
`csv-table` directives, which explores a few needs of authors not offered by
25-
other Sphinx directives.
23+
This grid table element is an alternative to the vanilla `list-table` and `csv-table`
24+
directive implementations, and as such, explores a few needs of authors not provided
25+
elsewhere.
2626

2727

2828
## Synopsis
@@ -82,7 +82,13 @@ A few more variants how to change the visual appearance.
8282

8383
### Visual line separators
8484

85-
Using `:row-class:` to assign row-level styles on the table-level component.
85+
By using `:row-class:` on the table-level directive, row-level styles can be
86+
assigned conveniently.
87+
88+
```markdown
89+
::::{sd-table}
90+
:row-class: top-border
91+
```
8692

8793
::::{sd-table}
8894
:widths: 3 9

docs/index.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ Get Started
3838

3939
::::::
4040

41-
Building upon sphinx-design
41+
Building upon sphinx{design}
4242
: [sphinx-design] is a Sphinx extension for designing beautiful, screen-size
4343
responsive web-components. It is inspired by the [Bootstrap], [Material Design],
44-
and [Material-UI] design frameworks, and is the foundation for all composite
45-
elements in this collection.
44+
and [Material-UI] design frameworks, and uses [CSS Flexible Box Layout], commonly
45+
known as [Flexbox]. It is the foundation for all composite elements in this collection.
4646

47-
Works with reStructuredText (rST) and Markedly Structured Text (MyST)
47+
Works with both reStructuredText (rST) and Markedly Structured Text (MyST)
4848
: Either write documentation using the venerable [reStructuredText], or use the
4949
new extended [Markdown]/[CommonMark] syntax [Markedly Structured Text]. Both
5050
are supported equally well.
@@ -108,11 +108,11 @@ HTML table based on a grid layout, with ergonomic top-down configuration.
108108
Composite info card container element, to be used as a grid item.
109109
:::
110110

111-
:::{grid-item-card} {octicon}`plus-circle` Special badges
111+
:::{grid-item-card} {octicon}`tag` Special badges
112112
:link: tag
113113
:link-type: doc
114114

115-
Special {bdg-primary}`badges` and other components.
115+
Special {tags}`tag-like, badges` and other components.
116116
:::
117117

118118
::::
@@ -126,6 +126,8 @@ Kudos to [Chris Sewell] and all contributors for conceiving and maintaining
126126
[Bootstrap]: https://getbootstrap.com/
127127
[Chris Sewell]: https://github.com/chrisjsewell
128128
[CommonMark]: https://spec.commonmark.org/
129+
[CSS Flexible Box Layout]: https://en.wikipedia.org/wiki/CSS_Flexible_Box_Layout
130+
[Flexbox]: https://www.w3.org/TR/css-flexbox-1/
129131
[Markdown]: https://daringfireball.net/projects/markdown/syntax
130132
[Markedly Structured Text]: https://myst-parser.readthedocs.io/
131133
[Material Design]: https://material.io

docs/infocard.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,15 @@
66
## About
77

88
A composite info card container element, to be used as an item within
9-
a [grid layout](inv:sd#grids). It provides the Sphinx directive `info-card`.
9+
a [grid layout](inv:sd#grids). It implements the Sphinx directive `info-card`.
1010

1111

1212
## Details
1313

14-
The info card is a composite element offering a title, description text, and
15-
both verbose and short tags. It is suitable for authoring pages enumerating
16-
items with dense information, without the maintenance nightmares of tables.
17-
18-
For a compact notation of the short tag elements, it uses the corresponding
19-
[](#tag-role) for efficiently rendering [](inv:sd#badges), which is also
20-
provided by this package.
21-
14+
The info card is a composite element based on nested grid and card components
15+
from [](inv:sd#index). It is suitable to be used as an alternative to tables,
16+
for example when authoring pages enumerating items with dense information,
17+
without the maintenance nightmares of tables.
2218

2319
## Synopsis
2420

@@ -49,6 +45,15 @@ and for consolidating them.
4945

5046
::::
5147

48+
:::{note}
49+
This example provides a title with link, a formatted description text, and both
50+
verbose and short tags, represented using badges.
51+
52+
For a compact markup to represent the short tag elements, it uses a shortcut notation
53+
based on the corresponding [](#tag-role), for efficiently rendering [sphinx{design}
54+
badges](inv:sd#badges) with a special appearance.
55+
:::
56+
5257

5358
## Usage
5459
````{tab-set-code}
@@ -61,4 +66,6 @@ and for consolidating them.
6166
````
6267

6368

69+
---
70+
6471
_This page is written in Markedly Structured Text (MyST Markdown)._

docs/sandbox.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
# Sandbox
44

5+
6+
## Setup
57
Those commands will get you started with a sandboxed development environment.
68
After invoking `poe check`, and observing the software tests succeed, you
79
should be ready to start hacking.
@@ -14,3 +16,41 @@ source .venv/bin/activate
1416
pip install --editable=.[develop,docs,test]
1517
poe check
1618
```
19+
20+
21+
## Software tests
22+
23+
For running the software tests after setup, invoke `poe check`.
24+
Optionally, activate the virtualenv, if you are coming back to
25+
development using a fresh terminal session.
26+
27+
```shell
28+
source .venv/bin/activate
29+
poe check
30+
```
31+
32+
33+
## Documentation
34+
35+
In order to build the documentation, invoke `poe docs-html`.
36+
```shell
37+
poe docs-html
38+
```
39+
40+
In order to _continuously_ rebuild the documentation, while editing it,
41+
invoke `poe docs-autobuild`.
42+
```shell
43+
poe docs-autobuild
44+
```
45+
46+
47+
## Edit source code
48+
49+
In order to edit or inspect the CSS stylesheet rules, head over to
50+
[`compiled/style.css`]. For editing or inspecting the directive- and
51+
role-implementations, see [`gridtable.py`], [`infocard.py`], and [`tag.py`].
52+
53+
[`compiled/style.css`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/compiled/style.css
54+
[`gridtable.py`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/gridtable.py
55+
[`infocard.py`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/infocard.py
56+
[`tag.py`]: https://github.com/panodata/sphinx-design-elements/blob/main/sphinx_design_elements/tag.py

docs/tag.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,23 @@
55

66
## About
77

8-
The `tag` and `tags` roles are shortcuts to the `badge` roles of sphinx{design},
9-
see [](inv:sd#badges).
8+
The `tag` and `tags` roles are shortcuts to the `bdg` badge roles of
9+
[sphinx{design}](inv:sd#index), see [](inv:sd#badges).
1010

1111

1212
## Details
1313

14-
The idea is to need less code for defining "tag"-like badges within the
14+
The idea is to reduce markup code for defining "tag"-like badges within the
1515
[](#infocard-directive) element. All of them will use the `outline` option flag
16-
by default, to give them a corresponding visual appearance.
16+
by default, to give them a corresponding visual appearance like demonstrated below.
1717

18-
19-
## Synopsis
20-
21-
There is the `{tag}`, and the `{tags}` role. A `{tag}` will render its text content
18+
There are two roles: `{tag}` and `{tags}`. A `{tag}` will render its text content
2219
1:1 into a single badge element, while `{tags}` will split the text by comma (`,`),
23-
and renders the outcome using individual badge elements.
20+
and renders the outcome using multiple badge elements.
2421

2522

23+
## Synopsis
24+
2625
::::{sd-table}
2726
:widths: 3 3 3 3
2827
:row-class: top-border

0 commit comments

Comments
 (0)