Phoenix: update the sphinx_generator.py file and correct the Sphinx documentation for missing image header, unwanted sections in wx.TextCtrl and other minor cosmetic adjustments.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@70743 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Andrea Gavana
2012-02-28 22:18:11 +00:00
parent c80c343ae9
commit 47aa4014fa
14 changed files with 101 additions and 24 deletions

View File

@@ -131,6 +131,8 @@ MAGIC_METHODS = {
# TODO: add more
}
SECTIONS_EXCLUDE = {'TextCtrl': ('|phoenix_title| TextCtrl and ``C++`` Streams', '|phoenix_title| Event Handling')}
# A regex to split a string keeping the whitespaces
RE_KEEP_SPACES = re.compile(r'(\s+)')
@@ -141,7 +143,7 @@ HTML_REPLACE = ['module', 'function', 'method', 'class', 'classmethod', 'staticm
# The SVN revision of wxWidgets/Phoenix used to build the Sphinx docs.
# There must be a more intelligent way to get this information automatically.
SVN_REVISION = '70154'
SVN_REVISION = '70741'
# Today's date representation for the Sphinx HTML docs
TODAY = datetime.date.today().strftime('%d %B %Y')

View File

@@ -22,7 +22,7 @@ import templates
from buildtools.config import copyIfNewer, writeIfChanged, newer
from utilities import Wx2Sphinx
from constants import HTML_REPLACE, SVN_REVISION, TODAY, SPHINXROOT
from constants import HTML_REPLACE, SVN_REVISION, TODAY, SPHINXROOT, SECTIONS_EXCLUDE
from constants import CONSTANT_INSTANCES, WIDGETS_IMAGES_ROOT, SPHINX_IMAGES_ROOT
@@ -118,6 +118,14 @@ def BuildEnumsAndMethods(sphinxDir):
for old, new in enum_dict.items():
text = text.replace(old, new)
widget_name = os.path.split(os.path.splitext(input)[0])[1]
if widget_name in SECTIONS_EXCLUDE:
start, end = SECTIONS_EXCLUDE[widget_name]
lindex = text.index(start)
rindex = text.index(end)
text = text[0:lindex] + text[rindex:]
# Replace the "Perl Note" stuff, we don't need it
newtext = ''
for line in text.splitlines():
@@ -479,7 +487,7 @@ def PostProcess(folder):
fileNames = glob.glob(folder + "/*.html")
phoenix_image = '<div class="floatcenter" style="background-color: white; text-align: middle; align: middle; padding: 40px 10px 15px 15px">\n' \
'<img src="_static/phoenix_top.png" alt="Phoenix Logo" align="middle" />\n' \
'<img src="_static/images/sphinxdocs/phoenix_top.png" alt="Phoenix Logo" align="middle" />\n' \
'</div>'