From 4cff7e069019bae85b0a568c773810ad3507d14d Mon Sep 17 00:00:00 2001 From: Cristian Greco Date: Sun, 2 Dec 2018 09:38:28 +0000 Subject: [PATCH] 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 Gbp-Pq: Name fix-html-docs.patch --- docs/css/base.css | 136 ++++++++++++++++++++++++ docs/css/rst.css | 245 +++++++++++++++++++++++++++++++++++++++++++ docs/index.rst | 2 +- docs/makefile | 34 ++++++ docs/manual-ref.html | 45 ++------ docs/template.txt | 29 +++++ 6 files changed, 454 insertions(+), 37 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 diff --git a/docs/css/base.css b/docs/css/base.css new file mode 100644 index 0000000..3a4ca84 --- /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;} + diff --git a/docs/css/rst.css b/docs/css/rst.css new file mode 100644 index 0000000..d3908a1 --- /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 */ + diff --git a/docs/index.rst b/docs/index.rst index f239556..bba5b02 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -87,7 +87,7 @@ Bindings .. _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 diff --git a/docs/makefile b/docs/makefile new file mode 100644 index 0000000..f2e54de --- /dev/null +++ b/docs/makefile @@ -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) diff --git a/docs/manual-ref.html b/docs/manual-ref.html index 97b99eb..45b9d08 100644 --- a/docs/manual-ref.html +++ b/docs/manual-ref.html @@ -18,10 +18,13 @@
- - - - +
+ +
@@ -3154,41 +3157,11 @@ support. - - -
- - - - - - - - - - - - - - - - - - - - - - - - - -
homebloguTP
downloaddocumentationDHT put extension
python bindingsfeaturesDHT security extension
mailing list archivecontributingstreaming
report a bugbuildingbittorrent slides
+ Copyright © 2005 Rasterbar Software. +
-
-
diff --git a/docs/template.txt b/docs/template.txt new file mode 100644 index 0000000..d3ed539 --- /dev/null +++ b/docs/template.txt @@ -0,0 +1,29 @@ +%(head_prefix)s +%(head)s + + +%(stylesheet)s + +%(body_prefix)s +
+
+ +
+
+%(body_pre_docinfo)s +%(docinfo)s +%(body)s +
+ +
+%(body_suffix)s -- 2.30.2