this post was submitted on 25 Oct 2025
13 points (100.0% liked)

Python

7665 readers
3 users here now

Welcome to the Python community on the programming.dev Lemmy instance!

๐Ÿ“… Events

PastNovember 2023

October 2023

July 2023

August 2023

September 2023

๐Ÿ Python project:
๐Ÿ’“ Python Community:
โœจ Python Ecosystem:
๐ŸŒŒ Fediverse
Communities
Projects
Feeds

founded 2 years ago
MODERATORS
 

I'm looking for a way to generate a single Markdown (.md) file that includes all the file names, function definitions, and docstrings from my Python files. Ideally, this should traverse a directory recursively while respecting the .gitignore rules.

Does anyone know of a package that accomplishes this?

you are viewing a single comment's thread
view the rest of the comments
[โ€“] logging_strict@programming.dev 2 points 2 months ago* (last edited 2 months ago)

Just spent the last two weeks (no exaggeration) putting documentation together. Ensuring references resolve correctly is the time consuming bit.

extlinks, nitpick_ignore, autodoc_type_aliases, intersphinx_mapping, multiple extensions, and building inventories using sphobjinv, Table of contents using sphinx-external-toc-strict links to both ref and docs.

The table of contents supports both .md and .rst files. With the caveat that the initial file must be index.rst.

Having to relearn all this crap to do the same thing (e.g. mkdocs)? Would rather stick a fork in my eye.

Here is a sample TOC config file wreck _toc.yml from package wreck. Shows globs:, file:, url: links.

This one includes both .rst and .md strict TOC _toc.yml

Output is a user manual web site or a pdf.

markdown and restructuredText are input files, not the end goal.