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 minimal platform for Markdown-based blogs

madblog This project provides a minimal blogging platform based on Markdown files. Demos This project powers the following blogs: Platypush My persona

Fabio Manganiello 2 Aug 02, 2022
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 template manager for writing API docs in python.

DocsGen-py A markdown template manager for writing API docs in python. Contents Usage API Reference Usage You can install the latest commit of this re

Ethan Evans 1 May 10, 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
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
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 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
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 31, 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
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
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
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
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
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
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 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
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
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 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