diff --git a/mkdocs.yaml b/mkdocs.yaml index b0939e74..5e43e483 100644 --- a/mkdocs.yaml +++ b/mkdocs.yaml @@ -10,4 +10,4 @@ pages: - ['topics/django-extra-views-compatibility.md', 'Topics / Django Extra Views Compatilibity'] - ['topics/release-notes.md', 'Topics / Release Notes'] -theme: 'spacelab' +theme: 'bootstrap' diff --git a/mkdocs/__init__.pyc b/mkdocs/__init__.pyc deleted file mode 100644 index 9c0c890c..00000000 Binary files a/mkdocs/__init__.pyc and /dev/null differ diff --git a/mkdocs/config.py b/mkdocs/config.py index 3cef967c..6e7cc61f 100644 --- a/mkdocs/config.py +++ b/mkdocs/config.py @@ -41,9 +41,4 @@ def load_config(filename='mkdocs.yaml', options=None): build_path = build_dir.replace(os.path.pathsep, '/') config['base_url'] = 'file://%s' % build_path - # Note that --serve may only be specified as a command line option, - # and not as a config file setting. - if options.get('serve'): - config['base_url'] = 'http://%s' % config['dev_addr'] - return config diff --git a/mkdocs/config.pyc b/mkdocs/config.pyc deleted file mode 100644 index 5bf1686d..00000000 Binary files a/mkdocs/config.pyc and /dev/null differ diff --git a/mkdocs/mkdocs b/mkdocs/mkdocs index 707368de..a3944d55 100755 --- a/mkdocs/mkdocs +++ b/mkdocs/mkdocs @@ -4,7 +4,6 @@ import mkdocs import shutil import sys -import tempfile def arg_to_option(arg): @@ -17,22 +16,21 @@ def arg_to_option(arg): return (arg, True) -def main(options=None): +def main(cmd, options=None): """ Build the documentation, and optionally start the devserver. """ - if 'serve' in options: - tempdir = tempfile.mkdtemp() - options['build_dir'] = tempdir - - config = mkdocs.load_config(options=options) - mkdocs.build(config) - - if 'serve' in options: + if cmd == 'serve': + config = mkdocs.load_config(options=options) mkdocs.serve(config, options=options) - shutil.rmtree(tempdir) + elif cmd == 'build': + config = mkdocs.load_config(options=options) + mkdocs.build(config) + else: + print 'mkdocs [build|serve] {options}' if __name__ == '__main__': - args = [arg_to_option(arg) for arg in sys.argv[1:] if arg.startswith('--')] - main(options=dict(args)) + cmd = sys.argv[1] if len(sys.argv) >= 2 else None + args = [arg_to_option(arg) for arg in sys.argv[2:] if arg.startswith('--')] + main(cmd, options=dict(args)) diff --git a/mkdocs/serve.py b/mkdocs/serve.py index 2c7adfcb..d8443d52 100644 --- a/mkdocs/serve.py +++ b/mkdocs/serve.py @@ -6,6 +6,8 @@ import os import posixpath import SimpleHTTPServer import SocketServer +import sys +import tempfile import urllib @@ -56,11 +58,25 @@ class FixedDirectoryHandler(SimpleHTTPServer.SimpleHTTPRequestHandler): path = os.path.join(path, word) return path + def log_message(self, format, *args): + sys.stderr.write("[%s] %s\n" % + (self.log_date_time_string(), + format%args)) + def serve(config, options=None): """ Start the devserver, and rebuild the docs whenever any changes take effect. """ + # Create a temporary build directory, and set some options to serve it + tempdir = tempfile.mkdtemp() + options['build_dir'] = tempdir + options['base_url'] = 'http://%s' % config['dev_addr'] + + # Perform the initial build + config = mkdocs.load_config(options=options) + mkdocs.build(config) + # Note: We pass any command-line options through so that we # can re-apply them if the config file is reloaded. event_handler = BuildEventHandler(options) @@ -82,5 +98,8 @@ def serve(config, options=None): print "Running at: http://%s:%s/" % (host, port) server.serve_forever() + + # Clean up observer.stop() observer.join() + shutil.rmtree(tempdir) diff --git a/mkdocs/serve.pyc b/mkdocs/serve.pyc deleted file mode 100644 index bd068a21..00000000 Binary files a/mkdocs/serve.pyc and /dev/null differ diff --git a/mkdocs/themes/bootstrap/css/base.css b/mkdocs/themes/bootstrap/css/base.css index 6ce6e78b..1ff2bbd6 100644 --- a/mkdocs/themes/bootstrap/css/base.css +++ b/mkdocs/themes/bootstrap/css/base.css @@ -14,49 +14,6 @@ div.source-links { float: right; } -div.navbar a.navbar-brand, -div.navbar a.navbar-brand:hover, -div.navbar a.navbar-brand:focus { - color: #fff; -} - -/* - * Main navigation - * - * Turn the `.navbar` at the top of the docs purple. - */ - -.navbar { - text-shadow: 0 -1px 0 rgba(0,0,0,.15); - background-color: #563d7c; - border-color: #463265; - box-shadow: 0 1px 0 rgba(255,255,255,.1); -} -.navbar .navbar-collapse { - border-color: #463265; -} -.navbar .navbar-brand { - color: #fff; -} -.navbar .navbar-nav > li > a { - color: #cdbfe3; -} -.navbar .navbar-nav > li > a:hover { - color: #fff; -} -.navbar .navbar-nav > .active > a, -.navbar .navbar-nav > .active > a:hover { - color: #fff; - background-color: #463265; -} -.navbar .navbar-toggle { - border-color: #563d7c; -} -.navbar .navbar-toggle:hover { - background-color: #463265; - border-color: #463265; -} - /* * Side navigation * @@ -69,36 +26,35 @@ div.navbar a.navbar-brand:focus { position: static; } +.bs-sidebar.well { + padding: 0; +} + /* First level of nav */ .bs-sidenav { margin-top: 30px; margin-bottom: 30px; padding-top: 10px; padding-bottom: 10px; - text-shadow: 0 1px 0 #fff; - background-color: #f7f5fa; border-radius: 5px; } /* All levels of nav */ .bs-sidebar .nav > li > a { display: block; - color: #716b7a; padding: 5px 20px; } .bs-sidebar .nav > li > a:hover, .bs-sidebar .nav > li > a:focus { text-decoration: none; - background-color: #e5e3e9; - border-right: 1px solid #dbd8e0; + border-right: 1px solid; } .bs-sidebar .nav > .active > a, .bs-sidebar .nav > .active:hover > a, .bs-sidebar .nav > .active:focus > a { font-weight: bold; - color: #563d7c; background-color: transparent; - border-right: 1px solid #563d7c; + border-right: 1px solid; } /* Nav: second level (shown on .active) */ diff --git a/mkdocs/themes/bootstrap/toc.html b/mkdocs/themes/bootstrap/toc.html index a9e7ff5b..bb8fdcd7 100644 --- a/mkdocs/themes/bootstrap/toc.html +++ b/mkdocs/themes/bootstrap/toc.html @@ -1,4 +1,4 @@ -   @@ -80,13 +43,12 @@ {{ project }} - {# PAGE CONTENT #}
{% include "breadcrumbs.html" %}
- {% block body %}{{ content }}{% endblock %} + {{ content }}
{% include "footer.html" %}
@@ -95,6 +57,5 @@
- {% include "versions.html" %} diff --git a/mkdocs/themes/readthedocs/footer.html b/mkdocs/themes/readthedocs/footer.html index aa4a22b5..5f1f8b57 100644 --- a/mkdocs/themes/readthedocs/footer.html +++ b/mkdocs/themes/readthedocs/footer.html @@ -14,6 +14,7 @@

+

diff --git a/mkdocs/themes/readthedocs/layout_old.html b/mkdocs/themes/readthedocs/layout_old.html deleted file mode 100644 index deb8df2a..00000000 --- a/mkdocs/themes/readthedocs/layout_old.html +++ /dev/null @@ -1,205 +0,0 @@ -{# - basic/layout.html - ~~~~~~~~~~~~~~~~~ - - Master layout template for Sphinx themes. - - :copyright: Copyright 2007-2013 by the Sphinx team, see AUTHORS. - :license: BSD, see LICENSE for details. -#} -{%- block doctype -%} - -{%- endblock %} -{%- set reldelim1 = reldelim1 is not defined and ' »' or reldelim1 %} -{%- set reldelim2 = reldelim2 is not defined and ' |' or reldelim2 %} -{%- set render_sidebar = (not embedded) and (not theme_nosidebar|tobool) and - (sidebars != []) %} -{%- set url_root = pathto('', 1) %} -{# XXX necessary? #} -{%- if url_root == '#' %}{% set url_root = '' %}{% endif %} -{%- if not embedded and docstitle %} - {%- set titlesuffix = " — "|safe + docstitle|e %} -{%- else %} - {%- set titlesuffix = "" %} -{%- endif %} - -{%- macro relbar() %} - -{%- endmacro %} - -{%- macro sidebar() %} - {%- if render_sidebar %} -
-
- {%- block sidebarlogo %} - {%- if logo %} - - {%- endif %} - {%- endblock %} - {%- if sidebars != None %} - {#- new style sidebar: explicitly include/exclude templates #} - {%- for sidebartemplate in sidebars %} - {%- include sidebartemplate %} - {%- endfor %} - {%- else %} - {#- old style sidebars: using blocks -- should be deprecated #} - {%- block sidebartoc %} - {%- include "localtoc.html" %} - {%- endblock %} - {%- block sidebarrel %} - {%- include "relations.html" %} - {%- endblock %} - {%- block sidebarsourcelink %} - {%- include "sourcelink.html" %} - {%- endblock %} - {%- if customsidebar %} - {%- include customsidebar %} - {%- endif %} - {%- block sidebarsearch %} - {%- include "searchbox.html" %} - {%- endblock %} - {%- endif %} -
-
- {%- endif %} -{%- endmacro %} - -{%- macro script() %} - - {%- for scriptfile in script_files %} - - {%- endfor %} -{%- endmacro %} - -{%- macro css() %} - - - {%- for cssfile in css_files %} - - {%- endfor %} -{%- endmacro %} - - - - - {{ metatags }} - {%- block htmltitle %} - {{ title|striptags|e }}{{ titlesuffix }} - {%- endblock %} - {{ css() }} - {%- if not embedded %} - {{ script() }} - {%- if use_opensearch %} - - {%- endif %} - {%- if favicon %} - - {%- endif %} - {%- endif %} -{%- block linktags %} - {%- if hasdoc('about') %} - - {%- endif %} - {%- if hasdoc('genindex') %} - - {%- endif %} - {%- if hasdoc('search') %} - - {%- endif %} - {%- if hasdoc('copyright') %} - - {%- endif %} - - {%- if parents %} - - {%- endif %} - {%- if next %} - - {%- endif %} - {%- if prev %} - - {%- endif %} -{%- endblock %} -{%- block extrahead %} {% endblock %} - - -{%- block header %}{% endblock %} - -{%- block relbar1 %}{{ relbar() }}{% endblock %} - -{%- block content %} - {%- block sidebar1 %} {# possible location for sidebar #} {% endblock %} - -
- {%- block document %} -
- {%- if render_sidebar %} -
- {%- endif %} -
- {% block body %} {% endblock %} -
- {%- if render_sidebar %} -
- {%- endif %} -
- {%- endblock %} - - {%- block sidebar2 %}{{ sidebar() }}{% endblock %} -
-
-{%- endblock %} - -{%- block relbar2 %}{{ relbar() }}{% endblock %} - -{%- block footer %} - -

asdf asdf asdf asdf 22

-{%- endblock %} - - - diff --git a/mkdocs/themes/readthedocs/toc.html b/mkdocs/themes/readthedocs/toc.html new file mode 100644 index 00000000..9445d6f2 --- /dev/null +++ b/mkdocs/themes/readthedocs/toc.html @@ -0,0 +1,8 @@ + diff --git a/mkdocs/themes/readthedocs/versions.html b/mkdocs/themes/readthedocs/versions.html deleted file mode 100644 index c131c9fc..00000000 --- a/mkdocs/themes/readthedocs/versions.html +++ /dev/null @@ -1,37 +0,0 @@ -{% if READTHEDOCS %} -{# Add rst-badge after rst-versions for small badge style. #} -
- - Read the Docs - v: {{ current_version }} - - -
-
-
Versions
- {% for slug, url in versions %} -
{{ slug }}
- {% endfor %} -
-
-
Downloads
- {% for type, url in downloads %} -
{{ type }}
- {% endfor %} -
-
-
On Read the Docs
-
- Project Home -
-
- Builds -
-
-
- Free document hosting provided by Read the Docs. - -
-
-{% endif %} - diff --git a/mkdocs/utils.pyc b/mkdocs/utils.pyc deleted file mode 100644 index 4fb20741..00000000 Binary files a/mkdocs/utils.pyc and /dev/null differ