diff options
author | Georg Brandl <georg@python.org> | 2014-01-19 10:57:49 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2014-01-19 10:57:49 +0100 |
commit | 883b960cb1c8e2abc6407dd373f57c0b0fef711c (patch) | |
tree | 8350d0b7e219090548560fe6d9b13dd1540397bd /sphinx/directives/code.py | |
parent | 5023da8ac31534f6bf3104fd3e5cf63a7a28df6c (diff) | |
parent | 05ba0766b3c43a5d2af774cef7e05d236164935c (diff) | |
download | sphinx-git-883b960cb1c8e2abc6407dd373f57c0b0fef711c.tar.gz |
Merge in pull request #172 from https://bitbucket.org/nsmgr8/sphinx/branch/default
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r-- | sphinx/directives/code.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index 7b1acfd58..bfe6c48e9 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -58,6 +58,7 @@ class CodeBlock(Directive): 'linenos': directives.flag, 'lineno-start': int, 'emphasize-lines': directives.unchanged_required, + 'filename': directives.unchanged_required, } def run(self): @@ -76,6 +77,9 @@ class CodeBlock(Directive): literal = nodes.literal_block(code, code) literal['language'] = self.arguments[0] + filename = self.options.get('filename') + if filename: + literal['filename'] = filename literal['linenos'] = 'linenos' in self.options or \ 'lineno-start' in self.options extra_args = literal['highlight_args'] = {} |