Skip to content
Merged
Show file tree
Hide file tree
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
34 changes: 12 additions & 22 deletions doc/source/guzzle_sphinx_theme/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ def setup(app):
app.connect('html-page-context', add_html_link)
app.connect('build-finished', create_sitemap)
app.sitemap_links = []
app.set_translator('html', HTMLTranslator)


def add_html_link(app, pagename, templatename, context, doctree):
Expand Down Expand Up @@ -51,28 +52,17 @@ def html_theme_path():


class HTMLTranslator(SphinxHTMLTranslator):
"""
Handle translating to bootstrap structure.
"""
def visit_table(self, node, name=''):
"""
Override docutils default table formatter to not include a border
and to use Bootstrap CSS
See: http://sourceforge.net/p/docutils/code/HEAD/tree/trunk/docutils/docutils/writers/html4css1/__init__.py#l1550
"""
self.context.append(self.compact_p)
self.compact_p = True
classes = ' '.join(['table', 'table-bordered',
self.settings.table_style]).strip()
self.body.append(
self.starttag(node, 'table', CLASS=classes))

def depart_table(self, node):
"""
This needs overridin' too
"""
self.compact_p = self.context.pop()
self.body.append('</table>\n')
def visit_admonition(self, node, name=''):
"""Uses the h3 tag for admonition titles instead of the p tag"""
self.body.append(self.starttag(
node, 'div', CLASS=('admonition ' + name)))
if name:
title = (
f"<h3 class='admonition-title'>"
f"{admonitionlabels[name]}</h3>"
)
self.body.append(title)
self.set_first_last(node)


class GuzzleStyle(Style):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
<div class="body">
<div class="well">
<p>
<strong>Note:</strong>
<h3 style="margin-top: 0px;">Note:</h3>
You are viewing the documentation for an older major version of the AWS CLI (version 1).
</p>
<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -481,16 +481,6 @@ div.admonition dl {
margin-bottom: 0;
}

p.admonition-title {
margin: 0px 10px 5px 0px;
font-weight: bold;
display: inline;
}

p.admonition-title:after {
content: ":";
}

div.body p.centered {
text-align: center;
margin-top: 25px;
Expand All @@ -510,14 +500,6 @@ dd div.admonition {
padding-left: 60px;
}

div.admonition p.admonition-title {
font-weight: bold;
font-size: 15px;
margin: 0 0 10px 0;
padding: 0;
line-height: 1;
}

div.admonition p.last {
margin-bottom: 0;
}
Expand All @@ -528,6 +510,14 @@ div.note {
border-radius: 3px;
}

div.body h3.admonition-title {
margin-top: 0px;
}

div.body h3.admonition-title:after {
content: ":";
}

/* -- other body styles ----------------------------------------------------- */

ol.arabic {
Expand Down