A Nim handler for mkdocstrings
Project description
mkdocstrings-nim
A mkdocstrings handler for Nim.
Parses Nim source files using the Nim compiler's AST to extract module docstrings, procedure signatures, parameter types, return types, and {.raises.} pragma annotations. Renders the extracted documentation as HTML within MkDocs using the ::: module directive syntax.
Installation
pip install mkdocstrings-nim
Requirements: Nim compiler must be installed and available in PATH.
Quick Start
- Add to your
mkdocs.yml:
plugins:
- mkdocstrings:
handlers:
nim:
paths: [src]
- Use in your markdown:
# API Reference
::: mymodule
- Build your docs:
mkdocs build
Configuration
Handler Options
| Option | Default | Description |
|---|---|---|
paths |
["src"] |
Search paths for Nim source files |
docstring_style |
"rst" |
Docstring format: rst, google, numpy, epydoc, or auto |
show_source |
true |
Show source line numbers |
show_signature |
true |
Show full signatures |
show_pragmas |
true |
Show pragma annotations |
Docstring Format
Use RST-style docstrings in your Nim code:
proc greet*(name: string): string =
## Greet someone by name.
##
## :param name: The name to greet
## :returns: A greeting message
result = "Hello, " & name & "!"
Development
git clone https://github.com/elijahr/mkdocstrings-nim
cd mkdocstrings-nim
pip install -e ".[dev]"
pytest
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mkdocstrings_nim-0.1.1.tar.gz.
File metadata
- Download URL: mkdocstrings_nim-0.1.1.tar.gz
- Upload date:
- Size: 31.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26d02d3dbefe270e58dbfb4fb0ee44836522f30018f24f4e139cfc280529ae8b
|
|
| MD5 |
60ded74f36a4c67ea2314f11eeadb87a
|
|
| BLAKE2b-256 |
61c960b071461f9d2a61f9751adae026eed3e76feca1f8c827e30c2ae918f341
|
Provenance
The following attestation bundles were made for mkdocstrings_nim-0.1.1.tar.gz:
Publisher:
publish.yml on elijahr/mkdocstrings-nim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocstrings_nim-0.1.1.tar.gz -
Subject digest:
26d02d3dbefe270e58dbfb4fb0ee44836522f30018f24f4e139cfc280529ae8b - Sigstore transparency entry: 737682850
- Sigstore integration time:
-
Permalink:
elijahr/mkdocstrings-nim@a64477e9dae0b4316b75514bc04f17c8cfae0c52 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/elijahr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a64477e9dae0b4316b75514bc04f17c8cfae0c52 -
Trigger Event:
push
-
Statement type:
File details
Details for the file mkdocstrings_nim-0.1.1-py3-none-any.whl.
File metadata
- Download URL: mkdocstrings_nim-0.1.1-py3-none-any.whl
- Upload date:
- Size: 79.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
020202f1e6d02e2aada31bccc1fdc66bb5276307dab99a7ea27c50820f9682c2
|
|
| MD5 |
b6b051549563d8e53661b663369ff986
|
|
| BLAKE2b-256 |
a9effdf979b6789aa55da6f338d2677ff61405a9e4dae4778ade5067039b707e
|
Provenance
The following attestation bundles were made for mkdocstrings_nim-0.1.1-py3-none-any.whl:
Publisher:
publish.yml on elijahr/mkdocstrings-nim
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mkdocstrings_nim-0.1.1-py3-none-any.whl -
Subject digest:
020202f1e6d02e2aada31bccc1fdc66bb5276307dab99a7ea27c50820f9682c2 - Sigstore transparency entry: 737682855
- Sigstore integration time:
-
Permalink:
elijahr/mkdocstrings-nim@a64477e9dae0b4316b75514bc04f17c8cfae0c52 -
Branch / Tag:
refs/tags/v0.1.1 - Owner: https://github.com/elijahr
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a64477e9dae0b4316b75514bc04f17c8cfae0c52 -
Trigger Event:
push
-
Statement type: