@@ -161,6 +161,7 @@ def __init__(self, md, config):
161161 self .slugify = config ["slugify" ]
162162 self .sep = config ["separator" ]
163163 self .toc_class = config ["toc_class" ]
164+ self .title_class = config ["title_class" ]
164165 self .use_anchors = parseBoolValue (config ["anchorlink" ])
165166 self .anchorlink_class = config ["anchorlink_class" ]
166167 self .use_permalinks = parseBoolValue (config ["permalink" ], False )
@@ -251,7 +252,8 @@ def build_toc_div(self, toc_list):
251252 # Add title to the div
252253 if self .title :
253254 header = etree .SubElement (div , "span" )
254- header .attrib ["class" ] = "toctitle"
255+ if self .title_class :
256+ header .attrib ["class" ] = self .title_class
255257 header .text = self .title
256258
257259 def build_etree_ul (toc_list , parent ):
@@ -335,6 +337,9 @@ def __init__(self, **kwargs):
335337 "title" : ["" ,
336338 "Title to insert into TOC <div> - "
337339 "Defaults to an empty string" ],
340+ "title_class" : ['toctitle' ,
341+ 'CSS class used for the title. '
342+ 'Defaults to "toctitle"' ],
338343 "toc_class" : ['toc' ,
339344 'CSS class(es) used for the link. '
340345 'Defaults to "toclink"' ],
0 commit comments