ThirdParty/Pygments/pygments/sphinxext.py

changeset 4697
c2e9bf425554
parent 4172
4f20dba37ab6
child 5713
6762afd9f963
--- a/ThirdParty/Pygments/pygments/sphinxext.py	Sun Jan 24 16:15:58 2016 +0100
+++ b/ThirdParty/Pygments/pygments/sphinxext.py	Sun Jan 24 19:28:37 2016 +0100
@@ -6,7 +6,7 @@
     Sphinx extension to generate automatic documentation of lexers,
     formatters and filters.
 
-    :copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
+    :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS.
     :license: BSD, see LICENSE for details.
 """
 
@@ -113,6 +113,8 @@
                 moduledocstrings[module] = moddoc
 
         for module, lexers in sorted(modules.items(), key=lambda x: x[0]):
+            if moduledocstrings[module] is None:
+                raise Exception("Missing docstring for %s" % (module,))
             heading = moduledocstrings[module].splitlines()[4].strip().rstrip('.')
             out.append(MODULEDOC % (module, heading, '-'*len(heading)))
             for data in lexers:
@@ -133,8 +135,8 @@
             if isinstance(docstring, bytes):
                 docstring = docstring.decode('utf8')
             heading = cls.__name__
-            out.append(FMTERDOC % (heading, ', '.join(data[1]) or 'None',
-                                   ', '.join(data[2]).replace('*', '\\*') or 'None',
+            out.append(FMTERDOC % (heading, ', '.join(data[2]) or 'None',
+                                   ', '.join(data[3]).replace('*', '\\*') or 'None',
                                    docstring))
         return ''.join(out)
 

eric ide

mercurial