← Back to team overview

ubuntu-packaging-guide-team team mailing list archive

[Merge] lp:~mitya57/ubuntu-packaging-guide/search-new into lp:ubuntu-packaging-guide

 

Dmitry Shachnev has proposed merging lp:~mitya57/ubuntu-packaging-guide/search-new into lp:ubuntu-packaging-guide.

Requested reviews:
  Daniel Holbach (dholbach)
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-new/+merge/129866

Despite named "search", this branch also contains lots of unrelated fixes. Most important ones:

* 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-new/+merge/129866
Your team Ubuntu Packaging Guide Team is subscribed to branch lp:ubuntu-packaging-guide.
=== modified file 'Makefile'
--- Makefile	2012-09-03 14:25:58 +0000
+++ Makefile	2012-10-16 12:20:25 +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/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-16 12:20:25 +0000
@@ -1,4 +1,5 @@
 _build/html/*.html
+_build/html/searchindex.js
 _build/html/_images
 _build/html/_static
 _build/html/_sources

=== modified file 'themes/ubuntu/layout.html'
--- themes/ubuntu/layout.html	2012-08-02 11:26:35 +0000
+++ themes/ubuntu/layout.html	2012-10-16 12:20:25 +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-16 12:20:25 +0000
@@ -33,25 +33,20 @@
 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-makefile,
+div.highlight-sh,
+div.highlight-python {
+	padding: 10px;
+	font-family: 'Ubuntu Mono', 'Consolas', 'Monaco', 'DejaVu Sans Mono', Courier, monospace;
+	background-color: #fdf6f2;
+	display: block;
+	margin-top: 5px;
+	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-16 12:20:25 +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 {
     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-16 12:20:25 +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();
+        }
+    });
+});

=== modified file 'ubuntu-packaging-guide/auto-pkg-test.rst'
--- ubuntu-packaging-guide/auto-pkg-test.rst	2012-10-12 12:00:41 +0000
+++ ubuntu-packaging-guide/auto-pkg-test.rst	2012-10-16 12:20:25 +0000
@@ -40,7 +40,9 @@
 The actual tests
 ================
 
-The accompanying test for the example above might be::
+The accompanying test for the example above might be:
+
+.. code-block:: sh
 
         #!/bin/sh
         # autopkgtest check: Build and run a program against glib, to verify that the

=== modified file 'ubuntu-packaging-guide/fixing-a-bug-example.rst'
--- ubuntu-packaging-guide/fixing-a-bug-example.rst	2012-09-16 07:13:56 +0000
+++ ubuntu-packaging-guide/fixing-a-bug-example.rst	2012-10-16 12:20:25 +0000
@@ -165,7 +165,7 @@
 
         bzr diff debian/changelog 
 
-and you will see something this:: 
+and you will see something like this:: 
 
         === modified file 'debian/changelog'
 	--- debian/changelog	2012-05-14 23:38:14 +0000

=== modified file 'ubuntu-packaging-guide/python-packaging.rst'
--- ubuntu-packaging-guide/python-packaging.rst	2012-09-09 09:17:32 +0000
+++ ubuntu-packaging-guide/python-packaging.rst	2012-10-16 12:20:25 +0000
@@ -19,8 +19,7 @@
 
 - The section of module packages should be ``python``, and ``doc`` for the documentation package. For an application, a single binary package will be enough.
 - We should add build dependencies on ``python-all (>= 2.6.6-3~)`` and ``python3-all (>= 3.1.2-7~)`` to make sure Python helpers are available (see the next section for details).
-- It’s recommended to add ``X-Python-Version`` and ``X-Python3-Version`` fields — see “`Specifying Supported Versions`_” section of the Policy for details. For example:
-  ::
+- It’s recommended to add ``X-Python-Version`` and ``X-Python3-Version`` fields — see “`Specifying Supported Versions`_” section of the Policy for details. For example::
   
     X-Python-Version: >= 2.6
     X-Python3-Version: >= 3.1
@@ -77,16 +76,12 @@
 
 If your package is an application and has private Python modules, they should be installed in ``/usr/share/module``, or ``/usr/lib/module`` if the modules are architecture-dependent (e.g. extensions) (see “`Programs Shipping Private Modules`_” section of the Policy).
 
-So, our ``python-markdown.install`` file will look like this (we’ll also want to install a ``markdown_py`` executable):
-
-::
+So, our ``python-markdown.install`` file will look like this (we’ll also want to install a ``markdown_py`` executable)::
 
   usr/lib/python2.*/
   usr/bin/
 
-and ``python3-markdown.install`` will only have one line:
-
-::
+and ``python3-markdown.install`` will only have one line::
 
   usr/lib/python3/
 
@@ -101,9 +96,7 @@
 * Add ``{sphinxdoc:Depends}`` to the dependency list of your ``-doc`` package;
 * Add the path of the built docs directory (usually ``build/sphinx/html``) to your ``.docs`` file.
 
-In our case, the docs are automatically built in ``build/docs/`` directory when we run ``setup.py build``, so we can simply put this in the ``python-markdown-doc.docs`` file:
-
-::
+In our case, the docs are automatically built in ``build/docs/`` directory when we run ``setup.py build``, so we can simply put this in the ``python-markdown-doc.docs`` file::
 
   build/docs/
 
@@ -117,9 +110,7 @@
 Checking for packaging mistakes
 -------------------------------
 
-Along with ``lintian``, there is a special tool for checking Python packages — ``lintian4py``. It is available in the `lintian4python`_ package. For example, these two commands invoke both versions of ``lintian`` and check source and binary packages:
-
-::
+Along with ``lintian``, there is a special tool for checking Python packages — ``lintian4py``. It is available in the `lintian4python`_ package. For example, these two commands invoke both versions of ``lintian`` and check source and binary packages::
 
   lintian -EI --pedantic *.dsc *.deb
   lintian4py -EI --pedantic *.dsc *.deb


Follow ups