Hide Internal Symbols
Keep private helpers out of your API reference while still exporting them.
Sometimes you need to export a symbol (for use by other modules or tests) but don’t want it cluttering your public API docs.
Using exclude in Config
Add the names to the exclude list in great-docs.yml:
great-docs.yml
exclude:
- _InternalHelper
- _parse_raw_config
- _SENTINELAny symbol whose name matches an entry in exclude is dropped during API discovery — it won’t appear in the reference pages or the sidebar.
Using the @nodoc Directive
Alternatively, add a @nodoc directive to the symbol’s docstring:
def _merge_dicts(a: dict, b: dict) -> dict:
"""Recursively merge two dicts.
@nodoc
"""
...Great Docs strips the directive line before rendering, so it never shows up in output even if you later remove the exclusion.
When to Use Which
| Approach | Best for |
|---|---|
exclude in YAML |
Batch exclusions, symbols without docstrings |
@nodoc directive |
Keeping the decision next to the code |
Both can be combined — exclude is checked first, then @nodoc.