inari

Write docstrings in Markdown!

This API documents are created by inari itself.

1
2
3
4
5
# create `inari` documents!
git clone https://github.com/tkamenoko/inari.git
cd inari
poetry install
poetry run mkdocs build

Features

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

Install

1
pip install inari[mkdocs]

Example

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# 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)
1
inari sample docs

inari makes this Markdown file:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<!-- 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