From 3bd9cd84714374bacc64e43eb6bb92488134175f Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 12 Dec 2009 08:23:57 +0800 Subject: [PATCH] sphinxtogithub.py: Handle hard-coded '_sources/' in javascript files Sphinx's searchtools.js has a hard-coded '_sources/' string. This adds a Replacer object to handle the '_sources/' string in javascript files. Signed-off-by: David Aguilar --- sphinxtogithub.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sphinxtogithub.py b/sphinxtogithub.py index 140759c..16a1ed1 100755 --- a/sphinxtogithub.py +++ b/sphinxtogithub.py @@ -183,6 +183,12 @@ class LayoutFactory(object): filelist.append( FileHandler(os.path.join(root, f), replacers, open) ) + if f.endswith(".js"): + filelist.append( + FileHandler(os.path.join(root, f), + [Replacer("'_sources/'", "'sources/'")], + open) + ) return Layout(underscore_directories, filelist)