mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2025-12-16 09:40:07 +01:00
Tweak links on the index pages to go to the page rather than the class
This commit is contained in:
@@ -261,13 +261,6 @@ def findInherited(input, class_summary, enum_base, text):
|
|||||||
text = text.replace(regs, newtext, 1)
|
text = text.replace(regs, newtext, 1)
|
||||||
continue
|
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:
|
if meth_name in CONSTANT_INSTANCES:
|
||||||
text = text.replace(regs, '``%s``'%meth_name, 1)
|
text = text.replace(regs, '``%s``'%meth_name, 1)
|
||||||
continue
|
continue
|
||||||
@@ -733,6 +726,8 @@ def postProcess(folder, options):
|
|||||||
newtext = changeWelcomeText(newtext, options)
|
newtext = changeWelcomeText(newtext, options)
|
||||||
else:
|
else:
|
||||||
newtext = removeHeaderImage(newtext, options)
|
newtext = removeHeaderImage(newtext, options)
|
||||||
|
if '1moduleindex' in basename:
|
||||||
|
newtext = tweakModuleIndex(newtext)
|
||||||
|
|
||||||
if orig_text != newtext:
|
if orig_text != newtext:
|
||||||
with textfile_open(filename, "wt") as fid:
|
with textfile_open(filename, "wt") as fid:
|
||||||
@@ -769,10 +764,20 @@ def removeHeaderImage(text, options):
|
|||||||
if tag:
|
if tag:
|
||||||
tag.extract()
|
tag.extract()
|
||||||
text = unicode(soup) if PY2 else str(soup)
|
text = unicode(soup) if PY2 else str(soup)
|
||||||
#text = text.replace('class="headerimage"', 'class="headerimage-noshow"')
|
|
||||||
return text
|
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):
|
def tooltipsOnInheritance(text, class_summary):
|
||||||
|
|
||||||
graphviz = re.findall(r'<p class="graphviz">(.*?)</p>', text, re.DOTALL)
|
graphviz = re.findall(r'<p class="graphviz">(.*?)</p>', text, re.DOTALL)
|
||||||
|
|||||||
Reference in New Issue
Block a user