@@ -29,7 +29,7 @@ class PrintSitePlugin(BasePlugin):
2929 ("print_page_title" , config_options .Type (str , default = "Print Site" )),
3030 ("print_page_basename" , config_options .Type (str , default = "print_page" )),
3131 ("add_table_of_contents" , config_options .Type (bool , default = True )),
32- ("toc_title" , config_options .Type (str , default = "Table of Contents" )),
32+ ("toc_title" , config_options .Type (str , default = None )),
3333 ("toc_depth" , config_options .Type (int , default = 3 )),
3434 ("add_full_urls" , config_options .Type (bool , default = False )),
3535 ("enumerate_headings" , config_options .Type (bool , default = True )),
@@ -59,6 +59,11 @@ def on_config(self, config, **kwargs):
5959 assert self .config .get ("enumerate_headings_depth" ) >= 1
6060 assert self .config .get ("enumerate_headings_depth" ) <= 6
6161
62+ # If the user does not specify a value for the item
63+ if self .config .get ("toc_title" ) is None :
64+ self .config ["toc_title" ] = config .get (
65+ "mdx_configs" , {}).get ("toc" , {}).get ("title" , "Table of Contents" )
66+
6267 # Because other plugins can alter the navigation
6368 # (and thus which pages should be in the print page)
6469 # it is important 'print-site' is defined last in the 'plugins'
0 commit comments