a small simple library for generating documentation from docstrings

Overview

inkpot

a small simple library for generating documentation from docstrings

inkpot is available on pip. Please give it a star if you like it!

drawing

GitHub stars GitHub forks Tweet

GitHub PyPI PyPI - Python Version PyPI - Downloads

To know more about way I started this project checkout this blog post

Installation

pip install inkpot

Usage

singel file

python3 -m inkpot myfile.py

or directory

python3 -m inkpot myproject/

output to a file (also works with directories)

python3 -m inkpot myfile.py > doc.md
python3 -m inkpot myproject/ > doc.md

Currently this returns a markdown table. More functionality and a better format will be added.

Example

Python file ex/add.py

def add(a,b):
    """ add to objects """
    return a + b
python3 -m inkpot ex/add.py

returns markdown

# ex/add.py
## ex/add.py
| type   | name   | doc-str        |
|:-------|:-------|:---------------|
| def    | add    | add to objects |
| module | add    | None           |

License

This project is licensed under the MIT License - see the LICENSE file for details

Comments
  • Added support for coroutines declared with async/await syntax

    Added support for coroutines declared with async/await syntax

    Added support for coroutines declared with async/await syntax.

    async def async_def_test(a, b, c):
        """
        Testing coroutines declared with async syntax
        """
        print("hello")
        await asyncio.sleep(1)
        print("world")
    
    opened by ViktorBusk 0
  • Added node visitor support (refactor in file class)

    Added node visitor support (refactor in file class)

    Refactored File class, much better code (more dynamic) with a node visitor. Also fixed directory support bug with double backslash.

    The output is still the same as before.

    opened by ViktorBusk 0
  • Added file-node support (classes, modules etc..) and better formatting for output.

    Added file-node support (classes, modules etc..) and better formatting for output.

    I found a Python base module called "ast". It parses a source file and checks for specified nodes (class, module etc..). I also changed the file-output to a markdown table format which looks much better in my opinion.

    python3 -m inkpot ex/car.py > car_test.md
    

    Output:

    car_test.md

    opened by ViktorBusk 0
  • Fixed issue with function definitions, and removed lowercase

    Fixed issue with function definitions, and removed lowercase

    There was an issue when extracting function definitions in the previous version, for example you could write something like:

    #def 
    test = "def"
    

    Both the comment and the string declaration would be interpreted as functions, but that is no longer the case.

    opened by ViktorBusk 0
  • Added support for multiline-docstrings

    Added support for multiline-docstrings

    Previously, only singleline-docstrings were supported, but not longer.

    Test Car Class:

    class car:
        def __init__(self):
            self.wheels = 0
            self.doors = 0
            self.engine = ""
            self.number_plate = ""
    
        def start(self):
            """starts the engine of the car"""
            self.engine = """Running"""
    
        def stop(self):
            """Stop the engine of the car!"""
            self.engine = "Stopping"
    
        def honk(self):
            """
            Use
            "The"
            ""Horn""
            """
            print("Honking...")
            print("Honk Honk!")
    
        def __str__(self):
            """
            example of a longer multiline-docstring,
            everything will be printed on a single line
            """
            return self.number_plate
    

    Output:

    # ex/car.py
    ## ex/car.py
    | def | doc-str |
    | --- | --- |
    |     __init__(self) | no docstring |
    |     start(self) | starts the engine of the car |
    |     stop(self) | stop the engine of the car! |
    |     honk(self) | use "the" ""horn"" |
    |     __str__(self) | example of a longer multiline-docstring, everything will be printed on a single line |
    
    opened by ViktorBusk 0
  • Skip given directory

    Skip given directory

    There should be a way of skipping a directory. This could be done by a flag -s "./not-included-dir/" or --skip "./not-included-dir/" But I might want to not include multiple directories, in this case one could maybe do something like this:

    --skip "./not-included-dir/|./some-other-dir"

    or

    --skip "./not-included-dir/, ./some-other-dir"

    I don't know what way would be best for multiple files

    or should one use an .inkpot.ignore file for multiple files :man_shrugging:

    enhancement 
    opened by AxelGard 0
Releases(v2.2.1)
Owner
Axel Gard
MSc Software Engineering @ Linköping University
Axel Gard
Converts a grading Excel sheet into Markdown documents.

GradeDocs Turns Excel worksheets into grade/score documents. Example Given such an Excel Worksheet (see examples/example.xlsx): The following commands

Patrick Bucher 1 Dec 19, 2021
A markdown extension for converting Leiden+ epigraphic text to TEI XML/HTML

LeidenMark $ pip install leidenmark A Python Markdown extension for converting Leiden+ epigraphic text to TEI XML/HTML. Inspired by the Brill plain te

André van Delft 2 Aug 04, 2021
Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files

Mdformat is an opinionated Markdown formatter that can be used to enforce a consistent style in Markdown files. Mdformat is a Unix-style command-line tool as well as a Python library.

Executable Books 180 Jan 06, 2023
Convert HTML to Markdown-formatted text.

html2text html2text is a Python script that converts a page of HTML into clean, easy-to-read plain ASCII text. Better yet, that ASCII also happens to

Alireza Savand 1.3k Dec 31, 2022
Convert mind maps to markdown for import into Roam.

Mind Map to Markdown for Roam import Got a Mind Map with contents you'd like to import into Roam? Soon, this Python application might do what just you

Romilly Cocking 3 Dec 09, 2021
Static site generator that supports Markdown and reST syntax. Powered by Python.

Pelican Pelican is a static site generator, written in Python. Write content in reStructuredText or Markdown using your editor of choice Includes a si

Pelican dev team 11.3k Jan 05, 2023
markdown2: A fast and complete implementation of Markdown in Python

Markdown is a light text markup format and a processor to convert that to HTML. The originator describes it as follows: Markdown is a text-to-HTML con

Trent Mick 2.4k Dec 30, 2022
An interactive, terminal-based markdown presenter

lookatme lookatme is an interactive, extensible, terminal-based markdown presentation tool. TOC TOC Features Tour Navigating the Presentation CLI Opti

James Johnson 1.4k Jan 01, 2023
A markdown lexer and parser which gives the programmer atomic control over markdown parsing to html.

A markdown lexer and parser which gives the programmer atomic control over markdown parsing to html.

stonepresto 4 Aug 13, 2022
A super simple script which uses the GitHub API to convert your markdown files to GitHub styled HTML site.

A super simple script which uses the GitHub API to convert your markdown files to GitHub styled HTML site.

Çalgan Aygün 213 Dec 22, 2022
A Discord Bot for rendering Markdown

Markdown to PDF Bot A discord bot that accepts markdown files (or messages) and displays them as images. Prerequisite To install, you must have have :

1 Oct 21, 2021
A Straightforward Markdown Journal

Introducing Pepys: A straightforward markdown journal "It is rightly made for those who love to document their daily life events" - FOSSBytes Pepys is

Luke Briggs 23 Nov 12, 2022
A Python implementation of John Gruber’s Markdown with Extension support.

Python-Markdown This is a Python implementation of John Gruber's Markdown. It is almost completely compliant with the reference implementation, though

Python-Markdown 3.1k Dec 30, 2022
A fast, extensible and spec-compliant Markdown parser in pure Python.

mistletoe mistletoe is a Markdown parser in pure Python, designed to be fast, spec-compliant and fully customizable. Apart from being the fastest Comm

Mi Yu 546 Jan 01, 2023
Application that converts markdown to html.

Markdown-Engine An application that converts markdown to html. Installation Using the package manager [pip] pip install -r requirements.txt Usage Run

adriano atambo 1 Jan 13, 2022
Yuque2md - Offline download the markdown file and image from yuque

yuque2md 按照语雀知识库里的目录,导出语雀知识库中所有的markdown文档,并离线图片到本地 使用 安装 Python3.x clone 项目 下载依

JiaJianHuang 4 Oct 30, 2022
A markdown generation library for Python.

Welcome to SnakeMD SnakeMD is your ticket to generating Markdown in Python. To prove it to you, we've generated this entire README using SnakeMD. See

The Renegade Coder 22 Dec 08, 2022
A automated python script that creates mark-down files to read for the aes keys and other useful information.

Archive A automated python script that creates mark-down files to read for the aes keys and other useful information. Table of Contents Benbot Automat

Tector 13 Dec 14, 2022
Pure-python-server - A blogging platform written in pure python for developer to share their coding knowledge

Pure Python web server - PyProject A blogging platform written in pure python (n

Srikar Koushik Satya Viswanadha 10 Nov 07, 2022
A Python library to retrieve annotations and notes from Zotero and save them into Markdown files.

Zotero to Markdown Generate Markdown files from Zotero annotations and notes. With new Zotero PDF Reader, all highlights are saved in the Zotero datab

Essi Alizadeh 20 Nov 03, 2022