Mercurial > hg > decoupage
changeset 28:fc1c479296c3
more docmentation updates
author | k0s <k0scist@gmail.com> |
---|---|
date | Tue, 19 Jan 2010 09:15:35 -0500 |
parents | 9e86c5cb111a |
children | ffd661a0f169 |
files | README.txt decoupage/formatters.py |
diffstat | 2 files changed, 52 insertions(+), 14 deletions(-) [+] |
line wrap: on
line diff
--- a/README.txt Mon Jan 18 15:33:42 2010 -0500 +++ b/README.txt Tue Jan 19 09:15:35 2010 -0500 @@ -65,20 +65,45 @@ Formatters: +sort: + determines how to sort the files in a directory; + right now only by case-insensitive alphabetically + * reverse : reverse the order of the sorting + all: only pass files of a certain pattern; the inverse of ignore calling all with no arguments means only files with descriptions are used -title: splits a description into a title and a description with a -separator -describe: substitute the description for the filename -ignore: ignore files of a certain pattern +title: + splits a description into a title and a description via a + separator in + the description. The template will now have an additional + variable, + 'title', per file + Arguments: + * separator: what separator to use (':' by default) + +describe: + obtain the description from the filename + the file extension (if any) will be dropped and + spaces will be substituted for underscores + +ignore: + ignore files of a glob patterns. + These files will not be linked to in the template. + e.g. /ignore = .* *.pdf # don't list dotfiles and PDFs + +images: display images with thumbnails include: include a file at the top of the body -css: specify CSS +css: specify CSS used (whitespace separated list) Decoupage also makes use of other special intrinsic keywords: -inherit: -transform: +formatters: ordered list of formatters to apply + +inherit: inherit configuration from a certain directory (instead of +the parent + +transform: a list of transformers for contenttransformer
--- a/decoupage/formatters.py Mon Jan 18 15:33:42 2010 -0500 +++ b/decoupage/formatters.py Tue Jan 19 09:15:35 2010 -0500 @@ -37,7 +37,8 @@ class Ignore(object): """ - ignore files of a glob patterns. These files will not be used in the index template. + ignore files of a glob patterns. + These files will not be linked to in the template. e.g. /ignore = .* *.pdf # don't list dotfiles and PDFs """ @@ -85,7 +86,7 @@ """ determines how to sort the files in a directory; right now only by case-insensitive alphabetically - * reverse : reverse the + * reverse : reverse the order of the sorting """ def __init__(self, pattern): self.args = [i.strip() for i in pattern.split(',')] @@ -99,13 +100,19 @@ class FilenameDescription(FormatterBase): - """substitute the description for the filename""" + """ + obtain the description from the filename + the file extension (if any) will be dropped and + spaces will be substituted for underscores + """ + # TODO : deal with CamelCaseFilenames def __call__(self, request, data): for f in data['files']: if f['description'] is None: description = f['name'] - description = description.rsplit('.', 1)[0] + if '.' in description: + description = description.rsplit('.', 1)[0] decription = description.strip('_') if '_' in description: description = ' '.join([i.title() for i in description.split('_')]) @@ -113,8 +120,14 @@ class TitleDescription(FormatterBase): - """splits a description into a title and a description with a separator""" - + """ + splits a description into a title and a description via a separator in + the description. The template will now have an additional variable, + 'title', per file + Arguments: + * separator: what separator to use (':' by default) + """ + # XXX what about setting the page title? defaults = { 'separator': ':' } @@ -129,7 +142,7 @@ f['description'] = None class CSS(object): - """specify CSS""" + """specify CSS used (whitespace separated list)""" def __init__(self, arg): self.css = arg.split()