Merge lp:~widelands-dev/widelands-website/solitaire_html_documentation into lp:widelands-website

Proposed by kaputtnik
Status: Merged
Merged at revision: 496
Proposed branch: lp:~widelands-dev/widelands-website/solitaire_html_documentation
Merge into: lp:widelands-website
Diff against target: 2015 lines (+1308/-502)
24 files modified
README.txt (+9/-20)
documentation/conf.py (+171/-0)
documentation/management/commands/create_docs.py (+134/-0)
documentation/static/basic.css (+645/-0)
documentation/static/pygments.css (+78/-0)
documentation/static/widelands.css (+258/-0)
local_settings.py.sample (+1/-0)
local_urls.py.sample (+7/-0)
media/css/documentation.css (+0/-118)
settings.py (+1/-1)
sitemap_urls.py (+0/-2)
sphinxdoc/admin.py (+0/-14)
sphinxdoc/migrations/0001_initial.py (+0/-24)
sphinxdoc/models.py (+0/-23)
sphinxdoc/sitemap.py (+0/-26)
sphinxdoc/urls.py (+0/-28)
sphinxdoc/views.py (+0/-89)
templates/navigation.html (+1/-1)
templates/sphinxdoc/app_list.html (+0/-18)
templates/sphinxdoc/base.html (+0/-17)
templates/sphinxdoc/documentation.html (+0/-57)
templates/sphinxdoc/genindex.html (+0/-38)
templates/sphinxdoc/py-modindex.html (+0/-23)
urls.py (+3/-3)
To merge this branch: bzr merge lp:~widelands-dev/widelands-website/solitaire_html_documentation
Reviewer Review Type Date Requested Status
Widelands Developers Pending
Review via email: mp+345460@code.launchpad.net

Commit message

Serve sphinx documentation as html files; Removes sphinx-doc

Description of the change

Serve sphinx documentation as html files. This remove unmaintained sphinx-doc. But all features of the produced html could be used (e.g searching).

The main idea is to let sphinx build the html files directly in the media folder of the website and link it from the navigation. So no extra entries for nginx are needed.

To ease up the creation step of the documentation, a management command is implemented which uses an own conf.py for sphinx. To create the documentation one can just write:

./manage.py create_docs

To have a similar look and feel in the created html files, i have added also the needed css and background images to this branch and let sphinx use them, so the main source code for widelands isn't tainted. An example image: https://bugs.launchpad.net/widelands-website/+bug/893275/+attachment/5046332/+files/solitaire_documentation.jpg

The management command let sphinx create the doctrees in the WIDELANDS_SVN_DIR/doc/sphinx/build/doctrees/ but puts the produced html in the folder in MEDIA/documentation/'. On unix like systems the produced html are served from a symlink called 'html'. This makes it possible to have consistent links during creation of new a documentation:

1. sphinx produces html files in a folder called 'html_temp'
2. switch the link to 'html_temp'
3. remove folder 'current' (if exist)
4. copy 'html_temp' to 'current'
5. switch the link to 'current'
6. remove 'html_temp'

On windows systems (if there are ever some users creating the website in an windows environment...) the step to create the symlink is omitted and 'html_temp' is moved to 'html'

We can do similar with the doxygen created documentation.

If you think this approach is good to go, i will make it work on the alpha site for testing. Since heavy file action is involved (moving, deleting of folders), please read the code of documentation/management/commands/create_docs.py very carefully :-)

To post a comment you must log in.
505. By kaputtnik

cleanups

Revision history for this message
GunChleoc (gunchleoc) wrote :

That screenshot looks so good - finally, a table of contents!

Just 1 tiny nit for a comment.

506. By kaputtnik

adressed code review; found an unneeded call to os.path.join

507. By kaputtnik

merged trunk

Revision history for this message
kaputtnik (franku) wrote :

Ok, my approach will not work on the server. After some fiddling i will continue the work for this next week.

Just if one want's to play around with the alpha site: Be aware that it is currently in a WIP-state.

Revision history for this message
kaputtnik (franku) wrote :

The alpha site is functional now and running. So one can test the look and feel of the documentation.

The link shown in the users addressbar isn't that good now. May i have to adjust nginx for that. Also there is no favicon shown.

In regard to bug 1758515 it has to be modified again.

Revision history for this message
kaputtnik (franku) wrote :

The link shown in user browsers addressbar is also fixed now. I fixed it in the same manner as the links for 'media' and 'wlmedia'. Added a location block to the nginx file and made a symlink to 'wlmedia/documentation/html'

I would be glad if some one can have a look at the documentation.

In the meantime i will adjust the code at home accordingly.

Revision history for this message
kaputtnik (franku) wrote :

Ah, forgotton: I have sometimes trouble to access the alpha site, because my browser opens wl.widelands.org instead. I have to clean the browsers cache to get into alpha...

508. By kaputtnik

adjusted code to make it run on the server

509. By kaputtnik

give the sidebars text a really dark green

Revision history for this message
GunChleoc (gunchleoc) wrote :

The really dark green works for me. Ship it! :)

Revision history for this message
kaputtnik (franku) wrote :

Hmmm... currently i didn't get the cron job /etc/cron.hourly/update_widelands_bzr to work... Commenting all other rows (except the 'bzr pull' command) and applying the following do not work for some reason:

# Some magic from: http://stackoverflow.com/a/29969243/200945. If we are
# run as root (which we are from cron), we rerun the script under the user we
# actually want to execute all commands as
if [ $UID -eq 0 ]; then
  exec sudo -u www-data "$0" "$@"
fi

cd /var/www/django_projects/wlwebsite/
source bin/activate
cd code/widelands

/var/www/django_projects/wlwebsite/bin/python manage.py create_docs

510. By kaputtnik

make local url work again

511. By kaputtnik

add a redirect to fix old links

Revision history for this message
kaputtnik (franku) wrote :

Just found that a redirect from docs/wl/ to documentation was missing.

Will give it another try to get it into production next weekend (when i am not that tired from work ;) )

Revision history for this message
GunChleoc (gunchleoc) wrote :

Glad you found it :)

Revision history for this message
kaputtnik (franku) wrote :

Ok, got it. The problem was that merging this branch the folder media/documentation/ was owned by me, so the script (which runs as user www-data) could not write into it.

Fixed also another small issue.

Merged and deployed.

The django management command to update the documentation is now executed daily. Former it was executed hourly. Is this ok?
If we want to update the documentation hourly, i have to investigate if the permissions allow it.

Hopefully SirVer did not get too much errors due to my changes in the cron jobs...

Revision history for this message
GunChleoc (gunchleoc) wrote :

Daily is good enough :)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'README.txt'
--- README.txt 2017-04-11 05:30:40 +0000
+++ README.txt 2018-05-24 19:17:56 +0000
@@ -150,25 +150,14 @@
150Setting up widelands source code documentation150Setting up widelands source code documentation
151----------------------------------------------151----------------------------------------------
152152
153Change to the directory doc/sphinx/ of the widelands source code and run153There is a small helper script to get the documenation. Be sure
154154you have set WIDELANDS_SVN_DIR set in local_settings.py. Run:
155 $ ./extract_rst.py155
156156 $ ./manage.py create_docs
157Now create the documentation as json files. You have to provide the path to157
158the sphinx-build executable of the website:158After finishing without errors, type localhost:8000/documentation/index.html
159159in your browsers addressbar or click on "Development -> Documentation".
160 $ ~/wlwebsite/bin/sphinx-build -b json -d build/doctrees source build/json160
161
162A new directory containing json files is created in doc/sphinx/build/json. The full path
163to this directory has to be set in the sphinxdoc-app of the website:
164
165Open http://localhost:8000/admin/sphinxdoc/app/ and add a new app with this values:
166
167Name: Widelands developer documentation
168Slug: wl
169Path: /your/path/to/widelands-src/doc/sphinx/build/json/
170
171Open http://localhost:8000/docs/wl/ to test if everything is working.
172161
173Uploading a map to the local website162Uploading a map to the local website
174------------------------------------163------------------------------------
@@ -182,7 +171,7 @@
182Contact171Contact
183=======172=======
184173
185Contact SirVer on the homepage for more information and problems.174Contact user 'kaputtnik' on the homepage for more information and problems.
186175
187176
188-- vim:ft=rst:177-- vim:ft=rst:
189178
=== added directory 'documentation'
=== added file 'documentation/__init__.py'
=== added file 'documentation/conf.py'
--- documentation/conf.py 1970-01-01 00:00:00 +0000
+++ documentation/conf.py 2018-05-24 19:17:56 +0000
@@ -0,0 +1,171 @@
1# -*- coding: utf-8 -*-
2#
3# Widelands documentation build configuration file, created by
4# sphinx-quickstart on Fri Jun 01 11:27:52 2012.
5#
6# This file is execfile()d with the current directory set to its containing dir.
7#
8# Note that not all possible configuration values are present in this
9# autogenerated file.
10#
11# All configuration values have a default; values that are commented out
12# serve to show the default.
13# For a complete list of options see: http://www.sphinx-doc.org/en/stable/config.html
14
15# import sys, os
16
17# If extensions (or modules to document with autodoc) are in another directory,
18# add these directories to sys.path here. If the directory is relative to the
19# documentation root, use os.path.abspath to make it absolute, like shown here.
20#sys.path.insert(0, os.path.abspath('.'))
21
22# -- General configuration -----------------------------------------------------
23
24# If your documentation needs a minimal Sphinx version, state it here.
25#needs_sphinx = '1.0'
26
27# Add any Sphinx extension module names here, as strings. They can be extensions
28# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
29extensions = ['sphinx.ext.mathjax']
30
31# Add any paths that contain templates here, relative to this directory.
32templates_path = ['_templates']
33
34# The suffix of source filenames.
35source_suffix = '.rst'
36
37# The encoding of source files.
38#source_encoding = 'utf-8-sig'
39
40# The master toctree document.
41master_doc = 'index'
42
43# General information about the project.
44project = u'Widelands'
45copyright = u'The Widelands Development Team'
46
47# The version info for the project you're documenting, acts as replacement for
48# |version| and |release|, also used in various other places throughout the
49# built documents.
50#
51# The short X.Y version.
52version = 'trunk'
53# The full version, including alpha/beta/rc tags.
54release = 'trunk'
55
56# The language for content autogenerated by Sphinx. Refer to documentation
57# for a list of supported languages.
58#language = None
59
60# There are two options for replacing |today|: either, you set today to some
61# non-false value, then it is used:
62#today = ''
63# Else, today_fmt is used as the format for a strftime call.
64#today_fmt = '%B %d, %Y'
65
66# List of patterns, relative to source directory, that match files and
67# directories to ignore when looking for source files.
68exclude_patterns = []
69
70# The reST default role (used for this markup: `text`) to use for all documents.
71#default_role = None
72
73# If true, '()' will be appended to :func: etc. cross-reference text.
74#add_function_parentheses = True
75
76# If true, the current module name will be prepended to all description
77# unit titles (such as .. function::).
78#add_module_names = True
79
80# If true, sectionauthor and moduleauthor directives will be shown in the
81# output. They are ignored by default.
82#show_authors = False
83
84# The name of the Pygments (syntax highlighting) style to use.
85pygments_style = 'sphinx'
86
87# A list of ignored prefixes for module index sorting.
88#modindex_common_prefix = []
89
90highlight_language = 'lua'
91
92
93# -- Options for HTML output ---------------------------------------------------
94
95# The theme to use for HTML and HTML Help pages. See the documentation for
96# a list of builtin themes.
97html_theme = 'basic'
98
99# Theme options are theme-specific and customize the look and feel of a theme
100# further. For a list of options available for each theme, see the
101# documentation.
102html_theme_options = {}
103
104# Add any paths that contain custom themes here, relative to this directory.
105#html_theme_path = []
106
107# The name for this set of Sphinx documents. If None, it defaults to
108# "<project> v<release> documentation".
109#html_title = None
110
111# A shorter title for the navigation bar. Default is the same as html_title.
112#html_short_title = None
113
114# The name of an image file (relative to this directory) to place at the top
115# of the sidebar.
116#html_logo = None
117
118# The name of an image file (within the static path) to use as favicon of the
119# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
120# pixels large.
121#html_favicon = None
122
123# Add any paths that contain custom static files (such as style sheets) here,
124# relative to this directory. They are copied after the builtin static files,
125# so a file named "default.css" will overwrite the builtin "default.css".
126html_static_path = ['static/']
127
128# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
129# using the given strftime format.
130html_last_updated_fmt = '%b %d, %Y'
131
132# If true, SmartyPants will be used to convert quotes and dashes to
133# typographically correct entities.
134#html_use_smartypants = True
135
136# Custom sidebar templates, maps document names to template names.
137#html_sidebars = {}
138
139# Additional templates that should be rendered to pages, maps page names to
140# template names.
141#html_additional_pages = {}
142
143# If false, no module index is generated.
144html_domain_indices = False
145
146# If false, no index is generated.
147html_use_index = True
148
149# If true, the index is split into individual pages for each letter.
150#html_split_index = False
151
152# If true, links to the reST sources are added to the pages.
153#html_show_sourcelink = True
154
155# If true, "Created using Sphinx" is shown in the HTML footer. Default is True.
156#html_show_sphinx = True
157
158# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True.
159#html_show_copyright = True
160
161# If true, an OpenSearch description file will be output, and all pages will
162# contain a <link> tag referring to it. The value of this option must be the
163# base URL from which the finished HTML is served.
164#html_use_opensearch = ''
165
166# This is the file name suffix for HTML files (e.g. ".xhtml").
167#html_file_suffix = None
168
169
170# Output file base name for HTML help builder.
171htmlhelp_basename = 'Widelandsdoc'
0172
=== added directory 'documentation/management'
=== added file 'documentation/management/__init__.py'
=== added directory 'documentation/management/commands'
=== added file 'documentation/management/commands/__init__.py'
=== added file 'documentation/management/commands/create_docs.py'
--- documentation/management/commands/create_docs.py 1970-01-01 00:00:00 +0000
+++ documentation/management/commands/create_docs.py 2018-05-24 19:17:56 +0000
@@ -0,0 +1,134 @@
1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3
4"""Create the source code documenation.
5
6This script covers all needed steps to create or recreate the widelands
7source code documentation.
8
9Needed dependency: Sphinx
10
11"""
12
13from __future__ import print_function
14from django.core.management.base import BaseCommand, CommandError
15from django.conf import settings
16from subprocess import check_call, CalledProcessError
17from documentation import conf
18import os
19import sys
20import shutil
21import glob
22
23
24class Command(BaseCommand):
25 help = 'Create the source code documenation.'
26
27 def __init__(self, *args, **kwargs):
28 super(Command, self).__init__(*args, **kwargs)
29
30 # Define the main directories used in this class
31 self.sphinx_dir = os.path.join(
32 settings.WIDELANDS_SVN_DIR, 'doc/sphinx')
33 self.build_dir = os.path.join(
34 settings.MEDIA_ROOT, 'documentation/html_temp')
35 self.sphinx_conf_dir = os.path.dirname(conf.__file__)
36
37 def move_docs(self):
38 """Move the documentation created by sphinxdoc to the correct folder.
39
40 On unix systems the files were served from the symlink called
41 'html'. On Windows systems the files will only be copied in a
42 folder called 'html'.
43
44 """
45
46 if os.name == 'posix':
47 # Creating symlinks is only available on unix systems
48 try:
49 link_name = os.path.join(
50 settings.MEDIA_ROOT, 'documentation/html')
51 target_dir = os.path.join(
52 settings.MEDIA_ROOT, 'documentation/current')
53
54 if not os.path.exists(target_dir):
55 # only needed on first run
56 os.mkdir(target_dir)
57
58 if os.path.exists(link_name):
59 # only needed if this script has already run
60 os.remove(link_name)
61
62 # Temporarily switch the symlink
63 os.symlink(self.build_dir, link_name)
64 # Remove current
65 shutil.rmtree(target_dir)
66 # Copy new build to current
67 shutil.copytree(self.build_dir, target_dir)
68 # Switch the link to current
69 os.remove(link_name)
70 os.symlink(target_dir, link_name)
71 except:
72 raise
73 else:
74 # Non unix OS: Copy docs
75 try:
76 target_dir = os.path.join(
77 settings.MEDIA_ROOT, 'documentation/html')
78 if os.path.exists(target_dir):
79 shutil.rmtree(target_dir)
80 shutil.copytree(self.build_dir, target_dir)
81 except:
82 raise
83
84 try:
85 # The new build directory is no longer needed
86 shutil.rmtree(self.build_dir)
87 except:
88 raise
89
90 def handle(self, *args, **options):
91 """Create the widelands source code documentation.
92
93 The Documenatation is built by sphinxdoc in the directory
94 'settings/MEDIA/documentation/html_temp'.
95
96 """
97
98 if not os.path.exists(self.sphinx_dir):
99 print(
100 "Can't find the directory given by WIDELANDS_SVN_DIR in local_settings.py:\n", self.sphinx_dir)
101 sys.exit(1)
102
103 if os.path.exists(os.path.join(self.sphinx_dir, 'build')):
104 # Clean the autogen* files created by extract_rst.py
105 # This has to be done because sometimes such a file remains after
106 # removing it from extract_rst.
107 try:
108 for f in glob.glob(os.path.join(self.sphinx_dir, 'source/autogen*')):
109 os.remove(f)
110 except OSError:
111 raise
112
113 # Locally 'dirhtml' do not work because the staticfiles view disallow
114 # directory indexes, but 'dirhtml' gives nicer addresses in production
115 builder = 'html'
116 if not settings.DEBUG:
117 # In production DEBUG is False
118 builder = 'dirhtml'
119
120 try:
121 check_call(['python', os.path.join(
122 self.sphinx_dir, 'extract_rst.py')])
123 check_call(['sphinx-build',
124 '-b', builder,
125 '-d', os.path.join(self.sphinx_dir, 'build/doctrees'),
126 '-c', self.sphinx_conf_dir,
127 os.path.join(self.sphinx_dir, 'source'),
128 self.build_dir,
129 ])
130 except CalledProcessError as why:
131 print('An error occured: {0}'.format(why))
132 sys.exit(1)
133
134 self.move_docs()
0135
=== added directory 'documentation/static'
=== added file 'documentation/static/basic.css'
--- documentation/static/basic.css 1970-01-01 00:00:00 +0000
+++ documentation/static/basic.css 2018-05-24 19:17:56 +0000
@@ -0,0 +1,645 @@
1/*
2 * basic.css
3 * ~~~~~~~~~
4 *
5 * Sphinx stylesheet -- basic theme.
6 *
7 * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
8 * :license: BSD, see LICENSE for details.
9 *
10 */
11
12@import url("widelands.css");
13
14/* -- main layout ----------------------------------------------------------- */
15
16div.clearer {
17 clear: both;
18}
19
20/* -- relbar ---------------------------------------------------------------- */
21
22div.related {
23 width: 100%;
24 font-size: 90%;
25}
26
27div.related h3 {
28 display: none;
29}
30
31div.related ul {
32 margin: 0;
33 padding: 0 0 0 10px;
34 list-style: none;
35}
36
37div.related li {
38 display: inline;
39}
40
41div.related li.right {
42 float: right;
43 margin-right: 5px;
44}
45
46/* -- sidebar --------------------------------------------------------------- */
47
48div.sphinxsidebarwrapper {
49 padding: 10px 5px 0 10px;
50}
51
52div.sphinxsidebar {
53 float: left;
54 width: 230px;
55 margin-left: -100%;
56 font-size: 90%;
57 word-wrap: break-word;
58 overflow-wrap : break-word;
59}
60
61div.sphinxsidebar ul {
62 list-style: none;
63}
64
65div.sphinxsidebar ul ul,
66div.sphinxsidebar ul.want-points {
67 margin-left: 20px;
68 list-style: square;
69}
70
71div.sphinxsidebar ul ul {
72 margin-top: 0;
73 margin-bottom: 0;
74}
75
76div.sphinxsidebar form {
77 margin-top: 10px;
78}
79
80/*div.sphinxsidebar input {
81 border: 1px solid #98dbcc;
82 font-family: sans-serif;
83 font-size: 1em;
84}*/
85
86div.sphinxsidebar #searchbox input[type="text"] {
87 width: 170px;
88}
89
90img {
91 border: 0;
92 max-width: 100%;
93}
94
95/* -- search page ----------------------------------------------------------- */
96
97ul.search {
98 margin: 10px 0 0 20px;
99 padding: 0;
100}
101
102ul.search li {
103 padding: 5px 0 5px 20px;
104 background-image: url(file.png);
105 background-repeat: no-repeat;
106 background-position: 0 7px;
107}
108
109ul.search li a {
110 font-weight: bold;
111}
112
113ul.search li div.context {
114 color: #888;
115 margin: 2px 0 0 30px;
116 text-align: left;
117}
118
119ul.keywordmatches li.goodmatch a {
120 font-weight: bold;
121}
122
123/* -- index page ------------------------------------------------------------ */
124
125table.contentstable {
126 width: 90%;
127 margin-left: auto;
128 margin-right: auto;
129}
130
131table.contentstable p.biglink {
132 line-height: 150%;
133}
134
135a.biglink {
136 font-size: 1.3em;
137}
138
139span.linkdescr {
140 font-style: italic;
141 padding-top: 5px;
142 font-size: 90%;
143}
144
145/* -- general index --------------------------------------------------------- */
146
147table.indextable {
148 width: 100%;
149}
150
151table.indextable td {
152 text-align: left;
153 vertical-align: top;
154}
155
156table.indextable ul {
157 margin-top: 0;
158 margin-bottom: 0;
159 list-style-type: none;
160}
161
162table.indextable > tbody > tr > td > ul {
163 padding-left: 0em;
164}
165
166table.indextable tr.pcap {
167 height: 10px;
168}
169/*
170table.indextable tr.cap {
171 margin-top: 10px;
172 background-color: #f2f2f2;
173}*/
174
175img.toggler {
176 margin-right: 3px;
177 margin-top: 3px;
178 cursor: pointer;
179}
180
181div.modindex-jumpbox {
182 border-top: 1px solid #ddd;
183 border-bottom: 1px solid #ddd;
184 margin: 1em 0 1em 0;
185 padding: 0.4em;
186}
187
188div.genindex-jumpbox {
189 border-top: 1px solid #ddd;
190 border-bottom: 1px solid #ddd;
191 margin: 1em 0 1em 0;
192 padding: 0.4em;
193}
194
195/* -- domain module index --------------------------------------------------- */
196
197table.modindextable td {
198 padding: 2px;
199 border-collapse: collapse;
200}
201
202/* -- general body styles --------------------------------------------------- */
203
204div.body p, div.body dd, div.body li, div.body blockquote {
205 -moz-hyphens: auto;
206 -ms-hyphens: auto;
207 -webkit-hyphens: auto;
208 hyphens: auto;
209}
210
211a.headerlink {
212 visibility: hidden;
213}
214
215h1:hover > a.headerlink,
216h2:hover > a.headerlink,
217h3:hover > a.headerlink,
218h4:hover > a.headerlink,
219h5:hover > a.headerlink,
220h6:hover > a.headerlink,
221dt:hover > a.headerlink,
222caption:hover > a.headerlink,
223p.caption:hover > a.headerlink,
224div.code-block-caption:hover > a.headerlink {
225 visibility: visible;
226}
227
228div.body p.caption {
229 text-align: inherit;
230}
231
232div.body td {
233 text-align: left;
234}
235
236.first {
237 margin-top: 0 !important;
238}
239
240p.rubric {
241 margin-top: 30px;
242 font-weight: bold;
243}
244
245img.align-left, .figure.align-left, object.align-left {
246 clear: left;
247 float: left;
248 margin-right: 1em;
249}
250
251img.align-right, .figure.align-right, object.align-right {
252 clear: right;
253 float: right;
254 margin-left: 1em;
255}
256
257img.align-center, .figure.align-center, object.align-center {
258 display: block;
259 margin-left: auto;
260 margin-right: auto;
261}
262
263.align-left {
264 text-align: left;
265}
266
267.align-center {
268 text-align: center;
269}
270
271.align-right {
272 text-align: right;
273}
274
275/* -- sidebars -------------------------------------------------------------- */
276
277div.sidebar {
278 margin: 0 0 0.5em 1em;
279 border: 1px solid #ddb;
280 padding: 7px 7px 0 7px;
281 background-color: #ffe;
282 width: 40%;
283 float: right;
284}
285
286p.sidebar-title {
287 font-weight: bold;
288}
289
290/* -- topics ---------------------------------------------------------------- */
291
292div.topic {
293 border: 1px solid #ccc;
294 padding: 7px 7px 0 7px;
295 margin: 10px 0 10px 0;
296}
297
298p.topic-title {
299 font-size: 1.1em;
300 font-weight: bold;
301 margin-top: 10px;
302}
303
304/* -- admonitions ----------------------------------------------------------- */
305
306div.admonition {
307 margin-top: 10px;
308 margin-bottom: 10px;
309 padding: 7px;
310}
311
312div.admonition dt {
313 font-weight: bold;
314}
315
316div.admonition dl {
317 margin-bottom: 0;
318}
319
320p.admonition-title {
321 margin: 0px 10px 5px 0px;
322 font-weight: bold;
323}
324
325div.body p.centered {
326 text-align: center;
327 margin-top: 25px;
328}
329
330/* -- tables ---------------------------------------------------------------- */
331
332table.docutils {
333 border: 0;
334 border-collapse: collapse;
335}
336
337table caption span.caption-number {
338 font-style: italic;
339}
340
341table caption span.caption-text {
342}
343
344table.docutils td, table.docutils th {
345 padding: 1px 8px 1px 5px;
346 border-top: 0;
347 border-left: 0;
348 border-right: 0;
349 border-bottom: 1px solid #aaa;
350}
351
352table.footnote td, table.footnote th {
353 border: 0 !important;
354}
355
356th {
357 text-align: left;
358 padding-right: 5px;
359}
360
361table.citation {
362 border-left: solid 1px gray;
363 margin-left: 1px;
364}
365
366table.citation td {
367 border-bottom: none;
368}
369
370/* -- figures --------------------------------------------------------------- */
371
372div.figure {
373 margin: 0.5em;
374 padding: 0.5em;
375}
376
377div.figure p.caption {
378 padding: 0.3em;
379}
380
381div.figure p.caption span.caption-number {
382 font-style: italic;
383}
384
385div.figure p.caption span.caption-text {
386}
387
388/* -- field list styles ----------------------------------------------------- */
389
390table.field-list td, table.field-list th {
391 border: 0 !important;
392}
393
394.field-list ul {
395 margin: 0;
396 padding-left: 1em;
397}
398
399.field-list p {
400 margin: 0;
401}
402
403.field-name {
404 -moz-hyphens: manual;
405 -ms-hyphens: manual;
406 -webkit-hyphens: manual;
407 hyphens: manual;
408}
409
410/* -- other body styles ----------------------------------------------------- */
411
412ol.arabic {
413 list-style: decimal;
414}
415
416ol.loweralpha {
417 list-style: lower-alpha;
418}
419
420ol.upperalpha {
421 list-style: upper-alpha;
422}
423
424ol.lowerroman {
425 list-style: lower-roman;
426}
427
428ol.upperroman {
429 list-style: upper-roman;
430}
431
432dl {
433 margin-bottom: 15px;
434}
435
436dd p {
437 margin-top: 0px;
438}
439
440dd ul, dd table {
441 margin-bottom: 10px;
442}
443
444dd {
445 margin-top: 3px;
446 margin-bottom: 10px;
447 margin-left: 30px;
448}
449
450/*dt:target, span.highlighted {
451 background-color: #fbe54e;
452}*/
453
454rect.highlighted {
455 fill: #C8BE93;
456}
457
458dl.glossary dt {
459 font-weight: bold;
460 font-size: 1.1em;
461}
462
463.optional {
464 font-size: 1.3em;
465}
466
467/*.sig-paren {
468 font-size: larger;
469}*/
470
471.versionmodified {
472 font-style: italic;
473}
474
475.system-message {
476 background-color: #fda;
477 padding: 5px;
478 border: 3px solid red;
479}
480
481.footnote:target {
482 background-color: #ffa;
483}
484
485.line-block {
486 display: block;
487 margin-top: 1em;
488 margin-bottom: 1em;
489}
490
491.line-block .line-block {
492 margin-top: 0;
493 margin-bottom: 0;
494 margin-left: 1.5em;
495}
496
497.guilabel, .menuselection {
498 font-family: sans-serif;
499}
500
501.accelerator {
502 text-decoration: underline;
503}
504
505.classifier {
506 font-style: oblique;
507}
508
509abbr, acronym {
510 border-bottom: dotted 1px;
511 cursor: help;
512}
513
514/* -- code displays --------------------------------------------------------- */
515
516pre {
517 overflow: auto;
518 overflow-y: hidden; /* fixes display issues on Chrome browsers */
519}
520
521span.pre {
522 -moz-hyphens: none;
523 -ms-hyphens: none;
524 -webkit-hyphens: none;
525 hyphens: none;
526}
527
528td.linenos pre {
529 padding: 5px 0px;
530 border: 0;
531 background-color: transparent;
532 color: #aaa;
533}
534
535table.highlighttable {
536 margin-left: 0.5em;
537}
538
539table.highlighttable td {
540 padding: 0 0.5em 0 0.5em;
541}
542
543div.code-block-caption {
544 padding: 2px 5px;
545 font-size: small;
546}
547
548div.code-block-caption code {
549 background-color: transparent;
550}
551
552div.code-block-caption + div > div.highlight > pre {
553 margin-top: 0;
554}
555
556div.code-block-caption span.caption-number {
557 padding: 0.1em 0.3em;
558 font-style: italic;
559}
560
561div.code-block-caption span.caption-text {
562}
563
564div.literal-block-wrapper {
565 padding: 1em 1em 0;
566}
567
568div.literal-block-wrapper div.highlight {
569 margin: 0;
570}
571
572code.descname {
573 background-color: transparent;
574 font-weight: bold;
575 font-size: 1.2em;
576}
577
578code.descclassname {
579 background-color: transparent;
580}
581
582code.xref, a code {
583 background-color: transparent;
584 font-weight: bold;
585}
586
587h1 code, h2 code, h3 code, h4 code, h5 code, h6 code {
588 background-color: transparent;
589}
590
591.viewcode-link {
592 float: right;
593}
594
595.viewcode-back {
596 float: right;
597 font-family: sans-serif;
598}
599
600div.viewcode-block:target {
601 margin: -1px -10px;
602 padding: 0 10px;
603}
604
605/* -- math display ---------------------------------------------------------- */
606
607img.math {
608 vertical-align: middle;
609}
610
611div.body div.math p {
612 text-align: center;
613}
614
615span.eqno {
616 float: right;
617}
618
619span.eqno a.headerlink {
620 position: relative;
621 left: 0px;
622 z-index: 1;
623}
624
625div.math:hover a.headerlink {
626 visibility: visible;
627}
628
629/* -- printout stylesheet --------------------------------------------------- */
630
631@media print {
632 div.document,
633 div.documentwrapper,
634 div.bodywrapper {
635 margin: 0 !important;
636 width: 100%;
637 }
638
639 div.sphinxsidebar,
640 div.related,
641 div.footer,
642 #top-link {
643 display: none;
644 }
645}
0646
=== added file 'documentation/static/black20.png'
1Binary files documentation/static/black20.png 1970-01-01 00:00:00 +0000 and documentation/static/black20.png 2018-05-24 19:17:56 +0000 differ647Binary files documentation/static/black20.png 1970-01-01 00:00:00 +0000 and documentation/static/black20.png 2018-05-24 19:17:56 +0000 differ
=== added file 'documentation/static/but1.png'
2Binary files documentation/static/but1.png 1970-01-01 00:00:00 +0000 and documentation/static/but1.png 2018-05-24 19:17:56 +0000 differ648Binary files documentation/static/but1.png 1970-01-01 00:00:00 +0000 and documentation/static/but1.png 2018-05-24 19:17:56 +0000 differ
=== added file 'documentation/static/parchment.png'
3Binary files documentation/static/parchment.png 1970-01-01 00:00:00 +0000 and documentation/static/parchment.png 2018-05-24 19:17:56 +0000 differ649Binary files documentation/static/parchment.png 1970-01-01 00:00:00 +0000 and documentation/static/parchment.png 2018-05-24 19:17:56 +0000 differ
=== added file 'documentation/static/pygments.css'
--- documentation/static/pygments.css 1970-01-01 00:00:00 +0000
+++ documentation/static/pygments.css 2018-05-24 19:17:56 +0000
@@ -0,0 +1,78 @@
1/*******************************/
2/* Pygment Syntax Highlighting */
3/*******************************/
4pre {
5 margin: 4px;
6 display: block; /*show black background over the whole width*/
7}
8.highlight {
9 /* text-shadow: none;
10 / * color: #000000;*/ *
11 padding: 4px;
12 border: 1px solid black;
13 background-image: url("black20.png");
14 margin: 4px 0px;
15 margin-left: 1em;
16}
17.highlight .hll { background-color: #ffffcc }
18/*.highlight { background: #f0f0f0; }*/
19.highlight .c { color: #60a0b0; font-style: italic } /* Comment */
20.highlight .err { border: 1px solid #FF0000 } /* Error */
21.highlight .k { color: #007020; font-weight: bold } /* Keyword */
22.highlight .o { color: #998 } /* Operator */
23.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
24.highlight .cp { color: #007020 } /* Comment.Preproc */
25.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
26.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
27.highlight .gd { color: #A00000 } /* Generic.Deleted */
28.highlight .ge { font-style: italic } /* Generic.Emph */
29.highlight .gr { color: #FF0000 } /* Generic.Error */
30.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
31.highlight .gi { color: #00A000 } /* Generic.Inserted */
32.highlight .go { color: #808080 } /* Generic.Output */
33.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
34.highlight .gs { font-weight: bold } /* Generic.Strong */
35.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
36.highlight .gt { color: #0040D0 } /* Generic.Traceback */
37.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
38.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
39.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
40.highlight .kp { color: #007020 } /* Keyword.Pseudo */
41.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
42.highlight .kt { color: #902000 } /* Keyword.Type */
43.highlight .m { color: #40a070 } /* Literal.Number */
44.highlight .s { color: #4070a0 } /* Literal.String */
45.highlight .na { color: #4070a0 } /* Name.Attribute */
46.highlight .nb { color: #007020 } /* Name.Builtin */
47.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
48.highlight .no { color: #60add5 } /* Name.Constant */
49.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
50.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
51.highlight .ne { color: #007020 } /* Name.Exception */
52.highlight .nf { color: #aaaa00 } /* Name.Function */
53.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
54.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
55.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
56.highlight .nv { color: #bb60d5 } /* Name.Variable */
57.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
58.highlight .w { color: #bbbbbb } /* Text.Whitespace */
59.highlight .mf { color: #40a070 } /* Literal.Number.Float */
60.highlight .mh { color: #40a070 } /* Literal.Number.Hex */
61.highlight .mi { color: #40a070 } /* Literal.Number.Integer */
62.highlight .mo { color: #40a070 } /* Literal.Number.Oct */
63.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
64.highlight .sc { color: #4070a0 } /* Literal.String.Char */
65.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
66.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
67.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
68.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
69.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
70.highlight .sx { color: #c65d09 } /* Literal.String.Other */
71.highlight .sr { color: #235388 } /* Literal.String.Regex */
72.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
73.highlight .ss { color: #517918 } /* Literal.String.Symbol */
74.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
75.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
76.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
77.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
78.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */
079
=== added file 'documentation/static/widelands.css'
--- documentation/static/widelands.css 1970-01-01 00:00:00 +0000
+++ documentation/static/widelands.css 2018-05-24 19:17:56 +0000
@@ -0,0 +1,258 @@
1/*
2 * classic.css_t
3 * ~~~~~~~~~~~~~
4 *
5 * Sphinx stylesheet -- classic theme.
6 *
7 * :copyright: Copyright 2007-2018 by the Sphinx team, see AUTHORS.
8 * :license: BSD, see LICENSE for details.
9 *
10 */
11/* This was adjusted by the widelands development team to fit with the
12 * widelands website style.
13 */
14
15/* -- page layout ----------------------------------------------------------- */
16
17body {
18 font-family: sans-serif;
19 font-size: 100%;
20 background-image: url("parchment.png");
21 color: #ffffff;
22 margin: 0;
23 padding: 0;
24}
25
26div.documentwrapper {
27 float: left;
28 width: 100%;
29}
30
31div.bodywrapper {
32 margin: 0 0 0 230px;
33}
34
35div.body {
36 background-image: url("but1.png");
37 background-color: #000000;
38 padding: 0 20px 30px 20px;
39}
40
41div.footer {
42 color: #181;
43 width: 100%;
44 padding: 9px 0 9px 0;
45 text-align: center;
46 font-size: 75%;
47}
48
49div.footer a {
50 color: #181;
51}
52
53div.related {
54 background-color: #000000;
55 background-image: url("wood.png");
56 line-height: 30px;
57}
58
59div.related a {
60 font-weight: bold;
61 color: rgba(254, 234, 138, 1);
62}
63
64div.sphinxsidebar {
65 color: #072107;
66}
67
68div.sphinxsidebar h3 {
69 font-family: 'Trebuchet MS', sans-serif;
70 font-size: 1.4em;
71 margin: 0;
72 padding: 0;
73}
74
75div.sphinxsidebar h3 a {
76 border-bottom: 1px solid #0d440d;
77}
78
79div.sphinxsidebar h4 {
80 font-family: 'Trebuchet MS', sans-serif;
81 font-size: 1.3em;
82 margin: 5px 0 0 0;
83 padding: 0;
84}
85
86div.sphinxsidebar p.topless {
87 margin: 5px 10px 10px 10px;
88}
89
90div.sphinxsidebar ul {
91 padding: 0;
92}
93div.sphinxsidebar ul.this-page-menu {
94 margin: 5px 10px 10px 10px;
95}
96div.sphinxsidebar a {
97 color: #072107;
98}
99
100div.sphinxsidebar a:hover {
101 text-decoration: underline;
102}
103
104div.sphinxsidebar input {
105 font-family: sans-serif;
106 font-size: 1em;
107}
108
109/* -- hyperlink styles ------------------------------------------------------ */
110
111a {
112 color: rgba(254, 234, 138, 1);
113 text-decoration: none;
114}
115
116a:visited {
117 color: #C8BE93;
118 text-decoration: none;
119}
120
121a:hover {
122 color: #181;
123}
124
125/* -- body styles ----------------------------------------------------------- */
126
127div.body h1,
128div.body h2,
129div.body h3,
130div.body h4,
131div.body h5,
132div.body h6 {
133 font-family: 'Trebuchet MS', sans-serif;
134 background-image: url("black20.png");
135 font-weight: normal;
136 color: #181;
137 border-bottom: 1px solid #C8BE93;
138 margin: 20px -20px 10px -20px;
139 padding: 3px 0 3px 10px;
140}
141
142div.body h1 {
143 margin-top: 0;
144}
145
146a.headerlink {
147 color: #181;
148 font-size: 0.8em;
149 padding: 0 4px 0 4px;
150 text-decoration: none;
151}
152
153a.headerlink:hover {
154 background-color: #181;
155 color: white;
156}
157
158div.body p, div.body dd, div.body li, div.body blockquote {
159 line-height: 130%;
160 /*margin: 0;*/
161}
162
163div.admonition p.admonition-title + p {
164 display: inline;
165}
166
167div.admonition p {
168 margin-bottom: 5px;
169}
170
171div.admonition pre {
172 margin-bottom: 5px;
173}
174
175div.admonition ul, div.admonition ol {
176 margin-bottom: 5px;
177}
178
179div.note {
180 border: 1px solid #ccc;
181}
182
183div.seealso {
184 background-color: #ffc;
185 border: 1px solid #ff6;
186}
187
188div.topic {
189 background-color: #eee;
190}
191
192div.warning {
193 background-color: #ffe4e4;
194 border: 1px solid #f66;
195}
196
197p.admonition-title {
198 display: inline;
199}
200
201p.admonition-title:after {
202 content: ":";
203}
204
205pre {
206 padding: 5px;
207 margin-left: 1em;
208 /*line-height: 120%;*/
209 background-image: url("black20.png");
210 border-left: none;
211 border-right: none;
212}
213
214div.body code .pre {
215 background-image: url("black20.png");
216 padding: 0 1px 0 1px;
217}
218
219th {
220 background-image: url("black20.png");
221}
222
223.warning code {
224 background: #efc2c2;
225}
226
227/*.note code {
228 background: #d6d6d6;
229}*/
230
231.viewcode-back {
232 font-family: sans-serif;
233}
234
235div.viewcode-block:target {
236 background-color: #f4debf;
237 border-top: 1px solid #ac9;
238 border-bottom: 1px solid #ac9;
239}
240
241div.code-block-caption {
242 color: #efefef;
243 background-color: #1c4e63;
244}
245
246
247/* Overwritten classes from basic.css */
248code.descname {
249 color: #181;
250 font-size: larger;
251 padding-right: 0.5em;
252}
253
254table.indextable tr.cap {
255 margin-top: 10px;
256 background-image: url("black20.png");
257}
258
0259
=== added file 'documentation/static/wood.png'
1Binary files documentation/static/wood.png 1970-01-01 00:00:00 +0000 and documentation/static/wood.png 2018-05-24 19:17:56 +0000 differ260Binary files documentation/static/wood.png 1970-01-01 00:00:00 +0000 and documentation/static/wood.png 2018-05-24 19:17:56 +0000 differ
=== modified file 'local_settings.py.sample'
--- local_settings.py.sample 2018-05-05 18:58:22 +0000
+++ local_settings.py.sample 2018-05-24 19:17:56 +0000
@@ -17,6 +17,7 @@
17# set WIDELANDS_SVN_DIR to the correct path. See also:17# set WIDELANDS_SVN_DIR to the correct path. See also:
18# https://wl.widelands.org/wiki/BzrPrimer/18# https://wl.widelands.org/wiki/BzrPrimer/
19WIDELANDS_SVN_DIR = "/path/to/widelands/trunk/"19WIDELANDS_SVN_DIR = "/path/to/widelands/trunk/"
20
20os.environ['PATH'] = WIDELANDS_SVN_DIR + ':' + os.environ['PATH']21os.environ['PATH'] = WIDELANDS_SVN_DIR + ':' + os.environ['PATH']
2122
22DATABASES = {23DATABASES = {
2324
=== modified file 'local_urls.py.sample'
--- local_urls.py.sample 2018-04-03 18:57:40 +0000
+++ local_urls.py.sample 2018-05-24 19:17:56 +0000
@@ -1,6 +1,9 @@
1from django.conf.urls import *1from django.conf.urls import *
2from django.conf import settings2from django.conf import settings
3from django.views.static import serve3from django.views.static import serve
4from os import path
5
6# Don't use this file on the server!
47
5local_urlpatterns = [8local_urlpatterns = [
6 url(r'^wlmedia/(?P<path>.*)$',9 url(r'^wlmedia/(?P<path>.*)$',
@@ -11,4 +14,8 @@
11 serve,14 serve,
12 {'document_root': settings.STATIC_MEDIA_PATH},15 {'document_root': settings.STATIC_MEDIA_PATH},
13 name='static_media_pybb'),16 name='static_media_pybb'),
17 url(r'^documentation/(?P<path>.*)$',
18 serve,
19 {'document_root': path.join(settings.STATIC_MEDIA_PATH, 'documentation/html')},
20 name='documentation'),
14]21]
1522
=== removed file 'media/css/documentation.css'
--- media/css/documentation.css 2017-12-12 11:48:37 +0000
+++ media/css/documentation.css 1970-01-01 00:00:00 +0000
@@ -1,118 +0,0 @@
1table.field-list{
2 border-collapse: separate;
3}
4
5.sphinx a.headerlink {
6 padding: 0 4px 0 4px;
7 visibility: hidden;
8}
9
10.sphinx *:hover > a.headerlink {
11 visibility: visible;
12}
13
14img.math{
15 vertical-align: middle;
16}
17
18th {
19 background-color: #4A4A4A;
20}
21
22/* Disable base style and set new ones */
23code {
24 font-weight: bold;
25 font-size: 1.3em;
26}
27
28/* Used for functions in first line */
29dt {
30 margin-top: 0.5em;
31 margin-bottom: 0.25em;
32}
33code.descname {
34 padding: 0.25em;
35 background-image: none;
36 font-weight: bold;
37 font-size: 1.4em;
38 color: #181;
39}
40
41
42/*******************************/
43/* Pygment Syntax Highlighting */
44/*******************************/
45pre {
46 margin: 0px;
47 display: block; /*show black background over the whole width*/
48}
49.highlight {
50/* text-shadow: none;
51/* color: #000000;*/
52 padding: 4px;
53 border: 1px solid black;
54 background-image: url("../img/black20.png");
55 margin: 4px 0px;
56}
57.highlight .hll { background-color: #ffffcc }
58/*.highlight { background: #f0f0f0; }*/
59.highlight .c { color: #60a0b0; font-style: italic } /* Comment */
60.highlight .err { border: 1px solid #FF0000 } /* Error */
61.highlight .k { color: #007020; font-weight: bold } /* Keyword */
62.highlight .o { color: #998 } /* Operator */
63.highlight .cm { color: #60a0b0; font-style: italic } /* Comment.Multiline */
64.highlight .cp { color: #007020 } /* Comment.Preproc */
65.highlight .c1 { color: #60a0b0; font-style: italic } /* Comment.Single */
66.highlight .cs { color: #60a0b0; background-color: #fff0f0 } /* Comment.Special */
67.highlight .gd { color: #A00000 } /* Generic.Deleted */
68.highlight .ge { font-style: italic } /* Generic.Emph */
69.highlight .gr { color: #FF0000 } /* Generic.Error */
70.highlight .gh { color: #000080; font-weight: bold } /* Generic.Heading */
71.highlight .gi { color: #00A000 } /* Generic.Inserted */
72.highlight .go { color: #808080 } /* Generic.Output */
73.highlight .gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
74.highlight .gs { font-weight: bold } /* Generic.Strong */
75.highlight .gu { color: #800080; font-weight: bold } /* Generic.Subheading */
76.highlight .gt { color: #0040D0 } /* Generic.Traceback */
77.highlight .kc { color: #007020; font-weight: bold } /* Keyword.Constant */
78.highlight .kd { color: #007020; font-weight: bold } /* Keyword.Declaration */
79.highlight .kn { color: #007020; font-weight: bold } /* Keyword.Namespace */
80.highlight .kp { color: #007020 } /* Keyword.Pseudo */
81.highlight .kr { color: #007020; font-weight: bold } /* Keyword.Reserved */
82.highlight .kt { color: #902000 } /* Keyword.Type */
83.highlight .m { color: #40a070 } /* Literal.Number */
84.highlight .s { color: #4070a0 } /* Literal.String */
85.highlight .na { color: #4070a0 } /* Name.Attribute */
86.highlight .nb { color: #007020 } /* Name.Builtin */
87.highlight .nc { color: #0e84b5; font-weight: bold } /* Name.Class */
88.highlight .no { color: #60add5 } /* Name.Constant */
89.highlight .nd { color: #555555; font-weight: bold } /* Name.Decorator */
90.highlight .ni { color: #d55537; font-weight: bold } /* Name.Entity */
91.highlight .ne { color: #007020 } /* Name.Exception */
92.highlight .nf { color: #aaaa00 } /* Name.Function */
93.highlight .nl { color: #002070; font-weight: bold } /* Name.Label */
94.highlight .nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
95.highlight .nt { color: #062873; font-weight: bold } /* Name.Tag */
96.highlight .nv { color: #bb60d5 } /* Name.Variable */
97.highlight .ow { color: #007020; font-weight: bold } /* Operator.Word */
98.highlight .w { color: #bbbbbb } /* Text.Whitespace */
99.highlight .mf { color: #40a070 } /* Literal.Number.Float */
100.highlight .mh { color: #40a070 } /* Literal.Number.Hex */
101.highlight .mi { color: #40a070 } /* Literal.Number.Integer */
102.highlight .mo { color: #40a070 } /* Literal.Number.Oct */
103.highlight .sb { color: #4070a0 } /* Literal.String.Backtick */
104.highlight .sc { color: #4070a0 } /* Literal.String.Char */
105.highlight .sd { color: #4070a0; font-style: italic } /* Literal.String.Doc */
106.highlight .s2 { color: #4070a0 } /* Literal.String.Double */
107.highlight .se { color: #4070a0; font-weight: bold } /* Literal.String.Escape */
108.highlight .sh { color: #4070a0 } /* Literal.String.Heredoc */
109.highlight .si { color: #70a0d0; font-style: italic } /* Literal.String.Interpol */
110.highlight .sx { color: #c65d09 } /* Literal.String.Other */
111.highlight .sr { color: #235388 } /* Literal.String.Regex */
112.highlight .s1 { color: #4070a0 } /* Literal.String.Single */
113.highlight .ss { color: #517918 } /* Literal.String.Symbol */
114.highlight .bp { color: #007020 } /* Name.Builtin.Pseudo */
115.highlight .vc { color: #bb60d5 } /* Name.Variable.Class */
116.highlight .vg { color: #bb60d5 } /* Name.Variable.Global */
117.highlight .vi { color: #bb60d5 } /* Name.Variable.Instance */
118.highlight .il { color: #40a070 } /* Literal.Number.Integer.Long */
1190
=== added directory 'media/documentation'
=== modified file 'settings.py'
--- settings.py 2018-05-07 06:32:56 +0000
+++ settings.py 2018-05-24 19:17:56 +0000
@@ -94,6 +94,7 @@
94 'wlggz',94 'wlggz',
95 'wlscheduling',95 'wlscheduling',
96 'check_input.apps.CheckInput',96 'check_input.apps.CheckInput',
97 'documentation',
97 'haystack', # search engine; see option HAYSTACK_CONNECTIONS98 'haystack', # search engine; see option HAYSTACK_CONNECTIONS
9899
99 # Modified 3rd party apps100 # Modified 3rd party apps
@@ -109,7 +110,6 @@
109 'dj_pagination',110 'dj_pagination',
110 'tagging',111 'tagging',
111 'djangoratings', # included as wlapp112 'djangoratings', # included as wlapp
112 'sphinxdoc', # included as wlapp
113]113]
114114
115MIDDLEWARE = [115MIDDLEWARE = [
116116
=== modified file 'sitemap_urls.py'
--- sitemap_urls.py 2016-12-13 18:28:51 +0000
+++ sitemap_urls.py 2018-05-24 19:17:56 +0000
@@ -7,12 +7,10 @@
7from news.sitemap import *7from news.sitemap import *
8from pybb.sitemap import *8from pybb.sitemap import *
9from wlhelp.sitemap import *9from wlhelp.sitemap import *
10from sphinxdoc.sitemap import *
1110
1211
13sitemaps = {12sitemaps = {
14 'static': StaticViewSitemap,13 'static': StaticViewSitemap,
15 'docs': DocumentationSitemap,
16 'news': NewsSitemap,14 'news': NewsSitemap,
17 'wiki': WikiSitemap,15 'wiki': WikiSitemap,
18 'forum': ForumSitemap,16 'forum': ForumSitemap,
1917
=== removed directory 'sphinxdoc'
=== removed file 'sphinxdoc/__init__.py'
=== removed file 'sphinxdoc/admin.py'
--- sphinxdoc/admin.py 2016-12-13 18:28:51 +0000
+++ sphinxdoc/admin.py 1970-01-01 00:00:00 +0000
@@ -1,14 +0,0 @@
1# encoding: utf-8
2"""Admin interface for the sphinxdoc app."""
3
4from django.contrib import admin
5
6from sphinxdoc.models import App
7
8
9class AppAdmin(admin.ModelAdmin):
10 list_display = ('name', 'path',)
11 prepopulated_fields = {'slug': ('name',)}
12
13
14admin.site.register(App, AppAdmin)
150
=== removed directory 'sphinxdoc/migrations'
=== removed file 'sphinxdoc/migrations/0001_initial.py'
--- sphinxdoc/migrations/0001_initial.py 2016-12-13 18:28:51 +0000
+++ sphinxdoc/migrations/0001_initial.py 1970-01-01 00:00:00 +0000
@@ -1,24 +0,0 @@
1# -*- coding: utf-8 -*-
2from __future__ import unicode_literals
3
4from django.db import models, migrations
5
6
7class Migration(migrations.Migration):
8
9 dependencies = [
10 ]
11
12 operations = [
13 migrations.CreateModel(
14 name='App',
15 fields=[
16 ('id', models.AutoField(verbose_name='ID',
17 serialize=False, auto_created=True, primary_key=True)),
18 ('name', models.CharField(max_length=100)),
19 ('slug', models.SlugField(
20 help_text='Used in the URL for the app. Must be unique.', unique=True)),
21 ('path', models.CharField(max_length=255)),
22 ],
23 ),
24 ]
250
=== removed file 'sphinxdoc/migrations/__init__.py'
=== removed file 'sphinxdoc/models.py'
--- sphinxdoc/models.py 2018-04-08 16:23:55 +0000
+++ sphinxdoc/models.py 1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
1# encoding: utf-8
2"""
3Models for django-sphinxdoc.
4"""
5
6from django.db import models
7from django.urls import reverse
8
9
10class App(models.Model):
11 name = models.CharField(max_length=100)
12 slug = models.SlugField(unique=True,
13 help_text=u'Used in the URL for the app. Must be unique.')
14 path = models.CharField(max_length=255)
15
16 def __unicode__(self):
17 return self.name
18
19 def get_absolute_url(self):
20 return reverse('doc-index', kwargs={'slug': self.slug})
21
22 class Meta:
23 app_label = 'sphinxdoc'
240
=== removed file 'sphinxdoc/sitemap.py'
--- sphinxdoc/sitemap.py 2016-12-15 12:55:44 +0000
+++ sphinxdoc/sitemap.py 1970-01-01 00:00:00 +0000
@@ -1,26 +0,0 @@
1from django.contrib.sitemaps import Sitemap
2from sphinxdoc.models import App
3import datetime
4import os
5
6try:
7 app = App.objects.get(slug='wl')
8except:
9 pass
10
11
12class DocumentationSitemap(Sitemap):
13 """This is just a dummy class to return the link to docs/wl/genindex."""
14
15 changefreq = 'yearly'
16 priority = 0.5
17
18 def items(self):
19 return ['']
20
21 def location(self, item):
22 return '/docs/wl/genindex/'
23
24 def lastmod(self, item):
25 return datetime.datetime.fromtimestamp(
26 os.path.getmtime(os.path.join(app.path, 'last_build')))
270
=== removed file 'sphinxdoc/urls.py'
--- sphinxdoc/urls.py 2016-11-07 13:26:04 +0000
+++ sphinxdoc/urls.py 1970-01-01 00:00:00 +0000
@@ -1,28 +0,0 @@
1# encoding: utf-8
2
3from django.conf.urls import *
4from django.views.generic.list import ListView
5from sphinxdoc import views
6from sphinxdoc import models
7
8app_info = {
9 'queryset': models.App.objects.all().order_by('name'),
10 'template_object_name': 'app',
11}
12
13
14urlpatterns = [
15 url(r'^$', ListView.as_view(), app_info,),
16 url(r'^(?P<slug>[\w-]+)/search/$',
17 views.search, name='doc-search', ),
18 url(r'^(?P<slug>[\w-]+)/_images/(?P<path>.*)$',
19 views.images, ),
20 url(r'^(?P<slug>[\w-]+)/_source/(?P<path>.*)$',
21 views.source, ),
22 url(r'^(?P<slug>[\w-]+)/_objects/$',
23 views.objects_inventory, name='objects-inv', ),
24 url(r'^(?P<slug>[\w-]+)/$',
25 views.documentation, {'url': ''}, name='doc-index', ),
26 url(r'^(?P<slug>[\w-]+)/(?P<url>(([\w-]+)/)+)$',
27 views.documentation, name='doc-detail', ),
28]
290
=== removed file 'sphinxdoc/views.py'
--- sphinxdoc/views.py 2018-04-07 15:35:47 +0000
+++ sphinxdoc/views.py 1970-01-01 00:00:00 +0000
@@ -1,89 +0,0 @@
1# encoding: utf-8
2
3import datetime
4import os.path
5
6from django.http import Http404
7from django.shortcuts import get_object_or_404, render
8#from django.template import RequestContext
9import json
10from django.views import static
11
12from sphinxdoc.models import App
13
14
15SPECIAL_TITLES = {
16 'genindex': 'General Index',
17 'py-modindex': 'Module Index',
18 'search': 'Search',
19}
20
21
22def documentation(request, slug, url):
23 app = get_object_or_404(App, slug=slug)
24 url = url.strip('/')
25 page_name = os.path.basename(url)
26
27 path = os.path.join(app.path, url, 'index.fjson')
28 if not os.path.exists(path):
29 path = os.path.dirname(path) + '.fjson'
30 if not os.path.exists(path):
31 raise Http404('"%s" does not exist' % path)
32
33 templates = (
34 'sphinxdoc/%s.html' % page_name,
35 'sphinxdoc/documentation.html',
36 )
37
38 data = {
39 'app': app,
40 'doc': json.load(open(path, 'rb')),
41 'env': json.load(open(
42 os.path.join(app.path, 'globalcontext.json'), 'rb')),
43 'version': app.name,
44 'docurl': url,
45 'update_date': datetime.datetime.fromtimestamp(
46 os.path.getmtime(os.path.join(app.path, 'last_build'))),
47 'home': app.get_absolute_url(),
48 # 'search': urlresolvers.reverse('document-search', kwargs={'lang':lang, 'version':version}),
49 'redirect_from': request.GET.get('from', None),
50
51 }
52 if 'title' not in data['doc']:
53 data['doc']['title'] = SPECIAL_TITLES[page_name]
54
55 return render(request, templates, data)
56
57
58def search(request, slug):
59 from django.http import HttpResponse
60 return HttpResponse('Not yet implemented.')
61
62
63def objects_inventory(request, slug):
64 app = get_object_or_404(App, slug=slug)
65 response = static.serve(
66 request,
67 document_root=app.path,
68 path='objects.inv',
69 )
70 response['Content-Type'] = 'text/plain'
71 return response
72
73
74def images(request, slug, path):
75 app = get_object_or_404(App, slug=slug)
76 return static.serve(
77 request,
78 document_root=os.path.join(app.path, '_images'),
79 path=path,
80 )
81
82
83def source(request, slug, path):
84 app = get_object_or_404(App, slug=slug)
85 return static.serve(
86 request,
87 document_root=os.path.join(app.path, '_sources'),
88 path=path,
89 )
900
=== modified file 'templates/navigation.html'
--- templates/navigation.html 2018-02-17 11:22:34 +0000
+++ templates/navigation.html 2018-05-24 19:17:56 +0000
@@ -50,7 +50,7 @@
50 <ul>50 <ul>
51 <li><a href="{% url 'wiki_article' "Contribute" %}">Contribute</a></li>51 <li><a href="{% url 'wiki_article' "Contribute" %}">Contribute</a></li>
52 <li><a href="{% url 'developers' %}">Widelands Development Team</a></li>52 <li><a href="{% url 'developers' %}">Widelands Development Team</a></li>
53 <li><a href="/docs/wl/" target="_blank">Documentation</a></li>53 <li><a href="documentation/index.html" target="_blank">Documentation</a></li>
54 <li><a href="https://bugs.launchpad.net/widelands" target="_blank">Widelands Bugtracker</a></li>54 <li><a href="https://bugs.launchpad.net/widelands" target="_blank">Widelands Bugtracker</a></li>
55 <li><a href="https://bugs.launchpad.net/widelands-website" target="_blank">Website Bugtracker</a></li>55 <li><a href="https://bugs.launchpad.net/widelands-website" target="_blank">Website Bugtracker</a></li>
56 </ul>56 </ul>
5757
=== removed directory 'templates/sphinxdoc'
=== removed file 'templates/sphinxdoc/app_list.html'
--- templates/sphinxdoc/app_list.html 2012-05-16 22:31:25 +0000
+++ templates/sphinxdoc/app_list.html 1970-01-01 00:00:00 +0000
@@ -1,18 +0,0 @@
1{% extends 'sphinxdoc/base.html' %}
2
3{% block title %}Overview - {{ block.super }}{% endblock %}
4
5{% block content %}
6<h1>Documentation Overview</h1>
7<div class="blogEntry">
8 <a href="/docs/">Documentation</a>
9
10 <br />
11
12 <ul>
13 {% for app in app_list %}
14 <li><a href="{{ app.get_absolute_url }}">{{ app.name }}</a></li>
15 {% endfor %}
16 </ul>
17</div>
18{% endblock content %}
190
=== removed file 'templates/sphinxdoc/base.html'
--- templates/sphinxdoc/base.html 2017-07-04 06:40:29 +0000
+++ templates/sphinxdoc/base.html 1970-01-01 00:00:00 +0000
@@ -1,17 +0,0 @@
1{% extends "base.html" %}
2
3{% block title %}
4Documentation - {{ block.super }}
5{% endblock %}
6
7{% block extra_head %}
8<link rel="stylesheet" type="text/css" media="all" href="{{ MEDIA_URL }}css/documentation.css" />
9
10{# using mathjax for formulas #}
11<script type="text/javascript" async
12 src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-MML-AM_CHTML">
13</script>
14
15{{ block.super}}
16{% endblock %}
17
180
=== removed file 'templates/sphinxdoc/documentation.html'
--- templates/sphinxdoc/documentation.html 2016-11-07 13:26:04 +0000
+++ templates/sphinxdoc/documentation.html 1970-01-01 00:00:00 +0000
@@ -1,57 +0,0 @@
1{% extends 'sphinxdoc/base.html' %}
2
3{% block title %}
4{{ app.name }} - {{ block.super }}
5{% endblock %}
6
7{% block content %}
8<h1>Documentation: {{ app.name }}</h1>
9<div class="blogEntry">
10 <a href="{{ app.get_absolute_url }}">{{ app.name }}</a>
11 {% for p in doc.parents %}
12 » <a href="{{ p.link }}">{{ p.title|safe }}</a>
13 {% endfor %}
14 » {{ doc.title|safe }}
15 {% if doc.prev or doc.next %}
16 <br /><br />
17 <div class="posLeft">
18 {% if doc.prev %}
19 Prev: <a href="{{ doc.prev.link }}">{{ doc.prev.title|safe }}</a>
20 {% endif %}
21 </div>
22 <div class="posRight">
23 {% if doc.next %}
24 Next: <a href="{{ doc.next.link }}">{{ doc.next.title|safe }}</a>
25 {% endif %}
26 </div>
27 {% endif %}
28
29 <br /><br />
30
31 <div class="sphinx">
32 {% block doc_body %}
33 {{ doc.body|safe }}
34 {% endblock %}
35 </div>
36
37 <br />
38
39 <div class="pagination-bottom">
40 {% if doc.prev or doc.next %}
41 <div class="posLeft">
42 {% if doc.prev %}
43 Prev: <a href="{{ doc.prev.link }}">{{ doc.prev.title|safe }}</a>
44 {% endif %}
45 </div>
46 <div class="posRight">
47 {% if doc.next %}
48 Next: <a href="{{ doc.next.link }}">{{ doc.next.title|safe }}</a>
49 {% endif %}
50 </div>
51 <br />
52 {% endif %}
53 <hr />
54 <span class="small">Last update: {{ update_date|date:"Y-m-d H:i" }} (<a href="http://www.timeanddate.com/worldclock/city.html?n=37">CET</a>)</span>
55 </div>
56</div>
57{% endblock content %}
580
=== removed file 'templates/sphinxdoc/genindex.html'
--- templates/sphinxdoc/genindex.html 2016-08-07 18:35:30 +0000
+++ templates/sphinxdoc/genindex.html 1970-01-01 00:00:00 +0000
@@ -1,38 +0,0 @@
1{% extends 'sphinxdoc/documentation.html' %}
2
3{% block doc_body %}
4 <h1>General Index</h1>
5 <p class="indexletters">
6 {% for letter, _ in doc.genindexentries %}
7 <a href="#{{ letter }}">{{ letter }}</a> {% if not forloop.last %} •{% endif %}
8 {% endfor %}
9 </p>
10
11 {% for letter, entries in doc.genindexentries %}
12 <br />
13 <h2 id="{{ letter }}">{{ letter }}</h2>
14 <dl class="index">
15 {% for name, contents in entries %}
16 <dt>
17 {# contents.0 is a list of links for the item #}
18 {% if contents.0 %}
19 <a href="{{ contents.0.0.1 }}">{{ name }}</a>
20 {% else %}
21 {{ name }}
22 {% endif %}
23 </dt>
24 {# contents.1 is a list of subitems #}
25 {% if contents.1 %}
26 {% for subname, sublinks in contents.1 %}
27 <dd>
28 <a href="{{ sublinks.0.1 }}">{{ subname }}</a>
29 {% for link in sublinks|slice:"1:" %}, <a href="{{ link }}">[Link]</a>{% endfor %}
30 </dd>
31 {% endfor %}
32 {% endif %}
33 {% endfor %}
34 </dl>
35 {% endfor %}
36 <br />
37{% endblock doc_body %}
38{% block doc_toc %}{% endblock %}
390
=== removed file 'templates/sphinxdoc/py-modindex.html'
--- templates/sphinxdoc/py-modindex.html 2018-05-02 18:02:12 +0000
+++ templates/sphinxdoc/py-modindex.html 1970-01-01 00:00:00 +0000
@@ -1,23 +0,0 @@
1{% extends 'sphinxdoc/documentation.html' %}
2
3{% block doc_body %}
4 <h1>Module Index</h1>
5 <dl>
6 {% for c in doc.content %}
7 {% for modul, level, fname, mainmod, unknown1, unknown2, descr in c.1 %}
8 {% if level < 2 %}
9 <dt><a href="../{{ fname }}">{{ modul }}</a></dt>
10 <dd>{{ descr }}
11 {% else %}
12 <dl>
13 <dt><a href="../{{ fname }}">{{ modul }}</a></dt>
14 <dd>{{ descr }}</dd>
15 </dl>
16 {% endif %}
17 {% endfor %}
18 </dd>
19 {% endfor %}
20 </dl>
21 <br />
22{% endblock doc_body %}
23{% block doc_toc %}{% endblock %}
240
=== modified file 'urls.py'
--- urls.py 2018-04-18 12:04:12 +0000
+++ urls.py 2018-05-24 19:17:56 +0000
@@ -38,9 +38,9 @@
3838
39 url(r'^threadedcomments/', include('threadedcomments.urls')),39 url(r'^threadedcomments/', include('threadedcomments.urls')),
4040
41 # Redirect old urls to docs to docs/wl41 # Redirect old urls to new documentation
42 url(r'^docs/$', RedirectView.as_view(url='/docs/wl', permanent=True), name='docs'),42 url(r'^docs/wl/(?P<path>.*)', RedirectView.as_view(url='/documentation/%(path)s', permanent=True), name='docs_wl'),
43 url(r'^docs/', include('sphinxdoc.urls')),43 url(r'^docs/$', RedirectView.as_view(url='/documentation/index.html', permanent=True), name='docs'),
4444
45 # 3rd party, modified for widelands45 # 3rd party, modified for widelands
46 url(r'^wiki/', include('wiki.urls')),46 url(r'^wiki/', include('wiki.urls')),

Subscribers

People subscribed via source and target branches