镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

[WIP] Include static files in config and to sidebar, #115 - #394

Open
braniii wants to merge 1 commit into
pdoc3:masterfrom
braniii:add_static_content
Open

braniii wants to merge 1 commit into
pdoc3:masterfrom
braniii:add_static_content

Conversation

@braniii

@braniii braniii commented Apr 24, 2022

Copy link
Copy Markdown

I would like to add the possibility of including files in the table of contents. As a first step we will focus only on including markdown files. In a next PR this should be extend to support .ipynb and .html. My idea is to add a dictionary in the pdoc/templates/config.mako where the user can specify the name of the toc as key and the value as the path of the markdown document.

@kernc I am new to mako and struggling with some basic tasks. My concept requires to create html files for each included Markdown file. If I got it correctly, the html/md files are generated by

pdoc/pdoc/cli.py

Lines 572 to 582 in 2cce30a

for module in modules:
if args.html:
_quit_if_exists(module, ext='.html')
recursive_write_files(module, ext='.html', **template_config)
elif args.output_dir: # Generate text files
_quit_if_exists(module, ext='.md')
recursive_write_files(module, ext='.md', **template_config)
else:
sys.stdout.write(module.text(**template_config))
# Two blank lines between two modules' texts
sys.stdout.write(os.linesep * (1 + 2 * int(module != modules[-1])))

So I guess one needs to include these static files in the modules variable. My problem is that the config.mako is not parsed by the cli.py. Can you point me to an ansatz on how to circumvent this issue?

Thank you so much for your help and this great project

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant