From: Cristian Greco <cristian@regolo.cc>
Date: Sun, 2 Dec 2018 09:38:28 +0000
Subject: Fix html documentation for offline browsing

The patch also includes the makefile and template.txt needed to rebuild
html docs from rst files.
Forwarded: not-needed
Origin: vendor
---
 docs/css/base.css                   | 136 ++++++++++++++++++++
 docs/css/rst.css                    | 245 ++++++++++++++++++++++++++++++++++++
 docs/hacking.html                   |  11 --
 docs/index.rst                      |  10 +-
 docs/makefile                       |  34 +++++
 docs/manual-ref.html                |  60 ++-------
 docs/reference-Alerts.html          |  11 --
 docs/reference-Bdecoding.html       |  11 --
 docs/reference-Bencoding.html       |  11 --
 docs/reference-Core.html            |  11 --
 docs/reference-Create_Torrents.html |  11 --
 docs/reference-Custom_Storage.html  |  11 --
 docs/reference-Error_Codes.html     |  11 --
 docs/reference-Filter.html          |  11 --
 docs/reference-Plugins.html         |  11 --
 docs/reference-Settings.html        |  11 --
 docs/reference-Storage.html         |  11 --
 docs/reference-Utility.html         |  11 --
 docs/reference-ed25519.html         |  11 --
 docs/reference.html                 |  11 --
 docs/single-page-ref.html           |  11 --
 docs/template.txt                   |  29 +++++
 docs/tutorial.html                  |  11 --
 23 files changed, 456 insertions(+), 245 deletions(-)
 create mode 100644 docs/css/base.css
 create mode 100644 docs/css/rst.css
 create mode 100644 docs/makefile
 create mode 100644 docs/template.txt

Index: libtorrent-rasterbar/docs/css/base.css
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ libtorrent-rasterbar/docs/css/base.css	2021-09-25 11:12:08.991778895 -0400
@@ -0,0 +1,136 @@
+/* Page template */
+
+html>body { font-size: 13px; }
+body { text-align: center; }
+
+#container {
+    text-align: left;
+    width: 700px;
+    margin: 0 auto;
+    position: relative;
+}
+
+#headerNav {
+}
+
+#headerNav ul {
+    margin: 2px;
+    list-style: none;
+    font-family: Tahoma;
+    text-align: right;
+    text-transform: uppercase;
+    line-height: 1em;
+}
+
+#headerNav ul li {
+    display: inline;
+    border-left: solid 1px #ccc;
+    padding-left: 10px;
+    padding-right: 10px;
+    margin: 0;
+    font-size: 80%;
+}
+
+#headerNav ul li.first {
+    border: 0;
+}
+
+#headerNav ul li a {
+    border: none;
+    color: #666;
+}
+
+#headerNav ul li a:hover {
+    background: #eee;
+}
+
+#header {
+    height: 116px;
+    width: 695px;
+    background: url(../img/orange.png) #FDA72A no-repeat top left;
+}
+
+#header h1 {
+    margin: 0;
+    padding: 0;
+    float: right;
+    width: 536px;
+    height: 116px;
+    background: url(../img/logo.png);
+}
+
+#header h1 span, #header h2 { display: none; }
+
+#footer {
+    clear: both;
+    width: 695px;
+    height: 49px;
+    background: #D3D3D3 url(../img/footer.png) no-repeat left top;
+    text-align: center;
+    margin-bottom: 1em;
+}
+
+#footer span {
+    line-height: 49px;
+    font-size: 88%;
+    text-align: center;
+    color: #777;
+    display: block;
+}
+
+#main {
+    font-family: Verdana;
+    line-height: 1.25em;
+    text-align: left;
+    margin-top: 10px;
+}
+
+/* Base elements */
+
+* {margin: 0; padding: 0;}
+body { font: 0.8125em Verdana, sans-serif;}
+
+h1, h2, h3 {
+    font: 1.5em Georgia "Times New Roman", serif;
+    letter-spacing: 1px;
+    padding-bottom: 0.5em;
+}
+
+h1 { font-size: 180%; }
+h2 { font-size: 130%; }
+h3 { font-size: 100%; }
+
+p {
+    font-size: 92%;
+    line-height: 1.7em;
+}
+
+a {
+    text-decoration: none;
+    color: #8D370A;
+    border-bottom: dotted 1px #8D370A;
+}
+
+a:hover {
+    border-bottom: solid 1px #8D370A;
+    background: #eee;
+}
+
+#librarySidebar {
+    float: left;
+    width: 150px;
+}
+
+#libraryBody {
+    border-left: solid 1px #eee;
+    padding-left: 10px;
+    margin-left: 158px;
+    margin-right: 10px;
+}
+
+ul, ol { line-height: 1.8em; }
+ul { list-style: square; }
+li { margin-left: 2.8em; font-size: 92%; }
+
+p, ul, ol, img {margin-bottom: 1em;}
+
Index: libtorrent-rasterbar/docs/css/rst.css
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ libtorrent-rasterbar/docs/css/rst.css	2021-09-25 11:12:08.991778895 -0400
@@ -0,0 +1,245 @@
+.document {
+    margin-left: 10px;
+    margin-right: 10px;
+}
+
+.document a {
+    border: none;
+    color: black;
+}
+
+.document a:hover {
+    background: none;
+}
+
+.document a.reference {
+    color: #8D370A;
+    border-bottom: dotted 1px #8D370A;
+}
+
+.document a.reference:hover {
+    border-bottom: solid 1px #8D370A;
+    background: #eee;
+}
+
+div.section {
+    margin-bottom: 3em;
+}
+
+div.section div.section div.section {
+    margin-bottom: 2em;
+}
+
+h3 { text-transform: uppercase; }
+
+div.section p, div.section ul, div.section dl {
+}
+
+table.docinfo {
+    text-align: left;
+    float: right;
+    width: 200px;
+    margin-right: 0px;
+    margin-left: 20px;
+    margin-bottom: 20px;
+}
+
+table.docinfo th {
+    border-top: none;
+    font-size: 72%;
+    padding-left: 10px;
+}
+
+table.docinfo td {
+    padding-left: 10px;
+    font-size: 88%;
+}
+
+table.docinfo tr.field td, table.docinfo tr.field th {display: none;}
+
+h1.title { display: none; }
+
+dt {
+    font-size: 100%;
+    letter-spacing: 2px;
+    line-height: 1em;
+    color: #315586;
+    color: #000;
+    font-family: Tahoma;
+    font-weight: bold;
+}
+
+dd {
+    line-height: 1.5em;
+    margin-left: 1em;
+    margin-bottom: 1em;
+    font-size: 92%;
+}
+
+tt {
+    font: 1em "Courier New", "Courier";
+    color: #315566;
+}
+
+pre {
+    font-family: "Courier", monospace;
+    margin-right: 10px;
+    background: #C1E5F6;
+    border-left: solid 2px #6185A6;
+    border-right: solid 2px #6185A6;
+    padding: 5px 10px 5px 10px;
+
+    background: #f6f6f6;
+    border: solid 1px #ddd;
+    margin: 1em 0;
+}
+
+div.warning, div.note, div.important {
+    width: 80%;
+    margin: 1.5em auto;
+    background: #C1E5F6;
+    background: #F1FFF5;
+    border: solid 1px #D1DFD5;
+    padding: 5px 10px 5px 10px;
+}
+
+p.admonition-title {
+    font-family: Georgia, "Lucida Grande";
+    font-size: 128%;
+    letter-spacing: 2px;
+    text-transform: uppercase;
+    margin: 0 0 0.5em 0;
+    border-bottom: solid 1px #D1DFD5
+}
+
+div.sidebar {
+    background: #f8f8e8;
+    float: right;
+    width: 20em;
+    margin-right: 1em;
+    border: solid 1px #e5e5d5;
+    padding: 1.3em;
+}
+
+div.sidebar p.sidebar-title {
+    font: 1.3em Georgia;
+    border-bottom: solid 1px #e5e5d5;
+    padding-bottom: 0.5em;
+    margin: 0 0 0.5em 0;
+}
+
+h1 { font-size: 230%; }
+h2 { font-size: 180%; }
+h3 { font-size: 130%; }
+
+table { margin-bottom: 1em; border-collapse: collapse; }
+table, th, td { border: none; }
+
+th, td { padding: 0.3em; }
+
+th {
+    text-align: left;
+    background: #f0f0e0;
+    border-right: solid 1px #f0f0e0;
+    border-top: solid 1px #e8e8d8;
+    border-bottom: solid 1px #e8e8d8;
+}
+
+td {
+    background: #f8f8e8;
+    border-right: solid 1px #f8f8e8;
+    border-bottom: solid 1px #e8e8d8;
+}
+
+td td {
+    background: #e8e8d8;
+    border-right: solid 1px #e8e8d8;
+    border-bottom: solid 1px #d8d8c8;
+}
+
+div.topic {
+    border-left: solid 1px #eee;
+    padding-left: 1em;
+    margin: 0 0 1.5em;
+}
+
+p.topic-title {
+    font: 1.3em Georgia, "Times New Roman", serif;
+}
+
+/* TOC */
+
+div.contents {
+    border: none;
+}
+
+#table-of-contents {
+    margin-left: 20px;
+    padding: 0 0 1em;
+    width: 200px;
+    float: right;
+    clear: right;
+    background: url(../img/blue_bottom.png) no-repeat bottom left;
+    border-right: solid 1px #A1C5D6;
+}
+
+#table-of-contents p {
+    font-family: Georgia, "Times New Roman", serif;
+    background: #A1C5D6 url(../img/blue_top.png) no-repeat top left;
+    color: #AD370A;
+    padding: 0.5em;
+    margin: 0;
+}
+
+#table-of-contents li {
+    margin: 0 0.5em 0 0.5em;
+}
+
+#table-of-contents ul {
+    margin: 0;
+    padding: 0 0 0 0.8em;
+    list-style: none;
+    text-align: left;
+    line-height: 1.5em;
+}
+
+#table-of-contents ul ul {
+    background: url(../img/dotline.gif) repeat-y;
+}
+
+#table-of-contents a.reference {
+    border: none;
+    font: 0.88em Tahoma;
+    font-weight: bold;
+    color: #000050;
+    margin-right: 1em;
+    background: url(../img/minus.gif) no-repeat left 50%;
+    padding-left: 15px;
+}
+
+#table-of-contents li li a.reference {
+    font-weight: normal;
+    background: none;
+    padding: 0;
+}
+
+#table-of-contents a.reference:hover {text-decoration: underline;}
+
+dd p {
+    font-size: 100%;
+}
+
+dd pre {
+    font-size: 108.7%;
+}
+
+li p, li li { font-size: 100%; }
+
+/* IE Hacks */
+
+/* Hides from IE-mac \*/
+* html li pre { height: 1%; }
+* html .topic pre { height: 1%; }
+* html #table-of-contents ul ul { height: 1%; }
+/* End hide from IE-mac */
+
Index: libtorrent-rasterbar/docs/index.rst
===================================================================
--- libtorrent-rasterbar.orig/docs/index.rst	2021-09-25 11:12:08.999779575 -0400
+++ libtorrent-rasterbar/docs/index.rst	2021-09-25 11:12:08.991778895 -0400
@@ -87,7 +87,7 @@
 .. _go: https://github.com/steeve/libtorrent-go
 .. _node: https://github.com/fanatid/node-libtorrent
 
-.. _`Introduction, slides`: bittorrent.pdf
+.. _`Introduction, slides`: http://www.rasterbar.com/products/libtorrent/bittorrent.pdf
 
 libtorrent is a feature complete C++ bittorrent implementation focusing
 on efficiency and scalability. It runs on embedded devices as well as
Index: libtorrent-rasterbar/docs/makefile
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ libtorrent-rasterbar/docs/makefile	2021-09-25 11:12:08.991778895 -0400
@@ -0,0 +1,34 @@
+#!/usr/bin/make -f
+# Upstream Author: Arvid Norberg - Modified by: Cristian Greco
+# This file has been downloaded from upstream svn and simplified in order to
+# generate an html documentation suitable for offline browsing.
+# This makefile assumes that you have python-docutils installed.
+
+TARGETS = \
+    index \
+	udp_tracker_protocol \
+	dht_rss \
+	dht_store \
+	client_test \
+	building \
+	features \
+	troubleshooting \
+	contributing\
+	examples \
+	extension_protocol \
+	dht_extensions \
+	dht_sec \
+	python_binding \
+	projects \
+	utp \
+	tuning \
+	streaming \
+	manual-ref
+
+all: $(TARGETS:=_rst2html)
+
+%_rst2html: %.rst
+	rst2html --template=template.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $*.html
+
+clean:
+	@rm -f $(TARGETS:=.html)
Index: libtorrent-rasterbar/docs/manual-ref.html
===================================================================
--- libtorrent-rasterbar.orig/docs/manual-ref.html	2021-09-25 11:12:08.999779575 -0400
+++ libtorrent-rasterbar/docs/manual-ref.html	2021-09-25 11:12:08.991778895 -0400
@@ -18,10 +18,13 @@
 <body>
 <div class="document">
     <div id="container">
-    <a href="index.html"><table id="header">
-    <tr><td id="orange"></td>
-    <td id="logo">libtorrent</td></tr>
-    </table></a>
+    <div id="headerNav">
+    <ul>
+    <li class="first"><a href="index.html">Home</a></li>
+    <li><a href="http://www.rasterbar.com/products.html">Products</a></li>
+    <li><a href="http://www.rasterbar.com/contact.html">Contact</a></li>
+    </ul>
+    </div>
     <div id="main">
 
 <table class="docinfo" frame="void" rules="none">
@@ -3154,41 +3157,11 @@
 </dl>
 </div>
 </div>
-
-    </div>
     </div>
-    <div id="gradient"></div>
     <div id="footer">
-    <table>
-    <tr>
-      <td><a href="index.html">home</a></td>
-      <td><a href="https://blog.libtorrent.org">blog</a></td>
-      <td><a href="utp.html">uTP</a></td>
-    </tr>
-    <tr>
-      <td><a href="https://sourceforge.net/projects/libtorrent/files/libtorrent/">download</a></td>
-      <td><a href="reference.html">documentation</a></td>
-      <td><a href="dht_store.html">DHT put extension</a></td>
-    </tr>
-    <tr>
-      <td><a href="https://sourceforge.net/projects/libtorrent/files/py-libtorrent/">python bindings</a></td>
-      <td><a href="features.html">features</a></td>
-      <td><a href="dht_sec.html">DHT security extension</a></td>
-    </tr>
-    <tr>
-      <td><a href="https://sourceforge.net/p/libtorrent/mailman/libtorrent-discuss/">mailing list archive</a></td>
-      <td><a href="contributing.html">contributing</a></td>
-      <td><a href="streaming.html">streaming</a></td>
-    </tr>
-    <tr>
-      <td><a href="https://github.com/arvidn/libtorrent/issues">report a bug</a></td>
-      <td><a href="building.html">building</a></td>
-      <td><a href="bittorrent.pdf">bittorrent slides</a></td>
-    </tr>
-    </table>
+    <span>Copyright &copy; 2005 Rasterbar Software.</span>
+    </div>
     </div>
-    <div id="filler"></div>
-
 </div>
 </body>
 </html>
Index: libtorrent-rasterbar/docs/template.txt
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ libtorrent-rasterbar/docs/template.txt	2021-09-25 11:12:08.991778895 -0400
@@ -0,0 +1,29 @@
+%(head_prefix)s
+%(head)s
+<link rel="stylesheet" type="text/css" href="css/base.css" />
+<link rel="stylesheet" type="text/css" href="css/rst.css" />
+%(stylesheet)s
+<style type="text/css">
+/* Hides from IE-mac \*/
+* html pre { height: 1%%; }
+/* End hide from IE-mac */
+</style>
+%(body_prefix)s
+    <div id="container">
+    <div id="headerNav">
+    <ul>
+    <li class="first"><a href="index.html">Home</a></li>
+    <li><a href="http://www.rasterbar.com/products.html">Products</a></li>
+    <li><a href="http://www.rasterbar.com/contact.html">Contact</a></li>
+    </ul>
+    </div>
+    <div id="main">
+%(body_pre_docinfo)s
+%(docinfo)s
+%(body)s
+    </div>
+    <div id="footer">
+    <span>Copyright &copy; 2005 Rasterbar Software.</span>
+    </div>
+    </div>
+%(body_suffix)s
