]> AND Public Git Repository - simgrid.git/blobdiff - docs/source/_ext/showfile.py
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' into klement
[simgrid.git] / docs / source / _ext / showfile.py
index 2c37ef6e916bf291adefd160d7f6b6d4f7994d51..14f4d0975a85b6943176a8de1b3519502bf82309 100644 (file)
@@ -72,6 +72,9 @@ class ExampleTabDirective(Directive):
         if filename[-3:] == '.py':
             language = 'Python'
             langcode = 'py'
+        elif filename[-2:] == '.c':
+            language = 'C'
+            langcode = 'c'
         elif filename[-4:] == '.cpp':
             language = 'C++'
             langcode = 'cpp'
@@ -79,7 +82,7 @@ class ExampleTabDirective(Directive):
             language = 'XML'
             langcode = 'xml'
         else:
-            raise Exception("Unknown language '{}'. Please choose '.cpp', '.py' or '.xml'".format(language))
+            raise Exception("Unknown language '{}'. Please choose '.cpp', '.py', '.c' or '.xml'".format(language))
 
         for idx, line in enumerate(self.content.data):
             self.content.data[idx] = '   ' + line
@@ -119,7 +122,7 @@ class ToggleDirective(Directive):
     def run(self):
         node = nodes.container()
         node['classes'].append('toggle-content')
-        if not "show" in self.options:
+        if "show" not in self.options:
             # This :show: thing is not working, and I fail to see why.
             # Only the hidden-content class gets a call to hide() in the Javascript,
             # and :show:n block# still get hidden when I load the page.
@@ -161,4 +164,3 @@ def setup(app):
 
     app.connect('builder-inited', add_assets)
     app.connect('build-finished', copy_assets)
-