Skip to main content

Write docstrings in Markdown!

Project description

inari

Write docstrings in Markdown!

Features

  • Minimum configuration.
  • No dependencies by default(but MkDocs is recommended!).
  • CLI and MkDocs Plugin.
  • Cross reference in API documents.

Install

pip install inari[mkdocs]

Example

# sample.py
"""This is a sample module."""

variable = 42
"""(`int`):  Docstrings for module-level variables."""

def func(foo: str, bar: int) -> str:
    """
    Docstrings for functions.

    **Args**

    * foo (`str`): First argument.
    * bar (`int`): Second argument.

    **Returns**

    * `str`: Type of return value.

    """
    return foo * bar

class SampleClass:
    """
    Class docstrings.

    **Attributes**

    * baz (`str`): Docstrings for attributes.

    """
    baz: str

    def __init__(self, b: str):
        """
        **Args**

        * b (`str`): Arguments for initializing.

        """

        self.baz = b

    def method(self, bar: int) -> str:
        """
        Method docstrings.

        Cross reference available. `sample.func`

        **Args**

        * bar(`int`)

        **Returns**

        * `str`

        """
        return func(self.baz, bar)
inari sample docs

inari makes this Markdown file:

<!-- docs/sample-py.md -->

# Module sample

This is a sample module.

## Variables

- **variable**{: #variable } (`int`): Docstrings for module-level variables.

## Classes

### SampleClass {: #SampleClass }

```python
class SampleClass(self, b: str)
```

Class docstrings.

**Attributes**

- **baz** (`str`): Docstrings for attributes.

**Args**

- **b** (`str`): Arguments for initializing.

---

#### Methods {: #SampleClass-methods }

[**method**](#SampleClass.method){: #SampleClass.method }

```python
def method(self, bar: int) -> str
```

Method docstrings.

Cross reference available. [`func `](#func)

**Args**

- **bar** (`int`)

**Returns**

- `str`

## Functions

### func {: #func }

```python
def func(foo: str, bar: int) -> str
```

Docstrings for functions.

**Args**

- **foo** (`str`): First argument.
- **bar** (`int`): Second argument.

**Returns**

- `str`: Type of return value.

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

inari-0.2.0.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

inari-0.2.0-py3-none-any.whl (12.5 kB view details)

Uploaded Python 3

File details

Details for the file inari-0.2.0.tar.gz.

File metadata

  • Download URL: inari-0.2.0.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.6 Linux/5.4.0-77-generic

File hashes

Hashes for inari-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ac170a9059daf843363be87d73996a1720f41f5e4cdcd34b077e5c00277f1f2e
MD5 ea747d5804c24ee1a7f5dcf66c3fb108
BLAKE2b-256 90f290223925a60a25372471ebddcd9787e6f68765c3e4f4317be2cba19d86f2

See more details on using hashes here.

File details

Details for the file inari-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: inari-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 12.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.7 CPython/3.9.6 Linux/5.4.0-77-generic

File hashes

Hashes for inari-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a01fa0c98eeb1335c674bcb2b11d0e874be35623779d7f3d6866760eab5d74b
MD5 23b5f3d829105567b90ce82fe2c15d7b
BLAKE2b-256 7befc9521c1bb14fe7c1011fc427e33bcdfaab1a4c8ec2ec8a3246b60c15fa73

See more details on using hashes here.

Supported by

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