NO-JIRA: Fix up HTML generation to produce "bare" HTML for qpid site and nice HTML for installed doc.

Qpid site requires very "bare" HTML - just content, no html, head or body tags.
This checkin creates a very simple "theme" that generates that.

We generate the nice sphinx theme in dochtml for installed documentation, which has search etc.

git-svn-id: https://svn.apache.org/repos/asf/qpid/dispatch/branches/0.4@1674104 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt
index 55aa18f..9d23a8b 100644
--- a/doc/CMakeLists.txt
+++ b/doc/CMakeLists.txt
@@ -121,10 +121,11 @@
 
     set(SPHINX_OUTPUT ${bin}/html/index.html ${bin}/singlehtml/book/book.html ${MAN_PAGES})
 
+    set(html_raw_options -D html_theme=bare -D html_add_permalinks=".")
     add_custom_command(
       OUTPUT ${SPHINX_OUTPUT}
       # html/ contains plain HTML suitable for embedding in the Qpid website.
-      COMMAND ${SPHINX_BUILD} -d ${bin}/doctrees -b html -D html_theme=basic ${bin} ${bin}/html
+      COMMAND ${SPHINX_BUILD} -d ${bin}/doctrees -b html ${html_raw_options} ${bin} ${bin}/html
       # dochtml/ is a self-contained site with searching, navigation etc. installed with the docs.
       COMMAND ${SPHINX_BUILD} -d ${bin}/doctrees -b html ${bin} ${bin}/dochtml
       # man/ contains Unix man pages.
diff --git a/doc/book/introduction.rst b/doc/book/introduction.rst
index 4723290..730bfab 100644
--- a/doc/book/introduction.rst
+++ b/doc/book/introduction.rst
@@ -110,8 +110,8 @@
 Features
 --------
 
--  Can be deployed stand-alone or in a network of routers
-  -  Supports arbitrary network topology - no restrictions on redundancy
-  -  Automatic route computation - adjusts quickly to changes in topology
--  Provides remote access to brokers or other AMQP servers
--  Security
+- Can be deployed stand-alone or in a network of routers
+  - Supports arbitrary network topology - no restrictions on redundancy
+  - Automatic route computation - adjusts quickly to changes in topology
+- Provides remote access to brokers or other AMQP servers
+- Security
diff --git a/doc/conf.py.in b/doc/conf.py.in
index 58b9a2f..43c1037 100644
--- a/doc/conf.py.in
+++ b/doc/conf.py.in
@@ -20,7 +20,7 @@
 
 # List of patterns, relative to source directory, that match files and
 # directories to ignore when looking for source files.
-exclude_patterns = ["**/*_help.rst"]
+exclude_patterns = ["**/*_help.rst", "notes"]
 
 # The name of the Pygments (syntax highlighting) style to use.
 pygments_style = 'sphinx'
@@ -30,6 +30,7 @@
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
 html_theme = 'sphinxdoc'
+html_theme_path = [ '${CMAKE_CURRENT_SOURCE_DIR}/themes' ]
 html_show_sourcelink = False
 
 # -- Options for manual page output --------------------------------------------
diff --git a/doc/index.rst b/doc/index.rst
index c395c9e..0e00953 100644
--- a/doc/index.rst
+++ b/doc/index.rst
@@ -18,17 +18,22 @@
 Documentation for dispatch
 ==========================
 
-See also the `dispatch router website <http://qpid.apache.org/components/dispatch-router>`_
-
 Documentation
 
--  `Dispatch router book <book/book.html>`__
+.. toctree::
+   :maxdepth: 1
+
+   book/book
 
 Manual pages
 
--  `qdrouterd <man/qdrouterd.html>`__ The router daemon
--  `qdrouterd.conf <man/qdrouterd.conf.html>`__ Router daemon
-   configuration
--  `qdstat <man/qdstat.html>`__ Check statistics for a running router
--  `qdmanage <man/qdmanage.html>`__ Query and set management attributes of
-   a running router.
+.. toctree::
+   :maxdepth: 1
+
+   man/qdrouterd
+   man/qdrouterd.conf.rst
+   man/qdstat.rst
+   man/qdmanage.rst
+
+See also the `dispatch router website <http://qpid.apache.org/components/dispatch-router>`_
+
diff --git a/doc/templates/layout.html b/doc/templates/layout.html
deleted file mode 100644
index 8a0a43a..0000000
--- a/doc/templates/layout.html
+++ /dev/null
@@ -1,9 +0,0 @@
-{% extends "!layout.html" %}
-
-{# Omit the top navigation bar. #}
-{% block relbar1 %}
-{% endblock %}
-
-{# Omit the bottom navigation bar. #}
-{% block relbar2 %}
-{% endblock %} 
diff --git a/doc/themes/bare/layout.html b/doc/themes/bare/layout.html
new file mode 100644
index 0000000..113cf1a
--- /dev/null
+++ b/doc/themes/bare/layout.html
@@ -0,0 +1,15 @@
+{#
+    basic/layout.html
+    ~~~~~~~~~~~~~~~~~
+
+    Generate HTML for the Qpid site - just bare content with no html, head or body tags.
+
+    :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
+    :license: BSD, see LICENSE for details.
+#}
+
+{%- block content %}
+  {%- block document %}
+  {% block body %} {% endblock %}
+  {%- endblock %}
+{%- endblock %}
diff --git a/doc/themes/bare/theme.conf b/doc/themes/bare/theme.conf
new file mode 100644
index 0000000..2b3c705
--- /dev/null
+++ b/doc/themes/bare/theme.conf
@@ -0,0 +1,8 @@
+# This theme outputs just bare content with no <html> <head> or <body> tags.
+# This is the form required by the Qpid website, which will add in its own stylesheets,
+# navigation etc.
+#
+[theme]
+inherit = basic
+
+