[Python-modules-commits] [sphinx] 01/02: Backport upstream patch to make search work with old templates.

Dmitry Shachnev mitya57 at moszumanska.debian.org
Wed Oct 4 04:33:42 UTC 2017


This is an automated email from the git hooks/post-receive script.

mitya57 pushed a commit to branch debian/master
in repository sphinx.

commit 12dd2005c23f1a82fd67960f9635edc133130f6a
Author: Dmitry Shachnev <mitya57 at gmail.com>
Date:   Wed Oct 4 11:25:16 2017 +0700

    Backport upstream patch to make search work with old templates.
---
 debian/changelog                               |  2 ++
 debian/patches/series                          |  1 +
 debian/patches/sourcelink_suffix_fallback.diff | 29 ++++++++++++++++++++++++++
 3 files changed, 32 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index dd67c27..8af8bb7 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -4,6 +4,8 @@ sphinx (1.6.4-2) UNRELEASED; urgency=medium
     to its manpage.
   * Backport upstream patch to fix wrong AssertionError in C++ domain
     (cpp_no_assert.diff; closes: #877014).
+  * Backport upstream patch to make searchtools.js work with pre-Sphinx 1.5
+    templates (sourcelink_suffix_fallback.diff).
 
  -- Dmitry Shachnev <mitya57 at debian.org>  Thu, 28 Sep 2017 19:44:01 +0300
 
diff --git a/debian/patches/series b/debian/patches/series
index 6713f7e..8704642 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ no_snowballstemmer.diff
 skip_tests_network.diff
 no_require_websupport.diff
 cpp_no_assert.diff
+sourcelink_suffix_fallback.diff
diff --git a/debian/patches/sourcelink_suffix_fallback.diff b/debian/patches/sourcelink_suffix_fallback.diff
new file mode 100644
index 0000000..ebfc589
--- /dev/null
+++ b/debian/patches/sourcelink_suffix_fallback.diff
@@ -0,0 +1,29 @@
+From: Dmitry Shachnev <mitya57 at debian.org>
+Date: Tue, 3 Oct 2017 18:42:06 +0700
+Subject: Make searchtools.js compatible with pre-Sphinx1.5 templates
+
+There are still plenty of projects which use custom templates where
+DOCUMENTATION_OPTIONS does not define SOURCELINK_SUFFIX.
+
+Currently search does not work in these projects. Make suffix fall
+back to .txt since that is the default value of configuration option.
+
+(cherry picked from commit 9da3bf93ff58e6f9fe4ab503f6e849c45fc05f9f)
+---
+ sphinx/themes/basic/static/searchtools.js_t | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/sphinx/themes/basic/static/searchtools.js_t b/sphinx/themes/basic/static/searchtools.js_t
+index 149d162..306fdf5 100644
+--- a/sphinx/themes/basic/static/searchtools.js_t
++++ b/sphinx/themes/basic/static/searchtools.js_t
+@@ -269,6 +269,9 @@ var Search = {
+           });
+         } else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
+           var suffix = DOCUMENTATION_OPTIONS.SOURCELINK_SUFFIX;
++          if (suffix === undefined) {
++            suffix = '.txt';
++          }
+           $.ajax({url: DOCUMENTATION_OPTIONS.URL_ROOT + '_sources/' + item[5] + (item[5].slice(-suffix.length) === suffix ? '' : suffix),
+                   dataType: "text",
+                   complete: function(jqxhr, textstatus) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/sphinx.git



More information about the Python-modules-commits mailing list