Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/mkdocs_print_site_plugin/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class PrintSitePlugin(BasePlugin):
("print_page_title", config_options.Type(str, default="Print Site")),
("print_page_basename", config_options.Type(str, default="print_page")),
("add_table_of_contents", config_options.Type(bool, default=True)),
("toc_title", config_options.Type(str, default="Table of Contents")),
("toc_title", config_options.Type(str, default=None)),
("toc_depth", config_options.Type(int, default=3)),
("add_full_urls", config_options.Type(bool, default=False)),
("enumerate_headings", config_options.Type(bool, default=True)),
Expand Down Expand Up @@ -59,6 +59,11 @@ def on_config(self, config, **kwargs):
assert self.config.get("enumerate_headings_depth") >= 1
assert self.config.get("enumerate_headings_depth") <= 6

# If the user does not specify a value for the item
if self.config.get("toc_title") is None:
self.config["toc_title"] = config.get(
"mdx_configs", {}).get("toc", {}).get("title", "Table of Contents")

# Because other plugins can alter the navigation
# (and thus which pages should be in the print page)
# it is important 'print-site' is defined last in the 'plugins'
Expand Down