ubuntu-packaging-guide-team team mailing list archive
-
ubuntu-packaging-guide-team team
-
Mailing list archive
-
Message #01128
[Merge] lp:~mitya57/ubuntu-packaging-guide/search into lp:ubuntu-packaging-guide
Dmitry Shachnev has proposed merging lp:~mitya57/ubuntu-packaging-guide/search into lp:ubuntu-packaging-guide.
Requested reviews:
Ubuntu Packaging Guide Team (ubuntu-packaging-guide-team)
Related bugs:
Bug #814679 in Ubuntu Packaging Guide: "Searching in the HTML guide is disabled because it didn't work"
https://bugs.launchpad.net/ubuntu-packaging-guide/+bug/814679
For more details, see:
https://code.launchpad.net/~mitya57/ubuntu-packaging-guide/search/+merge/129554
* Fix search not working (LP: #814679).
* Add CSS styling for code blocks and search results page.
* Use dh_sphinxdoc and don't manually link JS files.
--
https://code.launchpad.net/~mitya57/ubuntu-packaging-guide/search/+merge/129554
Your team Ubuntu Packaging Guide Team is requested to review the proposed merge of lp:~mitya57/ubuntu-packaging-guide/search into lp:ubuntu-packaging-guide.
=== modified file 'Makefile'
--- Makefile 2012-09-03 14:25:58 +0000
+++ Makefile 2012-10-13 10:11:20 +0000
@@ -49,16 +49,25 @@
# Always build an English version, even if there are no .po files.
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
mv $(BUILDDIR)/html/ubuntu-packaging-guide/*html $(BUILDDIR)/html/
+ mv $(BUILDDIR)/html/_sources/ubuntu-packaging-guide/*.txt $(BUILDDIR)/html/_sources/
+ rm -r $(BUILDDIR)/html/_sources/ubuntu-packaging-guide/ $(BUILDDIR)/html/ubuntu-packaging-guide/
sed -i 's/href="..\//href=".\//g' $(BUILDDIR)/html/*html
sed -i 's/src="..\/_static/src=".\/_static/g' $(BUILDDIR)/html/*html
sed -i 's/..\/_images/.\/_images/g' $(BUILDDIR)/html/*html
+ sed -i 's/ubuntu-packaging-guide\///g' $(BUILDDIR)/html/*html
+ sed -i 's/ubuntu-packaging-guide\///g' $(BUILDDIR)/html/searchindex.js
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html"
html-%: locale
$(SPHINXBUILD) -Dlanguage=$* -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html/$*
- mv $(BUILDDIR)/html/$*/ubuntu-packaging-guide/*html $(BUILDDIR)/html/$*
+ mv $(BUILDDIR)/html/$*/ubuntu-packaging-guide/*html $(BUILDDIR)/html/$*
+ mv $(BUILDDIR)/html/$*/_sources/ubuntu-packaging-guide/*.txt $(BUILDDIR)/html/$*/_sources/
+ rm -r $(BUILDDIR)/html/$*/_sources/ubuntu-packaging-guide/ $(BUILDDIR)/html/$*/ubuntu-packaging-guide/
sed -i 's/href="..\//href=".\//g' $(BUILDDIR)/html/$*/*html
+ sed -i 's/src="..\/_static/src=".\/_static/g' $(BUILDDIR)/html/$*/*html
sed -i 's/..\/_images/.\/_images/g' $(BUILDDIR)/html/$*/*html
+ sed -i 's/ubuntu-packaging-guide\///g' $(BUILDDIR)/html/$*/*html
+ sed -i 's/ubuntu-packaging-guide\///g' $(BUILDDIR)/html/$*/searchindex.js
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html/$*."
=== modified file 'debian/changelog'
--- debian/changelog 2012-10-12 14:53:27 +0000
+++ debian/changelog 2012-10-13 10:11:20 +0000
@@ -1,3 +1,4 @@
+<<<<<<< TREE
ubuntu-packaging-guide (0.2.5) UNRELEASED; urgency=low
[ Daniel Holbach ]
@@ -5,6 +6,16 @@
-- Daniel Holbach <daniel.holbach@xxxxxxxxxx> Fri, 12 Oct 2012 16:52:11 +0200
+=======
+ubuntu-packaging-guide (0.2.5) UNRELEASED; urgency=low
+
+ * Fix search not working (LP: #814679).
+ * Add CSS styling for code blocks and search results page.
+ * Use dh_sphinxdoc and don't manually link JS files.
+
+ -- Dmitry Shachnev <mitya57@xxxxxxxxx> Sat, 13 Oct 2012 11:16:52 +0400
+
+>>>>>>> MERGE-SOURCE
ubuntu-packaging-guide (0.2.4) unstable; urgency=low
[ Dmitry Shachnev ]
=== modified file 'debian/control'
--- debian/control 2012-09-05 14:13:32 +0000
+++ debian/control 2012-10-13 10:11:20 +0000
@@ -31,7 +31,7 @@
ubuntu-packaging-guide-html.
Package: ubuntu-packaging-guide-html
-Depends: libjs-jquery (>= 1.6.1), libjs-underscore, ${misc:Depends}
+Depends: ${sphinxdoc:Depends}, ${misc:Depends}
Architecture: all
Description: Ubuntu Packaging Guide - HTML guide
The Ubuntu Packaging Guide is a set of articles that should help you to get
=== modified file 'debian/rules'
--- debian/rules 2012-08-21 21:22:08 +0000
+++ debian/rules 2012-10-13 10:11:20 +0000
@@ -3,7 +3,7 @@
VERSION:= $(shell dpkg-parsechangelog | sed -rne 's,^Version: ([^-]+).*,\1,p')
%:
- dh $@ --builddirectory=_build
+ dh $@ --builddirectory=_build --with sphinxdoc
override_dh_auto_build:
make latexpdf
@@ -16,7 +16,7 @@
override_dh_link:
# symlink identical resources. Only needed for the html packages.
- for lang in `find debian/ -maxdepth 1 -iname *html* -type d | cut -c 30-`; do \
+ for lang in `find debian/ -maxdepth 1 -iname "*html*" -type d | cut -c 30-`; do \
cd debian/ubuntu-packaging-guide$$lang && LC_ALL=C fdupes -r1nq \
usr/share/doc/ubuntu-packaging-guide$$lang | while read s; do \
set -- $$(echo $$s | tr ' ' '\n' | sort); \
@@ -28,15 +28,6 @@
done; \
cd -; \
done
- # use system copies of jquery and underscore instead.
- for filename in `find $$DEBIANDIR -wholename '*/_static/jquery.js'`; do \
- rm $$filename; \
- ln -s /usr/share/javascript/jquery/jquery.js $$filename; \
- done
- for filename in `find $$DEBIANDIR -wholename '*/_static/underscore.js'`; do \
- rm $$filename; \
- ln -s /usr/share/javascript/underscore/underscore.js $$filename; \
- done
dh_link
override_dh_install:
=== modified file 'debian/ubuntu-packaging-guide-html.docs'
--- debian/ubuntu-packaging-guide-html.docs 2012-08-21 18:43:38 +0000
+++ debian/ubuntu-packaging-guide-html.docs 2012-10-13 10:11:20 +0000
@@ -1,4 +1,1 @@
-_build/html/*.html
-_build/html/_images
-_build/html/_static
-_build/html/_sources
+_build/html/*
=== modified file 'debian/ubuntu-packaging-guide-html.install'
--- debian/ubuntu-packaging-guide-html.install 2012-09-05 14:05:17 +0000
+++ debian/ubuntu-packaging-guide-html.install 2012-10-13 10:11:20 +0000
@@ -1,3 +1,1 @@
-_build/singlehtml/_images usr/share/doc/ubuntu-packaging-guide-html/singlehtml/
-_build/singlehtml/_static usr/share/doc/ubuntu-packaging-guide-html/singlehtml/
_build/singlehtml/index.html usr/share/doc/ubuntu-packaging-guide-html/singlehtml/
=== added file 'debian/ubuntu-packaging-guide-html.links'
--- debian/ubuntu-packaging-guide-html.links 1970-01-01 00:00:00 +0000
+++ debian/ubuntu-packaging-guide-html.links 2012-10-13 10:11:20 +0000
@@ -0,0 +1,2 @@
+usr/share/doc/ubuntu-packaging-guide-html/_static usr/share/doc/ubuntu-packaging-guide-html/singlehtml/_static
+usr/share/doc/ubuntu-packaging-guide-html/_images usr/share/doc/ubuntu-packaging-guide-html/singlehtml/_images
=== modified file 'themes/ubuntu/layout.html'
--- themes/ubuntu/layout.html 2012-08-02 11:26:35 +0000
+++ themes/ubuntu/layout.html 2012-10-13 10:11:20 +0000
@@ -82,10 +82,10 @@
HAS_SOURCE: {{ has_source|lower }}
};
</script>
- {# %- for scriptfile in script_files %}
+ {%- for scriptfile in script_files %}
<script type="text/javascript" src="{{ pathto(scriptfile, 1) }}"></script>
- {%- endfor % #}
- <script type="text/javascript" src="{{ pathto('_static/jquery.js', 1) }}"></script>
+ {%- endfor %}
+ {# <script type="text/javascript" src="{{ pathto('_static/jquery.js', 1) }}"></script> #}
<script type="text/javascript" src="{{ pathto('_static/main.js', 1) }}"></script>
{%- if use_opensearch %}
<link rel="search" type="application/opensearchdescription+xml"
@@ -131,9 +131,9 @@
<ul>
<li class="page_item current_page_item"><a title="Index" href="index.html">Index</a>
<li>
- <form id="form-search" method="get" action="/">
+ <form id="form-search" method="get" action="search.html">
<fieldset>
- <input id="input-search" type="text" name="s" value="Search" />
+ <input id="input-search" type="text" name="q" value="Search" />
</fieldset>
</form>
</li>
@@ -150,7 +150,7 @@
{%- block content %}
-<div id="content" class="container-12">
+<div id="content" class="body container-12">
<div class="grid-12">
{%- block sidebar1 %} {# possible location for sidebar #} {% endblock %}
=== modified file 'themes/ubuntu/static/base.css'
--- themes/ubuntu/static/base.css 2012-03-17 19:12:33 +0000
+++ themes/ubuntu/static/base.css 2012-10-13 10:11:20 +0000
@@ -33,25 +33,18 @@
em {
font-style: italic;
}
-code{
- padding: 10px;
- font-family: 'Ubuntu Mono', 'Consolas', 'Monaco', 'DejaVu Sans Mono', Courier, monospace;
- background-color: #fdf6f2;
- display: block;
- margin-bottom: 10px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
-}
-div.highlight-python{
- padding: 10px;
- font-family: 'Ubuntu Mono', 'Consolas', 'Monaco', 'DejaVu Sans Mono', Courier, monospace;
- background-color: #fdf6f2;
- display: block;
- margin-bottom: 10px;
- -moz-border-radius: 4px;
- -webkit-border-radius: 4px;
- border-radius: 4px;
+code,
+div.highlight,
+div.highlight-python {
+ padding: 10px;
+ font-family: 'Ubuntu Mono', 'Consolas', 'Monaco', 'DejaVu Sans Mono', Courier, monospace;
+ background-color: #fdf6f2;
+ display: block;
+ margin-bottom: 10px;
+ border: 1px solid #cdb;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
}
h1 {
font-size: 36px;
=== modified file 'themes/ubuntu/static/guide.css'
--- themes/ubuntu/static/guide.css 2012-09-09 08:57:27 +0000
+++ themes/ubuntu/static/guide.css 2012-10-13 10:11:20 +0000
@@ -1,13 +1,13 @@
/* CSS style bits for Ubuntu developer guide */
/* Author: Dmitry Shachnev <mitya57@xxxxxxxxx>, 2012 */
-.section li {
+.section li, ul.search li {
list-style-type: disc;
margin-left: 25px;
margin-bottom: 5px;
}
-.section ul, .highlight {
+.section ul, ul.search, .highlight {
margin-top: 5px;
margin-bottom: 10px;
}
@@ -30,3 +30,20 @@
font-weight: bold;
font-size: 110%;
}
+
+.highlighted {
+ background-color: #deb;
+}
+
+ul.search li a {
+ font-weight: bold;
+ font-size: 120%;
+}
+
+#search-results h2 {
+ margin-top: 20px;
+}
+
+.context {
+ margin-left: 30px;
+}
=== modified file 'themes/ubuntu/static/main.js'
--- themes/ubuntu/static/main.js 2012-05-24 15:53:00 +0000
+++ themes/ubuntu/static/main.js 2012-10-13 10:11:20 +0000
@@ -19,3 +19,39 @@
return false;
});
});
+
+
+$(document).ready(function() {
+ var text = 'Search';
+ $('#input-search').val(text);
+
+ // Clear and re-populate
+ $('#input-search').bind({
+ focus: function() {
+ if ($(this).val() == text) {
+ $(this).val('');
+ $(this).css('font-style', 'normal');
+ $(this).css('color', '#333');
+ }
+ },
+ blur: function() {
+ if ($(this).val() == '') {
+ $(this).val(text);
+ $(this).css('font-style', 'italic');
+ $(this).css('color', '#ccc');
+ }
+ }
+ })
+
+ // Enter key submits form
+ $('#input-search').keypress(function(e) {
+ if (e.which == 13) {
+ // Handle empty searches for WP
+ if ($(this).val() == '') {
+ $(this).val(' ');
+ }
+ $('#form-search').submit();
+ e.preventDefault();
+ }
+ });
+});
Follow ups