ml-tooling / lazydocs

📖 Generate markdown API documentation from Google-style Python docstring. The lazy alternative to Sphinx.
MIT License
205 stars 38 forks source link

Example: not working like Args: and Returns: #48

Closed Hermann-SW closed 1 year ago

Hermann-SW commented 1 year ago

lazydocs just generates everything after Example: in same line, unlike Args: or Retruns:

def bits(n: int) -> int:
    '''
    returns bit-length of n

    Example:
        Of biggest RSA number.
    >>> bits(rsa[-1][1])
    2048
    >>>
```
'''
return int(log2(n) + 1)
**Problem and motivation:**

Adding Examples in doc is important.

**Is this something you're interested in working on?**

No experience with act.

But I built a Makefile workaround:

... docs/RSA_numbers_factored.py.md: RSA_numbers_factored.py lazydocs $< sed -i "s# (```)\$$#\n\1#;s#(**Example.:*\)#\1\n#" $@ ...



Running that sed command after lazydocs results in wanted nice output:
<img src="https://stamm-wilbrandt.de/en/Example_lazydocs.png">
github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days

Hermann-SW commented 1 year ago

I don't know the process, but shouldn't somebody review this issue before marking stale and auto closing?

github-actions[bot] commented 1 year ago

This issue is stale because it has been open 90 days with no activity. Remove stale label or comment or this will be closed in 14 days