---
title: "Hide Internal Symbols"
description: "Keep private helpers out of your API reference while still exporting them."
tags: [API, Configuration]
---

# Hide Internal Symbols

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`:

```{.yaml filename="great-docs.yml"}
exclude:
  - _InternalHelper
  - _parse_raw_config
  - _SENTINEL
```

Any 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:

```python
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`).
