quickstart: Simplify generated conf.py (source_suffix)

This commit is contained in:
Takeshi KOMIYA 2019-02-09 01:39:29 +09:00
parent d129f447c3
commit d4df28c643
2 changed files with 2 additions and 1 deletions

View File

@ -56,12 +56,14 @@ extensions = [
# Add any paths that contain templates here, relative to this directory. # Add any paths that contain templates here, relative to this directory.
templates_path = ['{{ dot }}templates'] templates_path = ['{{ dot }}templates']
{% if suffix != '.rst' -%}
# The suffix(es) of source filenames. # The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string: # You can specify multiple suffix as a list of string:
# #
# source_suffix = ['.rst', '.md'] # source_suffix = ['.rst', '.md']
source_suffix = {{ suffix | repr }} source_suffix = {{ suffix | repr }}
{% endif -%}
{% if master_doc != 'index' -%} {% if master_doc != 'index' -%}
# The master toctree document. # The master toctree document.
master_doc = {{ master | repr }} master_doc = {{ master | repr }}

View File

@ -112,7 +112,6 @@ def test_quickstart_defaults(tempdir):
execfile_(conffile, ns) execfile_(conffile, ns)
assert ns['extensions'] == [] assert ns['extensions'] == []
assert ns['templates_path'] == ['_templates'] assert ns['templates_path'] == ['_templates']
assert ns['source_suffix'] == '.rst'
assert ns['master_doc'] == 'index' assert ns['master_doc'] == 'index'
assert ns['project'] == 'Sphinx Test' assert ns['project'] == 'Sphinx Test'
assert ns['copyright'] == '%s, Georg Brandl' % time.strftime('%Y') assert ns['copyright'] == '%s, Georg Brandl' % time.strftime('%Y')