diff --git a/sphinx_bootstrap_theme/bootstrap/static/bootstrap-sphinx.css_t b/sphinx_bootstrap_theme/bootstrap/static/bootstrap-sphinx.css_t index 572c0f5b..0b1787eb 100644 --- a/sphinx_bootstrap_theme/bootstrap/static/bootstrap-sphinx.css_t +++ b/sphinx_bootstrap_theme/bootstrap/static/bootstrap-sphinx.css_t @@ -117,56 +117,55 @@ td.field-body { /* First level of nav */ .bs-sidenav { - top: 80px; -// margin-top: 30px; -// margin-bottom: 30px; -// padding-top: 10px; -// padding-bottom: 10px; -// text-shadow: 0 1px 0 #fff; -// background-color: #f7f5fa; -// border-radius: 5px; + margin-top: 30px; + margin-bottom: 30px; + padding-top: 10px; + padding-bottom: 10px; + text-shadow: 0 1px 0 #fff; + background-color: #f7f5fa; + border-radius: 5px; } /* All levels of nav */ .bs-sidenav .nav > li > a { -// display: block; -// color: #716b7a; -// padding: 5px 20px; + display: block; + color: #716b7a; + padding: 5px 20px; } .bs-sidenav .nav > li > a:hover, .bs-sidenav .nav > li > a:focus { -// text-decoration: none; -// background-color: #e5e3e9; -// border-right: 1px solid #dbd8e0; + text-decoration: none; + background-color: #e5e3e9; + border-right: 1px solid #dbd8e0; } .bs-sidenav .nav > .active > a, .bs-sidenav .nav > .active:hover > a, .bs-sidenav .nav > .active:focus > a { -// font-weight: bold; -// color: #563d7c; -// background-color: transparent; -// border-right: 1px solid #563d7c; + font-weight: bold; + color: #563d7c; + background-color: transparent; + border-right: 1px solid #563d7c; } .bs-sidenav .nav .nav > li > a { -// padding-top: 3px; -// padding-bottom: 3px; -// padding-left: 30px; -// font-size: 90%; + padding-top: 3px; + padding-bottom: 3px; + padding-left: 30px; + font-size: 90%; } .bs-sidenav .nav .nav .nav > li > a { -// padding-top: 3px; -// padding-bottom: 3px; -// padding-left: 40px; -// font-size: 90%; + padding-top: 3px; + padding-bottom: 3px; + padding-left: 40px; + font-size: 90%; } .bs-sidenav .nav .nav .nav .nav > li > a { -// padding-top: 3px; -// padding-bottom: 3px; -// padding-left: 50px; -// font-size: 90%; + padding-top: 3px; + padding-bottom: 3px; + padding-left: 50px; + font-size: 90%; } /* Show and affix the side nav when space allows it */ diff --git a/sphinx_bootstrap_theme/example_module.py b/sphinx_bootstrap_theme/example_module.py index 6a352d35..e7616703 100644 --- a/sphinx_bootstrap_theme/example_module.py +++ b/sphinx_bootstrap_theme/example_module.py @@ -1,5 +1,5 @@ # coding=utf-8 -"""Example Module to show of :py:mod:`sphinx.autodoc` features with **Twitter Bootstrap**. +"""Example Module to show off :py:mod:`sphinx.autodoc` features with **Bootstrap**. .. moduleauthor:: Torbjörn Klatt """ diff --git a/sphinx_bootstrap_theme/html_bootstrap_translator.py b/sphinx_bootstrap_theme/html_bootstrap_translator.py index eaede035..07aae66a 100644 --- a/sphinx_bootstrap_theme/html_bootstrap_translator.py +++ b/sphinx_bootstrap_theme/html_bootstrap_translator.py @@ -1,5 +1,5 @@ # coding=utf-8 -"""A custom Sphinx HTML Translator for *Twitter Bootstrap* layout +"""A custom Sphinx HTML Translator for *Bootstrap* layout .. moduleauthor:: Torbjörn Klatt """ @@ -68,12 +68,12 @@ def debug_print(node): class BootstrapTranslator(HTMLTranslator): - """Custom HTML Translator for a Bootstrap-ifyied Sphinx layout + """Custom HTML Translator for a Bootstrap-ified Sphinx layout This is a specialization of the default HTML Translator of the docutils package. Only a couple of functions have been overridden to produce valid HTML to be - directly styled with *Twitter Bootstrap*. + directly styled with *Bootstrap*. """ # overridden @@ -143,9 +143,9 @@ def visit_paragraph(self, node): def visit_attribution(self, node): """Attribution line (e.g. in block quotes) - With *Twitter Bootstrap* we are able to style a special attribution - paragraph (read "*footer*") at the end of block quotes with the ReST - directive ``epigraph``. + With *Bootstrap* we are able to style a special attribution paragraph + (read "*footer*") at the end of block quotes with the ReST directive + ``epigraph``. .. admonition:: Example @@ -341,6 +341,21 @@ def visit_list_item(self, node): if len(node): node[0]['classes'].append('first') + # overridden + def visit_hlist(self, node): + """A hlist. Compact version of a list. + """ + atts = {'class': 'hlist'} + self.body.append(self.starttag(node, 'div', **atts)) + + def depart_hlist(self, node): + self.body.append('') + + def visit_hlistcol(self, node): + pass + def depart_hlistcol(self, node): + pass + # overridden def visit_definition_list(self, node): """Bootstrap-ified Definition List @@ -441,6 +456,12 @@ def depart_table(self, node): self.compact_p = self.context.pop() self.body.append('\n') + # LaTeX only + def visit_tabular_col_spec(self, node): + pass + def depart_tabular_col_spec(self, node): + pass + def visit_desc(self, node): self.body.append( self.starttag(node, 'div', @@ -768,3 +789,18 @@ def depart_literal(self, node): if node.parent.tagname != 'reference': self.protect_literal_text -= 1 self.body.append('') + + # autosummary extension + def visit_autosummary_table(self, node): + from sphinx.ext.autosummary import autosummary_table_visit_html + autosummary_table_visit_html(self, node) + + def depart_autosummary_table(self, node): + pass + + def visit_autosummary_toc(self, node): + from sphinx.ext.autosummary import autosummary_toc_visit_html + autosummary_toc_visit_html(self, node) + + def depart_autosummary_toc(self, node): + pass