Skip to content

Commit b00f3d3

Browse files
committed
add a local theme containing a customized sidebar
1 parent 10f3c87 commit b00f3d3

File tree

10 files changed

+545
-5
lines changed

10 files changed

+545
-5
lines changed

README

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,19 @@ Learning Linux C/C++ Programming from Scratch
33
Prerequisite
44
============
55

6-
easy_install sphinx
6+
$ sudo apt-get install python-setuptools
7+
$ sudo easy_install sphinx
8+
9+
Build
10+
=====
11+
12+
$ make html
13+
$ make epub
14+
15+
The build result will be generated under _build/html and _build/epub respectively.
16+
17+
TODO
18+
====
19+
20+
Generate images under images directory from dia files under dia directory automatically through Makefile, rather than manually.
721

conf.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,15 @@
9191

9292
# The theme to use for HTML and HTML Help pages. See the documentation for
9393
# a list of builtin themes.
94-
html_theme = 'default'
94+
html_theme = 'mytheme'
9595

9696
# Theme options are theme-specific and customize the look and feel of a theme
9797
# further. For a list of options available for each theme, see the
9898
# documentation.
9999
#html_theme_options = {}
100100

101101
# Add any paths that contain custom themes here, relative to this directory.
102-
#html_theme_path = []
102+
html_theme_path = ['.']
103103

104104
# The name for this set of Sphinx documents. If None, it defaults to
105105
# "<project> v<release> documentation".
@@ -131,7 +131,7 @@
131131
#html_use_smartypants = True
132132

133133
# Custom sidebar templates, maps document names to template names.
134-
html_sidebars = { '**': ['localtoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html'] }
134+
html_sidebars = { '**': ['localtoc.html', 'relations.html', 'sourcelink.html', 'searchbox.html', 'sidebarextra.html'] }
135135

136136
# Additional templates that should be rendered to pages, maps page names to
137137
# template names.

en/preface.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ So this is four years of college education vs. four months of vocational trainin
1414

1515
.. crossreference for interpreter above
1616
17-
Our training course is comprised of five sections::
17+
Our training course is comprised of five sections:
1818

1919
#. Some basic Linux commands and operations. To be prepared for the next section, students will learn to do basic file and disk operations, work with an text editor and run a compiler.
2020
#. C programming. In this section students will gain a thorough understanding of C language syntax as well as the functioning of C compiler and linker.

images/normalize.py

100644100755
File mode changed.

mytheme/layout.html

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{#
2+
default/layout.html
3+
~~~~~~~~~~~~~~~~~~~
4+
5+
Sphinx layout template for the default theme.
6+
7+
:copyright: Copyright 2007-2011 by the Sphinx team, see AUTHORS.
8+
:license: BSD, see LICENSE for details.
9+
#}
10+
{% extends "basic/layout.html" %}
11+
12+
{% if theme_collapsiblesidebar|tobool %}
13+
{% set script_files = script_files + ['_static/sidebar.js'] %}
14+
{% endif %}

mytheme/sidebarextra.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<table border=0 cellspacing=0 style="color: white;">
2+
3+
<tr><td>
4+
请输入您的email订阅<a href="http://groups.google.com/group/learning-linux-c-cpp">本书的邮件列表</a><br/>
5+
(Please enter your email to subscribe to <a href="http://groups.google.com/group/learning-linux-c-cpp">this book's mailing list</a>)<br/>
6+
<form action="http://groups.google.com/group/learning-linux-c-cpp/boxsubscribe"><input type=text name=email><input type=submit name="sub" value="订阅(Subscribe)"></form>
7+
</td></tr>
8+
9+
<tr><td><br/>关注<a href="http://weibo.com/sansoong">我的微博</a></td></tr>
10+
11+
<tr><td><br/>Checkout the source from github: <a href="https://github.com/learning-linux-c-cpp/akabook">https://github.com/learning-linux-c-cpp/akabook</a></td></tr>
12+
13+
<tr><td>
14+
<br/>感谢您的慷慨捐赠!<br/>
15+
Thanks for your generous donation!<br/>
16+
<a href="http://me.alipay.com/songjinshan" target="_blank"><img src="_static/me.alipay.png" alt="捐赠"></a>
17+
</td></tr>
18+
19+
</table>

0 commit comments

Comments
 (0)