X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/07e72b2e7fb40f325e2c1d66d141c517d31e5c10..f973433226af2e2e3059b62578bb0f3b215380fb:/docs/source/_ext/showfile.py diff --git a/docs/source/_ext/showfile.py b/docs/source/_ext/showfile.py index 2c37ef6e91..b65ecf6696 100644 --- a/docs/source/_ext/showfile.py +++ b/docs/source/_ext/showfile.py @@ -38,7 +38,7 @@ class ShowFileDirective(Directive): '.. toggle-header::', ' :header: View {}'.format(filename), '', - ' `Download {} `_'.format(os.path.basename(filename), filename), + ' `Download {} `_'.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 @@ -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. @@ -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) -