Skip to content

Commit 25c167c

Browse files
committed
📚 Improve documentation
1 parent bf59ae8 commit 25c167c

34 files changed

+3810
-366
lines changed

README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,6 @@ A sphinx extension for designing beautiful, view size responsive web components.
44

55
Created with inspiration from [Bootstrap](https://getbootstrap.com/) (v5), [Material Design](https://material.io) and [Material-UI](https://material-ui.com/) design frameworks.
66

7-
All components are principally based on CSS (not JavaScript),
8-
meaning they will be responsively rendered on any device.
9-
107
## Supported browsers
118

129
- Chrome >= 60
@@ -60,8 +57,6 @@ Use autoprefixer when compiling SASS (see <https://getbootstrap.com/docs/5.0/get
6057

6158
horizontal card (grid row inside card, picture on left)
6259

63-
avatars (rounded images)
64-
6560
horizontally scrollable cards: (see <https://stackoverflow.com/questions/35993300/horizontally-scrollable-list-of-cards-in-bootstrap>)
6661

6762
from inline-tabs:

docs/cards.md

Lines changed: 118 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,118 @@
1+
(cards)=
2+
3+
# Cards
4+
5+
A card is a flexible and extensible content container.
6+
It can be formatted with components including headers and footers, titles and images.
7+
8+
:::{card} Card Title
9+
10+
Card content
11+
:::
12+
13+
All content before the first occurrence three or more `^^^` is considered as a header,
14+
and all content after the final occurrence of three or more `+++` is considered as a footer:
15+
16+
:::{card} Card Title
17+
Header
18+
^^^
19+
Card content
20+
+++
21+
Footer
22+
:::
23+
24+
:::{card} Clickable Card (external)
25+
:link: https://example.com
26+
27+
The entire card can be clicked to navigate to <https://example.com>.
28+
:::
29+
30+
:::{card} Clickable Card (internal)
31+
:link: cards
32+
:link-type: ref
33+
34+
The entire card can be clicked to navigate to the `cards` reference target.
35+
:::
36+
37+
38+
::::{grid} 1 2 2 2
39+
:::{grid-item-card} Card Title
40+
:img-top: images/banner.png
41+
:img-bottom: images/banner.png
42+
43+
Header
44+
^^^
45+
Card content
46+
+++
47+
Footer
48+
:::
49+
::::
50+
51+
52+
:::{card} Align Center
53+
:width: 75%
54+
:margin: 0 2 auto auto
55+
:text-align: center
56+
57+
Content
58+
:::
59+
60+
:::{card} Align Right
61+
:width: 50%
62+
:margin: 0 2 auto 0
63+
:text-align: right
64+
65+
Content
66+
:::
67+
68+
:::{card} Align Left
69+
:width: 50%
70+
:margin: 0 2 0 auto
71+
:text-align: left
72+
73+
Content
74+
:::
75+
76+
See the [Bootstrap card](https://getbootstrap.com/docs/5.0/layout/grid/) for further details.
77+
78+
## `card` options
79+
80+
width
81+
: The width that the card should take up (in %): auto, 25%, 50%, 75%, 100%.
82+
83+
margin
84+
: Outer margin of grid.
85+
One (all) or four (top bottom left right) values from: 0, 1, 2, 3, 4, 5, auto.
86+
87+
text-align
88+
: Default horizontal text alignment: left, right, center or justify
89+
90+
img-top
91+
: A URI (relative file path or URL) to an image to be placed above the content.
92+
93+
img-bottom
94+
: A URI (relative file path or URL) to an image to be placed below the content.
95+
96+
link
97+
: Turn the entire card into a clickable link to an external/internal target.
98+
99+
link-type
100+
: Type of link: `url` (default), `ref`, `doc`, `any`.
101+
102+
no-shadow
103+
: Do not draw a shadow around the card.
104+
105+
class-card
106+
: Additional CSS classes for the card container element.
107+
108+
class-header
109+
: Additional CSS classes for the header element.
110+
111+
class-body
112+
: Additional CSS classes for the body element.
113+
114+
class-title
115+
: Additional CSS classes for the title element.
116+
117+
class-footer
118+
: Additional CSS classes for the footer element.

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
html_title = f"Sphinx Design ({html_theme})"
1212

1313
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
14-
myst_enable_extensions = ["colon_fence", "substitution"]
14+
myst_enable_extensions = ["colon_fence", "deflist", "substitution"]
1515

1616
myst_substitutions = {
1717
"loremipsum": "Lorem ipsum dolor sit amet, consectetur adipiscing elit. "

docs/dropdowns.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
(dropdowns)=
2+
3+
# Dropdowns
4+
5+
:::{dropdown} Dropdown title
6+
Dropdown content
7+
:::
8+
9+
:::{dropdown}
10+
Dropdown content
11+
:::
12+
13+
::::{dropdown} Parent dropdown title (open by default)
14+
:open:
15+
16+
:::{dropdown} Child dropdown title
17+
:color: warning
18+
:icon: alert
19+
20+
Dropdown content
21+
:::
22+
::::
23+
24+
## Dropdowns in a grid
25+
26+
:::::{grid} 1 1 2 2
27+
:gutter: 1
28+
29+
::::{grid-item}
30+
:::{dropdown} Dropdown title
31+
Dropdown content
32+
:::
33+
::::
34+
35+
::::{grid-item}
36+
:::{dropdown} Dropdown title
37+
Dropdown content
38+
:::
39+
::::
40+
41+
:::::

0 commit comments

Comments
 (0)