summaryrefslogtreecommitdiff
path: root/sphinx/directives/code.py
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2010-01-08 18:55:35 +0100
committerGeorg Brandl <georg@python.org>2010-01-08 18:55:35 +0100
commit2a2a66a923ce60d5057e62d92b8beedb6216a761 (patch)
treea3c3d445bcfc9b200da74038ae22737f6410f650 /sphinx/directives/code.py
parentc37ddd0a6f952a7dc6915bb586cc676467eb53ea (diff)
parent1efbe7c623ba3a9c14b15f4f8fb642229b78d5b4 (diff)
downloadsphinx-git-2a2a66a923ce60d5057e62d92b8beedb6216a761.tar.gz
merge with trunk
Diffstat (limited to 'sphinx/directives/code.py')
-rw-r--r--sphinx/directives/code.py3
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', ''):