Author: Cristian Greco <cristian@regolo.cc>
Description: Fix html documentation for offline browsing. The patch also
includes the makefile and template.txt needed to rebuild html docs from
rst files.

--- /dev/null
+++ b/docs/template.txt
@@ -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
--- /dev/null
+++ b/docs/makefile
@@ -0,0 +1,28 @@
+#!/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 \
+	client_test \
+	manual \
+	building \
+	features \
+	examples \
+	extension_protocol \
+	make_torrent \
+	dht_extensions \
+	libtorrent_plugins \
+	python_binding \
+	projects
+
+all: $(TARGETS:=_rst2html)
+
+%_rst2html: %.rst
+	rst2html --template=template.txt --stylesheet-path=style.css --link-stylesheet --no-toc-backlinks $? > $*.html
+
+clean:
+	@rm -f $(TARGETS:=.html)
--- /dev/null
+++ b/docs/css/base.css
@@ -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;}
+
--- /dev/null
+++ b/docs/css/rst.css
@@ -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 */
+
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -73,7 +73,7 @@
 .. _`ruby bindings`: http://libtorrent-ruby.rubyforge.org/
 .. _`python bindings`: python_binding.html
 
-.. _`Introduction, slides`: bittorrent.pdf
+.. _`Introduction, slides`: http://www.rasterbar.com/products/libtorrent/bittorrent.pdf
 
 libtorrent is a C++ library that aims to be a good alternative to all the
 other bittorrent implementations around. It is a
@@ -92,21 +92,11 @@
 Donate
 ======
 
-Support the development of libtorrent
+Support the development of libtorrent.
 
-.. raw:: html
-	
-	<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
-		<input type="hidden" name="cmd" value="_xclick">
-		<input type="hidden" name="business" value="arvid@cs.umu.se">
-		<input type="hidden" name="item_name" value="libtorrent">
-		<input type="hidden" name="return" value="http://libtorrent.sf.net">
-		<input type="hidden" name="currency_code" value="USD">
-		<input type="hidden" name="tax" value="0">
-		<input type="image" src="https://www.paypal.com/images/x-click-but04.gif"
-			border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
-	</form>
+(via paypal__ on Rasterbar's homepage)
 
+__ http://www.rasterbar.com/products/libtorrent/index.html
 
 
 Feedback
@@ -128,11 +118,8 @@
 
 Thanks to Reimond Retz for bugfixes, suggestions and testing
 
-Project is hosted by sourceforge.
-
-|sf_logo|__
+Project is hosted by sourceforge__.
 
-.. |sf_logo| image:: http://sourceforge.net/sflogo.php?group_id=7994
 __ http://sourceforge.net
 
 .. raw:: html
