Commits

Zachary Voase  committed 640451a

Added Pygments integration to the docs.

  • Participants
  • Parent commits 95db175

Comments (0)

Files changed (8)

File docs/_static/media/css/layout.css

 }
 
 pre, blockquote {
-	background-color: #bfbfbf;
+	background-color: #f6f6f6;
 	border: 1px solid #999;
 	border-left-width: 3px;
 	line-height: 1.5em;
 	padding: 0.5em;
 }
 
-blockquote {
-	font-style: italic;
-}
-
 blockquote p {
 	margin: 0;
 }

File docs/_static/media/css/pygments.css

+.hll { background-color: #ffffcc }
+.c { color: #808080 } /* Comment */
+.err { color: #F00000; background-color: #F0A0A0 } /* Error */
+.k { color: #008000; font-weight: bold } /* Keyword */
+.o { color: #303030 } /* Operator */
+.cm { color: #808080 } /* Comment.Multiline */
+.cp { color: #507090 } /* Comment.Preproc */
+.c1 { color: #808080 } /* Comment.Single */
+.cs { color: #cc0000; font-weight: bold } /* Comment.Special */
+.gd { color: #A00000 } /* Generic.Deleted */
+.ge { font-style: italic } /* Generic.Emph */
+.gr { color: #FF0000 } /* Generic.Error */
+.gh { color: #000080; font-weight: bold } /* Generic.Heading */
+.gi { color: #00A000 } /* Generic.Inserted */
+.go { color: #808080 } /* Generic.Output */
+.gp { color: #c65d09; font-weight: bold } /* Generic.Prompt */
+.gs { font-weight: bold } /* Generic.Strong */
+.gu { color: #800080; font-weight: bold } /* Generic.Subheading */
+.gt { color: #0040D0 } /* Generic.Traceback */
+.kc { color: #008000; font-weight: bold } /* Keyword.Constant */
+.kd { color: #008000; font-weight: bold } /* Keyword.Declaration */
+.kn { color: #008000; font-weight: bold } /* Keyword.Namespace */
+.kp { color: #003080; font-weight: bold } /* Keyword.Pseudo */
+.kr { color: #008000; font-weight: bold } /* Keyword.Reserved */
+.kt { color: #303090; font-weight: bold } /* Keyword.Type */
+.m { color: #6000E0; font-weight: bold } /* Literal.Number */
+.s { background-color: #fff0f0 } /* Literal.String */
+.na { color: #0000C0 } /* Name.Attribute */
+.nb { color: #007020 } /* Name.Builtin */
+.nc { color: #B00060; font-weight: bold } /* Name.Class */
+.no { color: #003060; font-weight: bold } /* Name.Constant */
+.nd { color: #505050; font-weight: bold } /* Name.Decorator */
+.ni { color: #800000; font-weight: bold } /* Name.Entity */
+.ne { color: #F00000; font-weight: bold } /* Name.Exception */
+.nf { color: #0060B0; font-weight: bold } /* Name.Function */
+.nl { color: #907000; font-weight: bold } /* Name.Label */
+.nn { color: #0e84b5; font-weight: bold } /* Name.Namespace */
+.nt { color: #007000 } /* Name.Tag */
+.nv { color: #906030 } /* Name.Variable */
+.ow { color: #000000; font-weight: bold } /* Operator.Word */
+.w { color: #bbbbbb } /* Text.Whitespace */
+.mf { color: #6000E0; font-weight: bold } /* Literal.Number.Float */
+.mh { color: #005080; font-weight: bold } /* Literal.Number.Hex */
+.mi { color: #0000D0; font-weight: bold } /* Literal.Number.Integer */
+.mo { color: #4000E0; font-weight: bold } /* Literal.Number.Oct */
+.sb { background-color: #fff0f0 } /* Literal.String.Backtick */
+.sc { color: #0040D0 } /* Literal.String.Char */
+.sd { color: #D04020 } /* Literal.String.Doc */
+.s2 { background-color: #fff0f0 } /* Literal.String.Double */
+.se { color: #606060; font-weight: bold; background-color: #fff0f0 } /* Literal.String.Escape */
+.sh { background-color: #fff0f0 } /* Literal.String.Heredoc */
+.si { background-color: #e0e0e0 } /* Literal.String.Interpol */
+.sx { color: #D02000; background-color: #fff0f0 } /* Literal.String.Other */
+.sr { color: #000000; background-color: #fff0ff } /* Literal.String.Regex */
+.s1 { background-color: #fff0f0 } /* Literal.String.Single */
+.ss { color: #A06000 } /* Literal.String.Symbol */
+.bp { color: #007020 } /* Name.Builtin.Pseudo */
+.vc { color: #306090 } /* Name.Variable.Class */
+.vg { color: #d07000; font-weight: bold } /* Name.Variable.Global */
+.vi { color: #3030B0 } /* Name.Variable.Instance */
+.il { color: #0000D0; font-weight: bold } /* Literal.Number.Integer.Long */

File docs/_static/media/css/typography.css

 	font-size: 11pt;
 }
 
-.quiet {
-	color: #555;
-	font-size: 0.8em;
-}
-
 h1 {
 	font-size: 2em;
 	font-weight: bold;
 	font-family: Inconsolata, Consolas, Menlo, Monaco, "Courier New", Courier;
 }
 
+blockquote {
+	color: #222;
+	font-style: italic;
+}
+
 pre {
-  font-size: 0.9em;
 	overflow-x: auto; /* Use horizontal scroller if needed; for Firefox 2, not needed in Firefox 3 */
 	white-space: pre-wrap; /* css-3 */
 	white-space: -moz-pre-wrap !important; /* Mozilla, since 1999 */

File docs/_templates/document.html

     
     {%- import "macros/html" as html -%}
     
+    {{ html.cssimport("http://yui.yahooapis.com/2.7.0/build/reset/reset-min.css") }}
     {{ html.cssimport("/media/css/layout.css") }}
     {{ html.cssimport("/media/css/typography.css") }}
+    {{ html.cssimport("/media/css/pygments.css") }}
   </head>
   
   <body>

File docs/etc-directory.md

 
 To create these configuration files in various deployments, the `generate_config` task has been defined in `project_dir/libs/templatecfg.py`. This takes a list of configured templates from the pavement options, and renders them out to a given `etcs/DEPLOYMENT` directory which you can then symlink `etc/` to. To do this, just run:
 
+    :::bash
     paver generate_config -d DEPLOYMENT_NAME
 
 You can also specify a `--force` option which will tell `generate_config` to overwrite any existing configuration files which exist at that location.

File docs/quickstart.md

 
 Begin by installing Paver on your machine:
 
+    :::bash
     easy_install Paver
 
 Then, create a directory to hold your site:
 
+    :::bash
     mkdir MyProj
     cd MyProj/
 
 Copy the Django-in-a-Box skeleton project to a sub-folder within this directory:
 
+    :::bash
     cp -R $DIAB_PROJECT/ ./myproj/
     cd myproj/
 
 Create and run the bootstrap script:
 
+    :::bash
     paver boostrap
     python start.py
 
 This will download all the required packages from PyPI, initialize a virtualenv and make the necessary directories throughout your project and site. Take a look through the `options` section of the `pavement.py` file in the project and make sure all the settings are correct, then run:
 
+    :::bash
     paver generate_config -d development
 
 To generate all the configuration files for a deployment called `development`. Now edit `etcs/development/lighttpd.conf`, and uncomment the lines with `server.bind` and `server.port` so that the server runs on localhost, port 8001 (otherwise you would need to run lighttpd as root).
 
 When you're happy with your configuration files, run:
 
+    :::bash
     ln -s `pwd`/etcs/development `pwd`/etc
 
 to make a symlink in the project directory from `etc` to the `etcs/development` directory. Run:
 
+    :::bash
     . ../bin/activate
     export DJANGO_SETTINGS_MODULE=myproj.settings.development
 
 to activate the virtualenv, and let Django know that you're using the `development` settings. Then run:
 
+    :::bash
     paver manage syncdb
 
 to create your SQLite database (which will be in `db/development.sqlite` under your site directory). You can now run:
 
+    :::bash
     paver manage runserver
 
 to run a development web server on port 8000, or run:
 
+    :::bash
     supervisord
 
 to start Supervisor, which will run an instance of lighttpd with five FastCGI worker processes on port 8001. To stop Supervisor, run:
 
-    supervisorctl
+    :::bash
+    supervisorctl shutdown
 
 You can also restart lighttpd with `supervisorctl restart lighttpd`, and you can restart the FastCGI processes with `supervisorctl restart django:*`. For more information, consult `supervisorctl --help`.

File docs/tools/jinja2.md

 
 In order to integrate more closely with Jinja2, Django-in-a-Box includes [DjanJinja][DjanJinja], a Django application which provides several shortcuts and wrappers to make using Jinja2 feel more native within Django. To get started straight away, write your templates using Jinja2, putting them in the same location as usual. To render them from within your views:
 
+    :::python
     from djanjinja.views import render_to_response
     
     def myview(request):

File docs/tools/supervisor.md

 
 The [Supervisor Manual][svd-manual] provides far better documentation than I can hope to provide here. I can, however, offer some good recipes for Django-in-a-Box:
 
+    :::bash
     # Start Supervisor
     $ supervisord
     
     # Shut down Supervisor
     $ supervisorctl shutdown
 
-If you ever run `supervisorctl` and receive an error message ending with something like:
+If you ever run `supervisorctl` and receive an error message ending with:
     
-    ...
     socket.error: [Errno 61] Connection refused
 
 That's usually a signal that Supervisor is not running. Check the `site_dir/log/supervisord.log` file for more information if this persists after running `supervisord` again.