diff --git a/sphinx/cmd/quickstart.py b/sphinx/cmd/quickstart.py index 76e9254fb..d7465b731 100644 --- a/sphinx/cmd/quickstart.py +++ b/sphinx/cmd/quickstart.py @@ -395,13 +395,6 @@ def generate(d, overwrite=True, silent=False, templatedir=None): d['project_doc_texescaped'] = (d['project'] + ' Documentation').\ translate(texescape.tex_escape_map) - # escape backslashes and single quotes in strings that are put into - # a Python string literal - for key in ('project', 'project_doc', 'project_doc_texescaped', - 'author', 'author_texescaped', 'copyright', - 'version', 'release', 'master'): - d[key + '_str'] = d[key].replace('\\', '\\\\').replace("'", "\\'") - ensuredir(d['path']) srcdir = d['sep'] and path.join(d['path'], 'source') or d['path'] diff --git a/sphinx/templates/quickstart/conf.py_t b/sphinx/templates/quickstart/conf.py_t index 90f3113ed..d354781bb 100644 --- a/sphinx/templates/quickstart/conf.py_t +++ b/sphinx/templates/quickstart/conf.py_t @@ -13,12 +13,12 @@ {% if append_syspath -%} import os import sys -sys.path.insert(0, '{{ module_path }}') +sys.path.insert(0, {{ module_path | repr }}) {% else -%} # import os # import sys {% if module_path -%} -# sys.path.insert(0, '{{ module_path }}') +# sys.path.insert(0, {{ module_path | repr }}) {% else -%} # sys.path.insert(0, os.path.abspath('.')) {% endif -%} @@ -26,14 +26,14 @@ sys.path.insert(0, '{{ module_path }}') # -- Project information ----------------------------------------------------- -project = '{{ project_str }}' -copyright = '{{ copyright_str }}' -author = '{{ author_str }}' +project = {{ project | repr }} +copyright = {{ copyright | repr }} +author = {{ author | repr }} # The short X.Y version -version = '{{ version_str }}' +version = {{ version | repr }} # The full version, including alpha/beta/rc tags -release = '{{ release_str }}' +release = {{ release | repr }} # -- General configuration --------------------------------------------------- @@ -54,11 +54,11 @@ templates_path = ['{{ dot }}templates'] # You can specify multiple suffix as a list of string: # # source_suffix = ['.rst', '.md'] -source_suffix = '{{ suffix }}' +source_suffix = {{ suffix | repr }} {% if master_doc != 'index' -%} # The master toctree document. -master_doc = '{{ master_str }}' +master_doc = {{ master | repr }} {% endif -%} # The language for content autogenerated by Sphinx. Refer to documentation @@ -127,8 +127,8 @@ latex_elements = { # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, '{{ project_fn }}.tex', '{{ project_doc_texescaped_str }}', - '{{ author_texescaped_str }}', 'manual'), + (master_doc, '{{ project_fn }}.tex', {{ project_doc_texescaped | repr }}, + {{ author_texescaped | repr }}, 'manual'), ]