2a8eea4463c3

Add some styles for the docs.
[view raw] [browse files]
author Steve Losh <steve@stevelosh.com>
date Thu, 19 Nov 2009 22:51:34 -0500
parents f9616d40630b
children b6989b5b27ef
branches/tags (none)
files .hgignore docs/.templates/404.html docs/.templates/base.html docs/.templates/document.html docs/.templates/listing.html docs/.templates/macros/html docs/.templates/markdoc-default/404.html docs/.templates/markdoc-default/base.html docs/.templates/markdoc-default/document.html docs/.templates/markdoc-default/listing.html docs/markdoc.yaml docs/static/media/css/layout.css docs/static/media/css/pygments.css docs/static/media/css/reset.css docs/static/media/css/typography.css

Changes

--- a/.hgignore	Thu Nov 19 21:53:55 2009 -0500
+++ b/.hgignore	Thu Nov 19 22:51:34 2009 -0500
@@ -1,4 +1,6 @@
 syntax: glob
+
+.DS_Store
 *.pyc
 docs/.html
 docs/.tmp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/404.html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,1 @@
+{% extends 'markdoc-default/404.html' %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/base.html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,1 @@
+{% extends 'markdoc-default/base.html' %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/document.html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,1 @@
+{% extends 'markdoc-default/document.html' %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/listing.html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,1 @@
+{% extends 'markdoc-default/listing.html' %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/macros/html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,19 @@
+{% macro cssimport(css_href, document_root="", media="screen, projection") -%}
+    <link rel="stylesheet" type="text/css" href="{{ document_root }}{{ css_href }}" {% if media %}media="{{ media }}" {% endif %}/>
+{%- endmacro %}
+
+{% macro css() -%}
+    <style type="text/css">
+        {{ caller() }}
+    </style>
+{%- endmacro %}
+
+{% macro jsimport(js_href, document_root="") -%}
+    <script type="application/javascript" src="{{ document_root }}{{ js_href }}"></script>
+{%- endmacro %}
+
+{% macro js() -%}
+    <script type="text/javascript">
+        {{ caller() }}
+    </script>
+{%- endmacro %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/markdoc-default/404.html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,9 @@
+{% extends 'base.html' %}
+
+{% block body %}
+<h1>Not Found: <code>{{ request.path_info|e }}</code></h1>
+<p>
+  We couldn&#8217;t find what you were looking for.
+  {% if not is_index %}You could try going <a href="{{ document_root }}/">home</a>.{% endif %}
+</p>
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/markdoc-default/base.html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
+    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
+  <head>
+    <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
+    
+    <title>
+      {% if 'wiki-name' in config %}{{ config['wiki-name']|e }} ยป {% endif -%}
+      {% block title %}{{ title }}{% endblock %}
+    </title>
+    
+    {% import "macros/html" as html -%}
+    
+    {{ html.cssimport("/media/css/reset.css", document_root) }}
+    {{ html.cssimport("/media/css/layout.css", document_root) }}
+    {{ html.cssimport("/media/css/typography.css", document_root) }}
+    {{ html.cssimport("/media/css/pygments.css", document_root) }}
+  </head>
+  
+  <body>
+    {% if crumbs %}
+        <div id="breadcrumbs">
+          <p>
+              {% for name, href in crumbs %}
+                {% if href == None %}
+                  {{ name|e }}
+                {% else %}
+                  <a href="{{ document_root }}{{ href|e }}">{{ name|e }}</a>{% if loop.revindex0 %} &#187;{% endif %}
+                {% endif %}
+              {% endfor %}
+          </p>
+        </div> <!-- div#breadcrumbs -->
+      {% endif %}
+      
+    <div id="content">
+      
+      {% block body %}
+      {% endblock %}
+    
+    </div> <!-- div#content -->
+    <div id="footer">
+        <p>
+            {% if 'wiki-name' in config %}
+            {{ config['wiki-name']|e }} &mdash;
+            {% endif %}
+            Powered by <a href="http://bitbucket.org/zacharyvoase/markdoc">Markdoc</a>.
+        </p>
+    </div>
+    
+  </body>
+</html>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/markdoc-default/document.html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,5 @@
+{% extends 'base.html' %}
+
+{% block body %}
+  {{ content }}
+{% endblock %}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/.templates/markdoc-default/listing.html	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,57 @@
+{% extends 'base.html' %}
+
+{% block title %}ls /{{ directory|e }}{% endblock %}
+
+{% block body %}
+  <h1><code>ls /{{ directory|e }}</code></h1>
+
+  {% if sub_directories %}
+  <h2>Directories</h2>
+
+  <table id="subdirs">
+    {% for subdir in sub_directories %}
+      <tr>
+        <td class="name">
+          <a class="dirlink" href="{{ document_root }}{{ subdir.href|e }}">
+            {{ subdir.basename|e }}/
+          </a>
+        </td>
+      </tr>
+    {% endfor %}
+  </table>
+  {% endif %}
+
+  {% if pages %}
+  <h2>Pages</h2>
+
+  <table id="pages">
+    {% for page in pages %}
+      <tr>
+        <td class="size">{{ page.humansize }}</td>
+        <td class="name">
+          <a href="{{ document_root }}{{ page.href|e }}.html" title="{{ page.title|e }}">
+            {{ page.title|e }}
+          </a>
+        </td>
+      </tr>
+    {% endfor %}
+  </table>
+  {% endif %}
+
+  {% if files %}
+  <h2>Files</h2>
+
+  <table id="files">
+    {% for file in files %}
+      <tr>
+        <td class="size">{{ file.humansize }}</td>
+        <td class="name">
+          <a href="{{ document_root }}{{ file.href|e }}">
+            <code>{{ file.basename|e }}</code>
+          </a>
+        </td>
+      </tr>
+    {% endfor %}
+  </table>
+  {% endif %}
+{% endblock %}
--- a/docs/markdoc.yaml	Thu Nov 19 21:53:55 2009 -0500
+++ b/docs/markdoc.yaml	Thu Nov 19 22:51:34 2009 -0500
@@ -1,10 +1,16 @@
 wiki-name: "hg-prompt"
+
+
+template-dir: ".templates"
+static-dir: "static"
+
 hide-prefix: "."
 document-extensions: [.md, .mdown, .markdown]
 generate-listing: always
 listing-filename: "list.html"
-use-default-static: true
-use-default-templates: true
+
+use-default-static: false
+use-default-templates: false
 
 markdown:
   safe_mode: false
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/static/media/css/layout.css	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,187 @@
+body, html {
+	background-color: #226F89;
+	margin: 0;
+	padding: 0;
+}
+
+div#breadcrumbs {
+	border-bottom: 4px dashed #265565;
+	border-left: 1px solid #265565;
+	border-right: 1px solid #265565;
+	margin: 0 auto;
+	padding: 0.5em 1.5em;
+	background-color: #fff;
+	width: 55em;
+}
+div#breadcrumbs p {
+	margin-bottom: 0.2em;
+}
+div#content {
+	background-color: #fff;
+	height: 100%;
+	margin: 0 auto;
+	overflow: hidden;
+	padding: 1em 1.5em 1.5em 1.5em;
+	width: 55em;
+	border-left: 1px solid #265565;
+	border-right: 1px solid #265565;
+}
+
+h1 {
+	margin: 0.3em 0;
+	padding: 0.1em 0;
+}
+h2, h3, h4, h5, h6 {
+	margin-top: 1em;
+	margin-bottom: 0.4em;
+}
+p, ul, blockquote {
+	line-height: 1.8em;
+	margin-top: 0;
+	margin-bottom: 1em;
+}
+a {
+	color: #133C4C;
+}
+a:hover {
+	color: #F14800;
+}
+
+div#footer {
+	background-color: #fff;
+	border: 1px solid #265565;
+	border-top: 4px dashed #265565;
+	width: 55em;
+	padding: 1em 1.5em;
+	margin: 0 auto;
+	margin-bottom: 3em;
+	text-align: center;
+	color: #666;
+}
+div#footer p {
+    margin: 0;
+    padding: 0;
+}
+
+ul {
+	padding-left: 1.5em;
+}
+ul li {
+	list-style-type: disc;
+	margin-left: 1.5em;
+	margin-top: 0.4em;
+}
+
+div.toc ul {
+    padding: 0;
+}
+div.toc ul li {
+    list-style-type: none;
+    margin: 0;
+}
+div.toc > ul > li {
+    list-style-type: none;
+    margin: 0;
+}
+div.toc > ul ul {
+    margin: 0 3em;
+}
+
+code {
+	background-color: #f6f6f6;
+	border: 1px solid #999;
+	padding: 2px;
+	white-space: nowrap;
+}
+pre code {
+	border: none;
+	padding: 0;
+	background: none;
+	white-space: pre-wrap;
+}
+a code {
+	background: none;
+	border: none;
+	margin: 0;
+	padding: 0;
+	text-decoration: inherit;
+}
+a.code {
+	background-color: #3f3f3f;
+}
+
+dt {
+	font-weight: bold;
+	margin-top: 1em;
+}
+dd {
+	line-height: 1.8em;
+	margin-left: 1.5em;
+}
+blockquote p {
+	margin: 0;
+}
+
+img {
+    background-color: #f6f6f6;
+    border: 1px solid #999;
+    padding: 1em;
+    display: block;
+    margin: 0 auto;
+}
+
+table {
+	margin: 1em;
+}
+table thead {
+	background-color: #f6f6f6;
+}
+table thead th {
+	border: 1px solid #999;
+	padding: 0.5em 1em;
+}
+table tbody tr td {
+	border: 1px solid #999;
+	padding: 0.5em 1em;
+}
+
+pre, blockquote, table.codehilitetable {
+	background-color: #f6f6f6;
+	border: 1px solid #999;
+	display: block;
+	line-height: 1.5em;
+    margin-left: 1.5em;
+    margin-right: 1.5em;
+	padding: 0.5em;
+	padding-left: 1em;
+}
+pre, table.codehilitetable {
+	margin-bottom: 1em;
+}
+table.codehilitetable div.linenodiv {
+	border-right: 1px solid #ccc;
+	margin-right: 1em;
+	padding-right: 1em;
+}
+table.codehilitetable pre {
+	background: none;
+	border: none;
+	margin: 0;
+	padding: 0;
+}
+
+table#pages tr, table#subdirs tr, table#files tr {
+	border-top: 1px solid #999;
+	border-bottom: 1px solid #999;
+}
+table tr td.name a {
+	display: block;
+	padding: 0.5em 1em;
+}
+table tr td.name a:hover {
+	background-color: #f6f6f6;
+}
+table tr td.size {
+	padding: 0.5em 1em;
+	width:  40px;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/static/media/css/pygments.css	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,61 @@
+.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 */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/static/media/css/reset.css	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,7 @@
+/*
+Copyright (c) 2009, Yahoo! Inc. All rights reserved.
+Code licensed under the BSD License:
+http://developer.yahoo.net/yui/license.txt
+version: 2.7.0
+*/
+html{color:#000;background:#FFF;}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,button,textarea,p,blockquote,th,td{margin:0;padding:0;}table{border-collapse:collapse;border-spacing:0;}fieldset,img{border:0;}address,caption,cite,code,dfn,em,strong,th,var,optgroup{font-style:inherit;font-weight:inherit;}del,ins{text-decoration:none;}li{list-style:none;}caption,th{text-align:left;}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:normal;}q:before,q:after{content:'';}abbr,acronym{border:0;font-variant:normal;}sup{vertical-align:baseline;}sub{vertical-align:baseline;}legend{color:#000;}input,button,textarea,select,optgroup,option{font-family:inherit;font-size:inherit;font-style:inherit;font-weight:inherit;}input,button,textarea,select{*font-size:100%;}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/docs/static/media/css/typography.css	Thu Nov 19 22:51:34 2009 -0500
@@ -0,0 +1,89 @@
+html {
+	font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif;
+	font-size: 10pt;
+}
+
+h1, h2, h3, h4, h5, h6 {
+	font-weight: bold;
+}
+
+h1 {
+	font-size: 2em;
+}
+
+h2 {
+	font-size: 1.6em;
+}
+
+h3 {
+	font-size: 1.3em;
+}
+
+h4 {
+	font-size: 1.1em;
+	font-weight: bold;
+}
+
+em {
+	font-style: italic;
+}
+
+strong {
+	font-weight: bold;
+}
+
+a {
+	text-decoration: none;
+}
+
+table#files a:hover, table#subdirs a:hover, table#pages a:hover {
+	color: #a00000;
+}
+
+a[href^="http:"] {
+	text-decoration: underline;
+}
+
+p#footer a {
+	text-decoration: none;
+}
+
+p code, ul code, ol code, dl code, blockquote code, tbody code, thead code {
+	font-size: 8pt;
+}
+
+pre, code, tt, table#subdirs tr td.name, table#files tr td.name, table tr td.size {
+	font-family: "DejaVu Sans Mono", "Bitstream Vera Sans Mono", Menlo, Inconsolata, Consolas, Monaco, "Courier New", Courier;
+}
+
+table#subdirs code, table#files code {
+	font-size: 10pt;
+}
+
+table.codehilitetable div.linenodiv {
+	color: #777;
+}
+
+blockquote {
+	color: #222;
+	font-style: italic;
+}
+
+pre {
+	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 */
+	white-space: -pre-wrap; /* Opera 4-6 */
+	white-space: -o-pre-wrap; /* Opera 7 */
+	/* width: 99%; */
+	word-wrap: break-word; /* Internet Explorer 5.5+ */
+}
+
+table thead th {
+	font-weight: bold;
+}
+
+.list-crumb {
+	color: #777;
+	font-variant: italic;
+}
\ No newline at end of file