mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Add intersphinx to quickstart.
This commit is contained in:
parent
b4c78df0a2
commit
408786e268
@ -202,6 +202,12 @@ latex_documents = [
|
|||||||
#latex_use_modindex = True
|
#latex_use_modindex = True
|
||||||
'''
|
'''
|
||||||
|
|
||||||
|
INTERSPHINX_CONFIG = '''
|
||||||
|
|
||||||
|
# Example configuration for intersphinx: refer to the Python standard library.
|
||||||
|
intersphinx_mapping = {'http://docs.python.org/dev': None}
|
||||||
|
'''
|
||||||
|
|
||||||
MASTER_FILE = '''\
|
MASTER_FILE = '''\
|
||||||
.. %(project)s documentation master file, created by sphinx-quickstart on %(now)s.
|
.. %(project)s documentation master file, created by sphinx-quickstart on %(now)s.
|
||||||
You can adapt this file completely to your liking, but it should at least
|
You can adapt this file completely to your liking, but it should at least
|
||||||
@ -418,6 +424,8 @@ Please indicate if you want to use one of the following Sphinx extensions:'''
|
|||||||
'from modules (y/N)', 'n', boolean)
|
'from modules (y/N)', 'n', boolean)
|
||||||
do_prompt(d, 'ext_doctest', 'doctest: automatically test code snippets '
|
do_prompt(d, 'ext_doctest', 'doctest: automatically test code snippets '
|
||||||
'in doctest blocks (y/N)', 'n', boolean)
|
'in doctest blocks (y/N)', 'n', boolean)
|
||||||
|
do_prompt(d, 'ext_intersphinx', 'intersphinx: link between Sphinx documentation '
|
||||||
|
'of different projects (y/N)', 'n', boolean)
|
||||||
print '''
|
print '''
|
||||||
If you are under Unix, a Makefile can be generated for you so that you
|
If you are under Unix, a Makefile can be generated for you so that you
|
||||||
only have to run e.g. `make html' instead of invoking sphinx-build
|
only have to run e.g. `make html' instead of invoking sphinx-build
|
||||||
@ -429,7 +437,7 @@ directly.'''
|
|||||||
d['now'] = time.asctime()
|
d['now'] = time.asctime()
|
||||||
d['underline'] = len(d['project']) * '='
|
d['underline'] = len(d['project']) * '='
|
||||||
d['extensions'] = ', '.join(
|
d['extensions'] = ', '.join(
|
||||||
repr('sphinx.ext.' + name) for name in ('autodoc', 'doctest')
|
repr('sphinx.ext.' + name) for name in ('autodoc', 'doctest', 'intersphinx')
|
||||||
if d['ext_' + name].upper() in ('Y', 'YES'))
|
if d['ext_' + name].upper() in ('Y', 'YES'))
|
||||||
d['copyright'] = time.strftime('%Y') + ', ' + d['author']
|
d['copyright'] = time.strftime('%Y') + ', ' + d['author']
|
||||||
d['project_doc'] = d['project'] + ' Documentation'
|
d['project_doc'] = d['project'] + ' Documentation'
|
||||||
@ -449,8 +457,12 @@ directly.'''
|
|||||||
mkdir_p(path.join(srcdir, d['dot'] + 'templates'))
|
mkdir_p(path.join(srcdir, d['dot'] + 'templates'))
|
||||||
mkdir_p(path.join(srcdir, d['dot'] + 'static'))
|
mkdir_p(path.join(srcdir, d['dot'] + 'static'))
|
||||||
|
|
||||||
|
conf_text = QUICKSTART_CONF % d
|
||||||
|
if d['ext_intersphinx'].upper() in ('Y', 'YES'):
|
||||||
|
conf_text += INTERSPHINX_CONFIG
|
||||||
|
|
||||||
f = open(path.join(srcdir, 'conf.py'), 'w')
|
f = open(path.join(srcdir, 'conf.py'), 'w')
|
||||||
f.write((QUICKSTART_CONF % d).encode('utf-8'))
|
f.write(conf_text.encode('utf-8'))
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
masterfile = path.join(srcdir, d['master'] + d['suffix'])
|
masterfile = path.join(srcdir, d['master'] + d['suffix'])
|
||||||
|
Loading…
Reference in New Issue
Block a user