summaryrefslogtreecommitdiff
path: root/sphinx/setup_command.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>2010-04-29 21:08:58 -0400
committerBarry Warsaw <barry@python.org>2010-04-29 21:08:58 -0400
commit71093f7f9bb6e2ca5e1f438ad857c0a826080c3f (patch)
tree63b2cab13ef2c109507b290570a031b80bad9ac0 /sphinx/setup_command.py
parent4d5001ccdd88e3eb9a7e5f16ada45a08a6597e91 (diff)
downloadsphinx-71093f7f9bb6e2ca5e1f438ad857c0a826080c3f.tar.gz
Add -i option to symlink index.html to the master doc.
Diffstat (limited to 'sphinx/setup_command.py')
-rw-r--r--sphinx/setup_command.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/sphinx/setup_command.py b/sphinx/setup_command.py
index 612c6060..e2d83bc6 100644
--- a/sphinx/setup_command.py
+++ b/sphinx/setup_command.py
@@ -71,8 +71,9 @@ class BuildDoc(Command):
('release=', None, 'The full version, including alpha/beta/rc tags'),
('today=', None, 'How to format the current date, used as the '
'replacement for |today|'),
+ ('link-index', 'i', 'Link index.html to the master doc'),
]
- boolean_options = ['fresh-env', 'all-files']
+ boolean_options = ['fresh-env', 'all-files', 'link-index']
def initialize_options(self):
@@ -83,6 +84,7 @@ class BuildDoc(Command):
self.release = ''
self.today = ''
self.config_dir = None
+ self.link_index = False
def _guess_source_dir(self):
for guess in ('doc', 'docs'):
@@ -147,3 +149,8 @@ class BuildDoc(Command):
'backslashreplace')
else:
raise
+
+ if self.link_index:
+ src = app.config.master_doc + app.builder.out_suffix
+ dst = app.builder.get_outfilename('index')
+ os.symlink(src, dst)