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

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

braniii
Copy link

@braniii braniii commented Apr 24, 2022

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

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