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
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 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
Comprehensive Markdown plugin built for Django

Django MarkdownX Django MarkdownX is a comprehensive Markdown plugin built for Django, the renowned high-level Python web framework, with flexibility,

neutronX 740 Jan 08, 2023
A command line tool that can convert Day One data into markdown files.

Introduction Features Before Start Export data from Day One Check Integrity Special Cases for Photo Extension Name Audio Extension Name Usage Known Is

gyro永不抽风 26 Dec 31, 2022
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
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 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
Notedown - Markdown <=> IPython Notebook

Python 2/3 and IPython 4 / Jupyter compatible! Convert IPython Notebooks to markdown (and back) notedown is a simple tool to create IPython notebooks

Aaron O'Leary 840 Jan 04, 2023
Livemark is a static page generator that extends Markdown with interactive charts, tables, and more.

Livermark This software is in the early stages and is not well-tested Livemark is a static site generator that extends Markdown with interactive chart

Frictionless Data 86 Dec 25, 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
WyPyPlus is a minimal wiki in 42 lines of Python code.

🍦 WyPyPlus: A personal wiki in 42 lines of code 🍦 WyPyPlus (pronounced "whippy plus") is a minimalist wiki server in 42 lines of code based on wypy

Leo Chen 8 Apr 07, 2022
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
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
Toci is a markdown tool to generate an outline from a given Jupyter notebook.

Toci is a markdown tool to generate an outline from a given Jupyter notebook. It traverses the markdown cells of a given ipynb file to form a toc for you.

Hakan Özler 7 Jan 22, 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
Preview GitHub README.md files locally before committing them.

Grip -- GitHub Readme Instant Preview Render local readme files before sending off to GitHub. Grip is a command-line server application written in Pyt

Joe Esposito 5.9k Jan 08, 2023
Markdown Presentations for Tech Conferences, Training, Developer Advocates, and Educators.

March 1, 2021: Service on gitpitch.com has been shutdown permanently. GitPitch 4.0 Docs Twitter About Watch the Introducing GitPitch 4.0 Video Visit t

David Russell 5.4k Jan 05, 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
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
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