Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

include local logo assets in pdoc output #766

Open
khusmann opened this issue Dec 22, 2024 · 0 comments
Open

include local logo assets in pdoc output #766

khusmann opened this issue Dec 22, 2024 · 0 comments

Comments

@khusmann
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant