Commits

reima committed 7963bb0

Fix breakage when template parameters without names are used (#35).

Comments (0)

Files changed (1)

robin/sphinx/directives.py

 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions are met: 
+# modification, are permitted provided that the following conditions are met:
 #
 # 1. Redistributions of source code must retain the above copyright notice, this
-#    list of conditions and the following disclaimer. 
+#    list of conditions and the following disclaimer.
 # 2. Redistributions in binary form must reproduce the above copyright notice,
 #    this list of conditions and the following disclaimer in the documentation
-#    and/or other materials provided with the distribution. 
+#    and/or other materials provided with the distribution.
 #
 # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
 # ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 
   def _get_function_section_name(self, section):
     raise NotImplementedError()
-  
+
   def _get_function_ids(self, info, section):
-    raise NotImplementedError() 
+    raise NotImplementedError()
 
   def _modify_function_query(self, query, info, section):
     pass
       for s in compound_info['sections']:
         type_list = nodes.definition_list()
         type_list['classes'].append('robin-type-list')
-        user_section_lists.append(type_list) 
+        user_section_lists.append(type_list)
 
       for function_info in function_infos:
         item = function_formatter.format_item(function_info)
       for s in compound_info['sections']:
         type_list = nodes.definition_list()
         type_list['classes'].append('robin-type-list')
-        user_section_lists.append(type_list) 
+        user_section_lists.append(type_list)
 
       for variable_info in variable_infos:
         variable_list.extend(variable_formatter.format_item(variable_info))
   def _is_template_specialization(self, info):
     return '<' in info['name']
 
+  def _format_template_parameter(self, param):
+    if not param['name']:
+      return ''.join(param['type'])
+    else:
+      return ''.join(param['type']) + ' ' + param['name']
+
   def _get_title(self, info):
     title = info['qualified_name']
 
 
     if template and not template_specialization:
       title += '<'
-      title += ', '.join([param['name']
+      title += ', '.join([self._format_template_parameter(param)
                           for param in info['template_parameters']])
       title += '>'