Skip to main content

Mojo function

doc_hidden

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()

Was this page helpful?