Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 38 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ A comprehensive documentation site generator for Python packages. Great Docs aut
- modern styling: clean, professional appearance
- mobile responsive: optimized for all device sizes
- streamlined workflow: single `great-docs build` command handles everything
- intelligent setup: auto-generates configuration from your package's `__all__`
- safe introspection: works with packages containing non-Python components
- intelligent setup: auto-generates configuration from your package's public API
- safe introspection: uses static analysis by default, with `__all__` as an option
- zero configuration: works out of the box with sensible defaults

## Quick Start
Expand Down Expand Up @@ -76,7 +76,7 @@ The installer will:
4. install all necessary files to the detected or chosen directory
5. auto-create `index.qmd` from your `README.md`
6. auto-detect your package name from `pyproject.toml`, `setup.py`, or directory structure
7. auto-generate API sections by parsing `__all__` from your package's `__init__.py`
7. auto-generate API sections by discovering public objects in your package
8. add website navigation with Home and API Reference links in the navbar

This up-and-running site sets you up for success with your documentation dreams.
Expand Down Expand Up @@ -206,7 +206,7 @@ The installer intelligently configures your documentation site:
- `pyproject.toml`
- `setup.py`
- Package directory structure
3. **Auto-generated API sections**: Parses your package's `__init__.py` to read `__all__` and automatically creates organized sections for:
3. **Auto-generated API sections**: Discovers your package's public API and automatically creates organized sections for:
- Classes
- Functions
- Other exports
Expand All @@ -221,7 +221,7 @@ The installer intelligently configures your documentation site:
renderer:
style: markdown
table_style: description-list
sections: # Auto-generated from __all__
sections: # Auto-generated from package exports
- title: Classes
desc: Core classes and types
contents:
Expand All @@ -233,14 +233,41 @@ The installer intelligently configures your documentation site:
- your_function
```

**Requirements for auto-generation**:
**API Discovery Methods**:

- Your package must have `__all__` defined in `__init__.py`
- Names in `__all__` should be importable from the package
By default, Great Docs uses static analysis (via griffe) to discover public objects in your package. This safely finds all non-private names (those not starting with an underscore) without importing your package or requiring `__all__` to be defined.

**Filtering non-documentable items**:
Alternatively, you can use the traditional `__all__`-based discovery by setting the `discovery_method` option:

If your package includes items that can't be auto-documented, you can exclude them in your `pyproject.toml`:
```toml
# In your pyproject.toml
[tool.great-docs]
discovery_method = "all" # Use __all__ instead of static analysis for discovery
```

**Auto-excluded objects**:

When using the default discovery method, Great Docs automatically excludes common internal/utility names that most packages don't want in their documentation:

| Category | Names |
| ----------------- | ---------------------------------------------------------------- |
| CLI/Entry points | `main`, `cli` |
| Version/Metadata | `version`, `VERSION`, `VERSION_INFO` |
| Module re-exports | `core`, `utils`, `helpers`, `constants`, `config`, `settings` |
| Standard library | `PackageNotFoundError`, `typing`, `annotations`, `TYPE_CHECKING` |
| Logging | `logger`, `log`, `logging` |

To force-include any auto-excluded items, use the `include` option:

```toml
# In your pyproject.toml
[tool.great-docs]
include = ["main", "cli"] # Force-include auto-excluded items
```

**Filtering objects from documentation**:

If your package includes additional items that shouldn't be documented, you can exclude them in your `pyproject.toml`:

```toml
# In your pyproject.toml
Expand All @@ -257,7 +284,7 @@ Great Docs will search for your package in standard locations including:
- `src/` directory
- `lib/` directory

If `__all__` is not found, Great Docs will create a basic configuration and you can manually add sections.
If discovery fails (e.g., the package cannot be loaded), Great Docs will create a basic configuration and you can manually add sections.

### Smart Method Splitting

Expand Down
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ _site/

# Quartodoc generated files
reference/
objects.json

# Python cache
__pycache__/
Expand Down
7 changes: 0 additions & 7 deletions docs/_quarto.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ website:
- section: Classes
contents:
- reference/GreatDocs.qmd
- section: Functions
contents:
- reference/main.qmd
quartodoc:
package: great_docs
dir: reference
Expand All @@ -47,7 +44,3 @@ quartodoc:
desc: Core classes and types
contents:
- GreatDocs
- title: Functions
desc: Public functions
contents:
- main
49 changes: 38 additions & 11 deletions docs/index.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ A comprehensive documentation site generator for Python packages. Great Docs aut
- modern styling: clean, professional appearance
- mobile responsive: optimized for all device sizes
- streamlined workflow: single `great-docs build` command handles everything
- intelligent setup: auto-generates configuration from your package's `__all__`
- safe introspection: works with packages containing non-Python components
- intelligent setup: auto-generates configuration from your package's public API
- safe introspection: uses static analysis by default, with `__all__` as an option
- zero configuration: works out of the box with sensible defaults

### Quick Start
Expand Down Expand Up @@ -121,7 +121,7 @@ The installer will:
4. install all necessary files to the detected or chosen directory
5. auto-create `index.qmd` from your `README.md`
6. auto-detect your package name from `pyproject.toml`, `setup.py`, or directory structure
7. auto-generate API sections by parsing `__all__` from your package's `__init__.py`
7. auto-generate API sections by discovering public objects in your package
8. add website navigation with Home and API Reference links in the navbar

This up-and-running site sets you up for success with your documentation dreams.
Expand Down Expand Up @@ -251,7 +251,7 @@ The installer intelligently configures your documentation site:
- `pyproject.toml`
- `setup.py`
- Package directory structure
3. **Auto-generated API sections**: Parses your package's `__init__.py` to read `__all__` and automatically creates organized sections for:
3. **Auto-generated API sections**: Discovers your package's public API and automatically creates organized sections for:
- Classes
- Functions
- Other exports
Expand All @@ -266,7 +266,7 @@ The installer intelligently configures your documentation site:
renderer:
style: markdown
table_style: description-list
sections: # Auto-generated from __all__
sections: # Auto-generated from package exports
- title: Classes
desc: Core classes and types
contents:
Expand All @@ -278,14 +278,41 @@ The installer intelligently configures your documentation site:
- your_function
```

**Requirements for auto-generation**:
**API Discovery Methods**:

- Your package must have `__all__` defined in `__init__.py`
- Names in `__all__` should be importable from the package
By default, Great Docs uses static analysis (via griffe) to discover public objects in your package. This safely finds all non-private names (those not starting with an underscore) without importing your package or requiring `__all__` to be defined.

**Filtering non-documentable items**:
Alternatively, you can use the traditional `__all__`-based discovery by setting the `discovery_method` option:

If your package includes items that can't be auto-documented, you can exclude them in your `pyproject.toml`:
```toml
## In your pyproject.toml
[tool.great-docs]
discovery_method = "all" # Use __all__ instead of static analysis for discovery
```

**Auto-excluded objects**:

When using the default discovery method, Great Docs automatically excludes common internal/utility names that most packages don't want in their documentation:

| Category | Names |
| ----------------- | ---------------------------------------------------------------- |
| CLI/Entry points | `main`, `cli` |
| Version/Metadata | `version`, `VERSION`, `VERSION_INFO` |
| Module re-exports | `core`, `utils`, `helpers`, `constants`, `config`, `settings` |
| Standard library | `PackageNotFoundError`, `typing`, `annotations`, `TYPE_CHECKING` |
| Logging | `logger`, `log`, `logging` |

To force-include any auto-excluded items, use the `include` option:

```toml
## In your pyproject.toml
[tool.great-docs]
include = ["main", "cli"] # Force-include auto-excluded items
```

**Filtering objects from documentation**:

If your package includes additional items that shouldn't be documented, you can exclude them in your `pyproject.toml`:

```toml
## In your pyproject.toml
Expand All @@ -302,7 +329,7 @@ Great Docs will search for your package in standard locations including:
- `src/` directory
- `lib/` directory

If `__all__` is not found, Great Docs will create a basic configuration and you can manually add sections.
If discovery fails (e.g., the package cannot be loaded), Great Docs will create a basic configuration and you can manually add sections.

#### Smart Method Splitting

Expand Down
Loading
Loading