diff options
author | Georg Brandl <georg@python.org> | 2010-01-08 18:55:35 +0100 |
---|---|---|
committer | Georg Brandl <georg@python.org> | 2010-01-08 18:55:35 +0100 |
commit | 2a2a66a923ce60d5057e62d92b8beedb6216a761 (patch) | |
tree | a3c3d445bcfc9b200da74038ae22737f6410f650 /sphinx/directives/code.py | |
parent | c37ddd0a6f952a7dc6915bb586cc676467eb53ea (diff) | |
parent | 1efbe7c623ba3a9c14b15f4f8fb642229b78d5b4 (diff) | |
download | sphinx-git-2a2a66a923ce60d5057e62d92b8beedb6216a761.tar.gz |
merge with trunk
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r-- | sphinx/directives/code.py | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sphinx/directives/code.py b/sphinx/directives/code.py index 3bf990199..4136bcec6 100644 --- a/sphinx/directives/code.py +++ b/sphinx/directives/code.py @@ -80,6 +80,7 @@ class LiteralInclude(Directive): final_argument_whitespace = False option_spec = { 'linenos': directives.flag, + 'tab-width': int, 'language': directives.unchanged_required, 'encoding': directives.encoding, 'pyobject': directives.unchanged_required, @@ -173,6 +174,8 @@ class LiteralInclude(Directive): lines.append(append + '\n') text = ''.join(lines) + if self.options.get('tab-width'): + text = text.expandtabs(self.options['tab-width']) retnode = nodes.literal_block(text, text, source=fn) retnode.line = 1 if self.options.get('language', ''): |