[yt-svn] commit/yt-doc: 3 new changesets

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Mon Nov 18 15:46:23 PST 2013


3 new commits in yt-doc:

https://bitbucket.org/yt_analysis/yt-doc/commits/979141a9b30d/
Changeset:   979141a9b30d
User:        ngoldbaum
Date:        2013-11-14 05:02:17
Summary:     Reducing the size of the search index.
Affected #:  2 files

diff -r 952a47356bf40057938ba6580900e8a9ffa674c2 -r 979141a9b30da82aff786ff546925c13deeea82e Makefile
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@
 
 fullclean:
 	-rm -rf $(BUILDDIR)/*
-	-rm -rf source/api/generated
+	-rm -rf source/reference/api/generated
 
 recipeclean:
 	-rm -rf _temp/*.done source/cookbook/_static/*

diff -r 952a47356bf40057938ba6580900e8a9ffa674c2 -r 979141a9b30da82aff786ff546925c13deeea82e source/conf.py
--- a/source/conf.py
+++ b/source/conf.py
@@ -11,7 +11,25 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys, os, glob
+import sys, os, glob, re
+from sphinx.search import WordCollector
+from docutils.nodes import comment, title, Text, SkipNode
+
+# Monkeypatching Sphinx search indexing to avoid indexing embedded
+# images, videos.
+def dispatch_visit(self, node):
+    if node.__class__ is comment:
+        raise SkipNode
+    nodetext = re.sub(r'<img[^<]+?>', '', node.astext())
+    nodetext = re.sub(r'<video[^<]+?>', '', nodetext)
+    nodetext = re.sub(r'<(script).*?</\1>(?s)', '', nodetext)
+    print node.__class__
+    if node.__class__ is Text:
+        self.found_words.extend(self.lang.split(nodetext))
+    elif node.__class__ is title:
+        self.found_title_words.extend(self.lang.split(nodetext))
+
+WordCollector.dispatch_visit = dispatch_visit
 
 on_rtd = os.environ.get("READTHEDOCS", None) == "True"
 


https://bitbucket.org/yt_analysis/yt-doc/commits/7561f1e21be7/
Changeset:   7561f1e21be7
User:        ngoldbaum
Date:        2013-11-14 05:53:00
Summary:     Removing an errant print statement.
Affected #:  1 file

diff -r 979141a9b30da82aff786ff546925c13deeea82e -r 7561f1e21be7c1256f49e87cad4b258749140642 source/conf.py
--- a/source/conf.py
+++ b/source/conf.py
@@ -23,7 +23,6 @@
     nodetext = re.sub(r'<img[^<]+?>', '', node.astext())
     nodetext = re.sub(r'<video[^<]+?>', '', nodetext)
     nodetext = re.sub(r'<(script).*?</\1>(?s)', '', nodetext)
-    print node.__class__
     if node.__class__ is Text:
         self.found_words.extend(self.lang.split(nodetext))
     elif node.__class__ is title:


https://bitbucket.org/yt_analysis/yt-doc/commits/97a828f0023b/
Changeset:   97a828f0023b
User:        ngoldbaum
Date:        2013-11-19 00:46:22
Summary:     Merged in ngoldbaum/yt-doc (pull request #119)

Reducing the size of the search index.
Affected #:  2 files

diff -r 3f08e9dfbb5d1c86c3e6952357575d52d5467300 -r 97a828f0023b545383fd6da256efe83ab8e6efdc Makefile
--- a/Makefile
+++ b/Makefile
@@ -41,7 +41,7 @@
 
 fullclean:
 	-rm -rf $(BUILDDIR)/*
-	-rm -rf source/api/generated
+	-rm -rf source/reference/api/generated
 
 recipeclean:
 	-rm -rf _temp/*.done source/cookbook/_static/*

diff -r 3f08e9dfbb5d1c86c3e6952357575d52d5467300 -r 97a828f0023b545383fd6da256efe83ab8e6efdc source/conf.py
--- a/source/conf.py
+++ b/source/conf.py
@@ -11,7 +11,24 @@
 # All configuration values have a default; values that are commented out
 # serve to show the default.
 
-import sys, os, glob
+import sys, os, glob, re
+from sphinx.search import WordCollector
+from docutils.nodes import comment, title, Text, SkipNode
+
+# Monkeypatching Sphinx search indexing to avoid indexing embedded
+# images, videos.
+def dispatch_visit(self, node):
+    if node.__class__ is comment:
+        raise SkipNode
+    nodetext = re.sub(r'<img[^<]+?>', '', node.astext())
+    nodetext = re.sub(r'<video[^<]+?>', '', nodetext)
+    nodetext = re.sub(r'<(script).*?</\1>(?s)', '', nodetext)
+    if node.__class__ is Text:
+        self.found_words.extend(self.lang.split(nodetext))
+    elif node.__class__ is title:
+        self.found_title_words.extend(self.lang.split(nodetext))
+
+WordCollector.dispatch_visit = dispatch_visit
 
 on_rtd = os.environ.get("READTHEDOCS", None) == "True"

Repository URL: https://bitbucket.org/yt_analysis/yt-doc/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.



More information about the yt-svn mailing list