-
-
Notifications
You must be signed in to change notification settings - Fork 23
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
Exclude submenu and TOC items for excluded folders. #106
Exclude submenu and TOC items for excluded folders. #106
Conversation
…tion. Created get_toc_sidebar_section and modified get_html_from_items to detect use of a section before adding to the content.
Given a sample site dir below, I needed to generate a pdf for a manual. The exclude left a number of empty sections (a bug). At first I used the exclude, but that presumes we'll stay abreast of new folders to exclude. I replicated the option from the enum-headings for include and fixed the empty sections. The manual still had the parent structure. Printing Operations resulted an index that included References, Guides, Operations. The print_docs_dir resets the root of the process to provide a clean TOC. -docs I'll eventually need a print for multiple docs and will need to update on_config to use an an array of print_docs_dir folders, page names, and other data. |
I havent had the chance to take a look yet. Any reason why you closed this PR? Looks like you put in quite some effort |
The eventuality I mentioned above arrived. I addressed the big parts yesterday and a quick test this morning. The change allows all the normal "config" inputs to be used as it is now, but if a "pages_to_print" is defined those become global settings that can be overwritten by page level configs. I still need to do some tests, annotate the docs/user guide, and research feeding the variables that are in the config for the page to the .tpl. Right now my tpl is using {{ config.extra.print_title }} and I need to modify env.globals = {"config": self.mkdocs_config, "page": self.print_page} in renderer.py to add the page information. - print-site:
add_cover_page: true
cover_page_template: "docs/assets/cover_page_policy.tpl"
add_table_of_contents: true
add_print_site_banner: false
pages_to_print:
- page_name: 'print_policy_page'
config:
- add_table_of_contents: true
- add_print_site_banner: false
- print_page_title: "Policy and Procedures"
- print_docs_dir: "Reference/Policies"
- page_name: 'print_presales'
config:
- add_table_of_contents: false
- add_print_site_banner: true
- print_page_title: "Pre Sales Onboarding Guide"
- print_docs_dir: "Reference/Pre Sales Onboarding Guide"
- page_name: 'print_service_catalog'
config:
- add_cover_page: true
- add_table_of_contents: true
- add_print_site_banner: false
- print_page_title: "Service Catalog"
- print_docs_dir: "Reference/Service Catalog"
|
Tim, I resubmitted under #108 last month. |
This is a PR to fix #76 by inspecting for the presence of child items within a section before adding to the TOC and Menu.