Skip to content

Commit fbe1c41

Browse files
Hide some members from the public docs. (#3080)
* Hide some members from the public docs. See relevant issue: #3076. Some methods need to be implemented to make the widget work but the user doesn't really care about them. For that matter, we can hide them from the public documentation. * Use private handler to hide from docs. Related comments: #3080 (comment)
1 parent 54ba357 commit fbe1c41

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

docs/api/widget.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
::: textual.widget
2+
options:
3+
filters:
4+
- "!^_"
5+
- "^__init__$"

mkdocs-common.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ plugins:
7878
- "!^_"
7979
- "^__init__$"
8080
- "!^can_replace$"
81+
# Hide some methods that Widget subclasses implement but that we don't want
82+
# to be shown in the docs.
83+
# This is then overridden in widget.md so that it shows in the base class.
84+
- "!^compose$"
85+
- "!^render$"
86+
- "!^render_line$"
87+
- "!^render_lines$"
88+
- "!^get_content_width$"
89+
- "!^get_content_height$"
8190
watch:
8291
- mkdocs-common.yml
8392
- mkdocs-nav.yml

src/textual/widgets/_placeholder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ def __init__(
120120
while next(self._variants_cycle) != self.variant:
121121
pass
122122

123-
def on_mount(self) -> None:
123+
def _on_mount(self) -> None:
124124
"""Set the color for this placeholder."""
125125
colors = Placeholder._COLORS.setdefault(
126126
self.app, cycle(_PLACEHOLDER_BACKGROUND_COLORS)

0 commit comments

Comments
 (0)