mitmproxy / mitmproxy/pdoc

include local logo assets in pdoc output

Open
#766 1 comment 3 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

When running pdoc in autoreload/preview mode, I was having trouble getting local logo images to work:

pdoc my_module --logo logo.png

Where logo.png is a file in the current directory I'm running pdoc from.

Similarly, if I create an output:

pdoc my_module --logo logo.png -o docs

I need to manually copy the logo into the output dir: cp ./logo.png docs, which makes it clear that --logo arg is a path relative to the hosted root. I cannot find a way of making a local logo work in autoreload/preview mode.

Proposal

It'd be nice when I specify a local image file, the asset is just included in the build.

Alternatives

Perhaps instead we could have a flag for --include-asset-dir or something that I could point to a directory that holds all the assets for the docs? For example, say I had a project with the following dir structure:

my_module
assets/logo.png
pyproject.toml

In the root project dir, I'd go

pdoc ./my_module --logo /logo.png --include-asset-dir ./assets -o docs

And it would copy the contents of ./assets into docs:

docs/index.html
docs/my_module.html
docs/logo.png
(etc)
Extra context

It's very possible there's already a way to handle this that I'm just missing... if so, please let me know how I should be approaching this! Thanks.

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 reproducing the issue with pdoc my_module --logo logo.png and with -o docs, then trace the CLI handling of --logo and output generation. Done means a local logo is included in the generated output and works in autoreload/preview mode without manual copying.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
cli, documentation
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.