Skip to content

Commit e58acb9

Browse files
committed
Merge pull request #43 from Trimardio/sphinx
Added a custom sphinx theme based on default. Added menu to sidebar. …
2 parents cbe3ad0 + 6a379cd commit e58acb9

File tree

7 files changed

+173
-25
lines changed

7 files changed

+173
-25
lines changed

conf.py

100644100755
+3-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,8 @@
107107

108108
# The theme to use for HTML and HTML Help pages. See the documentation for
109109
# a list of builtin themes.
110-
html_theme = 'default'
110+
html_theme = 'hyperboria-theme'
111+
html_theme_path = ["."]
111112

112113
# Theme options are theme-specific and customize the look and feel of a theme
113114
# further. For a list of options available for each theme, see the
@@ -136,7 +137,7 @@
136137
# Add any paths that contain custom static files (such as style sheets) here,
137138
# relative to this directory. They are copied after the builtin static files,
138139
# so a file named "default.css" will overwrite the builtin "default.css".
139-
html_static_path = ['_static']
140+
# html_static_path = ['_static']
140141

141142
# Add any extra paths that contain custom files (such as robots.txt or
142143
# .htaccess) here, relative to this directory. These files are copied

css/main.css

-23
This file was deleted.

hyperboria-theme/layout.html

+131
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
{#
2+
hyperboria-theme/layout.html
3+
~~~~~~~~~~~~~~~~~~~
4+
5+
Sphinx layout template for the default theme.
6+
7+
:copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
8+
:license: BSD, see LICENSE for details.
9+
#}
10+
11+
{%- extends "basic/layout.html" %}
12+
13+
{%- block sidebartoc %}
14+
15+
16+
17+
{% set sidebar_menu = [
18+
('title', 'About Hyperboria'),
19+
('Asking Questions *TODO*', 'todo'),
20+
('Peering', 'faq/peering'),
21+
('Security', 'faq/security'),
22+
('Meshlocals', 'meshlocals/intro',
23+
[('Meshlocals around the world', 'meshlocals/existing/index'),
24+
('Starting a Meshlocal', 'meshlocals/diy')]),
25+
('FAQ', 'faq/general'),
26+
('Achievements', 'achievements'),
27+
('Glossary', 'faq/glossary'),
28+
29+
('title', 'The cjdns routing protocol'),
30+
('About', '', [
31+
('Goals', 'project-goals'),
32+
('Goals (russian)', 'project-goals-ru'),
33+
('Original whitepaper', 'Whitepaper'),
34+
('Brief intro', 'intro'),
35+
('Security Specification', 'security-specifications'),
36+
]),
37+
('Installation', '', [
38+
('Most Linuxes *TODO*', 'todo'),
39+
('OpenWrt', 'install/openwrt'),
40+
('Android *TODO*', 'todo'),
41+
('Firefox OS *TODO*', 'todo'),
42+
('OS X', 'install/osx'),
43+
('Debian Wheezy', 'install/debian-wheezy'),
44+
('Debian Jessie', 'install/debian-jessie'),
45+
('Arch', 'install/arch'),
46+
('Fedora', 'install/fedora'),
47+
('FreeBSD *TODO*', 'todo'),
48+
('OpenBSD *TODO*', 'todo'),
49+
('Windows', 'install/windows'),
50+
('Building *on* Windows', 'install/build-on-windows'),
51+
('Securing your Windows system', 'config/windows-firewall'),
52+
]),
53+
('Usage', '', [
54+
('Setup', 'config/configure'),
55+
('Operator guidelines', 'cjdns/operator-guidelines'),
56+
('Securing your system', 'config/network-services'),
57+
('Tools *TODO*', 'todo'),
58+
('Third party tools', 'ctrls'),
59+
('Admin API', 'cjdns/admin-api'),
60+
]),
61+
('Working with cjdns', '', [
62+
('Anatomy of cjdroute', 'cjdns/anatomy'),
63+
('Peering over UDP', 'cjdns/peering-over-UDP-IP'),
64+
('nodeinfo.json', 'cjdns/nodeinfo-json'),
65+
('Changelog', 'cjdns/changelog'),
66+
]),
67+
('HowTo', '', [
68+
('Using cjdns as a VPN', 'config/tunnel'),
69+
('Shorewall and VPN gateway', 'config/shorewall-and-vpn-gateway-howto'),
70+
('NAT gateway for non-cjdns nodes', 'config/nat-gateway'),
71+
('Autostart at login', 'config/autostart-at-login'),
72+
('Run as non-root user', 'config/non-root-user'),
73+
]),
74+
('Troubleshooting', '', [
75+
('Read this first', 'bugs/policy'),
76+
('Memory leaks', 'bugs/debugging-memory-leaks'),
77+
('SecComp', 'bugs/Seccomp'),
78+
('Analyzing network IO', 'traffic-analysis'),
79+
]),
80+
('Known issues', '', [
81+
('Horizon', 'bugs/horizon'),
82+
('Black Hole', 'bugs/black-hole'),
83+
('Secret Santa', 'bugs/santa'),
84+
]),
85+
('Configurator timeout', '', [
86+
('Firewall on localhost', 'bugs/configurator-timeout'),
87+
('UDP overflow', 'bugs/connectTo-overflow'),
88+
('Hidden Peers', 'bugs/hidden-peers'),
89+
]),
90+
('OS/distro-specific quirks', 'bugs/distro-quirks'),
91+
('Reporting bugs', 'bugs/reporting')
92+
93+
]%}
94+
95+
96+
97+
{%- include "localtoc.html" %}
98+
<h3><a href="{{ pathto('index') }}">Menu</a></h3>
99+
<ul class="sidebar_menu">
100+
{% for link in sidebar_menu %}
101+
{% if link[0] == 'title' %}
102+
<h4>{{ link[1] }}</h4>
103+
{% else %}
104+
{% if link[1] == '' %}
105+
<li class="subtitle">{{ link[0] }}</li>
106+
{% elif link[1] == 'todo' %}
107+
<li class='todo'>{{ link[0] }}</li>
108+
{% else %}
109+
<li><a href="{{ pathto(link[1]) }}">{{ link[0] }}</a></li>
110+
{% endif %}
111+
{% if link[2] %}
112+
<ul>
113+
114+
{% for sublink in link[2] %}
115+
{% if sublink[1] == 'todo' %}
116+
<li class='todo'>{{ sublink[0] }}</li>
117+
{% else %}
118+
<li><a href="{{ pathto(sublink[1]) }}">{{ sublink[0] }}</a></li>
119+
{% endif %}
120+
{% endfor %}
121+
</ul>
122+
{% endif %}
123+
124+
{% endif %}
125+
{% endfor %}
126+
</ul>
127+
128+
129+
130+
{%- endblock %}
131+

hyperboria-theme/page.html

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{%- extends "hyperboria-theme/layout.html" %}
2+
3+
{% block body %}
4+
{{ body|replace('.md', '.html') }}
5+
{% endblock %}

hyperboria-theme/static/main.css

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
@import url("default.css");
2+
3+
4+
html, body{
5+
font-family: Helvetica-neue, Sans-Serif;
6+
height: 100%;
7+
}
8+
9+
.body {
10+
min-height: 1500px;
11+
}
12+
13+
14+
.document .sphinxsidebar li {
15+
text-overflow: ellipsis;
16+
list-style-position:inside;
17+
overflow: hidden;
18+
}
19+
20+
.document .sphinxsidebar ul {
21+
margin-right: 0;
22+
}
23+
24+
.todo {
25+
color: #ccc;
26+
}
27+
28+
.content {
29+
width: 90%;
30+
}
31+

hyperboria-theme/theme.conf

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[theme]
2+
inherit = default
3+
stylesheet = main.css

index.md

100644100755
File mode changed.

0 commit comments

Comments
 (0)