GithubHelp home page GithubHelp logo

joaomcteixeira / hypersimpledocstring2md Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 51 KB

A Hyper Simple Docstring to Markdown. Creates indexed Markdown files from Python libraries docstrings.

License: The Unlicense

Python 100.00%
python python3 documentation docstring markdown docstring-documentation docstring-markdown documentation-generator pydoc

hypersimpledocstring2md's Introduction

HyperSimpleDocstring2Md

A Hyper Simple Docstring to Markdown creator. Creates hierarchically indexed Markdown files from Python libraries' docstrings. Fully based on Python standard library.

Why?

It is extremely important to maintain software documentation up to date with the latest releases.

There are many packages out there to efficiently handle the documentation of Python projects, those can extract updated docstrings and setup beautiful web pages accordingly. But, such complex tools require a considerable amount of time and effort to master, and developers should thrive to keep up to date with the most novel routines and styles of documentation representation.

Moreover, in my opinion, these projects fail to address a specific collective of developers: those who thrive, above all, for extreme simplicity, long-term stability and universality of their output, in this case software documentation.

Solution

Hyper Simple Docstring 2 Markdown creator was designed to recursively extract DOCSTRINGS from a target Python package and write them to a simple yet organized and indexed Markdown formatted file. It intents to be exactly that, hyper simple in both input and output.

The output Mardown file can be directly used as a GitHub wiki page, for example.

Implementation

It uses Python +3.7 standard libraries, such as pydoc and the inspect module.

Which docstrings are covered?

In the current version, DOCSTRINGS from packages (__init__.py), modules, classes and functions are extracted.

How to use it

No installation is required and you only need to pass one argument, it's HYPER SIMPLE:

  • the PATH to your Python package
python hypersimpledocstring2md.py <PATH TO YOUR LIBRARY>

This will recursively read your library and generate a docs.md file containing all referred docstrings in an organized manner. All subpackages MUST have an __init__.py file.

but there are also additional features

For example:

  • you can add a base web url in order to link the index with the Markdown headers, it will result in <link>#<header>, very useful for GitHub pages.
$ python hypersimpledocstring2md.py -h
usage: hypersimpledocstring2md.py [-h] [--baselink baselink] [--output OUTPUT]
                                  path

Hyper Simple Docstring 2 Markdown - A routine to create a single Markdown
formatted file containing the documentation DOCSTRINGS of a target Python
library.

positional arguments:
  path                 PATH to Library.

optional arguments:
  -h, --help           show this help message and exit
  --baselink baselink  The base Web URL where the .md will be hosted toallow
                       Index-Header linking. Defaults to no link.
  --toplink toplink    Adds a quick link to the Index bellow each header.
                       Defaults to True.
  --output OUTPUT      The OUTPUT Markdown file. Defaults to 'docs.md'.

examples

HyperSimpleDocstring2Md is used to generate the Tauren-MD's documentation, take a look.

LICENSE

This software is licensed under the Unlicense as a demonstration of my gratitute to the whole Python community that cheerily and altruistically share knowledge on the Web. Thanks to the community.

hypersimpledocstring2md's People

Contributors

joaomcteixeira avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.