IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /docs/manual/basics.md). For the complete Mojo documentation index, see llms.txt.
Skip to main content
Version: 1.0.0b2
For the complete Mojo documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /docs/manual/basics.md).

doc_hidden

def doc_hidden()

Indicate that the decorated declaration is hidden from documentation generation.

This decorator allows for hiding the documentation for a declaration during generation. This is often used to hide __init__, and other special methods, that are not intended to be part of a library's documentation.

For example:

struct Foo:
@doc_hidden
def __init__(out self):
"This should not be called directly, use `Foo.create` instead."
return

@staticmethod
def create() -> Self:
return Self()