diff --git a/sphinxtools/postprocess.py b/sphinxtools/postprocess.py index 76fdd95d..7313da2e 100644 --- a/sphinxtools/postprocess.py +++ b/sphinxtools/postprocess.py @@ -445,6 +445,11 @@ def makeModuleIndex(sphinxDir, file): names = list(classes.keys()) names.sort(key=lambda n: imm.get_fullname(n)) + # Workaround to sort names in a case-insensitive way + lower_to_name = {} + for name in names: + lower_to_name[name.lower()] = name + text = '' if module: text += '\n\n.. module:: %s\n\n' % module @@ -455,7 +460,11 @@ def makeModuleIndex(sphinxDir, file): text += '%-80s **Short Description**\n' % '**Class**' text += 80*'=' + ' ' + 80*'=' + '\n' - for cls in names: + lower_names = list(lower_to_name.keys()) + lower_names.sort() + + for lower in lower_names: + cls = lower_to_name[lower] out = classes[cls] if '=====' in out: out = '' @@ -464,7 +473,8 @@ def makeModuleIndex(sphinxDir, file): text += 80*'=' + ' ' + 80*'=' + '\n\n' contents = [] - for cls in names: + for lower in lower_names: + cls = lower_to_name[lower] contents.append(wx2Sphinx(cls)[1]) for enum in enum_base: diff --git a/sphinxtools/utilities.py b/sphinxtools/utilities.py index b3faa89b..fedff86d 100644 --- a/sphinxtools/utilities.py +++ b/sphinxtools/utilities.py @@ -171,6 +171,9 @@ def replaceCppItems(line): """ items = RE_KEEP_SPACES.split(line) + + # This should get rid of substitutions like "float buffered"... + no_conversion = ['click', 'buffer', 'precision'] newstr = [] for n, item in enumerate(items): @@ -187,8 +190,15 @@ def replaceCppItems(line): elif item == 'char': item = 'int' elif item == 'double': - if len(items) > n+2 and not items[n+2].lower().startswith("click"): - item = 'float' + if len(items) > n+2: + target = items[n+2].lower() + replace = True + for excluded in no_conversion: + if target.startswith(excluded): + replace = False + break + if replace: + item = 'float' if len(item.replace('``', '')) > 2: if '*' in item: