Skip to main content

A Nim handler for mkdocstrings

Project description

mkdocstrings-nim

PyPI Python License Docs

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.

Documentation

Installation

pip install mkdocstrings-nim

Requirements: Nim compiler must be installed and available in PATH.

Quick Start

  1. Add to your mkdocs.yml:
plugins:
  - mkdocstrings:
      handlers:
        nim:
          paths: [src]
  1. Use in your markdown:
# API Reference

::: mymodule
  1. 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

mkdocstrings_nim-0.1.0.tar.gz (28.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mkdocstrings_nim-0.1.0-py3-none-any.whl (75.1 kB view details)

Uploaded Python 3

File details

Details for the file mkdocstrings_nim-0.1.0.tar.gz.

File metadata

  • Download URL: mkdocstrings_nim-0.1.0.tar.gz
  • Upload date:
  • Size: 28.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for mkdocstrings_nim-0.1.0.tar.gz
Algorithm Hash digest
SHA256 4bee26f18d78e0c59f72bc39e7a5e1e3d9d36bb94bd39d14550e92f88761b7e7
MD5 0692e2ffb5598745719ae34bd7882b2a
BLAKE2b-256 0b95f1e658b01cf2c3bc30ba6e54410bdf1b6bef821ae602ad86beffe1b733b8

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocstrings_nim-0.1.0.tar.gz:

Publisher: publish.yml on elijahr/mkdocstrings-nim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mkdocstrings_nim-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocstrings_nim-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 519cef00c76946a42439c3141284f7a7621947c3c40bedb9b7a9ed53e0f943c4
MD5 2589f7c6174371057e98f2426d726e65
BLAKE2b-256 95a8292dc5cffece9d2b179da7514f77e943845ae331b7dbcc04787663d71747

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocstrings_nim-0.1.0-py3-none-any.whl:

Publisher: publish.yml on elijahr/mkdocstrings-nim

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page