add 'Save to PDF' link in sidebar 31/18431/1
authorRyota MIBU <r-mibu@cq.jp.nec.com>
Wed, 10 Aug 2016 16:33:32 +0000 (01:33 +0900)
committerRyota MIBU <r-mibu@cq.jp.nec.com>
Wed, 10 Aug 2016 16:34:21 +0000 (01:34 +0900)
Change-Id: Ia9ffd10aa73c9e39203f31a5a19329006b68a444
Signed-off-by: Ryota MIBU <r-mibu@cq.jp.nec.com>
etc/pagemenu.html [new file with mode: 0644]
scripts/docs-build.sh

diff --git a/etc/pagemenu.html b/etc/pagemenu.html
new file mode 100644 (file)
index 0000000..2bb9d1c
--- /dev/null
@@ -0,0 +1,19 @@
+{#
+    opnfvdocs/etc/pagemenu.html
+    ~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+    Sphinx sidebar template: link to pdfcrowd.
+
+    :copyright: Copyright 2016 by OPNFV.
+    :license: Apache 2.0 .
+#}
+<div role="note" aria-label="source link">
+  <h3>{{ _('This Page') }}</h3>
+  <ul class="this-page-menu">
+    {%- if show_source and has_source and sourcename %}
+      <li><a href="{{ pathto('_sources/' + sourcename, true)|e }}"
+             rel="nofollow">{{ _('Show Source') }}</a></li>
+    {%- endif %}
+    <li><a href="//pdfcrowd.com/url_to_pdf/">Save to PDF</a></li>
+  </ul>
+</div>
index 5a7dbc0..b6bb5d5 100755 (executable)
@@ -110,6 +110,8 @@ function prepare_config() {
     _name="$2"
     _conf="$_src/conf.py"
 
+    touch "$_conf"
+
     # default params
     # Note: If you want to add a new sphinx extention here, you may need python
     #       package for it (e.g. python package 'sphinxcontrib-httpdomain' is
@@ -126,6 +128,10 @@ function prepare_config() {
     add_config "$_conf" 'html_logo' "'opnfv-logo.png'"
     add_config "$_conf" 'latex_domain_indices' "False"
     add_config "$_conf" 'latex_logo' "'opnfv-logo.png'"
+    add_config "$_conf" 'html_sidebars' \
+                        "{'**': ['globaltoc.html',
+                                 '$(cd $OPNFVDOCS_DIR; pwd)/etc/pagemenu.html',
+                                 'searchbox.html']}"
 
     # genarated params
     title=$(cd $_src; python -c "$get_title_script")