Skip to content

Commit a59e1e1

Browse files
committed
Merge branch 'refs/heads/forman-34-component_docs'
# Conflicts: # docs/components.md # mkdocs.yml
2 parents ee807d5 + 0ae9658 commit a59e1e1

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

chartlets.py/chartlets/container.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@
66

77
@dataclass(frozen=True)
88
class Container(Component, ABC):
9+
"""Base class for components that require child components to be useful."""
10+
911
children: list[Component] = field(default_factory=list)
12+
"""The child components."""
1013

1114
def add(self, component: Component):
15+
"""Add a component.
16+
17+
Args:
18+
component: the child component.
19+
"""
1220
self.children.append(component)

docs/components.md

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
Given here is a list of the components supported by chartlets.
1+
Given here is a list of the components supported by Chartlets.
22

3-
Using the Python package, they can be imported from the `chartlets.components`
4-
module, e.g.
3+
Using the Python package `chartlets`, the related component classes can be
4+
imported from the `chartlets.components` module, e.g.
55

66
```python
77
from chartlets.components import Checkbox
88
```
99

10+
## Classes
11+
1012
::: chartlets.components.Box
1113

1214
::: chartlets.components.Button
@@ -17,6 +19,8 @@ from chartlets.components import Checkbox
1719

1820
::: chartlets.components.Typography
1921

22+
## Base classes
2023

2124
::: chartlets.Component
2225

26+
::: chartlets.Container

mkdocs.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,13 @@ plugins:
1010
show_source: false
1111
show_if_no_docstring: false
1212
show_root_heading: true
13-
heading_level: 2
13+
heading_level: 3
14+
toc: true
15+
toc_depth: 1
16+
members:
17+
- methods
18+
- classes
19+
- attributes
1420

1521
nav:
1622
- Home: index.md
@@ -21,6 +27,8 @@ nav:
2127

2228
theme:
2329
name: material
30+
features:
31+
- toc.integrate # Ensures TOC is integrated into the sidebar
2432
locale: en
2533
#include_sidebar: false
2634
palette:

0 commit comments

Comments
 (0)