Phoenix docs: handle funny-formatted heading sections for window styles, extra styles and event handling; Add missing modules in the main.html Sphinx file; Convert some more snippets, specifying the highlight language used (XML/HTML for some snippets in wx.html); Correctly reference classes and functions in wx.Bitmap pure-Python methods.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73069 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Andrea Gavana
2012-11-30 20:54:13 +00:00
parent 3ca003508a
commit 604b778a2c
11 changed files with 71 additions and 40 deletions

View File

@@ -24,7 +24,8 @@ from buildtools.config import phoenixDir, wxDir
IGNORE = ['wxPython', 'wxWidgets', 'wxOSX', 'wxMGL', 'wxDFB', 'wxMAC', 'wxGTK', 'wxGTK2', 'wxUniversal',
'OS', 'X', 'OSX', 'DFB', 'MAC', 'GTK', 'GTK2', 'MSW', 'wxMSW', 'X11', 'OS2', 'MS', 'XP', 'GTK+',
'UI', 'GUI', '--', 'OTOH', 'GDI+', 'API', 'NT', 'RTL', 'GDI', '3D', 'MDI', 'SDI', 'TDI', 'URL',
'XPM', 'HTML', 'MIME', 'C++', 'XDG', 'A4', 'A5', 'KDE', 'GNOME', 'XFCE']
'XPM', 'HTML', 'MIME', 'C++', 'XDG', 'A4', 'A5', 'KDE', 'GNOME', 'XFCE', 'CSS', 'IE', 'FONT',
'SIZE', 'COLOR']
# C++ stuff to Python/ReST stuff
VALUE_MAP = {'true': '``True``',
@@ -176,7 +177,7 @@ SECTIONS_EXCLUDE = {
'Menu' : ('|phoenix_title| Allocation strategy', '|phoenix_title| Event handling'),
'MouseState' : ('This class is implemented', '.. seealso::'),
'Panel' : ('Please see :ref:`/', 'if not all characters'),
'TextCtrl' : ('|phoenix_title| TextCtrl and ``C++`` Streams', '|phoenix_title| Event Handling'),
'TextCtrl' : ('|phoenix_title| TextCtrl and C++ Streams', '|phoenix_title| Event Handling'),
'TextEntry' : ('Notice that you need', 'Currently this method is only '),
}

View File

@@ -170,7 +170,7 @@ def BuildEnumsAndMethods(sphinxDir):
# Replace ArrayXXX stuff...
for cpp in ['ArrayString()', 'ArrayInt()', 'ArrayDouble()']:
for cpp in ['ArrayString()', 'ArrayInt()', 'ArrayDouble()', 'ArrayString']:
text = text.replace(cpp, '[]')
text = TooltipsOnInheritance(text, class_summary)

View File

@@ -214,9 +214,14 @@ def ReplaceCppItems(line):
item = 'float'
if len(item.replace('``', '')) > 2:
# Avoid replacing standalone '&&' and similar
for cpp in CPP_ITEMS[0:2]:
item = item.replace(cpp, '')
if '*' in item:
try:
eval(item)
item = item.replace('*', 'x')
except:
# Avoid replacing standalone '&&' and similar
for cpp in CPP_ITEMS[0:2]:
item = item.replace(cpp, '')
newstr.append(item)
@@ -282,6 +287,9 @@ def PythonizeType(ptype):
if 'Image.' in ptype:
ptype = ptype.split('.')[-1]
if ptype.endswith('&'):
ptype = ':class:`%s`'%ptype[0:-1]
return ptype
@@ -354,6 +362,7 @@ def ConvertToPython(text):
if '``' not in newword and '()' not in word and '**' not in word:
word = word.replace(newword, "``%s``"%newword)
word = word.replace('->', '.')
newline.append(word)
newline = spacer + ''.join(newline)