From 734dbbefe93a93d65ca1d4cf6c4b819ea3c807b1 Mon Sep 17 00:00:00 2001 From: tav Date: Tue, 16 Feb 2010 21:06:17 +0000 Subject: [PATCH] Updated various docs to rst/genshi. --- AUTHORS | 24 +-- doc/README.md | 23 +-- doc/_config.yml | 2 +- doc/_layouts/{page.html => page.genshi} | 2 +- doc/_layouts/rawtext.html | 7 - doc/_layouts/{site.html => site.genshi} | 4 +- doc/credits.txt | 1 + doc/history.txt | 7 +- doc/index.txt | 119 +++++++------- doc/{TODO => planfile.txt} | 123 ++++++++++++++- doc/todo.txt | 13 -- doc/website/css/style.css | 200 ++++++++++++------------ src/pyutil/rst.py | 10 +- 13 files changed, 319 insertions(+), 216 deletions(-) rename doc/_layouts/{page.html => page.genshi} (71%) delete mode 100644 doc/_layouts/rawtext.html rename doc/_layouts/{site.html => site.genshi} (97%) rename doc/{TODO => planfile.txt} (53%) delete mode 100644 doc/todo.txt diff --git a/AUTHORS b/AUTHORS index db57aca..2a5328a 100644 --- a/AUTHORS +++ b/AUTHORS @@ -4,22 +4,24 @@ Ampify Authors This is the official list of the Ampify Authors ("The Contributors"), listed in alphabetical order: ++----------------------------+--------------------+--------------------------+----------------+ | Name | Nick | Email | Country | -|----------------------------|--------------------|--------------------------|----------------| -| [James Arthur] | thruflo | | U.K. | ++----------------------------+--------------------+--------------------------+----------------+ +| `James Arthur`_ | thruflo | | U.K. | | Maciej Fijalkowski | fijal | | Poland | -| [Mamading Ceesay] | evangineer | | U.K. | +| `Mamading Ceesay`_ | evangineer | | U.K. | | Mathew Ryden | oierw | | U.S.A. | -| [Sean B. Palmer] | sbp | | U.K. | -| [Tav] | tav | | U.K. | +| `Sean B. Palmer`_ | sbp | | U.K. | +| `Tav`_ | tav | | U.K. | ++----------------------------+--------------------+--------------------------+----------------+ -[James Arthur]: http://thruflo.com -[Mamading Ceesay]: http://twitter.com/evangineer -[Sean B. Palmer]: http://inamidst.com -[Tav]: http://tav.espians.com +.. _James Arthur: http://thruflo.com +.. _Mamading Ceesay: http://twitter.com/evangineer +.. _Sean B. Palmer: http://inamidst.com +.. _Tav: http://tav.espians.com By adding yourself to this list, you explicitly agree to affirm all of your Contributions to the Public Domain according to the Public Domain license that -can be found in the root [LICENSE] file. +can be found in the root `LICENSE`_ file. -[LICENSE]: license.html \ No newline at end of file +.. _LICENSE: license.html \ No newline at end of file diff --git a/doc/README.md b/doc/README.md index 389eb73..5d85168 100644 --- a/doc/README.md +++ b/doc/README.md @@ -2,22 +2,11 @@ This directory contains the documentation for the Ampify platform. You can also view the documentation online at: -* [http://code.ampify.it](http://code.ampify.it) +* [http://dev.ampify.it](http://dev.ampify.it) -The documentation site is automatically generated from the `*.md` source -[Markdown](http://daringfireball.net/projects/markdown/) files using -[Jekyll](http://github.com/mojombo/jekyll), a static site generator written in -Ruby. +The documentation site is automatically generated from the `*.txt` source +[reStructuredText](http://docutils.sourceforge.net/rst.html) files using +Yatiblog, a static site generator that can be found in `environ/startup`. -If you want the documentation as HTML files for offline use, you can install -Jekyll for yourself using: - - $ sudo gem install jekyll - -You also need to install the [Pygments](http://pygments.org/) syntax highlighter -for your system Python using something like: - - $ sudo easy_install Pygments - -You can then generate the `_site` HTML files by just running `jekyll` in this -directory. +If you want the documentation as HTML files for offline use, you can generate +the `website` HTML files by just running `yatiblog` in this directory. diff --git a/doc/_config.yml b/doc/_config.yml index bf631b8..84de6eb 100644 --- a/doc/_config.yml +++ b/doc/_config.yml @@ -3,6 +3,6 @@ site_description: The Ampify Platform site_license: Public Domain site_title: Ampify site_url: http://code.ampify.it + index_pages: -- feed.rss: feed.genshi - archive.html: archive.genshi diff --git a/doc/_layouts/page.html b/doc/_layouts/page.genshi similarity index 71% rename from doc/_layouts/page.html rename to doc/_layouts/page.genshi index 8254f24..df6feb9 100644 --- a/doc/_layouts/page.html +++ b/doc/_layouts/page.genshi @@ -3,5 +3,5 @@ ---
-{{content}} +${Markup(content)}
diff --git a/doc/_layouts/rawtext.html b/doc/_layouts/rawtext.html deleted file mode 100644 index f3a65ac..0000000 --- a/doc/_layouts/rawtext.html +++ /dev/null @@ -1,7 +0,0 @@ ---- -layout: page ---- - -
-{{content}}
-
diff --git a/doc/_layouts/site.html b/doc/_layouts/site.genshi
similarity index 97%
rename from doc/_layouts/site.html
rename to doc/_layouts/site.genshi
index 3209587..da4c5e7 100644
--- a/doc/_layouts/site.html
+++ b/doc/_layouts/site.genshi
@@ -1,7 +1,7 @@
 
 
 
-  Ampify :: {{page.title}}
+  Ampify :: ${title}
   
   
   
@@ -32,7 +32,7 @@
   
 
 
-{{content}} +${Markup(content)}
diff --git a/doc/credits.txt b/doc/credits.txt index 7e5b267..004bf36 100644 --- a/doc/credits.txt +++ b/doc/credits.txt @@ -1,5 +1,6 @@ --- layout: page +title: Credits --- Credits diff --git a/doc/history.txt b/doc/history.txt index 6d8124f..f09a1ad 100644 --- a/doc/history.txt +++ b/doc/history.txt @@ -1,10 +1,15 @@ --- layout: page +title: History --- History ======= +**2010-02-16** + +* The architecture for an "Ampify Zero" is finalised. + **2010-01-17** * Sean B. Palmer wrote the very first public article about Ampify: "`Ampify, a @@ -40,7 +45,7 @@ History **2009-08-18** * With help from David Pinto, Tav coded a prototype version of the collaboration - platform called `Tent `_. It added micro syntax and structured search to facilitate collaboration over IRC. **2009-08-14** diff --git a/doc/index.txt b/doc/index.txt index bfd9fe2..2b60d11 100644 --- a/doc/index.txt +++ b/doc/index.txt @@ -1,19 +1,20 @@ --- -layout: index +layout: page title: Documentation --- Ampify ====== -* Table of Contents -{:toc} +.. contents:: Table of Contents + :depth: 1 + :backlinks: none The Ampify Platform aims to allow for micro-data powered application development. The goal for the 1.0 release is to have a fully decentralised platform, but right now we're working on creating version `Zero`. -Have a read of the [ Zero Architecture](zero-architecture.html). +Have a read of the planfile for `Ampify Zero `_. Get Started @@ -22,89 +23,91 @@ Get Started You need to have Git, a recent Python 2.x and general dev tools (gcc, make, etc.) installed. -{% highlight bash %} -# clone the source repository. -$ git clone git://github.com/tav/ampify.git +.. syntax:: bash -# setup ampify related environment variables using the ampenv.sh bash script. -# you might also want to add this line to your ~/.profile or ~/.bashrc files. -$ source ampify/environ/startup/ampenv.sh + # clone the source repository. + $ git clone git://github.com/tav/ampify.git -# use the new git update command which will now be on your $PATH to keep the -# repository updated from now on — it also inits and updates git submodules. -$ cd ampify -$ git update + # setup ampify related environment variables using the ampenv.sh bash script. + # you might also want to add this line to your ~/.profile or ~/.bashrc files. + $ source ampify/environ/startup/ampenv.sh -# configure your build (and verify you have the necessary dependencies). -$ cd src -$ ./configure + # use the new git update command which will now be on your $PATH to keep the + # repository updated from now on — it also inits and updates git submodules. + $ cd ampify + $ git update -# build various aspects of the ampify platform and verify everything works by -# running the tests. -$ make test -{% endhighlight %} + # configure your build (and verify you have the necessary dependencies). + $ cd src + $ ./configure + + # build various aspects of the ampify platform and verify everything works by + # running the tests. + $ make test Get Involved ------------ -* Come by and say hello and introduce yourself on - [IRC](irc://irc.freenode.net/esp): +* Come by and say hello and introduce yourself on `IRC + `_: + +.. raw:: html -
-server: irc.freenode.net
-channel: #esp
-chatlogs: irclogs.ampify.it
-
+
+  server: irc.freenode.net
+  channel: #esp
+  chatlogs: irclogs.ampify.it
+  
-* Get on the [ampify-dev](http://groups.google.com/group/ampify-dev) mailing +* Get on the `ampify-dev `_ mailing list. -* Sign up to GitHub if you don't have an - [account](https://github.com/signup/free) — it takes just a minute! You can - then [fork](http://help.github.com/forking/) the [ampify - repository](http://github.com/tav/ampify) and send [pull - requests](http://github.com/guides/pull-requests) with any changes you might - have. +* Sign up to GitHub if you don't have an `account + `_ — it takes just a minute! You can then + `fork `_ the `ampify repository + `_ and send `pull requests + `_ with any changes you might have. -{% highlight bash %} -$ git clone git@github.com:yourUsername/ampify.git -$ git remote add upstream git://github.com/tav/ampify.git -{% endhighlight %} +.. syntax:: bash -* Read the [getting started with - git](http://www.espians.com/getting-started-with-git.html) guide for Ampify + $ git clone git@github.com:yourUsername/ampify.git + $ git remote add upstream git://github.com/tav/ampify.git + +* Read the `getting started with git + `_ guide for Ampify Developers if you're new to git. * Familiarise yourself with the Ampify testing and review process. -{% highlight bash %} -# commit your changes to your local repository. -$ git commit +.. syntax:: bash + + # commit your changes to your local repository. + $ git commit -# submit an issue to be reviewed on http://codereview.appspot.com — running this -# also checks with appropriate local revhooks before your submission is made. -$ git review submit + # submit an issue to be reviewed on http://codereview.appspot.com — running this + # also checks with appropriate local revhooks before your submission is made. + $ git review submit -# make any changes and keep committing and submitting updates on the issue until -# the reviewers give a LGTM (Looks Good To Me) reply. + # make any changes and keep committing and submitting updates on the issue until + # the reviewers give a LGTM (Looks Good To Me) reply. -# once you have an okay, squash your various commits into a single commit and -# push to the remote repository. -$ git review push -{% endhighlight %} + # once you have an okay, squash your various commits into a single commit and + # push to the remote repository. + $ git review push General Info ------------ -* [AUTHORS](authors.html) — A listing of those who have directly contributed +* `AUTHORS `_ — A listing of those who have directly contributed code/documentation to Ampify. -* [CREDITS](credits.html) — A listing of those who have contributed indirectly. +* `CREDITS `_ — A listing of those who have contributed + indirectly. -* [HISTORY](history.html) — A brief history of Ampify. +* `HISTORY `_ — A brief history of Ampify. -* [LICENSE](license.html) — The Public Domain License for the Ampify platform. +* `LICENSE `_ — The Public Domain License for the Ampify platform. -* [TODO](todo.html) — The current set of Priority Todo items. +* `PLANFILE `_ — The current planfile for Ampify Zero. diff --git a/doc/TODO b/doc/planfile.txt similarity index 53% rename from doc/TODO rename to doc/planfile.txt index f69e797..cf71c83 100644 --- a/doc/TODO +++ b/doc/planfile.txt @@ -1,11 +1,124 @@ +--- +license: Public Domain +layout: page +title: Planfile +--- + +Planfile +======== + +This is the current Planfile for `Ampify Zero `_: + +* Git Review +* Tests +* Build +* Devboard (incl. contributor agreement) +* Documentation style + LICENSE + +Hosting +------- + +✓ Investigate cloud service providers. + + Choosing good hosting provider(s) is going to be important for the long-term + success of Ampify. Unfortunately the current set of cloud services do not seem + to be spectacularly attractive choices. + + Services like `Amazon EC2 `_ are impressive from a + technical perspective. For example, Amazon's Elastic Load Balancer makes what + would otherwise be a pretty painful experience quite effortless. + + However, on the flip side, the abstractions also introduces a lot of + additional complexities to manage. This is most notable with the case of > + Amazon's `Elastic Block Store `_. Writing a file + to disk now involves half a dozen support structures! + + Cloud offerings also make very little sense from a financial perspective. Not + only do comparable "raw metal" servers cost substantially less, but you also + get a noticeable increase in raw performance. + + And, finally, multi-tenancy introduces a host of `novel security + considerations `_. + Server management is complicated enough without having to worry about these + and other gaming issues. + +✓ Investigate dedicated server providers. + + `Hostway `_ seem to have quite a + competitive offering with offers of good support and 100% uptime. The global + distribution (North America, Europe, East Asia) of their data centers is also + quite attractive with regards future expansion. + + Of the other providers, `Terremark `_ looks quite + impressive, but do not seem to be affordable at a small scale. `Codero + `_ (USA) and `Hetzner `_ + (Germany) are attractive price-wise, however they don't seem to be too + reliable with regards network connectivity. + +✗ Investigate/negotiate deal with Hostway. + + There are a number of issues to verify: + + * What's their process for scheduled maintenance? Do they have an IRC channel + for live support? + + * They don't have an IRC channel, but do offer 24x7 support and ticketing + system. + + * What are their limitations with regards to provisioning new servers? At what + rate can they handle orders for new servers? + + * They can deploy new servers (from any of their default configs) within 24 + hours, which could potentially be rushed. Custom configurations would take + longer though. + + * What are our options about deploying across their `various data centers + `_? What is the latency between + these locations? + + * We can choose which data centers to deploy to. + + * Do they offer ECC RAM on their servers? What kind specifically? + + * Yes, the RAM on the servers we've been looking at is DDR3 ECC. + + * Do they offer servers with Gigabit NIC? This will be quite important for the + frontend servers. + + * All servers are fitted with Gigabit NICs. + + * What happens when servers exceed their allocated 2TB bandwidth? Is "internal" + bandwidth charged for? What about across their data centers? + + * Excess bandwidth is charged for. We can prebuy various bandwidth plans. + And with regards internal traffic, we can arrange for our servers to be + setup on a private switch. + + * Do they offer static IP addresses? What's their process for allocation of new + address blocks? + + Tav is currently engaged in a dialogue with Jamie Fryer from Hostway. + + ✗ http://code.google.com/p/tesseract-ocr/wiki/ReadMe + ✗ Language detection + ✗ Trust metrics calculation + +Guess language + +✗ Weather Theme as ambient system status indicator + ✗ Nodules ✗ Language guesser -✓ Setup git repository for ampify -✗ Buy SSL certificate -✓ Buy ampify.it -✗ Send in verification documents to the Italian registrar -✗ Buy ampify.im | .com variants +The absolute basics: + + ✓ Setup git repository for ampify + ✗ Buy SSL certificate + ✓ Buy ampify.it + ✗ Send in verification documents to the Italian registrar + ✗ Buy ampify.im | .com variants + +And, then: ✓ Weblite base framework ✓ Weblite service loader diff --git a/doc/todo.txt b/doc/todo.txt deleted file mode 100644 index 5e69e30..0000000 --- a/doc/todo.txt +++ /dev/null @@ -1,13 +0,0 @@ ---- -license: Public Domain -layout: page -title: Todo ---- - -

Todo

- -This is the current stack of Todo items for [Ampify Zero](zero-architecture.html): - -
-{% include doc/TODO %}
-
\ No newline at end of file diff --git a/doc/website/css/style.css b/doc/website/css/style.css index c9423d5..f0a0972 100644 --- a/doc/website/css/style.css +++ b/doc/website/css/style.css @@ -127,7 +127,7 @@ ul { /* Class styles */ -.maruku_toc { +.contents { float: right; background-color: #fff; border: 1px solid #cacaca; @@ -140,7 +140,11 @@ ul { -webkit-box-shadow: 0px 0px 7px #cacaca; } -.maruku_toc ul { +.contents .topic-title { + display: none; +} + +.contents ul { list-style-type: circle !important; margin: 0; padding-left: 25px; @@ -149,99 +153,99 @@ ul { /* Source code syntax highlighting */ -.highlight .c { color: #919191 } /* Comment */ -.highlight .cm { color: #919191 } /* Comment.Multiline */ -.highlight .cp { color: #919191 } /* Comment.Preproc */ -.highlight .cs { color: #919191 } /* Comment.Special */ -.highlight .c1 { color: #919191 } /* Comment.Single */ - -.highlight .err { color: #a61717; background-color: #e3d2d2 } /* Error */ - -.highlight .g { color: #101010 } /* Generic */ -.highlight .gd { color: #d22323 } /* Generic.Deleted */ -.highlight .ge { color: #101010; font-style: italic } /* Generic.Emph */ -.highlight .gh { color: #101010 } /* Generic.Heading */ -.highlight .gi { color: #589819 } /* Generic.Inserted */ -.highlight .go { color: #6a6a6a } /* Generic.Output */ -.highlight .gp { color: #6a6a6a } /* Generic.Prompt */ -.highlight .gr { color: #d22323 } /* Generic.Error */ -.highlight .gs { color: #101010 } /* Generic.Strong */ -.highlight .gt { color: #d22323 } /* Generic.Traceback */ -.highlight .gu { color: #101010 } /* Generic.Subheading */ - -.highlight .k { color: #c32528 } /* Keyword */ /* espian red */ -.highlight .k { color: #ff5600 } /* Keyword */ /* orangy */ -.highlight .kc { color: #ff5600 } /* Keyword.Constant */ -.highlight .kd { color: #ff5600 } /* Keyword.Declaration */ -.highlight .kd { color: #ff5600 } /* Keyword.Declaration */ -.highlight .kn { color: #ff5600 } /* Keyword */ -.highlight .kp { color: #ff5600 } /* Keyword.Pseudo */ -.highlight .kr { color: #ff5600 } /* Keyword.Reserved */ -.highlight .kt { color: #ff5600 } /* Keyword.Type */ - -.highlight .l { color: #101010 } /* Literal */ -.highlight .ld { color: #101010 } /* Literal.Date */ - -.highlight .m { color: #3677a9 } /* Literal.Number */ /* darkish pastely blue */ -.highlight .m { color: #00a33f } /* Literal.Number */ /* brightish green */ -.highlight .mf { color: #00a33f } /* Literal.Number.Float */ -.highlight .mh { color: #00a33f } /* Literal.Number.Hex */ -.highlight .mi { color: #00a33f } /* Literal.Number.Integer */ -.highlight .il { color: #00a33f } /* Literal.Number.Integer.Long */ -.highlight .mo { color: #00a33f } /* Literal.Number.Oct */ - -.highlight .bp { color: #a535ae } /* Name.Builtin.Pseudo */ -.highlight .n { color: #101010 } /* Name */ -.highlight .na { color: #bbbbbb } /* Name.Attribute */ -.highlight .nb { color: #bf78cc } /* Name.Builtin */ /* pastely purple */ -.highlight .nb { color: #af956f } /* Name.Builtin */ /* pastely light brown */ -.highlight .nb { color: #a535ae } /* Name.Builtin */ /* brightish pastely purple */ -.highlight .nc { color: #101010 } /* Name.Class */ -.highlight .nd { color: #6d8091 } /* Name.Decorator */ -.highlight .ne { color: #af956f } /* Name.Exception */ -.highlight .nf { color: #101010 } /* Name.Function */ -.highlight .ni { color: #101010 } /* Name.Entity */ -.highlight .nl { color: #101010 } /* Name.Label */ -.highlight .nn { color: #101010 } /* Name.Namespace */ -.highlight .nn { color: #101010 } /* Name.Namespace */ -.highlight .no { color: #101010 } /* Name.Constant */ -.highlight .nx { color: #101010 } /* Name.Other */ -.highlight .nt { color: #6d8091 } /* Name.Tag */ -.highlight .nv { color: #101010 } /* Name.Variable */ -.highlight .vc { color: #101010 } /* Name.Variable.Class */ -.highlight .vg { color: #101010 } /* Name.Variable.Global */ -.highlight .vi { color: #101010 } /* Name.Variable.Instance */ -.highlight .py { color: #101010 } /* Name.Property */ - -.highlight .ow { color: #101010 } /* Operator.Word */ - -.highlight .o { color: #101010 } /* Operator */ -.highlight .p { color: #101010 } /* Punctuation */ - -.highlight .s { color: #dd1144 } /* Literal.String */ /* darkish red */ -.highlight .s { color: #c32528 } /* Literal.String */ /* espian red */ -.highlight .s { color: #39946a } /* Literal.String */ /* pastely greeny */ -.highlight .s { color: #00a33f } /* Literal.String */ /* brightish green */ -.highlight .s { color: #5d90cd } /* Literal.String */ /* pastely blue */ -.highlight .sb { color: #5d90cd } /* Literal.String.Backtick */ -.highlight .sc { color: #5d90cd } /* Literal.String.Char */ -.highlight .sd { color: #5d90cd } /* Literal.String.Doc */ -.highlight .se { color: #5d90cd } /* Literal.String.Escape */ -.highlight .sh { color: #5d90cd } /* Literal.String.Heredoc */ -.highlight .si { color: #5d90cd } /* Literal.String.Interpol */ -.highlight .sr { color: #5d90cd } /* Literal.String.Regex */ -.highlight .ss { color: #5d90cd } /* Literal.String.Symbol */ -.highlight .sx { color: #5d90cd } /* Literal.String.Other */ -.highlight .s1 { color: #5d90cd } /* Literal.String.Single */ -.highlight .s2 { color: #5d90cd } /* Literal.String.Double */ - -.highlight .w { color: #101010 } /* Text.Whitespace */ -.highlight .x { color: #101010 } /* Other */ - -.highlight .bash .nb { color: #101010 } -.highlight .bash .nv { color: #c32528 } - -.highlight .css .k { color: #606060 } -.highlight .css .nc { color: #c32528 } -.highlight .css .nf { color: #c32528 } -.highlight .css .nt { color: #c32528 } +.syntax .c { color: #919191 } /* Comment */ +.syntax .cm { color: #919191 } /* Comment.Multiline */ +.syntax .cp { color: #919191 } /* Comment.Preproc */ +.syntax .cs { color: #919191 } /* Comment.Special */ +.syntax .c1 { color: #919191 } /* Comment.Single */ + +.syntax .err { color: #a61717; background-color: #e3d2d2 } /* Error */ + +.syntax .g { color: #101010 } /* Generic */ +.syntax .gd { color: #d22323 } /* Generic.Deleted */ +.syntax .ge { color: #101010; font-style: italic } /* Generic.Emph */ +.syntax .gh { color: #101010 } /* Generic.Heading */ +.syntax .gi { color: #589819 } /* Generic.Inserted */ +.syntax .go { color: #6a6a6a } /* Generic.Output */ +.syntax .gp { color: #6a6a6a } /* Generic.Prompt */ +.syntax .gr { color: #d22323 } /* Generic.Error */ +.syntax .gs { color: #101010 } /* Generic.Strong */ +.syntax .gt { color: #d22323 } /* Generic.Traceback */ +.syntax .gu { color: #101010 } /* Generic.Subheading */ + +.syntax .k { color: #c32528 } /* Keyword */ /* espian red */ +.syntax .k { color: #ff5600 } /* Keyword */ /* orangy */ +.syntax .kc { color: #ff5600 } /* Keyword.Constant */ +.syntax .kd { color: #ff5600 } /* Keyword.Declaration */ +.syntax .kd { color: #ff5600 } /* Keyword.Declaration */ +.syntax .kn { color: #ff5600 } /* Keyword */ +.syntax .kp { color: #ff5600 } /* Keyword.Pseudo */ +.syntax .kr { color: #ff5600 } /* Keyword.Reserved */ +.syntax .kt { color: #ff5600 } /* Keyword.Type */ + +.syntax .l { color: #101010 } /* Literal */ +.syntax .ld { color: #101010 } /* Literal.Date */ + +.syntax .m { color: #3677a9 } /* Literal.Number */ /* darkish pastely blue */ +.syntax .m { color: #00a33f } /* Literal.Number */ /* brightish green */ +.syntax .mf { color: #00a33f } /* Literal.Number.Float */ +.syntax .mh { color: #00a33f } /* Literal.Number.Hex */ +.syntax .mi { color: #00a33f } /* Literal.Number.Integer */ +.syntax .il { color: #00a33f } /* Literal.Number.Integer.Long */ +.syntax .mo { color: #00a33f } /* Literal.Number.Oct */ + +.syntax .bp { color: #a535ae } /* Name.Builtin.Pseudo */ +.syntax .n { color: #101010 } /* Name */ +.syntax .na { color: #bbbbbb } /* Name.Attribute */ +.syntax .nb { color: #bf78cc } /* Name.Builtin */ /* pastely purple */ +.syntax .nb { color: #af956f } /* Name.Builtin */ /* pastely light brown */ +.syntax .nb { color: #a535ae } /* Name.Builtin */ /* brightish pastely purple */ +.syntax .nc { color: #101010 } /* Name.Class */ +.syntax .nd { color: #6d8091 } /* Name.Decorator */ +.syntax .ne { color: #af956f } /* Name.Exception */ +.syntax .nf { color: #101010 } /* Name.Function */ +.syntax .ni { color: #101010 } /* Name.Entity */ +.syntax .nl { color: #101010 } /* Name.Label */ +.syntax .nn { color: #101010 } /* Name.Namespace */ +.syntax .nn { color: #101010 } /* Name.Namespace */ +.syntax .no { color: #101010 } /* Name.Constant */ +.syntax .nx { color: #101010 } /* Name.Other */ +.syntax .nt { color: #6d8091 } /* Name.Tag */ +.syntax .nv { color: #101010 } /* Name.Variable */ +.syntax .vc { color: #101010 } /* Name.Variable.Class */ +.syntax .vg { color: #101010 } /* Name.Variable.Global */ +.syntax .vi { color: #101010 } /* Name.Variable.Instance */ +.syntax .py { color: #101010 } /* Name.Property */ + +.syntax .ow { color: #101010 } /* Operator.Word */ + +.syntax .o { color: #101010 } /* Operator */ +.syntax .p { color: #101010 } /* Punctuation */ + +.syntax .s { color: #dd1144 } /* Literal.String */ /* darkish red */ +.syntax .s { color: #c32528 } /* Literal.String */ /* espian red */ +.syntax .s { color: #39946a } /* Literal.String */ /* pastely greeny */ +.syntax .s { color: #00a33f } /* Literal.String */ /* brightish green */ +.syntax .s { color: #5d90cd } /* Literal.String */ /* pastely blue */ +.syntax .sb { color: #5d90cd } /* Literal.String.Backtick */ +.syntax .sc { color: #5d90cd } /* Literal.String.Char */ +.syntax .sd { color: #5d90cd } /* Literal.String.Doc */ +.syntax .se { color: #5d90cd } /* Literal.String.Escape */ +.syntax .sh { color: #5d90cd } /* Literal.String.Heredoc */ +.syntax .si { color: #5d90cd } /* Literal.String.Interpol */ +.syntax .sr { color: #5d90cd } /* Literal.String.Regex */ +.syntax .ss { color: #5d90cd } /* Literal.String.Symbol */ +.syntax .sx { color: #5d90cd } /* Literal.String.Other */ +.syntax .s1 { color: #5d90cd } /* Literal.String.Single */ +.syntax .s2 { color: #5d90cd } /* Literal.String.Double */ + +.syntax .w { color: #101010 } /* Text.Whitespace */ +.syntax .x { color: #101010 } /* Other */ + +.syntax.bash .nb { color: #101010 } +.syntax.bash .nv { color: #c32528 } + +.syntax.css .k { color: #606060 } +.syntax.css .nc { color: #c32528 } +.syntax.css .nf { color: #c32528 } +.syntax.css .nt { color: #c32528 } diff --git a/src/pyutil/rst.py b/src/pyutil/rst.py index 7367c48..4372dd9 100644 --- a/src/pyutil/rst.py +++ b/src/pyutil/rst.py @@ -448,13 +448,19 @@ def syntax_directive(name, arguments, options, content, lineno, """Prettify snippets into marked up HTML blocks.""" try: - lexer = get_lexer_by_name(arguments[0]) + lexer_name = arguments[0] + lexer = get_lexer_by_name(lexer_name) except ValueError: + lexer_name = 'txt' lexer = TextLexer() + formatter = HtmlFormatter( + cssclass='syntax %s' % lexer_name, lineseparator='
' + ) + return [nodes.raw( '', - highlight(u'\n'.join(content), lexer, SYNTAX_FORMATTER), + highlight(u'\n'.join(content), lexer, formatter), format='html' )]