Mercurial > hg > decoupage
annotate README.txt @ 99:2c7c4fda1a14
update ReST
author | Jeff Hammel <k0scist@gmail.com> |
---|---|
date | Tue, 23 Aug 2016 18:11:39 -0700 |
parents | 5330cd62e179 |
children | 70f5be036103 |
rev | line source |
---|---|
0
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
1 decoupage |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
2 ========= |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
3 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
4 what is it? |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
5 ----------- |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
6 |
78
5330cd62e179
something about hash marks in filenames
Jeff Hammel <jhammel@mozilla.com>
parents:
36
diff
changeset
|
7 `decoupage` is a *dynamic* file server that allows for index pages |
0
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
8 configurable with genshi templates and .ini files. I mainly wrote it |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
9 because i was tired of using apache for serving my website and |
18 | 10 generating index.html files by hand. Decoupage provides views into |
11 the filesystem. | |
12 | |
0
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
13 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
14 how do i use it? |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
15 ---------------- |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
16 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
17 Set up a `paste <http://pythonpaste.org>`_ .ini file that specifies the |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
18 directory to serve (``decoupage.directory``) and, optionally, a |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
19 configuration file .ini file (``decoupage.configuraton``) which |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
20 specifies the labels for the files based on directory. An example of a |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
21 `paste <http://pythonpaste.org>`_ .ini file is in |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
22 ``decoupage.ini``. Note the ``[app:decoupage]`` section:: |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
23 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
24 [app:decoupage] |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
25 paste.app_factory = decoupage.factory:factory |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
26 decoupage.directory = %(here)s/example |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
27 decoupage.configuration = %(here)s/example.ini |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
28 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
29 The labels for files are in ``example.ini``, specified by sections as |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
30 directories:: |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
31 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
32 [/] |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
33 foo.txt = a file about cats |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
34 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
35 [/cats] |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
36 lilly.txt = lilly |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
37 hobbes.txt = a file about Hobbes |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
38 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
39 You can specify the entire layout from here. Alternately, you can |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
40 have an ``index.ini`` in a directory which, if present, overrides the |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
41 default configuration. Such a file is in the ``fleem`` subdirectory |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
42 of ``example``:: |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
43 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
44 /template = index.html |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
45 fleem.txt = some fleem for ya |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
46 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
47 Try it out! Install decoupage and run ``paster serve decoupage.ini`` |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
48 and point your browser to the URL it gives you. |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
49 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
50 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
51 how do i do more with decoupage? |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
52 -------------------------------- |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
53 |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
54 Since filenames can't start with a ``/`` (just try it!), the |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
55 functionality of decoupage may be extended with ``/`` commands in a |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
56 section. This is done by adding a setuptools ``entry_point`` to |
fa2005f769eb
adding decoupage from http://my-svn.assembla.com/svn/arbez/decoupage r355
k0s <k0scist@gmail.com>
parents:
diff
changeset
|
57 ``[decoupage.formatters]``. See the decoupage ``setup.py`` and |
99 | 58 ``decoupage.formatters`` for examples. For instance, |
18 | 59 |
60 Running `decoupage-formatters` from the command line gives the list of | |
61 formatters that are available (which are pluggable setuptools extension points | |
62 at [decoupage.formatters]). For example: /include = site.html could | |
63 include the site.html genshi template at the top of the body. | |
64 | |
27 | 65 Formatters: |
66 | |
99 | 67 sort: |
68 determines how to sort the files in a directory; | |
28 | 69 right now only by case-insensitive alphabetically |
70 * reverse : reverse the order of the sorting | |
99 | 71 |
72 all: | |
73 only pass files of a certain pattern; | |
18 | 74 the inverse of ignore |
75 calling all with no arguments means only files with descriptions | |
76 are used | |
99 | 77 |
78 title: | |
28 | 79 splits a description into a title and a description via a |
99 | 80 separator in |
28 | 81 the description. The template will now have an additional |
99 | 82 variable, |
28 | 83 'title', per file |
84 Arguments: | |
85 * separator: what separator to use (':' by default) | |
78
5330cd62e179
something about hash marks in filenames
Jeff Hammel <jhammel@mozilla.com>
parents:
36
diff
changeset
|
86 |
99 | 87 describe: |
28 | 88 obtain the description from the filename |
89 the file extension (if any) will be dropped and | |
90 spaces will be substituted for underscores | |
99 | 91 |
92 ignore: | |
93 ignore files of a glob patterns. | |
28 | 94 These files will not be linked to in the template. |
99 | 95 e.g. ``/ignore = .* *.pdf # don't list dotfiles and PDFs`` |
96 | |
18 | 97 include: include a file at the top of the body |
99 | 98 |
28 | 99 css: specify CSS used (whitespace separated list) |
18 | 100 |
27 | 101 Decoupage also makes use of other special intrinsic keywords: |
102 | |
28 | 103 formatters: ordered list of formatters to apply |
104 | |
105 inherit: inherit configuration from a certain directory (instead of | |
106 the parent | |
107 | |
108 transform: a list of transformers for contenttransformer | |
36 | 109 |
110 | |
111 TODO | |
112 ---- | |
113 | |
114 * allow transformers to be configurable on a per-directory basis | |
115 * add a ``?format=rss`` query string argument | |
116 * add a ``?template=foo.html`` query string argument |