Commits

Anonymous committed 512b3b5

Handle project names with spaces.

  • Participants
  • Parent commits 8639aa7

Comments (0)

Files changed (3)

 
 * Fix determination of the title in HTML help output.
 
+* Handle project names containing spaces.
+
 
 Release 0.3 (May 6, 2008)
 =========================

sphinx/quickstart.py

 import sys, os, time
 from os import path
 
+from sphinx.util import make_filename
 from sphinx.util.console import purple, bold, red, nocolor
 
 
 #html_file_suffix = ''
 
 # Output file base name for HTML help builder.
-htmlhelp_basename = '%(project)sdoc'
+htmlhelp_basename = '%(project_fn)sdoc'
 
 
 # Options for LaTeX output
 # Grouping the document tree into LaTeX files. List of tuples
 # (source start file, target name, title, author, document class [howto/manual]).
 latex_documents = [
-  ('%(master)s', '%(project)s.tex', '%(project)s Documentation', '%(author)s', 'manual'),
+  ('%(master)s', '%(project_fn)s.tex', '%(project)s Documentation', '%(author)s', 'manual'),
 ]
 
 # The name of an image file (relative to this directory) to place at the top of
     do_prompt(d, 'makefile', 'Create Makefile? (y/n)',
               os.name == 'posix' and 'y' or 'n', boolean)
 
+    d['project_fn'] = make_filename(d['project'])
     d['year'] = time.strftime('%Y')
     d['now'] = time.asctime()
     d['underline'] = len(d['project']) * '='

sphinx/util/__init__.py

         _pat_cache[pat] = re.compile(_translate_pattern(pat))
     match = _pat_cache[pat].match
     return filter(match, names)
+
+
+no_fn_re = r'[:/\\?*%|"\'<>. \t]'
+
+def make_filename(string):
+    return no_fn_re.sub('', string)