From: Martin Quinson Date: Tue, 4 Feb 2020 10:07:27 +0000 (+0100) Subject: doc: allow to document C examples X-Git-Tag: v3.26~1053 X-Git-Url: http://bilbo.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/72b48071cfb00fd95eb0e16608b381512078b0ad?hp=be30b8efb55c3240d1825982dd7fe921d6e1c472 doc: allow to document C examples --- diff --git a/docs/source/_ext/showfile.py b/docs/source/_ext/showfile.py index 98579ffab6..14f4d0975a 100644 --- a/docs/source/_ext/showfile.py +++ b/docs/source/_ext/showfile.py @@ -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