Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix Host::execute to use *this as a host location, not the this_actor->get_host()
[simgrid.git] / docs / source / _ext / showfile.py
index 06845d40ed4062fd3f64e0ab4fec3c96419e47b3..b65ecf66965ff6ad9aa931c77c56e2dedd7a259f 100644 (file)
@@ -38,7 +38,7 @@ class ShowFileDirective(Directive):
           '.. toggle-header::',
           '   :header: View {}'.format(filename),
           '',
-          '   `Download {} <https://framagit.org/simgrid/simgrid/tree/{}>`_'.format(os.path.basename(filename), filename),
+          '   `Download {} <https://framagit.org/simgrid/simgrid/tree/master/{}>`_'.format(os.path.basename(filename), filename),
           '',
           '   .. literalinclude:: ../../{}'.format(filename),
           '      :language: {}'.format(language),
@@ -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
@@ -137,8 +140,8 @@ class ToggleDirective(Directive):
         return [par, node]
 
 def add_assets(app):
-    app.add_stylesheet(CSS_FILE)
-    app.add_javascript(JS_FILE)
+    app.add_css_file(CSS_FILE)
+    app.add_js_file(JS_FILE)
 
 
 def copy_assets(app, exception):
@@ -161,4 +164,3 @@ def setup(app):
 
     app.connect('builder-inited', add_assets)
     app.connect('build-finished', copy_assets)
-