Commit 5d9dfcd8 by Tom Christie

Code highlighting in docs

parent 382b277d
......@@ -10,6 +10,9 @@ body {
padding-bottom: 40px;
}
pre {
font-size: 12px;
}
/* Preserve the spacing of the navbar across different screen sizes. */
......
.com { color: #93a1a1; }
.lit { color: #195f91; }
.pun, .opn, .clo { color: #93a1a1; }
.fun { color: #dc322f; }
.str, .atv { color: #D14; }
.kwd, .prettyprint .tag { color: #1e347b; }
.typ, .atn, .dec, .var { color: teal; }
.pln { color: #48484c; }
.prettyprint {
padding: 8px;
background-color: #f7f7f9;
border: 1px solid #e1e1e8;
}
.prettyprint.linenums {
-webkit-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
-moz-box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
box-shadow: inset 40px 0 0 #fbfbfc, inset 41px 0 0 #ececf0;
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin: 0 0 0 33px; /* IE indents via margin-left */
}
ol.linenums li {
padding-left: 12px;
color: #bebec5;
line-height: 20px;
text-shadow: 0 1px 0 #fff;
}
\ No newline at end of file
......@@ -7,6 +7,7 @@
<meta name="author" content="">
<!-- Le styles -->
<link href="{{ base_url }}/css/prettify.css" rel="stylesheet">
<link href="{{ base_url }}/css/bootstrap.css" rel="stylesheet">
<link href="{{ base_url }}/css/bootstrap-responsive.css" rel="stylesheet">
<link href="{{ base_url }}/css/drf-styles.css" rel="stylesheet">
......@@ -15,7 +16,7 @@
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<body>
<body onload="prettyPrint()">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
......@@ -102,6 +103,7 @@
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="{{ base_url }}/js/jquery-1.8.1-min.js"></script>
<script src="{{ base_url }}/js/prettify.js"></script>
<script src="{{ base_url }}/js/bootstrap-dropdown.js"></script>
<script src="{{ base_url }}/js/bootstrap-scrollspy.js"></script>
<script src="{{ base_url }}/js/bootstrap-collapse.js"></script>
......
......@@ -8,6 +8,7 @@ This tutorial will walk you through the building blocks that make up REST framew
Before we do anything else we'll create a new virtual environment, using [virtualenv]. This will make sure our package configuration is keep nicely isolated from any other projects we're working on.
:::bash
mkdir ~/env
virtualenv --no-site-packages ~/env/tutorial
source ~/env/tutorial/bin/activate
......
......@@ -66,4 +66,6 @@ for (dirpath, dirnames, filenames) in os.walk(docs_dir):
os.makedirs(build_dir)
output = page.replace('{{ content }}', content).replace('{{ toc }}', toc).replace('{{ base_url }}', base_url).replace('{{ suffix }}', suffix).replace('{{ index }}', index)
output = re.sub(r'a href="([^"]*)\.md"', r'a href="\1%s"' % suffix, output)
output = re.sub(r'<pre><code>:::bash', r'<pre class="prettyprint lang-bsh">', output)
output = re.sub(r'<pre>', r'<pre class="prettyprint lang-py">', output)
open(build_file, 'w').write(output.encode('utf-8'))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment