diff --git a/docs/api/widget.md b/docs/api/widget.md index 3888a30d8f..072e9625e0 100644 --- a/docs/api/widget.md +++ b/docs/api/widget.md @@ -1 +1,5 @@ ::: textual.widget + options: + filters: + - "!^_" + - "^__init__$" diff --git a/mkdocs-common.yml b/mkdocs-common.yml index 0d59822f6a..aa3584c523 100644 --- a/mkdocs-common.yml +++ b/mkdocs-common.yml @@ -78,6 +78,15 @@ plugins: - "!^_" - "^__init__$" - "!^can_replace$" + # Hide some methods that Widget subclasses implement but that we don't want + # to be shown in the docs. + # This is then overridden in widget.md so that it shows in the base class. + - "!^compose$" + - "!^render$" + - "!^render_line$" + - "!^render_lines$" + - "!^get_content_width$" + - "!^get_content_height$" watch: - mkdocs-common.yml - mkdocs-nav.yml diff --git a/src/textual/widgets/_placeholder.py b/src/textual/widgets/_placeholder.py index a6ac37302f..21367631ea 100644 --- a/src/textual/widgets/_placeholder.py +++ b/src/textual/widgets/_placeholder.py @@ -120,7 +120,7 @@ def __init__( while next(self._variants_cycle) != self.variant: pass - def on_mount(self) -> None: + def _on_mount(self) -> None: """Set the color for this placeholder.""" colors = Placeholder._COLORS.setdefault( self.app, cycle(_PLACEHOLDER_BACKGROUND_COLORS)