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
Yuque2md - Offline download the markdown file and image from yuque

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

JiaJianHuang 4 Oct 30, 2022
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
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
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
A lightweight and fast-to-use Markdown document generator based on Python

A lightweight and fast-to-use Markdown document generator based on Python

快乐的老鼠宝宝 1 Jan 10, 2022
a small simple library for generating documentation from docstrings

inkpot a small simple library for generating documentation from docstrings inkpot is available on pip. Please give it a star if you like it! To know m

Axel Gard 5 Oct 20, 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
Remarkable Markdown Debian Package Fix

Remarkable debian package fix For some reason the Debian package for remarkable markdown editor has not been made to install properly on Ubuntu 20.04

Eric Seifert 37 Jan 02, 2023
A fast yet powerful Python Markdown parser with renderers and plugins.

Mistune v2 A fast yet powerful Python Markdown parser with renderers and plugins. NOTE: This is the re-designed v2 of mistune. Check v1 branch for ear

Hsiaoming Yang 2.2k Jan 04, 2023
Rich-cli is a command line toolbox for fancy output in the terminal

Rich CLI Rich-cli is a command line toolbox for fancy output in the terminal, built with Rich. Rich-cli can syntax highlight a large number of file ty

Textualize 2.5k Jan 02, 2023
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 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
CiteURL is an extensible tool that parses legal citations and makes links to websites where you can read the cited language for free.

CiteURL is an extensible tool that parses legal citations and makes links to websites where you can read the cited language for free. It can be used t

15 Dec 27, 2022
😸Awsome markdown readme for your profile or your portfolio

GitHub Profile Readme Description That's a simple and minimalist README.md for your profile Usage You can download or copy to your repository and make

0 Jul 24, 2022
An automated scanning, enumeration, and note taking tool for pentesters

EV1L J3ST3R An automated scanning, enumeration, and note taking tool Created by S1n1st3r Meant to help easily go through Hack The Box machine and TryH

14 Oct 02, 2022
Provides syntax for Python-Markdown which allows for the inclusion of the contents of other Markdown documents.

Markdown-Include This is an extension to Python-Markdown which provides an "include" function, similar to that found in LaTeX (and also the C pre-proc

Chris MacMackin 85 Dec 30, 2022
Read a list in markdown and do something with it!

Markdown List Reader A simple tool for reading lists in markdown. Usage Begin by running the mdr.py file and input either a markdown string with the -

Esteban Garcia 3 Sep 13, 2021
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
Markdown journal template.

Markdown Journal Template Description This project contains a script which creates a markdown journal template for the current year by creating a mark

Stephen McAleese 2 Mar 06, 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