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.1.tar.gz (31.9 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.1-py3-none-any.whl (79.0 kB view details)

Uploaded Python 3

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

Hashes for mkdocstrings_nim-0.1.1.tar.gz
Algorithm Hash digest
SHA256 26d02d3dbefe270e58dbfb4fb0ee44836522f30018f24f4e139cfc280529ae8b
MD5 60ded74f36a4c67ea2314f11eeadb87a
BLAKE2b-256 61c960b071461f9d2a61f9751adae026eed3e76feca1f8c827e30c2ae918f341

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocstrings_nim-0.1.1.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.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mkdocstrings_nim-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 020202f1e6d02e2aada31bccc1fdc66bb5276307dab99a7ea27c50820f9682c2
MD5 b6b051549563d8e53661b663369ff986
BLAKE2b-256 a9effdf979b6789aa55da6f338d2677ff61405a9e4dae4778ade5067039b707e

See more details on using hashes here.

Provenance

The following attestation bundles were made for mkdocstrings_nim-0.1.1-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