Metadata-Version: 2.4
Name: nadoc
Version: 0.1.0a1
Summary: A simple static documentation generator for OpenAPI 3.1 specs
Author-email: Ibudidi <ibudidi@users.noreply.github.com>
License-Expression: MIT
Project-URL: Homepage, https://github.com/ibudidi/nadoc
Project-URL: Repository, https://github.com/ibudidi/nadoc
Project-URL: Issues, https://github.com/ibudidi/nadoc/issues
Keywords: openapi,documentation,static-site,api
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Documentation
Classifier: Topic :: Software Development :: Documentation
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: Jinja2<4,>=3.1
Requires-Dist: markdown-it-py<5,>=3
Requires-Dist: Pygments<3,>=2.19
Requires-Dist: PyYAML<7,>=6
Dynamic: license-file

# Nadoc

Deterministic static documentation for OpenAPI.

Nadoc converts an OpenAPI 3.1 document and an optional OpenAPI Overlay 1.x document into a self-contained,
server-rendered API documentation site. CSS, JavaScript, and language icons are embedded in the generated HTML;
Python is only required at generation time.

> Nadoc is currently alpha software. It intentionally rejects unsupported OpenAPI constructs in strict mode rather
> than silently omitting them.

## Install

From this source checkout:

```bash
python3 -m pip install .
```

For isolated command-line installation, use `pipx install .`.

## Use

```bash
nadoc openapi.yaml --output-dir api-docs
```

Apply an optional overlay and minify the HTML shell:

```bash
nadoc openapi.yaml \
  --overlay documentation-overlay.yaml \
  --output-dir api-docs \
  --minify
```

Generated files:

```text
api-docs/
├── index.html
└── openapi.yaml
```

Use custom progressive-enhancement assets with `--css` and `--js`. Use `--check` to avoid writing and return exit
code `1` when generated files are missing or stale. Input and validation errors return exit code `2`.

Nadoc can also be used from Python:

```python
from nadoc import render

result = render(
    "openapi.yaml",
    overlay="documentation-overlay.yaml",
    output_dir="api-docs",
)
print(result.html_path)
```

## Supported scope

Nadoc currently supports the OpenAPI 3.1 operation, parameter, request/response media, example, server, tag,
`x-codeSamples`, and local component-schema constructs used by its test suite. It supports exact-target OpenAPI
Overlay 1.x object merges and replacements.

Strict mode currently rejects schema composition (`allOf`, `oneOf`, and `anyOf`), remote/file references,
discriminators, conditionals, callbacks, webhooks, and other unsupported schema keywords. Use `--no-strict` only
when omission of unsupported semantics is acceptable.

## Develop

```bash
python3 -m unittest discover -s tests -v
python3 -m compileall -q src tests
node --check src/nadoc/assets/nada.js
```
