mitmproxy / mitmproxy/pdoc

Add a configuration file (`pdoc.toml`)

Open
#878 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
Dominant language
Python
Stars
2.5k
Forks
228
PR merge metrics
No merged PRs in 30d

Description

Problem Description

Most commonly, people will be using the same set of arguments every time they build their documentation. While this could be delegated to a task runner like Make or Just, it would also be convenient for pdoc to define its own config file and read arguments from that.

Proposal
  • Define a config file name, format, and spec, e.g. pdoc.toml, which can represent any arguments which can be passed to the CLI.
  • When pdoc is called, check for this config file in the working directory (possibly also its ancestors).
  • Merge the commnd line and config arguments.
  • Add a --config argument for overriding the config location (do not allow this to be configured in pdoc.toml).
Alternatives

Keep the status quo, encouraging people to use their own collection of scripts and config scattered across build tools and contexts.

Bikeshedding file formats:

Pain points
  • merging config can be non-trivial where arguments can be repeated, e.g. the module list - do you extend or replace?
  • resolving relative paths may need to work differently in the CLI (relative to working directory) and the config file (relative to the directory of the config file)
Example
# module, path, and regex ignore patterns could be split into different keys
modules = ["pdoc.doc", "./pdoc/doc.py", "!foo.bar"]

output_directory = "./build/"
docformat = "markdown"
include_undocumented = true
edit_url = {
  "module.name" = "https://my_prefix.com/"
}

...

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by mapping the existing CLI arguments and how pdoc is invoked. Define the pdoc.toml format and semantics for repeated arguments, path resolution, config discovery, and command-line precedence; add the --config override without allowing it in the config file. Done means documented behavior and coverage for loading, merging, and overriding configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, documentation
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.