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.1.0.tar.gz (9.6 kB view details)

Uploaded Source

Built Distribution

inari-0.1.0-py3-none-any.whl (9.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: inari-0.1.0.tar.gz
  • Upload date:
  • Size: 9.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.4 Linux/4.15.0-58-generic

File hashes

Hashes for inari-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b62f4da76a60ee1bd53cd864b69bafd82cc5e8a0c5d53108cf1cadefa61e4ba2
MD5 2bd50964a4f93ee3cf6fb92622fdfa20
BLAKE2b-256 75de74d0c308f00f20fe1bacd253d492027d52245227533d91fc24eab315065c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: inari-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/0.12.17 CPython/3.7.4 Linux/4.15.0-58-generic

File hashes

Hashes for inari-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 51a76e160fe0811c86a4a0c639f27752d20d8b746a2464ea8deed84ca11cc473
MD5 29fc8fe4bbbe06adde58fc966486aa73
BLAKE2b-256 ce2087d70b702be7916beb5e68101deeb15d11d6f3c21d88430d5638bbbcec1b

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