From d4df28c643083f19fc662c99a0d423162755b165 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 9 Feb 2019 01:39:29 +0900 Subject: [PATCH] quickstart: Simplify generated conf.py (source_suffix) --- sphinx/templates/quickstart/conf.py_t | 2 ++ tests/test_quickstart.py | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/sphinx/templates/quickstart/conf.py_t b/sphinx/templates/quickstart/conf.py_t index 524f1671d..d1ba65713 100644 --- a/sphinx/templates/quickstart/conf.py_t +++ b/sphinx/templates/quickstart/conf.py_t @@ -56,12 +56,14 @@ extensions = [ # Add any paths that contain templates here, relative to this directory. templates_path = ['{{ dot }}templates'] +{% if suffix != '.rst' -%} # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] source_suffix = {{ suffix | repr }} +{% endif -%} {% if master_doc != 'index' -%} # The master toctree document. master_doc = {{ master | repr }} diff --git a/tests/test_quickstart.py b/tests/test_quickstart.py index 10e015fd9..f3563be50 100644 --- a/tests/test_quickstart.py +++ b/tests/test_quickstart.py @@ -112,7 +112,6 @@ def test_quickstart_defaults(tempdir): execfile_(conffile, ns) assert ns['extensions'] == [] assert ns['templates_path'] == ['_templates'] - assert ns['source_suffix'] == '.rst' assert ns['master_doc'] == 'index' assert ns['project'] == 'Sphinx Test' assert ns['copyright'] == '%s, Georg Brandl' % time.strftime('%Y')