From fc8f3adfc06e15ace1e1287d51099c01fe10a9c4 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 20 Jan 2014 17:54:59 +0000 Subject: [PATCH] Readthedocs theme and other hotness --- mkdocs.yaml | 2 +- mkdocs/__init__.pyc | Bin 345 -> 0 bytes mkdocs/config.py | 5 - mkdocs/config.pyc | Bin 1496 -> 0 bytes mkdocs/mkdocs | 24 +- mkdocs/serve.py | 19 ++ mkdocs/serve.pyc | Bin 4117 -> 0 bytes mkdocs/themes/bootstrap/css/base.css | 56 +---- mkdocs/themes/bootstrap/toc.html | 2 +- mkdocs/themes/plain/base.html | 38 ---- mkdocs/themes/plain/content.html | 9 - mkdocs/themes/plain/css/base.css | 101 --------- .../themes/plain/css/bootstrap-3.0.3.min.css | 7 - mkdocs/themes/plain/css/prettify-1.0.css | 28 --- mkdocs/themes/plain/js/base.js | 52 ----- mkdocs/themes/plain/js/bootstrap-3.0.3.min.js | 7 - mkdocs/themes/plain/js/prettify-1.0.min.js | 28 --- mkdocs/themes/plain/nav.html | 51 ----- mkdocs/themes/plain/toc.html | 10 - mkdocs/themes/readthedocs/base.html | 43 +--- mkdocs/themes/readthedocs/footer.html | 1 + mkdocs/themes/readthedocs/layout_old.html | 205 ------------------ mkdocs/themes/readthedocs/toc.html | 8 + mkdocs/themes/readthedocs/versions.html | 37 ---- mkdocs/utils.pyc | Bin 1575 -> 0 bytes 25 files changed, 49 insertions(+), 684 deletions(-) delete mode 100644 mkdocs/__init__.pyc delete mode 100644 mkdocs/config.pyc delete mode 100644 mkdocs/serve.pyc delete mode 100644 mkdocs/themes/plain/base.html delete mode 100644 mkdocs/themes/plain/content.html delete mode 100644 mkdocs/themes/plain/css/base.css delete mode 100644 mkdocs/themes/plain/css/bootstrap-3.0.3.min.css delete mode 100644 mkdocs/themes/plain/css/prettify-1.0.css delete mode 100644 mkdocs/themes/plain/js/base.js delete mode 100644 mkdocs/themes/plain/js/bootstrap-3.0.3.min.js delete mode 100644 mkdocs/themes/plain/js/prettify-1.0.min.js delete mode 100644 mkdocs/themes/plain/nav.html delete mode 100644 mkdocs/themes/plain/toc.html delete mode 100644 mkdocs/themes/readthedocs/layout_old.html create mode 100644 mkdocs/themes/readthedocs/toc.html delete mode 100644 mkdocs/themes/readthedocs/versions.html delete mode 100644 mkdocs/utils.pyc 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 9c0c890c242ddf37fcde17dc0e35c033080394d4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 345 zcmYk1!A`?442GR%9SE4jWAxO5xS?s{1}6?hT*|>>O#q9eL3KKb_u-{@jy(W4?ND(N zJ6~e^m-T*i^7Zsxw{Wmb;*A`>7H4EDZ~$IGqd+Cjz-8byG6P z#MS&dHK|9Tf5~I7It>()9^%gSOrb+81Yvf3C0IR5K36gL_N^z5WUE_>cf+=twEqGk bbrccHkI#54b!#8Y;Or);bDH{G$;y5K{W(ji 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 5bf1686d37a8cec5e8a66397a81392250ee5aab9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1496 zcmbtUTW{1x6h33`J-Z13L6ave6_k~bc9TA&2q6Rl0+p&%GVl^1S&nB&ym&p9XO@e! zc_Dr8KkIv6`X~4S^gGA9G%tOsy`FQOGw1TnhF?d6zu*29XS8}k(8u^(g+=41s31D| z&MP`ml=oS$13F|9g0x7tK{}+nAU)E3kOAop5V#CMMx;0C(1fJ7=`aPhN zHuJB>*Kuh64bQP3f~{&hGnr4ybZ&f`73rCA9t`;&mebUkWKkE5tw{4yIDc;7--3g- znG;WD5}ns#KV9U7_I(b(oakASeJr_6NC!XtJlV&4@ZkRb{(ck1d`MEQYrg?|VY9SI z-sOdHj^+7#K4kJaoflaExr?uZ?07uMg1tJ$ST4Tm=EXd+uQ^zdl`d~V}>teoYf=6fS4@QjV-dBy05jEas55|&p z0_Q6A=W>Wt=RCvoiNkiE+wyr`+gjWhg2EIw)xy}yl;ZvD`O%X%zrIeM{&sxy%L}n( zw)!kV7nM%E0mOj0yp}u1mn;#CCy6-EEbbVWd1id}QHyhJsv^yrjhvw~6~HVmV-6-) zhs&0btg#g*?Bp6PkbZ($V2%=a#d7^sn!QJx`9?Nf|(<{aCy`I|aQ3uodTHgbOdCi;J}?IF^`xz&rpJmU5`jz3hx OFjQTB1H27YgVsL+e?rs% 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 bd068a21b0752e8bbf5baceb8a49effddda9bc5b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4117 zcmb_f?QR>#6}_{hDC#S6lSVOPqu3^JL7;}z7WvV-K^w$MEEI^6E*%sl5-e8Sp|}*e zOYaOV3!r{EX!{O*gFZkXq3_V&eS|(hd(It^a-7ybyNH<#@->8~x@E$O$G?RDv| zFWYVDw~P--tXH`D1@m@-?xWI@(%|Zb`l_wk6|jooKHnb|_4~A>Tm6 zUABAOO^9Cn2fuEFmT#f5Pi^U)-$1iEakhSHYj^B_fb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k^09SG z7Hx(Z@V~&DFuNi7Hm5L-!M#UE3xw6S3PHhlR;@RJU^@s1I@o=QN=c^Yv)U_zy(av;NQ%s#> z2=43H+_lnWmyL%I&elX+S49?ATJc;x-;!NI{j_u!s8 zIPR)=)GK5Oss)ew{OU_aA>alh%fv4E1!e-f5^0($_Nu{|^}*!{t(q{H6Q;_zUqI2N z_f%EknBv2Quu~s9U(J%AU`ju#)E*(z<#J6uQ>0h?Y*O!pyes6Ss|kv_{OAgAr(N{; z5i%rg%qoaVwhs~Uk_&ER{a^#a{6n7mBUIAbHhkX2bIWW-oyOh9U2`YeHJf<4%!kyL z=b0aj^6E6)k8NcD 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 4fb20741f23fb75cd5ad15f1d0e686645933e980..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1575 zcmbtUOHUL*5U!qGaCd>I#Q2DpzOe`0^6pYOASHp=yZZt%(0DeB@<_X)u41!SMt-V&p^Ms=wHNW3&Z4=^_qD4l zqoe#tmr-SMuM=CD*cX*GPMbsP{7Bqw5ASfU9HVf)i-nzfR>C5WGUJ!Qi-q$&u<&oN z@2%ge zC*y3M6tO#7IIbI&N4^guj=lH8riSx&oF#SF)w;T;uGVH7n>VZtDv64m25pg0LxnEc zk-v7I;a4F2R#|U!T;!f{zg>B}g4ctlNFi7XSrKx%LdH7eiV6HhiD=xD2OPdB1f$XB z5i%$tV|81+xq1>q0KX6EGT@vbf1I8S!v`=6z=>NQC_Xtk*J2h{xA-XvVPcAq_LT(ONNXyR*ZWq;g6_>YIuKHslxV#aY%nd@9#I(WsW z1;TuH;6md6amc9|>apsn3)%4xgq(YLm&pT=MSS6Ic31S^=uK86b!y&ne@gsSwc6