summaryrefslogtreecommitdiff
path: root/sphinx/util/osutil.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2018-12-02 01:30:51 +0900
committerGitHub <noreply@github.com>2018-12-02 01:30:51 +0900
commite527be396a761a8d3a2c8788d766363a01bc1810 (patch)
treed4e8316f720ff12d31e70b67faf9ec0c7ecf0ee7 /sphinx/util/osutil.py
parent1b039614bc0355a5f884f7c338ca45ceb6de0bc8 (diff)
parentb2f069ba6e5740824500ba62df38dd2996fa22a0 (diff)
downloadsphinx-git-e527be396a761a8d3a2c8788d766363a01bc1810.tar.gz
Merge pull request #5607 from tk0miya/smart_texinfo_conf_py
quickstart: Simplify generated conf.py (for texinfo)
Diffstat (limited to 'sphinx/util/osutil.py')
-rw-r--r--sphinx/util/osutil.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/sphinx/util/osutil.py b/sphinx/util/osutil.py
index f2e2b60d5..f2ac4032f 100644
--- a/sphinx/util/osutil.py
+++ b/sphinx/util/osutil.py
@@ -140,6 +140,7 @@ def copyfile(source, dest):
no_fn_re = re.compile(r'[^a-zA-Z0-9_-]')
+project_suffix_re = re.compile(' Documentation$')
def make_filename(string):
@@ -147,6 +148,11 @@ def make_filename(string):
return no_fn_re.sub('', string) or 'sphinx'
+def make_filename_from_project(project):
+ # type: (str) -> unicode
+ return make_filename(project_suffix_re.sub('', project)).lower()
+
+
def ustrftime(format, *args):
# type: (unicode, Any) -> unicode
"""[DEPRECATED] strftime for unicode strings."""