Merge pull request #1397 from wxWidgets/more-sphinx-tweaks

More sphinx tweaks
This commit is contained in:
Robin Dunn
2019-10-17 16:38:52 -07:00
committed by GitHub
2 changed files with 20 additions and 17 deletions

View File

@@ -110,8 +110,10 @@ div.document {
background-color: rgb(230,230,230);
position: relative;
margin-left: 240px;
z-index: 0;
top: 30px;
}
div.sphinxsidebarwrapper {
padding: 10px 5px 0 10px;
}
div.document-no-sidebar {
@@ -125,13 +127,12 @@ div.document-no-sidebar {
div.sphinxsidebar {
background-color: rgb(230,230,230);
margin-left: 0;
float: none;
position: fixed;
overflow: auto;
width: 240px;
max-width: 240px;
height: auto;
z-index: 1;
float: none;
overflow: auto;
position: fixed;
left: 0;
top: 30px;
bottom: 0;
@@ -153,11 +154,8 @@ div.related {
border-top: 1px solid #ddd;
border-bottom: 1px solid #ddd;
font-size: 90%;
position: fixed;
line-height: normal;
position: fixed;
height: auto;
z-index: 1;
left: 0;
right: 0;
top: 0;

View File

@@ -261,13 +261,6 @@ def findInherited(input, class_summary, enum_base, text):
text = text.replace(regs, newtext, 1)
continue
## elif meth_name in enum_base:
## newtext = ':ref:`%s`'%meth_name
## text = text.replace(regs, newtext, 1)
## continue
if meth_name in CONSTANT_INSTANCES:
text = text.replace(regs, '``%s``'%meth_name, 1)
continue
@@ -733,6 +726,8 @@ def postProcess(folder, options):
newtext = changeWelcomeText(newtext, options)
else:
newtext = removeHeaderImage(newtext, options)
if '1moduleindex' in basename:
newtext = tweakModuleIndex(newtext)
if orig_text != newtext:
with textfile_open(filename, "wt") as fid:
@@ -769,10 +764,20 @@ def removeHeaderImage(text, options):
if tag:
tag.extract()
text = unicode(soup) if PY2 else str(soup)
#text = text.replace('class="headerimage"', 'class="headerimage-noshow"')
return text
def tweakModuleIndex(text):
from bs4 import BeautifulSoup
soup = BeautifulSoup(text, 'html.parser')
for tag in soup.findAll('a'):
# Chop off the #anchor if it is identical to the basname of the doc
href = tag['href'].split('.html#')
if len(href) == 2 and href[0] == href[1]:
tag['href'] = href[0] + '.html'
return unicode(soup) if PY2 else str(soup)
def tooltipsOnInheritance(text, class_summary):
graphviz = re.findall(r'<p class="graphviz">(.*?)</p>', text, re.DOTALL)