changeset 397:dcaa41b39c23

docs: Add more nice graphics.
author Ludovic Chabant <ludovic@chabant.com>
date Wed, 21 Oct 2015 22:48:19 -0700
parents 2a70f537337d
children 0f4032dafc1f
files docs/assets/css/wikked.less docs/assets/img/dead_witch.png docs/assets/img/melting.png docs/assets/img/monkey.png docs/assets/img/soldier_monkey.png docs/assets/img/toto.png docs/assets/img/witch.png docs/assets/img/wizard.png docs/pages/00__index.md docs/pages/01_installation.md docs/pages/02_overview.md docs/pages/03_configuration.md docs/pages/04_syntax.md docs/pages/05_deployment.md docs/templates/default.html
diffstat 15 files changed, 48 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/docs/assets/css/wikked.less	Thu Oct 15 23:39:17 2015 -0700
+++ b/docs/assets/css/wikked.less	Wed Oct 21 22:48:19 2015 -0700
@@ -23,15 +23,18 @@
 }
 
 // Quotes with a nice icon.
+@blockquote-img-width: 72px + 20px;
+@blockquote-img-height: 100px + 20px;
+
 blockquote {
     padding: 1em;
     margin: 1em 0;
-    min-height: 220px;
+    min-height: @blockquote-img-height;
     color: lighten(@color-gray-dark, 3%);
     background: darken(@color-gray-light, 5%);
 
     p {
-        margin-left: 170px; // width/height of the "toto" image: 145x200
+        margin-left: @blockquote-img-width; // width/height of the "toto" image: 72x100
     }
     p:first-child::before {
         content: " ";
@@ -40,10 +43,10 @@
         background-position: left center;
         display: block;
         float: left;
-        margin-left: -170px;
+        margin-left: -@blockquote-img-width;
         margin-top: -1em;
-        width: 150px;
-        height: 220px;
+        width: @blockquote-img-width;
+        height: @blockquote-img-height;
     }
 }
 
@@ -99,6 +102,16 @@
     }
 }
 
+.wiki-docs header.header-img {
+    img { margin: 1em; float: right; }
+    h1 { float: left; }
+    &::after {
+        content: " ";
+        display: block;
+        clear: both;
+    }
+}
+
 @media screen and (min-width: 48em) {
     // Visible menu by default on big screens.
     .wrapper.wiki-docs {
Binary file docs/assets/img/dead_witch.png has changed
Binary file docs/assets/img/melting.png has changed
Binary file docs/assets/img/monkey.png has changed
Binary file docs/assets/img/soldier_monkey.png has changed
Binary file docs/assets/img/toto.png has changed
Binary file docs/assets/img/witch.png has changed
Binary file docs/assets/img/wizard.png has changed
--- a/docs/pages/00__index.md	Thu Oct 15 23:39:17 2015 -0700
+++ b/docs/pages/00__index.md	Wed Oct 21 22:48:19 2015 -0700
@@ -1,6 +1,7 @@
 ---
 title: Wikked
 icon: home
+header_img: dead_witch.png
 ---
 
 **Wikked** is a [wiki][] engine that stores its data in plain text files using
--- a/docs/pages/01_installation.md	Thu Oct 15 23:39:17 2015 -0700
+++ b/docs/pages/01_installation.md	Wed Oct 21 22:48:19 2015 -0700
@@ -1,6 +1,7 @@
 ---
 title: Installation
 icon: cloud-download
+header_img: monkey.png
 ---
 
 ## From the package index
--- a/docs/pages/02_overview.md	Thu Oct 15 23:39:17 2015 -0700
+++ b/docs/pages/02_overview.md	Wed Oct 21 22:48:19 2015 -0700
@@ -1,6 +1,7 @@
 ---
 title: Overview
 icon: book
+header_img: witch.png
 ---
 
 Wikked's data is entirely stored in text files on disk. All you ever need, or
--- a/docs/pages/03_configuration.md	Thu Oct 15 23:39:17 2015 -0700
+++ b/docs/pages/03_configuration.md	Wed Oct 21 22:48:19 2015 -0700
@@ -1,6 +1,7 @@
 ---
 title: Configuration
 icon: cog
+header_img: soldier_monkey.png
 ---
 
 Wikked can be configured with a few files:
--- a/docs/pages/04_syntax.md	Thu Oct 15 23:39:17 2015 -0700
+++ b/docs/pages/04_syntax.md	Wed Oct 21 22:48:19 2015 -0700
@@ -1,6 +1,7 @@
 ---
 title: Syntax
 icon: pencil
+header_img: melting.png
 ---
 
 ## Formatting
--- a/docs/pages/05_deployment.md	Thu Oct 15 23:39:17 2015 -0700
+++ b/docs/pages/05_deployment.md	Wed Oct 21 22:48:19 2015 -0700
@@ -1,6 +1,7 @@
 ---
 title: Deployment
 icon: server
+header_img: wizard.png
 ---
 
 Wikked runs by default with an "easy" configuration, _i.e._ something that will
@@ -27,12 +28,12 @@
  [flaskdeploy]: http://flask.pocoo.org/docs/deploying/
     
 
-## Apache and WSGI
+## Public facing wiki
 
-A simple way to run Wikked on a production server is to use [Apache][] with
-[`mod_wsgi`][wsgi]. For a proper introduction to the matter, you can see
-[Flask's documentation on the subject][flask_wsgi]. Otherwise, you can probably
-reuse the following examples.
+A simple way to run Wikked on a production server (_i.e._ a server accessible
+from the internet) is to use [Apache][] with [`mod_wsgi`][wsgi]. For a proper
+introduction to the matter, you can see [Flask's documentation on the
+subject][flask_wsgi]. Otherwise, you can probably reuse the following examples.
 
  [apache]: https://httpd.apache.org/
  [wsgi]: http://code.google.com/p/modwsgi/
@@ -83,18 +84,23 @@
 > `/path/to/your/wiki/venv/lib/python/site-packages/wikked/static`.
 
 
-## Background updates
+## Advanced configurations
+
+### Background updates
 
-The second thing to do is to enable background wiki updates. Good news: they're
-already enabled if you used the `get_wsgi_app` function from the previous
-section (you can disable it by passing `async_update=False` if you really need
-to).
+By default, when you edit a page, Wikked will invalidate any page with a query
+in it. That page will be re-computed the next time you visit it. But this may
+not work very well if you have a lot of queries. As an alternative, Wikked can
+run background updates.
+
+First you enable background updates in the `get_wsgi_app` function from the previous
+section. You just need to pass `async_update=True`.
 
 > If you want to use background updates locally, you can do `wk runserver
 > --usetasks`.
 
-However, you'll still need to run a separate process that, well, runs those
-updates in the background. To do this:
+Now, you'll need to run a separate process that, well, runs those updates in the
+background. To do this:
 
     cd /path/to/my/wiki
     wk runtasks
@@ -106,9 +112,7 @@
  [celerysqlite]: http://docs.celeryproject.org/en/latest/getting-started/brokers/sqlalchemy.html
 
 
-## Backend options
-
-**This is for advanced use only**
+### Backend options
 
 If you want to use a different storage than SQLite, set the `database_url`
 setting in your `wikirc` to an [SQLAlchemy-supported database URL][SQLAlchemy].
--- a/docs/templates/default.html	Thu Oct 15 23:39:17 2015 -0700
+++ b/docs/templates/default.html	Wed Oct 21 22:48:19 2015 -0700
@@ -23,9 +23,14 @@
         <div class="wrapper wiki-docs">
             {% block header %}
             {% if page.header_bg %}
-            <header class="header-bg" style="background-image: url('/img/{{page.header_bg}}');">
+            <header class="header-bg" style="background-image: url('{{site.root}}img/{{page.header_bg}}');">
                 <h1>{{page.title}}</h1>
             </header>
+            {% elif page.header_img %}
+            <header class="header-img">
+                <h1>{{ page.title }}</h1>
+                <img src="{{ site.root }}img/{{ page.header_img }}" alt="" />
+            </header>
             {% else %}
             <header>
                 <h1>{{ page.title }}</h1>