From 105b5c2863bfa4e578bcd92533e51595fcfd3495 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Thu, 21 Apr 2011 17:10:00 +0200 Subject: [PATCH 0001/2344] Add subtitle --- pelican/readers.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pelican/readers.py b/pelican/readers.py index 4e1d7b2e..6d0b6cea 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -49,9 +49,14 @@ class RstReader(Reader): rendered_content = core.publish_parts(text, writer_name='html', settings_overrides=extra_params) title = rendered_content.get('title') + subtitle = rendered_content.get('subtitle') or '' content = rendered_content.get('body') + if not metadatas.has_key('title'): metadatas['title'] = title + if not metadatas.has_key('subtitle'): + metadatas['subtitle'] = subtitle + return content, metadatas class MarkdownReader(Reader): From 98ed7338e6c360dd82f0220971851c39875d3cb3 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Thu, 21 Apr 2011 19:26:12 +0200 Subject: [PATCH 0002/2344] add a test metadata for #98 --- samples/content/another_super_article.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/content/another_super_article.rst b/samples/content/another_super_article.rst index abe8d26c..5ec1e2b8 100644 --- a/samples/content/another_super_article.rst +++ b/samples/content/another_super_article.rst @@ -6,6 +6,7 @@ Oh yeah ! :category: bar :author: Alexis Métaireau :slug: oh-yeah +:license: WTFPL Why not ? ========= From bb0d4bcc2f755e5ae27f41d402c158bba7496b6d Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 24 Apr 2011 13:05:40 +0200 Subject: [PATCH 0003/2344] =?UTF-8?q?Add=20documentation=20about=20the=20R?= =?UTF-8?q?ELATIVE=5FURLS=20setting.=20Thanks=20to=20G=C3=BCnter=20Kolouse?= =?UTF-8?q?k.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- THANKS | 1 + docs/settings.rst | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/THANKS b/THANKS index 078a67d1..4a8a52a5 100644 --- a/THANKS +++ b/THANKS @@ -14,3 +14,4 @@ bugs or giving ideas. Thanks to them ! - Laureline Guérin - Samuel Martin - Marcus Fredriksson +- Günter Kolousek diff --git a/docs/settings.rst b/docs/settings.rst index 67039832..e3f4a94e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -63,11 +63,16 @@ Setting name what it does ? `PATH` path to look at for input files. `PDF_PROCESSOR` Put True if you want to have PDF versions of your documents. You will need to install `rst2pdf`. +`RELATIVE_URL` Defines if pelican should use relative urls or not. + It is set to True per default. `REVERSE_ARCHIVE_ORDER` Reverse the archives order. (True makes it in descending order: the newer first) `REVERSE_CATEGORY_ORDER` Reverse the category order. (True makes it in descending order, default is alphabetically) -`SITEURL` base URL of your website. +`SITEURL` base URL of your website. Note that this is not + a way to tell pelican to use relative urls or + static ones. You should rather use the `RELATIVE_URL` + setting for such use. `SITENAME` Your site name, `SKRIBIT_TYPE` The type of skribit widget (TAB or WIDGET). `SKRIBIT_TAB_COLOR` Tab color (#XXXXXX, default #333333). From 8de525fa281a8052a57c7f9f2fde41b48e3b5e07 Mon Sep 17 00:00:00 2001 From: Skami18 Date: Mon, 25 Apr 2011 12:13:44 +0200 Subject: [PATCH 0004/2344] Removed a bug (debug messages was not showed) and improved readability --- pelican/log.py | 98 ++++++++++++++++++++++++++------------------------ 1 file changed, 52 insertions(+), 46 deletions(-) diff --git a/pelican/log.py b/pelican/log.py index b895ad66..72b7a017 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -1,46 +1,51 @@ -import logging +from logging import * import sys import os global ANSI ANSI = { - 'gray' : lambda(text) : '\033[1;30m' + unicode(text) + '\033[1;m', - 'red' : lambda(text) : '\033[1;31m' + unicode(text) + '\033[1;m', - 'green' : lambda(text) : '\033[1;32m' + unicode(text) + '\033[1;m', - 'yellow' : lambda(text) : '\033[1;33m' + unicode(text) + '\033[1;m', - 'blue' : lambda(text) : '\033[1;34m' + unicode(text) + '\033[1;m', - 'magenta' : lambda(text) : '\033[1;35m' + unicode(text) + '\033[1;m', - 'cyan' : lambda(text) : '\033[1;36m' + unicode(text) + '\033[1;m', - 'white' : lambda(text) : '\033[1;37m' + unicode(text) + '\033[1;m', - 'crimson' : lambda(text) : '\033[1;38m' + unicode(text) + '\033[1;m', - 'bgred' : lambda(text) : '\033[1;41m' + unicode(text) + '\033[1;m', - 'bggreen' : lambda(text) : '\033[1;42m' + unicode(text) + '\033[1;m', - 'bgbrown' : lambda(text) : '\033[1;43m' + unicode(text) + '\033[1;m', - 'bgblue' : lambda(text) : '\033[1;44m' + unicode(text) + '\033[1;m', - 'bgmagenta' : lambda(text) : '\033[1;45m' + unicode(text) + '\033[1;m', - 'bgcyan' : lambda(text) : '\033[1;46m' + unicode(text) + '\033[1;m', - 'bggray' : lambda(text) : '\033[1;47m' + unicode(text) + '\033[1;m', - 'bgcrimson' : lambda(text) : '\033[1;48m' + unicode(text) + '\033[1;m' + 'gray' : lambda(text) : u'\033[1;30m' + unicode(text) + u'\033[1;m', + 'red' : lambda(text) : u'\033[1;31m' + unicode(text) + u'\033[1;m', + 'green' : lambda(text) : u'\033[1;32m' + unicode(text) + u'\033[1;m', + 'yellow' : lambda(text) : u'\033[1;33m' + unicode(text) + u'\033[1;m', + 'blue' : lambda(text) : u'\033[1;34m' + unicode(text) + u'\033[1;m', + 'magenta' : lambda(text) : u'\033[1;35m' + unicode(text) + u'\033[1;m', + 'cyan' : lambda(text) : u'\033[1;36m' + unicode(text) + u'\033[1;m', + 'white' : lambda(text) : u'\033[1;37m' + unicode(text) + u'\033[1;m', + 'bgred' : lambda(text) : u'\033[1;41m' + unicode(text) + u'\033[1;m', + 'bggreen' : lambda(text) : u'\033[1;42m' + unicode(text) + u'\033[1;m', + 'bgbrown' : lambda(text) : u'\033[1;43m' + unicode(text) + u'\033[1;m', + 'bgblue' : lambda(text) : u'\033[1;44m' + unicode(text) + u'\033[1;m', + 'bgmagenta' : lambda(text) : u'\033[1;45m' + unicode(text) + u'\033[1;m', + 'bgcyan' : lambda(text) : u'\033[1;46m' + unicode(text) + u'\033[1;m', + 'bggray' : lambda(text) : u'\033[1;47m' + unicode(text) + u'\033[1;m', + 'bgyellow' : lambda(text) : u'\033[1;43m' + unicode(text) + u'\033[1;m', + 'bggrey' : lambda(text) : u'\033[1;100m' + unicode(text) + u'\033[1;m' } -class ANSIFormatter(logging.Formatter): + +class ANSIFormatter(Formatter): """ Convert a `logging.LogReport' object into colored text, using ANSI escape sequences. """ ## colors: def format(self, record): - if not record.levelname or record.levelname is 'INFO': - return ANSI['white'](record.msg) + if record.levelname is 'INFO': + return ANSI['cyan']('-> ') + unicode(record.msg) elif record.levelname is 'WARNING': - return ANSI['yellow'](record.levelname) + ': ' + record.msg + return ANSI['yellow'](record.levelname) + ': ' + unicode(record.msg) elif record.levelname is 'ERROR': - return ANSI['red'](record.levelname) + ': ' + record.msg + return ANSI['red'](record.levelname) + ': ' + unicode(record.msg) elif record.levelname is 'CRITICAL': - return ANSI['bgred'](record.levelname) + ': ' + record.msg + return ANSI['bgred'](record.levelname) + ': ' + unicode(record.msg) + elif record.levelname is 'DEBUG': + return ANSI['bggrey'](record.levelname) + ': ' + unicode(record.msg) + else: + return ANSI['white'](record.levelname) + ': ' + unicode(record.msg) -class TextFormatter(logging.Formatter): +class TextFormatter(Formatter): """ Convert a `logging.LogReport' object into text. """ @@ -52,7 +57,7 @@ class TextFormatter(logging.Formatter): return record.levelname + ': ' + record.msg -class Formatter(object): +class DummyFormatter(object): """ A dummy class. Return an instance of the appropriate formatter (ANSIFormatter if sys.stdout.isatty() is True, else TextFormatter) @@ -66,21 +71,10 @@ class Formatter(object): -# shortcuts -debug, info, warn, error, critical = (logging.debug, - logging.info, - logging.warn, - logging.error, - logging.critical) -DEBUG, INFO, WARN, ERROR, CRITICAL = (logging.DEBUG, - logging.INFO, - logging.WARN, - logging.ERROR, - logging.CRITICAL) -def init(level=None, logger=logging.getLogger(), handler=logging.StreamHandler()): - fmt = Formatter() +def init(level=None, logger=getLogger(), handler=StreamHandler()): + fmt = DummyFormatter() handler.setFormatter(fmt) logger.addHandler(handler) if level: @@ -88,11 +82,23 @@ def init(level=None, logger=logging.getLogger(), handler=logging.StreamHandler() if __name__ == '__main__': - init() - logging.basicConfig(filename='example.log',level=logging.DEBUG) - logging.debug('Logging test') - logging.info('info') - logging.warning('warning') - logging.error('error') - logging.critical('critical') + init(level=DEBUG) + debug('debug') + info('info') + warning('warning') + error('error') + critical('critical') + +__all__ = [ + "debug", + "info", + "warn", + "error", + "critical", + "DEBUG", + "INFO", + "WARN", + "ERROR", + "CRITICAL" +] From 764a135bb3a37d6be0fc08c3ddc67aaa7409314b Mon Sep 17 00:00:00 2001 From: Simon Liedtke Date: Sun, 24 Apr 2011 09:05:38 -0700 Subject: [PATCH 0005/2344] Pelican is an "it", not a "he" --- docs/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index d90e1fe8..fc2e171e 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -38,7 +38,7 @@ Writing articles using pelican Files metadata -------------- -Pelican tries to be smart enough to get the informations he needs from the +Pelican tries to be smart enough to get the informations it needs from the file system (for instance, about the category of your articles), but you need to provide by hand some of those informations in your files. From b6b7238519f6049c932d5c1e542bdc5483fb7327 Mon Sep 17 00:00:00 2001 From: Simon Liedtke Date: Sun, 24 Apr 2011 09:24:05 -0700 Subject: [PATCH 0006/2344] removed unused import --- pelican/__init__.py | 1 - 1 file changed, 1 deletion(-) mode change 100755 => 100644 pelican/__init__.py diff --git a/pelican/__init__.py b/pelican/__init__.py old mode 100755 new mode 100644 index 497e5d0d..195ada34 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -1,6 +1,5 @@ import argparse import os -from functools import partial from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, PdfGenerator) From ec9525a3e82a9c279b476c5bc6aeb0a0883f1804 Mon Sep 17 00:00:00 2001 From: derdon Date: Mon, 25 Apr 2011 00:33:55 +0200 Subject: [PATCH 0007/2344] include the default values of the settings in the 1st column in parens this way, it is much easier for the reader to see which variable has which default value. I also added some default values which could not be found in the documentation before. --- docs/settings.rst | 157 +++++++++++++++++++++++----------------------- 1 file changed, 79 insertions(+), 78 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index e3f4a94e..498f60cd 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -20,84 +20,85 @@ Here are the available settings. Please note that all the settings you put in this file will be passed to the templates as well. -======================== ======================================================= -Setting name what it does ? -======================== ======================================================= -`AUTHOR` Default author (put your name) -`CATEGORY_FEED` Where to put the atom categories feeds. default is - `feeds/%s.atom.xml`, where %s is the name of the - category. -`CATEGORY_FEED_RSS` Where to put the categories rss feeds. default is None - (no rss) -`CSS_FILE` To specify the CSS file you want to load, if it's not - the default one ('main.css') -`DATE_FORMATS` If you do manage multiple languages, you can set - the date formatting here. -`DEFAULT_CATEGORY` The default category to fallback on. `misc` by default. -`DEFAULT_DATE_FORMAT` The default date format you want to use. -`DEFAULT_LANG` The default language to use. Default is 'en'. -`DEFAULT_ORPHANS` The minimum number of articles allowed on the last - page, defaults to zero. Use this when you don't want - to have a last page with very few articles. -`DEFAULT_PAGINATION` The maximum number of articles to include on a page, - not including orphans. Default is 5. -`DISPLAY_PAGES_ON_MENU` Display or not the pages on the menu of the template. - Templates can follow or not this settings. -`FALLBACK_ON_FS_DATE` If True, pelican will use the file system dates infos - (mtime) if it can't get informations from the - metadata? -`FEED` relative url to output the atom feed. Default is - `feeds/all.atom.xml` -`FEED_RSS` relative url to output the rss feed. Default is - None (no rss) -`JINJA_EXTENSIONS` A list of any Jinja2 extensions you want to use. - Default is no extensions (the empty list). -`KEEP_OUTPUT_DIRECTORY` Keep the output directory and just update all the - generated files. -`LOCALE` Change the locale. Default is the system locale. - Default is to delete the output directory. -`MARKUP` A list of available markup languages you want to use. - For the moment, only available values are `rst` and `md`. -`OUTPUT_PATH` Where to output the generated files. Default to - "output" -`PATH` path to look at for input files. -`PDF_PROCESSOR` Put True if you want to have PDF versions of your - documents. You will need to install `rst2pdf`. -`RELATIVE_URL` Defines if pelican should use relative urls or not. - It is set to True per default. -`REVERSE_ARCHIVE_ORDER` Reverse the archives order. (True makes it in - descending order: the newer first) -`REVERSE_CATEGORY_ORDER` Reverse the category order. (True makes it in - descending order, default is alphabetically) -`SITEURL` base URL of your website. Note that this is not - a way to tell pelican to use relative urls or - static ones. You should rather use the `RELATIVE_URL` - setting for such use. -`SITENAME` Your site name, -`SKRIBIT_TYPE` The type of skribit widget (TAB or WIDGET). -`SKRIBIT_TAB_COLOR` Tab color (#XXXXXX, default #333333). -`SKRIBIT_TAB_HORIZ` Tab Distance from Left (% or distance, default Null). -`SKRIBIT_TAB_VERT` Tab Distance from Top (% or distance, default 20%). -`SKRIBIT_TAB_PLACEMENT` Tab placement (Top, Bottom, Left or Right, default - LEFT). -`SKRIBIT_TAB_SITENAME` Tab identifier (See Skribit part below). -`SKRIBIT_WIDGET_ID` Widget identifier (See Skribit part below). -`STATIC_PATHS` The static paths you want to have accessible on the - output path "static". By default, pelican will copy - the 'images' folder to the output folder. -`STATIC_THEME_PATHS` Static theme paths you want to copy. Default values - is `static`, but if your theme have others static paths, - you can put them here. -`TAG_CLOUD_STEPS` Count of different font sizes in the tag cloud. -`TAG_CLOUD_MAX_ITEMS` Maximum tags count in the cloud. -`THEME` theme to use to product the output. can be the - complete static path to a theme folder, or chosen - between the list of default themes (see below) -`TRANSLATION_FEED` Where to put the RSS feed for translations. Default - is feeds/all-%s.atom.xml where %s is the name of the - lang. -`WITH_PAGINATION` Activate pagination. Default is False. -======================== ======================================================= +================================================ ===================================================== +Setting name (default value) what does it do? +================================================ ===================================================== +`AUTHOR` Default author (put your name) +`CATEGORY_FEED` ('feeds/%s.atom.xml'[1]_) Where to put the atom categories feeds. +`CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the categories rss feeds. +`CSS_FILE` (``'main.css'``) specify the CSS file you want to load +`DATE_FORMATS` (``{}``) If you do manage multiple languages, you can + set the date formatting here. +`DEFAULT_CATEGORY` (``'misc'``) The default category to fallback on. +`DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use. +`DEFAULT_LANG` (``'en'``) The default language to use. +`DEFAULT_ORPHANS` (0) The minimum number of articles allowed on the + last page. Use this when you don't want to + have a last page with very few articles. +`DEFAULT_PAGINATION` (5) The maximum number of articles to include on a + page, not including orphans. +`DISPLAY_PAGES_ON_MENU` (``True``) Display or not the pages on the menu of the + template. Templates can follow or not this + settings. +`FALLBACK_ON_FS_DATE` (``True``) If True, pelican will use the file system + dates infos (mtime) if it can't get + informations from the metadata? +`FEED` (``'feeds/all.atom.xml'``) relative url to output the atom feed. +`FEED_RSS` (``None``, i.e. no RSS) relative url to output the rss feed. +`JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. +`KEEP_OUTPUT_DIRECTORY` (``False``) Keep the output directory and just update all + the generated files. +`LOCALE` (''[2]_) Change the locale. +`MARKUP` (``('rst', 'md')``) A list of available markup languages you want + to use. For the moment, only available values + are `rst` and `md`. +`OUTPUT_PATH` (``'output/'``) Where to output the generated files. +`PATH` (``None``) path to look at for input files. +`PDF_PROCESSOR` (``False``) Set to True if you want to have PDF versions + of your documents. You will need to install + `rst2pdf`. +`RELATIVE_URL` (``True``) Defines if pelican should use relative urls or + not. +`REVERSE_ARCHIVE_ORDER` (``False``) Reverse the archives order. (True makes it in + descending order: the newer first) +`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True makes it in + descending order, default is alphabetically) +`SITEURL` base URL of your website. Note that this is + not a way to tell pelican to use relative urls + or static ones. You should rather use the + `RELATIVE_URL` setting for such use. +`SITENAME` (``'A Pelican Blog'``) Your site name, +`SKRIBIT_TYPE` The type of skribit widget (TAB or WIDGET). +`SKRIBIT_TAB_COLOR` Tab color (#XXXXXX, default #333333). +`SKRIBIT_TAB_HORIZ` Tab Distance from Left (% or distance, default Null). +`SKRIBIT_TAB_VERT` Tab Distance from Top (% or distance, default 20%). +`SKRIBIT_TAB_PLACEMENT` Tab placement (Top, Bottom, Left or Right, + default LEFT). +`SKRIBIT_TAB_SITENAME` Tab identifier (See Skribit part below). +`SKRIBIT_WIDGET_ID` Widget identifier (See Skribit part below). +`STATIC_PATHS` The static paths you want to have accessible +(``['images']``) on the output path "static". By default, + pelican will copy the 'images' folder to the + output folder. +`STATIC_THEME_PATHS` (``['static']``) Static theme paths you want to copy. Default + values is `static`, but if your theme have + others static paths, you can put them here. +`TAG_CLOUD_STEPS` (4) Count of different font sizes in the tag + cloud. +`TAG_CLOUD_MAX_ITEMS` (100) Maximum tags count in the cloud. +`THEME` theme to use to product the output. can be the + complete static path to a theme folder, or + chosen between the list of default themes (see + below) +`TRANSLATION_FEED` ('feeds/all-%s.atom.xml'[3]_) Where to put the RSS feed for translations. +`WITH_PAGINATION` (``False``) Activate pagination. +================================================ ===================================================== + +.. [1] %s is the name of the category. + +.. [2] Default is the system locale. Default is to delete the output directory. + +.. [3] %s is the language Skribit ======= From c8d20a70648debb1148a0e9bdd616652929a5a57 Mon Sep 17 00:00:00 2001 From: derdon Date: Mon, 25 Apr 2011 00:36:15 +0200 Subject: [PATCH 0008/2344] fixed the writings of two variable names in the settings table --- docs/settings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 498f60cd..66152a3e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -54,7 +54,7 @@ Setting name (default value) what does it do? are `rst` and `md`. `OUTPUT_PATH` (``'output/'``) Where to output the generated files. `PATH` (``None``) path to look at for input files. -`PDF_PROCESSOR` (``False``) Set to True if you want to have PDF versions +`PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions of your documents. You will need to install `rst2pdf`. `RELATIVE_URL` (``True``) Defines if pelican should use relative urls or @@ -80,7 +80,7 @@ Setting name (default value) what does it do? (``['images']``) on the output path "static". By default, pelican will copy the 'images' folder to the output folder. -`STATIC_THEME_PATHS` (``['static']``) Static theme paths you want to copy. Default +`THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default values is `static`, but if your theme have others static paths, you can put them here. `TAG_CLOUD_STEPS` (4) Count of different font sizes in the tag From 1ef913cb6434240640b2308cc1a2e220b056ce70 Mon Sep 17 00:00:00 2001 From: derdon Date: Mon, 25 Apr 2011 00:38:15 +0200 Subject: [PATCH 0009/2344] various grammar fixes --- docs/settings.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 66152a3e..064bc64e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -81,12 +81,12 @@ Setting name (default value) what does it do? pelican will copy the 'images' folder to the output folder. `THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default - values is `static`, but if your theme have - others static paths, you can put them here. + values is `static`, but if your theme has + other static paths, you can put them here. `TAG_CLOUD_STEPS` (4) Count of different font sizes in the tag cloud. `TAG_CLOUD_MAX_ITEMS` (100) Maximum tags count in the cloud. -`THEME` theme to use to product the output. can be the +`THEME` theme to use to produce the output. can be the complete static path to a theme folder, or chosen between the list of default themes (see below) From 6b62ed867379b6b6c4a513aaacaccc27113547a8 Mon Sep 17 00:00:00 2001 From: derdon Date: Mon, 25 Apr 2011 00:39:21 +0200 Subject: [PATCH 0010/2344] removed a useless comma --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 064bc64e..a40ebbb9 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -67,7 +67,7 @@ Setting name (default value) what does it do? not a way to tell pelican to use relative urls or static ones. You should rather use the `RELATIVE_URL` setting for such use. -`SITENAME` (``'A Pelican Blog'``) Your site name, +`SITENAME` (``'A Pelican Blog'``) Your site name `SKRIBIT_TYPE` The type of skribit widget (TAB or WIDGET). `SKRIBIT_TAB_COLOR` Tab color (#XXXXXX, default #333333). `SKRIBIT_TAB_HORIZ` Tab Distance from Left (% or distance, default Null). From 60807d1958eca0d46d77870e0353d0b3215436e1 Mon Sep 17 00:00:00 2001 From: derdon Date: Mon, 25 Apr 2011 00:40:42 +0200 Subject: [PATCH 0011/2344] removed a confusing question mark --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index a40ebbb9..795f220c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -42,7 +42,7 @@ Setting name (default value) what does it do? settings. `FALLBACK_ON_FS_DATE` (``True``) If True, pelican will use the file system dates infos (mtime) if it can't get - informations from the metadata? + informations from the metadata `FEED` (``'feeds/all.atom.xml'``) relative url to output the atom feed. `FEED_RSS` (``None``, i.e. no RSS) relative url to output the rss feed. `JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. From 51f760edc2ab4a2ab18c1e5916eb30a7270849f1 Mon Sep 17 00:00:00 2001 From: derdon Date: Tue, 26 Apr 2011 00:39:31 +0200 Subject: [PATCH 0012/2344] move a default value to the table cell it belongs to --- docs/settings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 795f220c..d4340006 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -76,8 +76,8 @@ Setting name (default value) what does it do? default LEFT). `SKRIBIT_TAB_SITENAME` Tab identifier (See Skribit part below). `SKRIBIT_WIDGET_ID` Widget identifier (See Skribit part below). -`STATIC_PATHS` The static paths you want to have accessible -(``['images']``) on the output path "static". By default, +`STATIC_PATHS` (``['images']``) The static paths you want to have accessible + on the output path "static". By default, pelican will copy the 'images' folder to the output folder. `THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default From bb24c05b903d338b4f5ca9b79dcd0295bcb5c39f Mon Sep 17 00:00:00 2001 From: derdon Date: Tue, 26 Apr 2011 02:37:56 +0200 Subject: [PATCH 0013/2344] added missing whitespace in the CLI help --- pelican/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 195ada34..08ddc716 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -91,8 +91,8 @@ def main(): parser.add_argument(dest='path', nargs='?', help='Path where to find the content files') parser.add_argument('-t', '--theme-path', dest='theme', - help='Path where to find the theme templates. If not specified, it will' - 'use the default one included with pelican.') + help='Path where to find the theme templates. If not specified, it' + 'will use the default one included with pelican.') parser.add_argument('-o', '--output', dest='output', help='Where to output the generated files. If not specified, a directory' ' will be created, named "output" in the current path.') From f9819e0c712ad7cb2e06c1b5158d46314b9a70ee Mon Sep 17 00:00:00 2001 From: derdon Date: Tue, 26 Apr 2011 02:39:57 +0200 Subject: [PATCH 0014/2344] another whitespace mistake in the CLI help --- pelican/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 08ddc716..12d12210 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -97,8 +97,8 @@ def main(): help='Where to output the generated files. If not specified, a directory' ' will be created, named "output" in the current path.') parser.add_argument('-m', '--markup', default=None, dest='markup', - help='the list of markup language to use (rst or md). Please indicate them' - 'separated by commas') + help='the list of markup language to use (rst or md). Please indicate ' + 'them separated by commas') parser.add_argument('-s', '--settings', dest='settings', help='the settings of the application. Default to None.') parser.add_argument('-k', '--keep-output-directory', dest='keep', From deb5b8a98f56bf73ced4a1e14227767aa008cd29 Mon Sep 17 00:00:00 2001 From: derdon Date: Tue, 26 Apr 2011 02:49:00 +0200 Subject: [PATCH 0015/2344] typos, grammar mistakes, minor whitespace issues --- docs/themes.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/themes.rst b/docs/themes.rst index 9f8b8765..301e090e 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -32,17 +32,17 @@ To make your own theme, you must follow the following structure:: just examples. Put what you need here. * `templates` contains all the templates that will be used to generate the content. - I've just put the mandatory templates here, you can define your own if it helps + I've just put the mandatory templates here, you can define your own if it helps you to organize yourself while doing the theme. Templates and variables ======================= It's using a simple syntax, that you can embbed into your html pages. -This document describes which templates should exists on a theme, and which +This document describes which templates should exist on a theme, and which variables will be passed to each template, while generating it. -All templates will receive the variables defined in your settings file, if they +All templates will receive the variables defined in your settings file, if they are in caps. You can access them directly. Common variables @@ -114,7 +114,7 @@ page_name 'category/`category_name`'. Useful for pagination article.html ------------- -This template will be processed for each article. .html files will be outputed +This template will be processed for each article. .html files will be output in output/`article_name`.html. Here are the specific variables it gets. ============= =================================================== @@ -152,8 +152,8 @@ page_name 'tag/`tag_name`'. Useful for pagination links. Include skribit script ====================== -In order to support skribit scripts in your themes, you must following these -actions : +In order to support skribit scripts in your themes, you must perform these +actions: * Copy `skribit_tab_script.html` and `skribit_widget_script.html` in your templates directory. From d2bb85ab6ce534b92457f08ad0333c2a4e90358b Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Mon, 25 Apr 2011 23:29:45 +0100 Subject: [PATCH 0016/2344] Thanks Simon Liedtke --- THANKS | 1 + 1 file changed, 1 insertion(+) diff --git a/THANKS b/THANKS index 4a8a52a5..39f54e61 100644 --- a/THANKS +++ b/THANKS @@ -15,3 +15,4 @@ bugs or giving ideas. Thanks to them ! - Samuel Martin - Marcus Fredriksson - Günter Kolousek +- Simon Liedtke From 15de7d45c9c0402f3669169ab0605b999d89726e Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Mon, 25 Apr 2011 23:33:13 +0100 Subject: [PATCH 0017/2344] Little doc fix --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index d4340006..363ffc87 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -167,7 +167,7 @@ The `notmyidea` theme can make good use of the following settings. I recommend to use them too in your themes. ======================= ======================================================= -Setting name what it does ? +Setting name what does it do ? ======================= ======================================================= `DISQUS_SITENAME` Pelican can handle disqus comments, specify the sitename you've filled in on disqus From ca2030f62c652b8c62ef8c45800634379ab6717a Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Tue, 26 Apr 2011 00:34:03 +0100 Subject: [PATCH 0018/2344] theme switch --- docs/_themes/LICENSE | 37 -- docs/_themes/README | 31 -- docs/_themes/flask/layout.html | 16 - docs/_themes/flask/relations.html | 19 - docs/_themes/flask/static/flasky.css_t | 387 ------------------ docs/_themes/flask/static/small_flask.css | 70 ---- docs/_themes/flask/theme.conf | 7 - docs/_themes/flask_small/static/flasky.css_t | 287 ------------- docs/_themes/flask_theme_support.py | 86 ---- .../{flask_small => pelican}/layout.html | 0 docs/_themes/pelican/static/pelican.css_t | 247 +++++++++++ .../{flask_small => pelican}/theme.conf | 4 +- docs/conf.py | 4 +- 13 files changed, 251 insertions(+), 944 deletions(-) delete mode 100644 docs/_themes/LICENSE delete mode 100644 docs/_themes/README delete mode 100644 docs/_themes/flask/layout.html delete mode 100644 docs/_themes/flask/relations.html delete mode 100644 docs/_themes/flask/static/flasky.css_t delete mode 100644 docs/_themes/flask/static/small_flask.css delete mode 100644 docs/_themes/flask/theme.conf delete mode 100644 docs/_themes/flask_small/static/flasky.css_t delete mode 100644 docs/_themes/flask_theme_support.py rename docs/_themes/{flask_small => pelican}/layout.html (100%) create mode 100644 docs/_themes/pelican/static/pelican.css_t rename docs/_themes/{flask_small => pelican}/theme.conf (58%) diff --git a/docs/_themes/LICENSE b/docs/_themes/LICENSE deleted file mode 100644 index 8daab7ee..00000000 --- a/docs/_themes/LICENSE +++ /dev/null @@ -1,37 +0,0 @@ -Copyright (c) 2010 by Armin Ronacher. - -Some rights reserved. - -Redistribution and use in source and binary forms of the theme, with or -without modification, are permitted provided that the following conditions -are met: - -* Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - -* Redistributions in binary form must reproduce the above - copyright notice, this list of conditions and the following - disclaimer in the documentation and/or other materials provided - with the distribution. - -* The names of the contributors may not be used to endorse or - promote products derived from this software without specific - prior written permission. - -We kindly ask you to only use these themes in an unmodified manner just -for Flask and Flask-related products, not for unrelated projects. If you -like the visual style and want to use it for your own projects, please -consider making some larger changes to the themes (such as changing -font faces, sizes, colors or margins). - -THIS THEME IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS THEME, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/docs/_themes/README b/docs/_themes/README deleted file mode 100644 index b3292bdf..00000000 --- a/docs/_themes/README +++ /dev/null @@ -1,31 +0,0 @@ -Flask Sphinx Styles -=================== - -This repository contains sphinx styles for Flask and Flask related -projects. To use this style in your Sphinx documentation, follow -this guide: - -1. put this folder as _themes into your docs folder. Alternatively - you can also use git submodules to check out the contents there. -2. add this to your conf.py: - - sys.path.append(os.path.abspath('_themes')) - html_theme_path = ['_themes'] - html_theme = 'flask' - -The following themes exist: - -- 'flask' - the standard flask documentation theme for large - projects -- 'flask_small' - small one-page theme. Intended to be used by - very small addon libraries for flask. - -The following options exist for the flask_small theme: - - [options] - index_logo = '' filename of a picture in _static - to be used as replacement for the - h1 in the index.rst file. - index_logo_height = 120px height of the index logo - github_fork = '' repository name on github for the - "fork me" badge diff --git a/docs/_themes/flask/layout.html b/docs/_themes/flask/layout.html deleted file mode 100644 index d7c87927..00000000 --- a/docs/_themes/flask/layout.html +++ /dev/null @@ -1,16 +0,0 @@ -{%- extends "basic/layout.html" %} -{%- block extrahead %} - {{ super() }} - {% if theme_touch_icon %} - - {% endif %} - -{% endblock %} -{%- block relbar2 %}{% endblock %} -{%- block footer %} - -{%- endblock %} diff --git a/docs/_themes/flask/relations.html b/docs/_themes/flask/relations.html deleted file mode 100644 index 3bbcde85..00000000 --- a/docs/_themes/flask/relations.html +++ /dev/null @@ -1,19 +0,0 @@ -

Related Topics

- diff --git a/docs/_themes/flask/static/flasky.css_t b/docs/_themes/flask/static/flasky.css_t deleted file mode 100644 index 0de60eee..00000000 --- a/docs/_themes/flask/static/flasky.css_t +++ /dev/null @@ -1,387 +0,0 @@ -/* - * flasky.css_t - * ~~~~~~~~~~~~ - * - * :copyright: Copyright 2010 by Armin Ronacher. - * :license: Flask Design License, see LICENSE for details. - */ - -{% set page_width = '940px' %} -{% set sidebar_width = '220px' %} - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'Georgia', serif; - font-size: 17px; - background-color: white; - color: #000; - margin: 0; - padding: 0; -} - -div.document { - width: {{ page_width }}; - margin: 30px auto 0 auto; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 0 0 0 {{ sidebar_width }}; -} - -div.sphinxsidebar { - width: {{ sidebar_width }}; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 0 30px; -} - -img.floatingflask { - padding: 0 0 10px 10px; - float: right; -} - -div.footer { - width: {{ page_width }}; - margin: 20px auto 30px auto; - font-size: 14px; - color: #888; - text-align: right; -} - -div.footer a { - color: #888; -} - -div.related { - display: none; -} - -div.sphinxsidebar a { - color: #444; - text-decoration: none; - border-bottom: 1px dotted #999; -} - -div.sphinxsidebar a:hover { - border-bottom: 1px solid #999; -} - -div.sphinxsidebar { - font-size: 14px; - line-height: 1.5; -} - -div.sphinxsidebarwrapper { - padding: 18px 10px; -} - -div.sphinxsidebarwrapper p.logo { - padding: 0 0 20px 0; - margin: 0; - text-align: center; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: 'Garamond', 'Georgia', serif; - color: #444; - font-size: 24px; - font-weight: normal; - margin: 0 0 5px 0; - padding: 0; -} - -div.sphinxsidebar h4 { - font-size: 20px; -} - -div.sphinxsidebar h3 a { - color: #444; -} - -div.sphinxsidebar p.logo a, -div.sphinxsidebar h3 a, -div.sphinxsidebar p.logo a:hover, -div.sphinxsidebar h3 a:hover { - border: none; -} - -div.sphinxsidebar p { - color: #555; - margin: 10px 0; -} - -div.sphinxsidebar ul { - margin: 10px 0; - padding: 0; - color: #000; -} - -div.sphinxsidebar input { - border: 1px solid #ccc; - font-family: 'Georgia', serif; - font-size: 1em; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -div.body h1 { margin-top: 0; padding-top: 0; font-size: 240%; } -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: #ddd; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #eaeaea; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - background: #fafafa; - margin: 20px -30px; - padding: 10px 30px; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} - -div.admonition tt.xref, div.admonition a tt { - border-bottom: 1px solid #fafafa; -} - -dd div.admonition { - margin-left: -60px; - padding-left: 60px; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight { - background-color: white; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.9em; -} - -img.screenshot { -} - -tt.descname, tt.descclassname { - font-size: 0.95em; -} - -tt.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #eee; - background: #fdfdfd; - font-size: 0.9em; -} - -table.footnote + table.footnote { - margin-top: -15px; - border-top: none; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.footnote td.label { - width: 0px; - padding: 0.3em 0 0.3em 0.5em; -} - -table.footnote td { - padding: 0.3em 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -blockquote { - margin: 0 0 0 30px; - padding: 0; -} - -ul, ol { - margin: 10px 0 10px 30px; - padding: 0; -} - -pre { - background: #eee; - padding: 7px 30px; - margin: 15px -30px; - line-height: 1.3em; -} - -dl pre, blockquote pre, li pre { - margin-left: -60px; - padding-left: 60px; -} - -dl dl pre { - margin-left: -90px; - padding-left: 90px; -} - -tt { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, a tt { - background-color: #FBFBFB; - border-bottom: 1px solid white; -} - -a.reference { - text-decoration: none; - border-bottom: 1px dotted #004B6B; -} - -a.reference:hover { - border-bottom: 1px solid #6D4100; -} - -a.footnote-reference { - text-decoration: none; - font-size: 0.7em; - vertical-align: top; - border-bottom: 1px dotted #004B6B; -} - -a.footnote-reference:hover { - border-bottom: 1px solid #6D4100; -} - -a:hover tt { - background: #EEE; -} diff --git a/docs/_themes/flask/static/small_flask.css b/docs/_themes/flask/static/small_flask.css deleted file mode 100644 index 1c6df309..00000000 --- a/docs/_themes/flask/static/small_flask.css +++ /dev/null @@ -1,70 +0,0 @@ -/* - * small_flask.css_t - * ~~~~~~~~~~~~~~~~~ - * - * :copyright: Copyright 2010 by Armin Ronacher. - * :license: Flask Design License, see LICENSE for details. - */ - -body { - margin: 0; - padding: 20px 30px; -} - -div.documentwrapper { - float: none; - background: white; -} - -div.sphinxsidebar { - display: block; - float: none; - width: 102.5%; - margin: 50px -30px -20px -30px; - padding: 10px 20px; - background: #333; - color: white; -} - -div.sphinxsidebar h3, div.sphinxsidebar h4, div.sphinxsidebar p, -div.sphinxsidebar h3 a { - color: white; -} - -div.sphinxsidebar a { - color: #aaa; -} - -div.sphinxsidebar p.logo { - display: none; -} - -div.document { - width: 100%; - margin: 0; -} - -div.related { - display: block; - margin: 0; - padding: 10px 0 20px 0; -} - -div.related ul, -div.related ul li { - margin: 0; - padding: 0; -} - -div.footer { - display: none; -} - -div.bodywrapper { - margin: 0; -} - -div.body { - min-height: 0; - padding: 0; -} diff --git a/docs/_themes/flask/theme.conf b/docs/_themes/flask/theme.conf deleted file mode 100644 index 307a1f0d..00000000 --- a/docs/_themes/flask/theme.conf +++ /dev/null @@ -1,7 +0,0 @@ -[theme] -inherit = basic -stylesheet = flasky.css -pygments_style = flask_theme_support.FlaskyStyle - -[options] -touch_icon = diff --git a/docs/_themes/flask_small/static/flasky.css_t b/docs/_themes/flask_small/static/flasky.css_t deleted file mode 100644 index fe2141c5..00000000 --- a/docs/_themes/flask_small/static/flasky.css_t +++ /dev/null @@ -1,287 +0,0 @@ -/* - * flasky.css_t - * ~~~~~~~~~~~~ - * - * Sphinx stylesheet -- flasky theme based on nature theme. - * - * :copyright: Copyright 2007-2010 by the Sphinx team, see AUTHORS. - * :license: BSD, see LICENSE for details. - * - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: 'Georgia', serif; - font-size: 17px; - color: #000; - background: white; - margin: 0; - padding: 0; -} - -div.documentwrapper { - float: left; - width: 100%; -} - -div.bodywrapper { - margin: 40px auto 0 auto; - width: 700px; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 30px 30px; -} - -img.floatingflask { - padding: 0 0 10px 10px; - float: right; -} - -div.footer { - text-align: right; - color: #888; - padding: 10px; - font-size: 14px; - width: 650px; - margin: 0 auto 40px auto; -} - -div.footer a { - color: #888; - text-decoration: underline; -} - -div.related { - line-height: 32px; - color: #888; -} - -div.related ul { - padding: 0 0 0 10px; -} - -div.related a { - color: #444; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #004B6B; - text-decoration: underline; -} - -a:hover { - color: #6D4100; - text-decoration: underline; -} - -div.body { - padding-bottom: 40px; /* saved for footer */ -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - margin: 30px 0px 10px 0px; - padding: 0; -} - -{% if theme_index_logo %} -div.indexwrapper h1 { - text-indent: -999999px; - background: url({{ theme_index_logo }}) no-repeat center center; - height: {{ theme_index_logo_height }}; -} -{% endif %} - -div.body h2 { font-size: 180%; } -div.body h3 { font-size: 150%; } -div.body h4 { font-size: 130%; } -div.body h5 { font-size: 100%; } -div.body h6 { font-size: 100%; } - -a.headerlink { - color: white; - padding: 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - color: #444; - background: #eaeaea; -} - -div.body p, div.body dd, div.body li { - line-height: 1.4em; -} - -div.admonition { - background: #fafafa; - margin: 20px -30px; - padding: 10px 30px; - border-top: 1px solid #ccc; - border-bottom: 1px solid #ccc; -} - -div.admonition p.admonition-title { - font-family: 'Garamond', 'Georgia', serif; - font-weight: normal; - font-size: 24px; - margin: 0 0 10px 0; - padding: 0; - line-height: 1; -} - -div.admonition p.last { - margin-bottom: 0; -} - -div.highlight{ - background-color: white; -} - -dt:target, .highlight { - background: #FAF3E8; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre, tt { - font-family: 'Consolas', 'Menlo', 'Deja Vu Sans Mono', 'Bitstream Vera Sans Mono', monospace; - font-size: 0.85em; -} - -img.screenshot { -} - -tt.descname, tt.descclassname { - font-size: 0.95em; -} - -tt.descname { - padding-right: 0.08em; -} - -img.screenshot { - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils { - border: 1px solid #888; - -moz-box-shadow: 2px 2px 4px #eee; - -webkit-box-shadow: 2px 2px 4px #eee; - box-shadow: 2px 2px 4px #eee; -} - -table.docutils td, table.docutils th { - border: 1px solid #888; - padding: 0.25em 0.7em; -} - -table.field-list, table.footnote { - border: none; - -moz-box-shadow: none; - -webkit-box-shadow: none; - box-shadow: none; -} - -table.footnote { - margin: 15px 0; - width: 100%; - border: 1px solid #eee; -} - -table.field-list th { - padding: 0 0.8em 0 0; -} - -table.field-list td { - padding: 0; -} - -table.footnote td { - padding: 0.5em; -} - -dl { - margin: 0; - padding: 0; -} - -dl dd { - margin-left: 30px; -} - -pre { - padding: 0; - margin: 15px -30px; - padding: 8px; - line-height: 1.3em; - padding: 7px 30px; - background: #eee; - border-radius: 2px; - -moz-border-radius: 2px; - -webkit-border-radius: 2px; -} - -dl pre { - margin-left: -60px; - padding-left: 60px; -} - -tt { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ -} - -tt.xref, a tt { - background-color: #FBFBFB; -} - -a:hover tt { - background: #EEE; -} diff --git a/docs/_themes/flask_theme_support.py b/docs/_themes/flask_theme_support.py deleted file mode 100644 index 33f47449..00000000 --- a/docs/_themes/flask_theme_support.py +++ /dev/null @@ -1,86 +0,0 @@ -# flasky extensions. flasky pygments style based on tango style -from pygments.style import Style -from pygments.token import Keyword, Name, Comment, String, Error, \ - Number, Operator, Generic, Whitespace, Punctuation, Other, Literal - - -class FlaskyStyle(Style): - background_color = "#f8f8f8" - default_style = "" - - styles = { - # No corresponding class for the following: - #Text: "", # class: '' - Whitespace: "underline #f8f8f8", # class: 'w' - Error: "#a40000 border:#ef2929", # class: 'err' - Other: "#000000", # class 'x' - - Comment: "italic #8f5902", # class: 'c' - Comment.Preproc: "noitalic", # class: 'cp' - - Keyword: "bold #004461", # class: 'k' - Keyword.Constant: "bold #004461", # class: 'kc' - Keyword.Declaration: "bold #004461", # class: 'kd' - Keyword.Namespace: "bold #004461", # class: 'kn' - Keyword.Pseudo: "bold #004461", # class: 'kp' - Keyword.Reserved: "bold #004461", # class: 'kr' - Keyword.Type: "bold #004461", # class: 'kt' - - Operator: "#582800", # class: 'o' - Operator.Word: "bold #004461", # class: 'ow' - like keywords - - Punctuation: "bold #000000", # class: 'p' - - # because special names such as Name.Class, Name.Function, etc. - # are not recognized as such later in the parsing, we choose them - # to look the same as ordinary variables. - Name: "#000000", # class: 'n' - Name.Attribute: "#c4a000", # class: 'na' - to be revised - Name.Builtin: "#004461", # class: 'nb' - Name.Builtin.Pseudo: "#3465a4", # class: 'bp' - Name.Class: "#000000", # class: 'nc' - to be revised - Name.Constant: "#000000", # class: 'no' - to be revised - Name.Decorator: "#888", # class: 'nd' - to be revised - Name.Entity: "#ce5c00", # class: 'ni' - Name.Exception: "bold #cc0000", # class: 'ne' - Name.Function: "#000000", # class: 'nf' - Name.Property: "#000000", # class: 'py' - Name.Label: "#f57900", # class: 'nl' - Name.Namespace: "#000000", # class: 'nn' - to be revised - Name.Other: "#000000", # class: 'nx' - Name.Tag: "bold #004461", # class: 'nt' - like a keyword - Name.Variable: "#000000", # class: 'nv' - to be revised - Name.Variable.Class: "#000000", # class: 'vc' - to be revised - Name.Variable.Global: "#000000", # class: 'vg' - to be revised - Name.Variable.Instance: "#000000", # class: 'vi' - to be revised - - Number: "#990000", # class: 'm' - - Literal: "#000000", # class: 'l' - Literal.Date: "#000000", # class: 'ld' - - String: "#4e9a06", # class: 's' - String.Backtick: "#4e9a06", # class: 'sb' - String.Char: "#4e9a06", # class: 'sc' - String.Doc: "italic #8f5902", # class: 'sd' - like a comment - String.Double: "#4e9a06", # class: 's2' - String.Escape: "#4e9a06", # class: 'se' - String.Heredoc: "#4e9a06", # class: 'sh' - String.Interpol: "#4e9a06", # class: 'si' - String.Other: "#4e9a06", # class: 'sx' - String.Regex: "#4e9a06", # class: 'sr' - String.Single: "#4e9a06", # class: 's1' - String.Symbol: "#4e9a06", # class: 'ss' - - Generic: "#000000", # class: 'g' - Generic.Deleted: "#a40000", # class: 'gd' - Generic.Emph: "italic #000000", # class: 'ge' - Generic.Error: "#ef2929", # class: 'gr' - Generic.Heading: "bold #000080", # class: 'gh' - Generic.Inserted: "#00A000", # class: 'gi' - Generic.Output: "#888", # class: 'go' - Generic.Prompt: "#745334", # class: 'gp' - Generic.Strong: "bold #000000", # class: 'gs' - Generic.Subheading: "bold #800080", # class: 'gu' - Generic.Traceback: "bold #a40000", # class: 'gt' - } diff --git a/docs/_themes/flask_small/layout.html b/docs/_themes/pelican/layout.html similarity index 100% rename from docs/_themes/flask_small/layout.html rename to docs/_themes/pelican/layout.html diff --git a/docs/_themes/pelican/static/pelican.css_t b/docs/_themes/pelican/static/pelican.css_t new file mode 100644 index 00000000..164073e1 --- /dev/null +++ b/docs/_themes/pelican/static/pelican.css_t @@ -0,0 +1,247 @@ +/* + * pelican.css_t + * ~~~~~~~~~~~~ + * + * Sphinx stylesheet -- pelican theme, based on the nature theme + * + * :copyright: Copyright 2011 by Alexis Metaireau. + */ + +@import url("basic.css"); + +/* -- page layout ----------------------------------------------------------- */ + +body { + font-family: Arial, sans-serif; + font-size: 100%; + background-color: white; + color: #555; + margin: 0; + padding: 0; +} + +div.documentwrapper { + width: 70%; + margin: auto; +} + +div.bodywrapper { + margin: 0 0 0 230px; +} + +hr { + border: 1px solid #B1B4B6; +} + +div.document { + background-color: #eee; +} + +div.body { + background-color: #ffffff; + color: #3E4349; + padding: 0 30px 30px 30px; + font-size: 0.9em; +} + +div.footer { + color: #555; + width: 100%; + padding: 13px 0; + text-align: center; + font-size: 75%; +} + +div.footer a { + color: #444; + text-decoration: underline; +} + +div.related { + background-color: #6BA81E; + line-height: 32px; + color: #fff; + text-shadow: 0px 1px 0 #444; + font-size: 0.9em; +} + +div.related a { + color: #E2F3CC; +} + +div.sphinxsidebar { + font-size: 0.75em; + line-height: 1.5em; +} + +div.sphinxsidebarwrapper{ + padding: 20px 0; +} + +div.sphinxsidebar h3, +div.sphinxsidebar h4 { + font-family: Arial, sans-serif; + color: #222; + font-size: 1.2em; + font-weight: normal; + margin: 0; + padding: 5px 10px; + background-color: #ddd; + text-shadow: 1px 1px 0 white +} + +div.sphinxsidebar h4{ + font-size: 1.1em; +} + +div.sphinxsidebar h3 a { + color: #444; +} + + +div.sphinxsidebar p { + color: #888; + padding: 5px 20px; +} + +div.sphinxsidebar p.topless { +} + +div.sphinxsidebar ul { + margin: 10px 20px; + padding: 0; + color: #000; +} + +div.sphinxsidebar a { + color: #444; +} + +div.sphinxsidebar input { + border: 1px solid #ccc; + font-family: sans-serif; + font-size: 1em; +} + +div.sphinxsidebar input[type=text]{ + margin-left: 20px; +} + +/* -- body styles ----------------------------------------------------------- */ + +a { + color: #005B81; + text-decoration: none; +} + +a:hover { + color: #E32E00; + text-decoration: underline; +} + +div.body h1, +div.body h2, +div.body h3, +div.body h4, +div.body h5, +div.body h6 { + font-family: Arial, sans-serif; + font-weight: normal; + color: #212224; + margin: 30px 0px 10px 0px; + padding: 5px 0 5px 10px; + text-shadow: 0px 1px 0 white +} + +div.body h1 { + border-top: 20px solid white; + margin-top: 0; + font-size: 250%; + text-align: center; +} +div.body h2 { font-size: 150%; background-color: #C8D5E3; } +div.body h3 { font-size: 120%; background-color: #D8DEE3; } +div.body h4 { font-size: 110%; background-color: #D8DEE3; } +div.body h5 { font-size: 100%; background-color: #D8DEE3; } +div.body h6 { font-size: 100%; background-color: #D8DEE3; } + +a.headerlink { + color: #c60f0f; + font-size: 0.8em; + padding: 0 4px 0 4px; + text-decoration: none; +} + +a.headerlink:hover { + background-color: #c60f0f; + color: white; +} + +div.body p, div.body dd, div.body li { + line-height: 1.5em; +} + +div.admonition p.admonition-title + p { + display: inline; +} + +div.highlight{ + background-color: #111; +} + +div.note { + background-color: #eee; + border: 1px solid #ccc; +} + +div.seealso { + background-color: #ffc; + border: 1px solid #ff6; +} + +div.topic { + background-color: #eee; +} + +div.warning { + background-color: #ffe4e4; + border: 1px solid #f66; +} + +p.admonition-title { + display: inline; +} + +p.admonition-title:after { + content: ":"; +} + +pre { + padding: 10px; + background-color: #111; + color: #fff; + line-height: 1.2em; + border: 1px solid #C6C9CB; + font-size: 1.1em; + margin: 1.5em 0 1.5em 0; + -webkit-box-shadow: 1px 1px 1px #d8d8d8; + -moz-box-shadow: 1px 1px 1px #d8d8d8; +} + +tt { + background-color: #ecf0f3; + color: #222; + /* padding: 1px 2px; */ + font-size: 1.1em; + font-family: monospace; +} + +.viewcode-back { + font-family: Arial, sans-serif; +} + +div.viewcode-block:target { + background-color: #f4debf; + border-top: 1px solid #ac9; + border-bottom: 1px solid #ac9; +} diff --git a/docs/_themes/flask_small/theme.conf b/docs/_themes/pelican/theme.conf similarity index 58% rename from docs/_themes/flask_small/theme.conf rename to docs/_themes/pelican/theme.conf index 07036d14..ffbb7945 100644 --- a/docs/_themes/flask_small/theme.conf +++ b/docs/_themes/pelican/theme.conf @@ -1,8 +1,8 @@ [theme] inherit = basic -stylesheet = flasky.css +stylesheet = pelican.css nosidebar = true -pygments_style = flask_theme_support.FlaskyStyle +pygments_style = fruity [options] index_logo_height = 120px diff --git a/docs/conf.py b/docs/conf.py index 507e30a3..76167eaf 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,6 @@ master_doc = 'index' project = u'Pelican' copyright = u'2010, Alexis Metaireau and contributors' exclude_patterns = ['_build'] -pygments_style = 'sphinx' version = "2" release = version @@ -24,12 +23,13 @@ release = version # a list of builtin themes. sys.path.append(os.path.abspath('_themes')) html_theme_path = ['_themes'] -html_theme = 'flask_small' +html_theme = 'pelican' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. html_theme_options = { + 'nosidebar': True, 'index_logo': 'pelican.png', 'github_fork': 'ametaireau/pelican', } From 3d2ae33799fc334aaa24f6be7cf9557c1d3e2811 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Tue, 26 Apr 2011 00:40:16 +0100 Subject: [PATCH 0019/2344] update the theme (logo) --- docs/_themes/pelican/static/pelican.css_t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/_themes/pelican/static/pelican.css_t b/docs/_themes/pelican/static/pelican.css_t index 164073e1..3cb2a3c1 100644 --- a/docs/_themes/pelican/static/pelican.css_t +++ b/docs/_themes/pelican/static/pelican.css_t @@ -34,7 +34,6 @@ hr { } div.document { - background-color: #eee; } div.body { @@ -153,12 +152,20 @@ div.body h6 { text-shadow: 0px 1px 0 white } +{% if theme_index_logo %} +div.indexwrapper h1 { + text-indent: -999999px; + background: url({{ theme_index_logo }}) no-repeat center center; + height: {{ theme_index_logo_height }}; +} +{% endif %} div.body h1 { border-top: 20px solid white; margin-top: 0; font-size: 250%; text-align: center; } + div.body h2 { font-size: 150%; background-color: #C8D5E3; } div.body h3 { font-size: 120%; background-color: #D8DEE3; } div.body h4 { font-size: 110%; background-color: #D8DEE3; } From 91cb42d7d887d1899617dd5bcf76685ba8f67865 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Tue, 26 Apr 2011 12:23:45 +0200 Subject: [PATCH 0020/2344] add a KISS plugin system --- pelican/__init__.py | 25 +++++++++++++++++++++++-- pelican/settings.py | 1 + 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 12d12210..cf99295e 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -1,5 +1,8 @@ import argparse import os +import pkgutil + +from blinker import signal from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, PdfGenerator) @@ -13,7 +16,7 @@ VERSION = "2.6.0" class Pelican(object): def __init__(self, settings=None, path=None, theme=None, output_path=None, - markup=None, keep=False): + markup=None, keep=False, plugins_path=None): """Read the settings, and performs some checks on the environment before doing anything else. """ @@ -41,6 +44,15 @@ class Pelican(object): self.theme = theme_path else: raise Exception("Impossible to find the theme %s" % theme) + + plugins_path = plugins_path or settings['PLUGINS_PATH'] + if plugins_path: + plugins_path = os.path.abspath(plugins_path) + self.load_plugins(plugins_path) + else: + self.plugins = None + + signal('pelican_initialized').send(self) def run(self): """Run the generators and return""" @@ -81,6 +93,13 @@ class Pelican(object): def get_writer(self): return Writer(self.output_path, settings=self.settings) + + def load_plugins(self,path): + loaded = [] + for module_loader, name, ispkg in pkgutil.walk_packages(path=[path,]): + loaded.append( module_loader.find_module(name).load_module(name) ) + self.plugins = loaded + @@ -116,6 +135,8 @@ def main(): parser.add_argument('-r', '--autoreload', dest='autoreload', action='store_true', help="Relaunch pelican each time a modification occurs on the content" "files") + parser.add_argument('-p', '--plugins', default=None, dest='plugins_path', + help='the path of plugins to use') args = parser.parse_args() log.init(args.verbosity) @@ -134,7 +155,7 @@ def main(): cls = getattr(module, cls_name) try: - pelican = cls(settings, args.path, args.theme, args.output, markup, args.keep) + pelican = cls(settings, args.path, args.theme, args.output, markup, args.keep, args.plugins_path) if args.autoreload: while True: try: diff --git a/pelican/settings.py b/pelican/settings.py index 6c0918a0..3786b7f5 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -37,6 +37,7 @@ _DEFAULT_CONFIG = {'PATH': None, 'WITH_PAGINATION': False, 'DEFAULT_PAGINATION': 5, 'DEFAULT_ORPHANS': 0, + 'PLUGINS_PATH': None, } def read_settings(filename): From 4fb5d2b31e755d346e1ff5b7f6d188e0f3ef8b09 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Tue, 26 Apr 2011 12:26:56 +0200 Subject: [PATCH 0021/2344] add plugin sample --- plugins_samples/initialized.py | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 plugins_samples/initialized.py diff --git a/plugins_samples/initialized.py b/plugins_samples/initialized.py new file mode 100644 index 00000000..f104c275 --- /dev/null +++ b/plugins_samples/initialized.py @@ -0,0 +1,7 @@ +from blinker import signal + + +def test(sender): + print "%s initialized !!" % sender + +signal('pelican_initialized').connect(test) From dfe4d4e1320d3652fcf11bfd4983df4bf7fdc8e1 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Tue, 26 Apr 2011 13:16:09 +0200 Subject: [PATCH 0022/2344] add gravatar plugin and pelican_generate_context signal --- pelican/generators.py | 5 +++++ plugins_samples/gravatar.py | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 plugins_samples/gravatar.py diff --git a/pelican/generators.py b/pelican/generators.py index 569d5f50..02131532 100755 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -8,6 +8,8 @@ import os import math import random +from blinker import signal + from jinja2 import Environment, FileSystemLoader from jinja2.exceptions import TemplateNotFound @@ -92,6 +94,7 @@ class ArticlesGenerator(Generator): self.dates = {} self.tags = defaultdict(list) self.categories = defaultdict(list) + self.signal = {'pelican_generate_context' : signal('pelican_generate_context')} super(ArticlesGenerator, self).__init__(*args, **kwargs) def generate_feeds(self, writer): @@ -200,6 +203,8 @@ class ArticlesGenerator(Generator): and self.settings['FALLBACK_ON_FS_DATE']: metadatas['date'] = datetime.fromtimestamp(os.stat(f).st_ctime) + self.signal['pelican_generate_context'].send(self, metadatas=metadatas) + article = Article(content, metadatas, settings=self.settings, filename=f) if not is_valid_content(article, f): diff --git a/plugins_samples/gravatar.py b/plugins_samples/gravatar.py new file mode 100644 index 00000000..ca08984c --- /dev/null +++ b/plugins_samples/gravatar.py @@ -0,0 +1,20 @@ +import hashlib + +from blinker import signal + + +def add_gravatar(generator, metadatas): + + #first check email + if 'email' not in metadatas.keys()\ + and 'AUTHOR_EMAIL' in generator.settings.keys(): + metadatas['email'] = generator.settings['AUTHOR_EMAIL'] + + #then add gravatar url + if 'email' in metadatas.keys(): + gravatar_url = "http://www.gravatar.com/avatar/" + \ + hashlib.md5(metadatas['email'].lower()).hexdigest() + metadatas["author_gravatar"] = gravatar_url + + +signal('pelican_generate_context').connect(add_gravatar) From eef5fc8f9969da8a32a5371dea4c1be897141ca0 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Tue, 26 Apr 2011 19:44:40 +0200 Subject: [PATCH 0023/2344] rename signal --- pelican/generators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 02131532..38826a49 100755 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -94,7 +94,7 @@ class ArticlesGenerator(Generator): self.dates = {} self.tags = defaultdict(list) self.categories = defaultdict(list) - self.signal = {'pelican_generate_context' : signal('pelican_generate_context')} + self.signal = {'pelican_article_generate_context' : signal('pelican_article_generate_context')} super(ArticlesGenerator, self).__init__(*args, **kwargs) def generate_feeds(self, writer): @@ -203,7 +203,7 @@ class ArticlesGenerator(Generator): and self.settings['FALLBACK_ON_FS_DATE']: metadatas['date'] = datetime.fromtimestamp(os.stat(f).st_ctime) - self.signal['pelican_generate_context'].send(self, metadatas=metadatas) + self.signal['pelican_article_generate_context'].send(self, metadatas=metadatas) article = Article(content, metadatas, settings=self.settings, filename=f) From 91831eb5259757c3b1da586cb95080f6b719b99a Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Tue, 26 Apr 2011 19:44:55 +0200 Subject: [PATCH 0024/2344] add doc --- plugins_samples/gravatar.py | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/plugins_samples/gravatar.py b/plugins_samples/gravatar.py index ca08984c..9887e97e 100644 --- a/plugins_samples/gravatar.py +++ b/plugins_samples/gravatar.py @@ -1,7 +1,26 @@ import hashlib from blinker import signal +""" +Gravata plugin for Pelican +========================== +Simply add author_gravatar variable in article's context, which contain +the gravatar url. + +Settings: +--------- + +Add AUTHOR_EMAIL to your settings file to define default author email + +Article metadatas: +------------------ + +:email: article's author email + +If one of them are defined the author_gravatar variable is added to +article's context. +""" def add_gravatar(generator, metadatas): @@ -17,4 +36,4 @@ def add_gravatar(generator, metadatas): metadatas["author_gravatar"] = gravatar_url -signal('pelican_generate_context').connect(add_gravatar) +signal('pelican_article_generate_context').connect(add_gravatar) From 09567fa99ea0cb27ab4f1ca146c909cdacda814c Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Tue, 26 Apr 2011 20:02:05 +0200 Subject: [PATCH 0025/2344] add global license capabability as a plugin --- plugins_samples/global_license.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 plugins_samples/global_license.py diff --git a/plugins_samples/global_license.py b/plugins_samples/global_license.py new file mode 100644 index 00000000..feae64e2 --- /dev/null +++ b/plugins_samples/global_license.py @@ -0,0 +1,23 @@ +from blinker import signal + +""" +License plugin for Pelican +========================== + +Simply add license variable in article's context, which contain +the license text. + +Settings: +--------- + +Add LICENSE to your settings file to define default license. + +""" + +def add_license(generator, metadatas): + if 'license' not in metadatas.keys()\ + and 'LICENSE' in self.settings.keys(): + metadatas['license'] = self.settings['LICENSE'] + + +signal('pelican_article_generate_context').connect(add_license) From f4b2b628744efbda99f9b0c43035f1d49c8cecb0 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Tue, 26 Apr 2011 20:04:44 +0200 Subject: [PATCH 0026/2344] fix mistake --- plugins_samples/global_license.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins_samples/global_license.py b/plugins_samples/global_license.py index feae64e2..eeb20965 100644 --- a/plugins_samples/global_license.py +++ b/plugins_samples/global_license.py @@ -16,8 +16,8 @@ Add LICENSE to your settings file to define default license. def add_license(generator, metadatas): if 'license' not in metadatas.keys()\ - and 'LICENSE' in self.settings.keys(): - metadatas['license'] = self.settings['LICENSE'] + and 'LICENSE' in generator.settings.keys(): + metadatas['license'] = generator.settings['LICENSE'] signal('pelican_article_generate_context').connect(add_license) From 07edd96088f0ac7e4d39f86853eacc64fc8623e5 Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Tue, 26 Apr 2011 23:13:28 +0200 Subject: [PATCH 0027/2344] add blinker to requires --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 936a3171..4744d0fb 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ import sys VERSION = "2.6.0" # find a better way to do so. -requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'Markdown'] +requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'Markdown', 'blinker'] if sys.version_info < (2,7): requires.append('argparse') From 20b0d1d4ae3aff83b49d542652dd44c7ab9872bb Mon Sep 17 00:00:00 2001 From: Nicolas Duhamel Date: Wed, 27 Apr 2011 18:09:55 +0200 Subject: [PATCH 0028/2344] Fix little bug when declaring plugins path in config file --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index cf99295e..1a618b45 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -47,7 +47,7 @@ class Pelican(object): plugins_path = plugins_path or settings['PLUGINS_PATH'] if plugins_path: - plugins_path = os.path.abspath(plugins_path) + plugins_path = os.path.abspath(os.path.expanduser(plugins_path)) self.load_plugins(plugins_path) else: self.plugins = None From c5a63c953a0f9e068a2563a9c5ab11045eaf4c1e Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 17 Jun 2011 23:37:08 +0200 Subject: [PATCH 0029/2344] Remove the dependency to pkgutil for the plugins --- pelican/__init__.py | 29 +++++++------------ pelican/generators.py | 4 +-- pelican/plugins/__init__.py | 0 .../plugins}/global_license.py | 6 ++-- .../plugins}/gravatar.py | 19 ++++++------ .../plugins}/initialized.py | 3 +- 6 files changed, 28 insertions(+), 33 deletions(-) create mode 100644 pelican/plugins/__init__.py rename {plugins_samples => pelican/plugins}/global_license.py (72%) rename {plugins_samples => pelican/plugins}/gravatar.py (60%) rename {plugins_samples => pelican/plugins}/initialized.py (57%) diff --git a/pelican/__init__.py b/pelican/__init__.py index 846e2554..515434cc 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -1,7 +1,6 @@ import argparse import os import time -import pkgutil from blinker import signal @@ -46,15 +45,18 @@ class Pelican(object): else: raise Exception("Impossible to find the theme %s" % theme) - plugins_path = plugins_path or settings['PLUGINS_PATH'] - if plugins_path: - plugins_path = os.path.abspath(os.path.expanduser(plugins_path)) - self.load_plugins(plugins_path) - else: - self.plugins = None - + self.init_plugins() signal('pelican_initialized').send(self) + def init_plugins(self): + self.plugins = self.settings['PLUGINS'] + for plugin in self.plugins: + # if it's a string, then import it + if isinstance(plugin, str): + plugin = __import__(plugin, globals(), locals(), 'module') + + plugin.register() + def run(self): """Run the generators and return""" @@ -97,13 +99,6 @@ class Pelican(object): def get_writer(self): return Writer(self.output_path, settings=self.settings) - def load_plugins(self, path): - loaded = [] - for module_loader, name, ispkg in pkgutil.walk_packages(path=[path,]): - loaded.append(module_loader.find_module(name).load_module(name)) - self.plugins = loaded - - def main(): @@ -136,8 +131,6 @@ def main(): parser.add_argument('-r', '--autoreload', dest='autoreload', action='store_true', help="Relaunch pelican each time a modification occurs on the content" "files") - parser.add_argument('-p', '--plugins', default=None, dest='plugins_path', - help='the path of plugins to use') args = parser.parse_args() log.init(args.verbosity) @@ -155,7 +148,7 @@ def main(): try: pelican = cls(settings, args.path, args.theme, args.output, markup, - args.delete_outputdir, args.plugins_path) + args.delete_outputdir) if args.autoreload: while True: try: diff --git a/pelican/generators.py b/pelican/generators.py index b6619d0e..eb74aff9 100755 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -13,7 +13,7 @@ from blinker import signal from jinja2 import Environment, FileSystemLoader from jinja2.exceptions import TemplateNotFound -from pelican.utils import copytree, get_relative_path, process_translations, open +from pelican.utils import copy, get_relative_path, process_translations, open from pelican.contents import Article, Page, is_valid_content from pelican.readers import read_file from pelican.log import * @@ -214,7 +214,7 @@ class ArticlesGenerator(Generator): and self.settings['FALLBACK_ON_FS_DATE']: metadata['date'] = datetime.fromtimestamp(os.stat(f).st_ctime) - self.signal['pelican_article_generate_context'].send(self, metadatas=metadatas) + self.signal['pelican_article_generate_context'].send(self, metadata=metadata) article = Article(content, metadata, settings=self.settings, filename=f) if not is_valid_content(article, f): diff --git a/pelican/plugins/__init__.py b/pelican/plugins/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/plugins_samples/global_license.py b/pelican/plugins/global_license.py similarity index 72% rename from plugins_samples/global_license.py rename to pelican/plugins/global_license.py index eeb20965..b6913831 100644 --- a/plugins_samples/global_license.py +++ b/pelican/plugins/global_license.py @@ -14,10 +14,10 @@ Add LICENSE to your settings file to define default license. """ -def add_license(generator, metadatas): - if 'license' not in metadatas.keys()\ +def add_license(generator, metadata): + if 'license' not in metadata.keys()\ and 'LICENSE' in generator.settings.keys(): - metadatas['license'] = generator.settings['LICENSE'] + metadata['license'] = generator.settings['LICENSE'] signal('pelican_article_generate_context').connect(add_license) diff --git a/plugins_samples/gravatar.py b/pelican/plugins/gravatar.py similarity index 60% rename from plugins_samples/gravatar.py rename to pelican/plugins/gravatar.py index 9887e97e..2601ada0 100644 --- a/plugins_samples/gravatar.py +++ b/pelican/plugins/gravatar.py @@ -13,7 +13,7 @@ Settings: Add AUTHOR_EMAIL to your settings file to define default author email -Article metadatas: +Article metadata: ------------------ :email: article's author email @@ -22,18 +22,19 @@ If one of them are defined the author_gravatar variable is added to article's context. """ -def add_gravatar(generator, metadatas): +def add_gravatar(generator, metadata): #first check email - if 'email' not in metadatas.keys()\ + if 'email' not in metadata.keys()\ and 'AUTHOR_EMAIL' in generator.settings.keys(): - metadatas['email'] = generator.settings['AUTHOR_EMAIL'] + metadata['email'] = generator.settings['AUTHOR_EMAIL'] #then add gravatar url - if 'email' in metadatas.keys(): + if 'email' in metadata.keys(): gravatar_url = "http://www.gravatar.com/avatar/" + \ - hashlib.md5(metadatas['email'].lower()).hexdigest() - metadatas["author_gravatar"] = gravatar_url + hashlib.md5(metadata['email'].lower()).hexdigest() + metadata["author_gravatar"] = gravatar_url - -signal('pelican_article_generate_context').connect(add_gravatar) + +def register(): + signal('pelican_article_generate_context').connect(add_gravatar) diff --git a/plugins_samples/initialized.py b/pelican/plugins/initialized.py similarity index 57% rename from plugins_samples/initialized.py rename to pelican/plugins/initialized.py index f104c275..076ba06d 100644 --- a/plugins_samples/initialized.py +++ b/pelican/plugins/initialized.py @@ -4,4 +4,5 @@ from blinker import signal def test(sender): print "%s initialized !!" % sender -signal('pelican_initialized').connect(test) +def register(): + signal('pelican_initialized').connect(test) From 28c0644eb60200e333a9f21f9e8ada5e16307df7 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 18 Jun 2011 01:03:53 +0200 Subject: [PATCH 0030/2344] Plugins doc + minor design changes. --- docs/index.rst | 2 + docs/plugins.rst | 75 +++++++++++++++++++++++++++++++ docs/settings.rst | 5 ++- pelican/__init__.py | 4 +- pelican/generators.py | 8 ++-- pelican/plugins/global_license.py | 6 +-- pelican/plugins/gravatar.py | 4 +- pelican/plugins/initialized.py | 5 +-- pelican/settings.py | 2 +- pelican/signals.py | 4 ++ 10 files changed, 97 insertions(+), 18 deletions(-) create mode 100644 docs/plugins.rst create mode 100644 pelican/signals.py diff --git a/docs/index.rst b/docs/index.rst index 2897bc63..0e6ba583 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -55,6 +55,8 @@ A french version of the documentation is available at :doc:`fr/index`. getting_started settings themes + pelican-themes + plugins internals faq contribute diff --git a/docs/plugins.rst b/docs/plugins.rst new file mode 100644 index 00000000..6763f5ef --- /dev/null +++ b/docs/plugins.rst @@ -0,0 +1,75 @@ +.. _plugins: + +Plugins +####### + +Since version 2.8, pelican manages plugins. Plugins are a way to add feature to +pelican without having to directly hack pelican code. + +Pelican is shipped with a set of core plugins, but you can easily implement +your own (and this page describes how) + +How to use plugins? +==================== + +To load plugins, you have to specify a them in your settings file. You have two +ways to do so: by specifying strings with the path to the callables: :: + + PLUGINS = ['pelican.plugins.gravatar',] + +Or by importing them and adding them to the list:: + + from pelican.plugins import gravatar + PLUGINS = [gravatar, ] + +If your plugins are not in an importable path, you can specify a `PLUGIN_PATH` +in the settings:: + + PLUGIN_PATH = "plugins" + PLUGINS = ["list", "of", "plugins"] + +How to create plugins? +====================== + +Plugins are based on the concept of signals. Pelican sends signals and plugins +subscribe to those signals. The list of signals are defined in a following +section. + +The only rule to follow for plugins is to define a `register` callable, in +which you map the signals to your plugin logic. Let's take a simple exemple:: + + from pelican import signals + + def test(sender): + print "%s initialized !!" % sender + + def register(): + signals.initialized.connect(test) + + +List of signals +=============== + +Here is the list of currently implemented signals: + +========================= ============================ ===================== +Signal Arguments Description +========================= ============================ ===================== +initialized pelican object +article_generate_context article_generator, metadata +========================= ============================ ===================== + +The list is currently small, don't hesitate to add signals and make a pull +request if you need them! + +List of plugins +=============== + +Not all the list are described here, but a few of them have been extracted from +pelican core and provided in pelican.plugins. They are described here: + +Tag cloud +--------- + +Translation +----------- diff --git a/docs/settings.rst b/docs/settings.rst index 9c596da3..9287facd 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -51,6 +51,7 @@ Setting name (default value) what does it do? `PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions of your documents. You will need to install `rst2pdf`. +`PLUGINS` (``[]``) The list of plugins to load. See :ref:`plugins`. `RELATIVE_URL` (``True``) Defines if pelican should use relative urls or not. `SITEURL` base URL of your website. Note that this is @@ -208,14 +209,14 @@ Setting name what does it do ? `GITHUB_URL` Your github URL (if you have one), it will then use it to create a github ribbon. `GOOGLE_ANALYTICS` 'UA-XXXX-YYYY' to activate google analytics. +`LINKS` A list of tuples (Title, Url) for links to appear on + the header. `PIWIK_URL` URL to your Piwik server - without 'http://' at the beginning. `PIWIK_SSL_URL` If the SSL-URL differs from the normal Piwik-URL you have to include this setting too. (optional) `PIWIK_SITE_ID` ID for the monitored website. You can find the ID in the Piwik admin interface > settings > websites. -`LINKS` A list of tuples (Title, Url) for links to appear on - the header. `SOCIAL` A list of tuples (Title, Url) to appear in the "social" section. `TWITTER_USERNAME` Allows to add a button on the articles to tweet about diff --git a/pelican/__init__.py b/pelican/__init__.py index 515434cc..7121318e 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -2,7 +2,7 @@ import argparse import os import time -from blinker import signal +from pelican import signals from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, PdfGenerator) @@ -46,7 +46,7 @@ class Pelican(object): raise Exception("Impossible to find the theme %s" % theme) self.init_plugins() - signal('pelican_initialized').send(self) + signals.initialized.send(self) def init_plugins(self): self.plugins = self.settings['PLUGINS'] diff --git a/pelican/generators.py b/pelican/generators.py index eb74aff9..38fa9da7 100755 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -8,8 +8,6 @@ import os import math import random -from blinker import signal - from jinja2 import Environment, FileSystemLoader from jinja2.exceptions import TemplateNotFound @@ -17,6 +15,7 @@ from pelican.utils import copy, get_relative_path, process_translations, open from pelican.contents import Article, Page, is_valid_content from pelican.readers import read_file from pelican.log import * +from pelican import signals class Generator(object): @@ -100,7 +99,6 @@ class ArticlesGenerator(Generator): self.dates = {} self.tags = defaultdict(list) self.categories = defaultdict(list) - self.signal = {'pelican_article_generate_context' : signal('pelican_article_generate_context')} super(ArticlesGenerator, self).__init__(*args, **kwargs) self.drafts = [] @@ -214,7 +212,7 @@ class ArticlesGenerator(Generator): and self.settings['FALLBACK_ON_FS_DATE']: metadata['date'] = datetime.fromtimestamp(os.stat(f).st_ctime) - self.signal['pelican_article_generate_context'].send(self, metadata=metadata) + signals.article_generate_context.send(self, metadata=metadata) article = Article(content, metadata, settings=self.settings, filename=f) if not is_valid_content(article, f): @@ -318,7 +316,7 @@ class StaticGenerator(Generator): final_path=None): """Copy all the paths from source to destination""" for path in paths: - copy(path, source, os.path.join(output_path, destination), final_path, + copy(path, source, os.path.join(output_path, destination), final_path, overwrite=True) def generate_output(self, writer): diff --git a/pelican/plugins/global_license.py b/pelican/plugins/global_license.py index b6913831..463a93b3 100644 --- a/pelican/plugins/global_license.py +++ b/pelican/plugins/global_license.py @@ -1,4 +1,4 @@ -from blinker import signal +from pelican import signals """ License plugin for Pelican @@ -19,5 +19,5 @@ def add_license(generator, metadata): and 'LICENSE' in generator.settings.keys(): metadata['license'] = generator.settings['LICENSE'] - -signal('pelican_article_generate_context').connect(add_license) +def register(): + signals.article_generate_context.connect(add_license) diff --git a/pelican/plugins/gravatar.py b/pelican/plugins/gravatar.py index 2601ada0..200bb5a5 100644 --- a/pelican/plugins/gravatar.py +++ b/pelican/plugins/gravatar.py @@ -1,6 +1,6 @@ import hashlib -from blinker import signal +from pelican import signals """ Gravata plugin for Pelican ========================== @@ -37,4 +37,4 @@ def add_gravatar(generator, metadata): def register(): - signal('pelican_article_generate_context').connect(add_gravatar) + signals.article_generate_context.connect(add_gravatar) diff --git a/pelican/plugins/initialized.py b/pelican/plugins/initialized.py index 076ba06d..5e4cf174 100644 --- a/pelican/plugins/initialized.py +++ b/pelican/plugins/initialized.py @@ -1,8 +1,7 @@ -from blinker import signal - +from pelican import signals def test(sender): print "%s initialized !!" % sender def register(): - signal('pelican_initialized').connect(test) + signals.initialized.connect(test) diff --git a/pelican/settings.py b/pelican/settings.py index 3cc4157a..c1f15b2d 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -42,7 +42,7 @@ _DEFAULT_CONFIG = {'PATH': None, 'DEFAULT_METADATA': (), 'FILES_TO_COPY': (), 'DEFAULT_STATUS': 'published', - 'PLUGINS_PATH': None, + 'PLUGINS': [], } def read_settings(filename): diff --git a/pelican/signals.py b/pelican/signals.py new file mode 100644 index 00000000..f2bf4547 --- /dev/null +++ b/pelican/signals.py @@ -0,0 +1,4 @@ +from blinker import signal + +initialized = signal('pelican_initialized') +article_generate_context = signal('article_generate_context') From c6c0ee76c2d47017a56ef8442d8616e2dd2fb9d7 Mon Sep 17 00:00:00 2001 From: Marco Milanesi Date: Tue, 6 Sep 2011 18:54:41 +0200 Subject: [PATCH 0031/2344] implemented github activity plugin --- pelican/plugins/github_activity.py | 27 +++++++++++++++++++++++++++ pelican/signals.py | 1 + pelican/utils.py | 12 ++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 pelican/plugins/github_activity.py diff --git a/pelican/plugins/github_activity.py b/pelican/plugins/github_activity.py new file mode 100644 index 00000000..d279e616 --- /dev/null +++ b/pelican/plugins/github_activity.py @@ -0,0 +1,27 @@ +from pelican import signals +from pelican.utils import singleton + +@singleton +class GitHubActivity(): + def __init__(self, generator): + try: + import feedparser + self.ga = feedparser.parse( + generator.settings['GITHUB_ACTIVITY_FEED']) + except ImportError: + raise Exception("unable to find feedparser") + + def fetch(self): + return [activity['content'][0]['value'].strip() + for activity in self.ga['entries']] + +def add_github_activity(generator, metadata): + if 'GITHUB_ACTIVITY_FEED' in generator.settings.keys(): + + ga = GitHubActivity(generator) + + ga_html_snippets = ga.fetch() + generator.context['github_activity'] = ga_html_snippets + +def register(): + signals.article_generate_context.connect(add_github_activity) diff --git a/pelican/signals.py b/pelican/signals.py index f2bf4547..fb50252f 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -2,3 +2,4 @@ from blinker import signal initialized = signal('pelican_initialized') article_generate_context = signal('article_generate_context') +github_activity = signal('github_activity') diff --git a/pelican/utils.py b/pelican/utils.py index 8e48c2e9..a67836ca 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -222,3 +222,15 @@ def files_changed(path, extensions): LAST_MTIME = mtime return True return False + +def singleton(cls): + """ + Singleton decorator for multiple calls inside plugins + for an example see pelican/plugins/github_activity.py + """ + instances = {} + def getinstance(*args, **kwargs): + if cls not in instances: + instances[cls] = cls(*args, **kwargs) + return instances[cls] + return getinstance From 3743617d27f5ec5216432636433dc566a7f802c1 Mon Sep 17 00:00:00 2001 From: Marco Milanesi Date: Tue, 6 Sep 2011 18:56:44 +0200 Subject: [PATCH 0032/2344] removed spurious signal --- pelican/signals.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pelican/signals.py b/pelican/signals.py index fb50252f..f2bf4547 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -2,4 +2,3 @@ from blinker import signal initialized = signal('pelican_initialized') article_generate_context = signal('article_generate_context') -github_activity = signal('github_activity') From 575905ac53f1af696045f68e0ac469ecd2a2ba9a Mon Sep 17 00:00:00 2001 From: Marco Milanesi Date: Tue, 6 Sep 2011 19:14:21 +0200 Subject: [PATCH 0033/2344] some commentary copyright infos some instructions on how to use the plugin --- pelican/plugins/github_activity.py | 35 ++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/pelican/plugins/github_activity.py b/pelican/plugins/github_activity.py index d279e616..bbce2759 100644 --- a/pelican/plugins/github_activity.py +++ b/pelican/plugins/github_activity.py @@ -1,8 +1,32 @@ +# -*- coding: utf-8 -*- +""" + Copyright (c) Marco Milanesi + + A plugin to list your Github Activity + To enable it set in your pelican config file the GITHUB_ACTIVITY_FEED + parameter pointing to your github activity feed. + + for example my personal activity feed is: + + https://github.com/kpanic.atom + + in your template just write a for in jinja2 syntax against the + github_activity variable. + + github_activity is a list containing raw html from github so you can + include it directly in your template + +""" + from pelican import signals from pelican.utils import singleton + @singleton class GitHubActivity(): + """ + A class created to fetch github activity with feedparser + """ def __init__(self, generator): try: import feedparser @@ -12,10 +36,17 @@ class GitHubActivity(): raise Exception("unable to find feedparser") def fetch(self): + """ + returns a list of html snippets fetched from github actitivy feed + """ return [activity['content'][0]['value'].strip() for activity in self.ga['entries']] + def add_github_activity(generator, metadata): + """ + registered handler for the github activity plugin + """ if 'GITHUB_ACTIVITY_FEED' in generator.settings.keys(): ga = GitHubActivity(generator) @@ -23,5 +54,9 @@ def add_github_activity(generator, metadata): ga_html_snippets = ga.fetch() generator.context['github_activity'] = ga_html_snippets + def register(): + """ + Plugin registration + """ signals.article_generate_context.connect(add_github_activity) From 48d7df72f1a0d9c405cac85b662a70c6c14dc238 Mon Sep 17 00:00:00 2001 From: Marco Milanesi Date: Wed, 7 Sep 2011 17:08:28 +0200 Subject: [PATCH 0034/2344] refactored code and introduced a new signal in ArticlesGenerator __init__ --- pelican/generators.py | 1 + pelican/plugins/github_activity.py | 26 ++++++++++++++++---------- pelican/signals.py | 1 + pelican/utils.py | 12 ------------ 4 files changed, 18 insertions(+), 22 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 38fa9da7..9baf240e 100755 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -101,6 +101,7 @@ class ArticlesGenerator(Generator): self.categories = defaultdict(list) super(ArticlesGenerator, self).__init__(*args, **kwargs) self.drafts = [] + signals.article_generator_init.send(self) def generate_feeds(self, writer): """Generate the feeds from the current context, and output files.""" diff --git a/pelican/plugins/github_activity.py b/pelican/plugins/github_activity.py index bbce2759..ba6cd70f 100644 --- a/pelican/plugins/github_activity.py +++ b/pelican/plugins/github_activity.py @@ -19,10 +19,8 @@ """ from pelican import signals -from pelican.utils import singleton -@singleton class GitHubActivity(): """ A class created to fetch github activity with feedparser @@ -30,7 +28,7 @@ class GitHubActivity(): def __init__(self, generator): try: import feedparser - self.ga = feedparser.parse( + self.activities = feedparser.parse( generator.settings['GITHUB_ACTIVITY_FEED']) except ImportError: raise Exception("unable to find feedparser") @@ -40,23 +38,31 @@ class GitHubActivity(): returns a list of html snippets fetched from github actitivy feed """ return [activity['content'][0]['value'].strip() - for activity in self.ga['entries']] + for activity in self.activities['entries']] -def add_github_activity(generator, metadata): +def fetch_github_activity(gen, metadata): """ registered handler for the github activity plugin + it puts in generator.context the html needed to be displayed on a + template """ - if 'GITHUB_ACTIVITY_FEED' in generator.settings.keys(): - ga = GitHubActivity(generator) + if 'GITHUB_ACTIVITY_FEED' in gen.settings.keys(): + gen.context['github_activity'] = gen.plugin_instance.fetch() - ga_html_snippets = ga.fetch() - generator.context['github_activity'] = ga_html_snippets + +def feed_parser_initialization(generator): + """ + Initialization of feed parser + """ + + generator.plugin_instance = GitHubActivity(generator) def register(): """ Plugin registration """ - signals.article_generate_context.connect(add_github_activity) + signals.article_generator_init.connect(feed_parser_initialization) + signals.article_generate_context.connect(fetch_github_activity) diff --git a/pelican/signals.py b/pelican/signals.py index f2bf4547..b1c35794 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -2,3 +2,4 @@ from blinker import signal initialized = signal('pelican_initialized') article_generate_context = signal('article_generate_context') +article_generator_init = signal('article_generator_init') diff --git a/pelican/utils.py b/pelican/utils.py index a67836ca..8e48c2e9 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -222,15 +222,3 @@ def files_changed(path, extensions): LAST_MTIME = mtime return True return False - -def singleton(cls): - """ - Singleton decorator for multiple calls inside plugins - for an example see pelican/plugins/github_activity.py - """ - instances = {} - def getinstance(*args, **kwargs): - if cls not in instances: - instances[cls] = cls(*args, **kwargs) - return instances[cls] - return getinstance From 948ef452ca7d6a02175674b1169fa9c700f72c28 Mon Sep 17 00:00:00 2001 From: Marco Milanesi Date: Wed, 7 Sep 2011 18:55:37 +0200 Subject: [PATCH 0035/2344] documentation for the github activity plugin --- docs/plugins.rst | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 6763f5ef..42ecd656 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -52,12 +52,13 @@ List of signals Here is the list of currently implemented signals: -========================= ============================ ===================== +========================= ============================ ========================================= Signal Arguments Description -========================= ============================ ===================== +========================= ============================ ========================================= initialized pelican object article_generate_context article_generator, metadata -========================= ============================ ===================== +article_generator_init article_generator invoked in the ArticlesGenerator.__init__ +========================= ============================ ========================================= The list is currently small, don't hesitate to add signals and make a pull request if you need them! @@ -73,3 +74,41 @@ Tag cloud Translation ----------- + +Github Activity +_______________ + +This plugins introduces a new depencency, you have to install feedparser +if you want to use it, these are some ways to do it:: + + apt-get install python-feedparser # on debian based distributions like ubuntu + sudo easy_install feedparser + sudo pip install feedparser + +To enable it set in your pelican config file the GITHUB_ACTIVITY_FEED +parameter pointing to your github activity feed. + +for example my personal activity feed is:: + + https://github.com/kpanic.atom + +and the config line could be:: + + GITHUB_ACTIVITY_FEED = 'https://github.com/kpanic.atom' + +in your template just write a for in jinja2 syntax against the +github_activity variable, like for example:: + + {% if GITHUB_ACTIVITY_FEED %} + + {% endif %} + + +github_activity is a list containing raw html from github so you can include it +directly in your (for example base.html) template and style it in a way that +your prefer using your css skills From 83d59d6b93a9300572c5f1adddca524baba5cb43 Mon Sep 17 00:00:00 2001 From: Marco Milanesi Date: Tue, 18 Oct 2011 22:21:43 +0200 Subject: [PATCH 0036/2344] revised github activity to adapt it to new github atom feed changes --- pelican/plugins/github_activity.py | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/pelican/plugins/github_activity.py b/pelican/plugins/github_activity.py index ba6cd70f..f2ba1da7 100644 --- a/pelican/plugins/github_activity.py +++ b/pelican/plugins/github_activity.py @@ -13,9 +13,20 @@ in your template just write a for in jinja2 syntax against the github_activity variable. - github_activity is a list containing raw html from github so you can - include it directly in your template + i.e. + + + github_activity is a list containing a list. The first element is the title + and the second element is the raw html from github """ from pelican import signals @@ -31,14 +42,20 @@ class GitHubActivity(): self.activities = feedparser.parse( generator.settings['GITHUB_ACTIVITY_FEED']) except ImportError: - raise Exception("unable to find feedparser") + raise Exception("Unable to find feedparser") def fetch(self): """ returns a list of html snippets fetched from github actitivy feed """ - return [activity['content'][0]['value'].strip() - for activity in self.activities['entries']] + + entries = [] + for activity in self.activities['entries']: + entries.append( + [element for element in [activity['title'], + activity['content'][0]['value']]]) + + return entries def fetch_github_activity(gen, metadata): From 462e637e69e46318411b53eac6d237c8ef498542 Mon Sep 17 00:00:00 2001 From: Marco Milanesi Date: Wed, 19 Oct 2011 11:57:37 +0200 Subject: [PATCH 0037/2344] updated doc --- docs/plugins.rst | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 42ecd656..3bf7c532 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -100,15 +100,20 @@ in your template just write a for in jinja2 syntax against the github_activity variable, like for example:: {% if GITHUB_ACTIVITY_FEED %} - + {% endif %} -github_activity is a list containing raw html from github so you can include it -directly in your (for example base.html) template and style it in a way that -your prefer using your css skills + +github_activity is a list containing a list. The first element is the title and +the second element is the raw html from github so you can include it directly +in your (for example base.html) template and style it in a way that your prefer +using your css skills From f248a811076bdf5facfbf75de49e52fef0d6315a Mon Sep 17 00:00:00 2001 From: Skami18 Date: Sat, 29 Oct 2011 18:04:59 +0200 Subject: [PATCH 0038/2344] Plugins are now installed by setuptools --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 18db914f..071d3523 100755 --- a/setup.py +++ b/setup.py @@ -16,7 +16,7 @@ setup( author_email = 'alexis@notmyidea.org', description = "A tool to generate a static blog, with restructured text (or markdown) input files.", long_description=open('README.rst').read(), - packages = ['pelican'], + packages = ['pelican', 'pelican.plugins'], include_package_data = True, install_requires = requires, scripts = ['bin/pelican', 'tools/pelican-themes'], From b735f5fa49643bbf87aa58dca53b2e2830bbc0d7 Mon Sep 17 00:00:00 2001 From: Skami18 Date: Sun, 30 Oct 2011 14:10:50 +0100 Subject: [PATCH 0039/2344] Plugin loading is logged in debug mode (-D) --- pelican/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pelican/__init__.py b/pelican/__init__.py index 7121318e..5b84685d 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -53,8 +53,10 @@ class Pelican(object): for plugin in self.plugins: # if it's a string, then import it if isinstance(plugin, str): + log.debug("Loading plugin `{0}' ...".format(plugin)) plugin = __import__(plugin, globals(), locals(), 'module') + log.debug("Registering plugin `{0}' ...".format(plugin.__name__)) plugin.register() def run(self): From c522ce7fbcb37a8ca141c6b2604ba85bfef00125 Mon Sep 17 00:00:00 2001 From: Skami18 Date: Sun, 30 Oct 2011 14:14:10 +0100 Subject: [PATCH 0040/2344] New plugin that provides an ..html:: directive for reStructuredText --- pelican/plugins/html_rst_directive.py | 63 +++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 pelican/plugins/html_rst_directive.py diff --git a/pelican/plugins/html_rst_directive.py b/pelican/plugins/html_rst_directive.py new file mode 100644 index 00000000..d14000a0 --- /dev/null +++ b/pelican/plugins/html_rst_directive.py @@ -0,0 +1,63 @@ +from docutils import nodes +from docutils.parsers.rst import directives, Directive +from pelican import log + +""" +HTML tags for reStructuredText +============================== + +Directives +---------- + +.. html:: + + (HTML code) + + +Example +------- + +A search engine: + +.. html:: +
+ + + +
+ + +A contact form: + +.. html:: + +
+

+ +
+ +
+ +

+
+ +""" + + +class RawHtml(Directive): + required_arguments = 0 + optional_arguments = 0 + final_argument_whitespace = True + has_content = True + + def run(self): + html = u' '.join(self.content) + node = nodes.raw('', html, format='html') + return [node] + + + +def register(): + directives.register_directive('html', RawHtml) + From 6c5fe3b0cf8708550c672377de8728a1625e5ddd Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Tue, 28 Feb 2012 19:09:41 +0100 Subject: [PATCH 0041/2344] prepare next release --- pelican/__init__.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 6ea5ab0f..710c9ff1 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -9,7 +9,7 @@ from pelican.utils import clean_output_dir, files_changed from pelican.writers import Writer from pelican import log -__version__ = "2.8.0" +__version__ = "3.0" class Pelican(object): diff --git a/setup.py b/setup.py index 1d6b3615..e01448ed 100755 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ from setuptools import setup import sys import platform -VERSION = "2.8.0" # find a better way to do so. +VERSION = "3.0" # find a better way to do so. requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'pytz'] if sys.version_info < (2,7): From 917633628ac5e7dfb654fbfb9ce0963d3d3eb3a9 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Wed, 29 Feb 2012 18:15:38 +0100 Subject: [PATCH 0042/2344] add some more articles for the tests --- samples/content/article2-fr.rst | 9 +++++++++ samples/content/article2.rst | 9 +++++++++ samples/pelican.conf.py | 2 +- 3 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 samples/content/article2-fr.rst create mode 100644 samples/content/article2.rst diff --git a/samples/content/article2-fr.rst b/samples/content/article2-fr.rst new file mode 100644 index 00000000..31970f7e --- /dev/null +++ b/samples/content/article2-fr.rst @@ -0,0 +1,9 @@ +Deuxième article +################ + +:tags: foo, bar, baz +:date: 2012-02-29 +:lang: fr +:slug: second-article + +Ceci est un article, en français. diff --git a/samples/content/article2.rst b/samples/content/article2.rst new file mode 100644 index 00000000..66f768ea --- /dev/null +++ b/samples/content/article2.rst @@ -0,0 +1,9 @@ +Second article +############## + +:tags: foo, bar, baz +:date: 2012-02-29 +:lang: en +:slug: second-article + +This is some article, in english diff --git a/samples/pelican.conf.py b/samples/pelican.conf.py index fb3b091b..d725265c 100755 --- a/samples/pelican.conf.py +++ b/samples/pelican.conf.py @@ -9,7 +9,7 @@ DISQUS_SITENAME = "blog-notmyidea" PDF_GENERATOR = False REVERSE_CATEGORY_ORDER = True LOCALE = "" -DEFAULT_PAGINATION = 2 +DEFAULT_PAGINATION = 4 FEED_RSS = 'feeds/all.rss.xml' CATEGORY_FEED_RSS = 'feeds/%s.rss.xml' From ddac40e9cbdc002766548ea4d9535ff77e174949 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 3 Mar 2012 18:26:07 +0100 Subject: [PATCH 0043/2344] Include .bat files in the distribution. Fix #221 --- MANIFEST.in | 1 + 1 file changed, 1 insertion(+) diff --git a/MANIFEST.in b/MANIFEST.in index a092ecd0..fc46d905 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,3 +2,4 @@ include *.rst global-include *.py recursive-include pelican *.html *.css *png include LICENSE +global-include *.bat From bde06c401174d74d6c449bae0725f6853f3e726e Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 6 Mar 2012 06:13:17 -0800 Subject: [PATCH 0044/2344] Improve English documentation with enhanced clarity, grammar, and spelling --- README.rst | 45 +++++---- docs/contribute.rst | 36 +++---- docs/faq.rst | 55 ++++++----- docs/getting_started.rst | 140 ++++++++++++++------------ docs/importer.rst | 8 +- docs/index.rst | 41 ++++---- docs/internals.rst | 91 +++++++++-------- docs/pelican-themes.rst | 14 +-- docs/settings.rst | 208 ++++++++++++++++++++------------------- docs/themes.rst | 170 ++++++++++++++++---------------- docs/tips.rst | 18 ++-- 11 files changed, 426 insertions(+), 400 deletions(-) diff --git a/README.rst b/README.rst index 8a6ef04c..0a27bdcd 100644 --- a/README.rst +++ b/README.rst @@ -3,51 +3,54 @@ Pelican Pelican is a simple weblog generator, written in `Python `_. -* Write your weblog entries directly with your editor of choice (vim!) and - directly in `reStructuredText `_, or `Markdown `_. -* A simple cli-tool to (re)generate the weblog. +* Write your weblog entries directly with your editor of choice (vim!) + in `reStructuredText `_ or `Markdown `_ +* Includes a simple CLI tool to (re)generate the weblog * Easy to interface with DVCSes and web hooks -* Completely static output, so easy to host anywhere ! +* Completely static output is easy to host anywhere Features -------- Pelican currently supports: -* blog articles and pages -* comments, via an external service (disqus). Please notice that while - it's useful, it's an external service, and you'll not manage the - comments by yourself. It could potentially eat your data. -* theming support (themes are done using `jinja2 `_) -* PDF generation of the articles/pages (optional). -* Translations -* Syntactic recognition +* Blog articles and pages +* Comments, via an external service (Disqus). (Please note that while + useful, Disqus is an external service, and thus the comment data will be + somewhat outside of your control and potentially subject to data loss.) +* Theming support (themes are created using `jinja2 `_) +* PDF generation of the articles/pages (optional) +* Publication of articles in multiple languages +* Atom/RSS feeds +* Code syntax highlighting +* Import from WordPress, Dotclear, or RSS feeds +* Integration with external tools: Twitter, Google Analytics, etc. (optional) -Have a look to `the documentation `_ for -more informations. +Have a look at `the documentation `_ for +more information. -Why the name "Pelican" ? +Why the name "Pelican"? ------------------------ -Heh, you didn't noticed? "Pelican" is an anagram for "Calepin" ;) +Heh, you didn't notice? "Pelican" is an anagram for "Calepin" ;) Source code ----------- -You can access the source code via git on http://github.com/ametaireau/pelican/ +You can access the source code via git at: https://github.com/ametaireau/pelican -If you feel hackish, have a look to the `pelican's internals explanations -`_. +If you feel hackish, have a look at the `pelican's internals explanation +`_. Feedback / Contact us ===================== -If you want to see new features in Pelican, dont hesitate to tell me, to clone +If you want to see new features in Pelican, don't hesitate to tell me, to clone the repository, etc. That's open source, dude! Contact me at "alexis at notmyidea dot org" for any request/feedback! You can also join the team at `#pelican on irc.freenode.org `_ -(or if you don't have any IRC client, using `the webchat +(or if you don't have any IRC client, use `the webchat `_) for quick feedback. diff --git a/docs/contribute.rst b/docs/contribute.rst index 0aaa5771..84b99293 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -1,28 +1,28 @@ -How to contribute ? +How to contribute? ################### -There are many ways to contribute to pelican. You can enhance the -documentation, add missing features, fix bugs or just report them. +There are many ways to contribute to Pelican. You can enhance the +documentation, add missing features, and fix bugs (or just report them). -Don't hesitate to fork and make a pull request on github. +Don't hesitate to fork and make a pull request on GitHub. -Set up the development environment -================================== +Setting up the development environment +====================================== -You're free to setup up the environment in any way you like. Here is a way -using virtualenv and virtualenvwrapper. If you don't have them, you can install -them using:: +You're free to set up your development environment any way you like. Here is a +way using virtualenv and virtualenvwrapper. If you don't have them, you can +install these packages via:: $ pip install virtualenvwrapper -Virtual environments allow you to work on an installation of python which is -not the one installed on your system. Especially, it will install the different -projects under a different location. +Virtual environments allow you to work on Python projects which are isolated +from one another so you can use different packages (and package versions) with +different projects. -To create the virtualenv environment, you have to do:: +To create a virtual environment, use the following syntax:: - $ mkvirtualenv pelican --no-site-package + $ mkvirtualenv pelican -Then you would have to install all the dependencies:: +To manually install the dependencies:: $ pip install -r dev_requirements.txt $ python setup.py develop @@ -31,10 +31,10 @@ Running the test suite ====================== Each time you add a feature, there are two things to do regarding tests: -checking that the tests run in a right way, and be sure that you add tests for -the feature you are working on or the bug you're fixing. +checking that the existing tests pass, and adding tests for your new feature +or for the bug you're fixing. -The tests leaves under "pelican/tests" and you can run them using the +The tests live in "pelican/tests" and you can run them using the "discover" feature of unittest2:: $ unit2 discover diff --git a/docs/faq.rst b/docs/faq.rst index dbdf9692..b3dbca87 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -1,50 +1,51 @@ Frequently Asked Questions (FAQ) ################################ -Here is a summary of the frequently asked questions for pelican. +Here is a summary of the frequently asked questions for Pelican. -Is it mandatory to have a configuration file ? -============================================== +Is it mandatory to have a configuration file? +============================================= -No, it's not. Configurations files are just an easy way to configure pelican. -For the basic operations, it's possible to specify options while invoking -pelican with the command line (see `pelican --help` for more informations about -that) +No, it's not. Configuration files are just an easy way to configure Pelican. +For basic operations, it's possible to specify options while invoking Pelican +via the command line. See `pelican --help` for more information. -I'm creating my own theme, how to use pygments ? -================================================ +I'm creating my own theme. How do I use Pygments for syntax highlighting? +========================================================================= -Pygment add some classes to the generated content, so the theming of your theme -will be done thanks to a css file. You can have a look to the one proposed by -default `on the project website `_ +Pygments adds some classes to the generated content. These classes are used by +themes to style code syntax highlighting via CSS. Specifically, you can +customize the appearance of your syntax highlighting via the `.codehilite pre` +class in your theme's CSS file. To see how various styles can be used to render +Django code, for example, you can use the demo `on the project website +`_. -How do I create my own theme ? +How do I create my own theme? ============================== -Please refer yourself to :ref:`theming-pelican`. +Please refer to :ref:`theming-pelican`. -How can I help ? +How can I help? ================ -You have different options to help. First, you can use pelican, and report any -idea or problem you have on `the bugtracker +There are several ways to help out. First, you can use Pelican and report any +suggestions or problems you might have on `the bugtracker `_. -If you want to contribute, please have a look to `the git repository -`_, fork it, add your changes and do -a pull request, I'll review them as soon as possible. +If you want to contribute, please fork `the git repository +`_, make your changes, and issue +a pull request. I'll review your changes as soon as possible. -You can also contribute by creating themes, and making the documentation -better. +You can also contribute by creating themes and improving the documentation. -I want to use markdown, but I got an error -========================================== +I want to use Markdown, but I got an error. +=========================================== -Markdown is not a hard dependency for pelican, so you will need to install it -by yourself. You can do so by typing:: +Markdown is not a hard dependency for Pelican, so you will need to explicitly +install it. You can do so by typing:: $ (sudo) pip install markdown -In case you don't have pip installed, consider installing it by doing:: +In case you don't have pip installed, consider installing it via:: $ (sudo) easy_install pip diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 3e60b63a..1647fee4 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -4,13 +4,12 @@ Getting started Installing ========== -You're ready? Let's go ! You can install pelican in a lot of different ways, -the simpler one is via `pip `_:: +You're ready? Let's go! You can install Pelican via several different methods. The simplest is via `pip `_:: $ pip install pelican -If you have the sources, you can install pelican using the distutils command -install. I recommend to do so in a virtualenv:: +If you have the project source, you can install Pelican using the distutils +method. I recommend doing so in a virtualenv:: $ virtualenv pelican_venv $ source bin/activate @@ -19,30 +18,30 @@ install. I recommend to do so in a virtualenv:: Dependencies ------------ -At this time, pelican is dependent of the following python packages: +At this time, Pelican is dependent on the following Python packages: -* feedgenerator, to generate the ATOM feeds. -* jinja2, for templating support. +* feedgenerator, to generate the Atom feeds +* jinja2, for templating support -If you're not using python 2.7, you will also need `argparse`. +If you're not using Python 2.7, you will also need `argparse`. Optionally: -* docutils, for reST support -* pygments, to have syntactic colorization with resT input -* Markdown, for Markdown as an input format +* pygments, for syntax highlighting +* docutils, for supporting reStructuredText as an input format +* Markdown, for supporting Markdown as an input format -Writing articles using pelican +Writing articles using Pelican ============================== -Files metadata +File metadata -------------- -Pelican tries to be smart enough to get the informations it needs from the -file system (for instance, about the category of your articles), but you need to -provide by hand some of those informations in your files. +Pelican tries to be smart enough to get the information it needs from the +file system (for instance, about the category of your articles), but some +information you need to provide in the form of metadata inside your files. -You could provide the metadata in the restructured text files, using the +You can provide this metadata in reStructuredText text files via the following syntax (give your file the `.rst` extension):: My super title @@ -54,31 +53,35 @@ following syntax (give your file the `.rst` extension):: :author: Alexis Metaireau -You can also use a markdown syntax (with a file ending in `.md`):: +You can also use Markdown syntax (with a file ending in `.md`):: Date: 2010-12-03 Title: My super title + Tags: thats, awesome + Slug: my-super-post - Put you content here. + This is the content of my super blog post. -Note that none of those are mandatory: if the date is not specified, pelican will -rely on the mtime of your file, and the category can also be determined by the -directory where the rst file is. For instance, the category of -`python/foobar/myfoobar.rst` is `foobar`. +Note that, aside from the title, none of this metadata is mandatory: if the date +is not specified, Pelican will rely on the file's "mtime" timestamp, and the +category can be determined by the directory in which the file resides. For +example, a file located at `python/foobar/myfoobar.rst` will have a category of +`foobar`. Generate your blog ------------------ -To launch pelican, just use the `pelican` command:: +To launch Pelican, just use the `pelican` command:: $ pelican /path/to/your/content/ [-s path/to/your/settings.py] -And… that's all! You can see your weblog generated on the `content/` folder. +And… that's all! Your weblog will be generated and saved in the `content/` +folder. -This one will just generate a simple output, with the default theme. It's not -really sexy, as it's a simple HTML output (without any style). +The above command will use the default theme to produce a simple site. It's not +very sexy, as it's just simple HTML output (without any style). -You can create your own style if you want, have a look to the help to see all +You can create your own style if you want. Have a look at the help to see all the options you can use:: $ pelican --help @@ -88,7 +91,7 @@ Kickstart a blog You also can use the `pelican-quickstart` script to start a new blog in seconds, by just answering few questions. Just run `pelican-quickstart` and -you're done! (Added in pelican 3) +you're done! (Added in Pelican 3.0) Pages ----- @@ -102,26 +105,26 @@ the menu. Importing an existing blog -------------------------- -It is possible to import your blog from dotclear, wordpress and an RSS feed using +It is possible to import your blog from Dotclear, WordPress, and RSS feeds using a simple script. See :ref:`import`. Translations ------------ It is possible to translate articles. To do so, you need to add a `lang` meta -in your articles/pages, and to set a `DEFAULT_LANG` setting (which is en by -default). -Then, only articles with this default language will be listed, and -each article will have a translation list. +attribute to your articles/pages and set a `DEFAULT_LANG` setting (which is +English [en] by default). With those settings in place, only articles with the +default language will be listed, and each article will be accompanied by a list +of available translations for that article. -Pelican uses the "slug" of two articles to compare if they are translations of -each others. So it's possible to define (in restructured text) the slug -directly. +Pelican uses the article's URL "slug" to determine if two or more articles are +translations of one another. The slug can be set manually in the file's +metadata; if not set explicitly, Pelican will auto-generate the slug from the +title of the article. -Here is an exemple of two articles (one in english and the other one in -french). +Here is an example of two articles, one in English and the other in French. -The english one:: +The English article:: Foobar is not dead ################## @@ -129,9 +132,9 @@ The english one:: :slug: foobar-is-not-dead :lang: en - That's true, foobar is still alive ! + That's true, foobar is still alive! -And the french one:: +And the French version:: Foobar n'est pas mort ! ####################### @@ -141,56 +144,67 @@ And the french one:: Oui oui, foobar est toujours vivant ! -Despite the text quality, you can see that only the slug is the same here. -You're not forced to define the slug that way, and it's completely possible to -have two translations with the same title (which defines the slug) +Post content quality notwithstanding, you can see that only item in common +between the two articles is the slug, which is functioning here as an +identifier. If you'd rather not explicitly define the slug this way, you must +then instead ensure that the translated article titles are identical, since the +slug will be auto-generated from the article title. -Syntactic recognition +Syntax highlighting --------------------- -Pelican is able to regognise the syntax you are using, and to colorize the -right way your block codes. To do so, you have to use the following syntax:: +Pelican is able to provide colorized syntax highlighting for your code blocks. +To do so, you have to use the following convention for reStructuredText:: .. code-block:: identifier your code goes here -The identifier is one of the lexers available `here -`_. +For Markdown, format your code blocks thusly: -You also can use the default `::` syntax:: + ::identifier + your code goes here + +The specified identifier should be one that appears on the +`list of available lexers `_. + +You also can use the default `::` syntax, in which case it will be assumed +that your code is written in Python. For reStructuredText:: :: your code goes here -It will be assumed that your code is witten in python. +For Markdown: + + :: + your code goes here Autoreload ---------- -It's possible to tell pelican to watch for your modifications, instead of -manually launching it each time you need. Use the `-r` option, or -`--autoreload`. +It's possible to tell Pelican to watch for your modifications, instead of +manually launching it every time you want to see your changes. To enable this, +run the `pelican` command with the `-r` or `--autoreload` options. Publishing drafts ----------------- -If you want to publish an article as a draft, for friends to review it for -instance, you can add a ``status: draft`` to its metadata, it will then be -available under the ``drafts`` folder, and not be listed under the index page nor -any category page. +If you want to publish an article as a draft (for friends to review before +publishing, for example), you can add a ``status: draft`` attribute to its +metadata. That article will then be output to the ``drafts`` folder and not +listed on the index page nor on any category page. Viewing the generated files --------------------------- -The files generated by pelican are static files, so you don't actually need -something special to see what's hapenning with the generated files. +The files generated by Pelican are static files, so you don't actually need +anything special to see what's happening with the generated files. -You can either run your browser on the files on your disk:: +You can either use your browser to open the files on your disk:: $ firefox output/index.html -Or run a simple web server using python:: +Or run a simple web server using Python:: cd output && python -m SimpleHTTPServer diff --git a/docs/importer.rst b/docs/importer.rst index 6e5734ae..377820af 100644 --- a/docs/importer.rst +++ b/docs/importer.rst @@ -10,11 +10,11 @@ Description ``pelican-import`` is a command line tool for converting articles from other software to ReStructuredText. The supported formats are: -- Wordpress XML export +- WordPress XML export - Dotclear export -- RSS/ATOM feed +- RSS/Atom feed -The conversion from HTML to ReStructuredText relies on `pandoc +The conversion from HTML to reStructuredText relies on `pandoc `_. For Dotclear, if the source posts are written with Markdown syntax, they will not be converted (as Pelican also supports Markdown). @@ -40,7 +40,7 @@ Optional arguments: Examples ======== -for Wordpress:: +for WordPress:: $ pelican-import --wpfile -o ~/output ~/posts.xml diff --git a/docs/index.rst b/docs/index.rst index 38ebf49c..c6638997 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,57 +1,58 @@ Pelican ####### -Pelican is a simple weblog generator, written in python. +Pelican is a simple weblog generator, written in Python. -* Write your weblog entries directly with your editor of choice (vim!) and - directly in restructured text, or markdown. -* A simple cli-tool to (re)generate the weblog. +* Write your weblog entries directly with your editor of choice (vim!) in + reStructuredText or Markdown +* A simple CLI tool to (re)generate the weblog * Easy to interface with DVCSes and web hooks -* Completely static output, so easy to host anywhere ! +* Completely static output is easy to host anywhere Features ======== Pelican currently supports: -* blog articles and simple pages -* comments, via an external service (disqus). Please notice that while - it's useful, it's an external service, and you'll not manage the - comments by yourself. It could potentially eat your data. (optional) -* easy theming (themes are done using `jinja2 `_) -* PDF generation of the articles/pages (optional). -* publication of articles in various languages -* RSS/Atom feeds -* wordpress/dotclear or RSS imports -* integration with various tools: twitter/google analytics (optional) +* Blog articles and pages +* Comments, via an external service (Disqus). (Please note that while + useful, Disqus is an external service, and thus the comment data will be + somewhat outside of your control and potentially subject to data loss.) +* Theming support (themes are created using `jinja2 `_) +* PDF generation of the articles/pages (optional) +* Publication of articles in multiple languages +* Atom/RSS feeds +* Code syntax highlighting +* Import from WordPress, Dotclear, or RSS feeds +* Integration with external tools: Twitter, Google Analytics, etc. (optional) Why the name "Pelican" ? ======================== -Heh, you didn't noticed? "Pelican" is an anagram for "Calepin" ;) +Heh, you didn't notice? "Pelican" is an anagram for "Calepin" ;) Source code =========== -You can access the source code via git on http://github.com/ametaireau/pelican/ +You can access the source code via git at http://github.com/ametaireau/pelican/ Feedback / Contact us ===================== -If you want to see new features in Pelican, dont hesitate to tell me, to clone +If you want to see new features in Pelican, don't hesitate to tell me, to clone the repository, etc. That's open source, dude! Contact me at "alexis at notmyidea dot org" for any request/feedback! You can also join the team at `#pelican on irc.freenode.org `_ -(or if you don't have any IRC client, using `the webchat +(or if you don't have any IRC client, use `the webchat `_) for quick feedback. Documentation ============= -A french version of the documentation is available at :doc:`fr/index`. +A French version of the documentation is available at :doc:`fr/index`. .. toctree:: :maxdepth: 2 diff --git a/docs/internals.rst b/docs/internals.rst index 269fe415..f0934825 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -1,49 +1,48 @@ Pelican internals ################# -This section describe how pelican is working internally. As you'll see, it's -quite simple, but a bit of documentation doesn't hurt :) +This section describe how Pelican works internally. As you'll see, it's +quite simple, but a bit of documentation doesn't hurt. :) -You can also find in :doc:`report` an excerpt of a report the original author -wrote, with some software design information. +You can also find in the :doc:`report` section an excerpt of a report the +original author wrote with some software design information. .. _report: :doc:`report` Overall structure ================= -What `pelican` does, is taking a list of files, and processing them, to some -sort of output. Usually, the files are restructured text and markdown files, -and the output is a blog, but it can be anything you want. +What `pelican` does is take a list of files and process them into some +sort of output. Usually, the input files are reStructuredText and Markdown +files, and the output is a blog, but both input and output can be anything you +want. -I've separated the logic in different classes and concepts: +The logic is separated into different classes and concepts: -* `writers` are responsible of all the writing process of the - files. It's writing .html files, RSS feeds and so on. Since those operations - are commonly used, the object is created once, and then passed to the - generators. +* `writers` are responsible for writing files: .html files, RSS feeds, and so + on. Since those operations are commonly used, the object is created once and + then passed to the generators. -* `readers` are used to read from various formats (Markdown, and Restructured - Text for now, but the system is extensible). Given a file, they return - metadata (author, tags, category etc) and content (HTML formated) +* `readers` are used to read from various formats (Markdown and + reStructuredText for now, but the system is extensible). Given a file, they return + metadata (author, tags, category, etc.) and content (HTML-formatted). -* `generators` generate the different outputs. For instance, pelican comes with - `ArticlesGenerator` and `PageGenerator`, into others. Given - a configurations, they can do whatever they want. Most of the time it's - generating files from inputs. +* `generators` generate the different outputs. For instance, Pelican comes with + `ArticlesGenerator` and `PageGenerator`. Given a configuration, they can do + whatever they want. Most of the time, it's generating files from inputs. -* `pelican` also uses `templates`, so it's easy to write you own theme. The +* `pelican` also uses `templates`, so it's easy to write your own theme. The syntax is `jinja2`, and, trust me, really easy to learn, so don't hesitate - a second. + to jump in and build your own theme. -How to implement a new reader ? -=============================== +How to implement a new reader? +============================== -There is an awesome markup language you want to add to pelican ? -Well, the only thing you have to do is to create a class that have a `read` -method, that is returning an HTML content and some metadata. +Is there an awesome markup language you want to add to Pelican? +Well, the only thing you have to do is to create a class with a `read` +method that returns HTML content and some metadata. -Take a look to the Markdown reader:: +Take a look at the Markdown reader:: class MarkdownReader(Reader): enabled = bool(Markdown) @@ -63,31 +62,31 @@ Take a look to the Markdown reader:: metadata[name.lower()] = meta return content, metadata -Simple isn't it ? +Simple, isn't it? -If your new reader requires additional Python dependencies then you should wrap -their `import` statements in `try...except`. Then inside the reader's class -set the `enabled` class attribute to mark import success or failure. This makes -it possible for users to continue using their favourite markup method without -needing to install modules for all the additional formats they don't use. +If your new reader requires additional Python dependencies, then you should wrap +their `import` statements in a `try...except` block. Then inside the reader's +class, set the `enabled` class attribute to mark import success or failure. +This makes it possible for users to continue using their favourite markup method +without needing to install modules for formats they don't use. -How to implement a new generator ? -================================== +How to implement a new generator? +================================= -Generators have basically two important methods. You're not forced to create -both, only the existing ones will be called. +Generators have two important methods. You're not forced to create +both; only the existing ones will be called. -* `generate_context`, that is called in a first place, for all the generators. +* `generate_context`, that is called first, for all the generators. Do whatever you have to do, and update the global context if needed. This context is shared between all generators, and will be passed to the - templates. For instance, the `PageGenerator` `generate_context` method find - all the pages, transform them into objects, and populate the context with - them. Be careful to *not* output anything using this context at this stage, - as it is likely to change by the effect of others generators. + templates. For instance, the `PageGenerator` `generate_context` method finds + all the pages, transforms them into objects, and populates the context with + them. Be careful *not* to output anything using this context at this stage, + as it is likely to change by the effect of other generators. -* `generate_output` is then called. And guess what is it made for ? Oh, - generating the output :) That's here that you may want to look at the context - and call the methods of the `writer` object, that is passed at the first +* `generate_output` is then called. And guess what is it made for? Oh, + generating the output. :) It's here that you may want to look at the context + and call the methods of the `writer` object that is passed as the first argument of this function. In the `PageGenerator` example, this method will - look at all the pages recorded in the global context, and output a file on + look at all the pages recorded in the global context and output a file on the disk (using the writer method `write_file`) for each page encountered. diff --git a/docs/pelican-themes.rst b/docs/pelican-themes.rst index bd2dba77..c7cbc5b7 100644 --- a/docs/pelican-themes.rst +++ b/docs/pelican-themes.rst @@ -57,11 +57,11 @@ With ``pelican-themes``, you can see the available themes by using the ``-l`` or two-column@ simple -In this example, we can see there is 3 themes available: ``notmyidea``, ``simple`` and ``two-column``. +In this example, we can see there are three themes available: ``notmyidea``, ``simple``, and ``two-column``. -``two-column`` is prefixed with an ``@`` because this theme is not copied to the Pelican theme path, but just linked to it (see `Creating symbolic links`_ for details about creating symbolic links). +``two-column`` is prefixed with an ``@`` because this theme is not copied to the Pelican theme path, but is instead just linked to it (see `Creating symbolic links`_ for details about creating symbolic links). -Note that you can combine the ``--list`` option with the ``-v`` or ``--verbose`` option to get a more verbose output, like this: +Note that you can combine the ``--list`` option with the ``-v`` or ``--verbose`` option to get more verbose output, like this: .. code-block:: console @@ -95,8 +95,8 @@ This option takes as argument the path(s) of the theme(s) you want to install, a Removing themes """"""""""""""" -Pelican themes can also removes themes from the Pelican themes path. -The ``-r`` or ``--remove`` takes as argument the name(s) of the theme(s) you want to remove, and can be combined with the ``--verbose`` option. +The ``pelican-themes`` command can also remove themes from the Pelican themes path. +The ``-r`` or ``--remove`` option takes as argument the name(s) of the theme(s) you want to remove, and can be combined with the ``--verbose`` option. .. code-block:: console @@ -113,7 +113,7 @@ The ``-r`` or ``--remove`` takes as argument the name(s) of the theme(s) you wan Creating symbolic links """"""""""""""""""""""" -``pelican-themes`` can also install themes by creating symbolic links instead of copying the whole themes in the Pelican themes path. +``pelican-themes`` can also install themes by creating symbolic links instead of copying entire themes into the Pelican themes path. To symbolically link a theme, you can use the ``-s`` or ``--symlink``, which works exactly as the ``--install`` option: @@ -152,7 +152,7 @@ The ``--install``, ``--remove`` and ``--symlink`` option are not mutually exclus --symlink ~/Dev/Python/pelican-themes/two-column \ --verbose -In this example, the theme ``notmyidea-cms`` is replaced by the theme ``notmyidea-cms-fr`` +In this example, the theme ``notmyidea-cms`` is replaced by the theme ``notmyidea-cms-fr`` diff --git a/docs/settings.rst b/docs/settings.rst index 9d34fae0..2d40d4ec 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -6,26 +6,26 @@ the command line:: $ pelican -s path/to/your/settingsfile.py path -Settings are given as the form of a python module (a file). You can have an +Settings are configured in the form of a Python module (a file). You can see an example by looking at `/samples/pelican.conf.py `_ -All the settings identifiers must be set in caps, otherwise they will not be +All the setting identifiers must be set in all-caps, otherwise they will not be processed. The settings you define in the configuration file will be passed to the -templates, it allows you to use them to add site-wide contents if you need. +templates, which allows you to use your settings to add site-wide content. -Here is a list of settings for pelican, regarding the different features. +Here is a list of settings for Pelican: Basic settings ============== ================================================ ===================================================== -Setting name (default value) what does it do? +Setting name (default value) What does it do? ================================================ ===================================================== -`ARTICLE_PERMALINK_STRUCTURE` (``''``) Empty by default. Allows to render URLs in a - particular way, see below. +`ARTICLE_PERMALINK_STRUCTURE` (``''``) Empty by default. Enables some customization of URL + structure (see below for more detail). `AUTHOR` Default author (put your name) `CLEAN_URLS` (``False``) If set to `True`, the URLs will not be suffixed by `.html`, so you will have to setup URL rewriting on @@ -33,68 +33,71 @@ Setting name (default value) what does it do? `DATE_FORMATS` (``{}``) If you do manage multiple languages, you can set the date formatting here. See "Date format and locales" section below for details. -`DEFAULT_CATEGORY` (``'misc'``) The default category to fallback on. +`DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on. `DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use. -`DISPLAY_PAGES_ON_MENU` (``True``) Display or not the pages on the menu of the - template. Templates can follow or not this - settings. -`FALLBACK_ON_FS_DATE` (``True``) If True, pelican will use the file system - dates infos (mtime) if it can't get - informations from the metadata +`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the + template. Templates may or not honor this + setting. +`FALLBACK_ON_FS_DATE` (``True``) If True, Pelican will use the file system + timestamp information (mtime) if it can't get + date information from the metadata. `JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. -`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory and just +`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as the generated files. `LOCALE` (''[#]_) Change the locale. A list of locales can be provided here or a single string representing one locale. When providing a list, all the locales will be tried until one works. `MARKUP` (``('rst', 'md')``) A list of available markup languages you want - to use. For the moment, only available values + to use. For the moment, the only available values are `rst` and `md`. -`MD_EXTENSIONS` (``('codehilite','extra')``) A list of the extensions that the markdown processor +`MD_EXTENSIONS` (``('codehilite','extra')``) A list of the extensions that the Markdown processor will use. Refer to the extensions chapter in the Python-Markdown documentation for a complete list of supported extensions. `OUTPUT_PATH` (``'output/'``) Where to output the generated files. -`PATH` (``None``) path to look at for input files. +`PATH` (``None``) Path to look at for input files. `PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions of your documents. You will need to install `rst2pdf`. -`RELATIVE_URLS` (``True``) Defines if pelican should use relative urls or +`RELATIVE_URLS` (``True``) Defines whether Pelican should use relative URLs or not. `SITENAME` (``'A Pelican Blog'``) Your site name -`SITEURL` base URL of your website. Note that this is - not a way to tell pelican to use relative urls - or static ones. You should rather use the - `RELATIVE_URL` setting for such use. +`SITEURL` Base URL of your website. Note that this is + not a way to tell Pelican whether to use relative URLs + or static ones. You should instead use the + `RELATIVE_URL` setting for that purpose. `STATIC_PATHS` (``['images']``) The static paths you want to have accessible on the output path "static". By default, - pelican will copy the 'images' folder to the + Pelican will copy the 'images' folder to the output folder. `TIMEZONE` The timezone used in the date information, to - generate atom and rss feeds. See the "timezone" + generate Atom and RSS feeds. See the "timezone" section below for more info. ================================================ ===================================================== -.. [#] Default is the system locale. Default is to delete the output directory. +.. [#] Default is the system locale. + Article permalink structure --------------------------- -Allow to render articles sorted by date, in case you specify a format as -specified in the example. It follows the python datetime directives: + +This setting allows you to output your articles sorted by date, provided that +you specify a format as specified below. This format follows the Python +``datetime`` directives: * %Y: Year with century as a decimal number. * %m: Month as a decimal number [01,12]. * %d: Day of the month as a decimal number [01,31]. -Note: if you specify a datetime directive, it will be substituted using the -date metadata field into the rest file. if the date is not specified, pelican -will rely on the mtime of your file. +Note: If you specify a datetime directive, it will be substituted using the +input files' date metadata attribute. If the date is not specified for a +particular file, Pelican will rely on the file's mtime timestamp. -Check the python datetime documentation at http://bit.ly/cNcJUC for more +Check the Python datetime documentation at http://bit.ly/cNcJUC for more information. -Also, you can use any metadata in the restructured text files: +Also, you can use other file metadata attributes as well: * category: '%(category)s' * author: '%(author)s' @@ -103,20 +106,19 @@ Also, you can use any metadata in the restructured text files: Example usage: -* '/%Y/%m/' it will be something like '/2011/07/sample-post.html'. -* '/%Y/%(category)s/' it will be something like '/2011/life/sample-post.html'. +* '/%Y/%m/' will render something like '/2011/07/sample-post.html'. +* '/%Y/%(category)s/' will render something like '/2011/life/sample-post.html'. Timezone -------- -If no timezone is defined, UTC is assumed. This means that the generated atom -and rss feeds will have wrong date information if your locale is not UTC. +If no timezone is defined, UTC is assumed. This means that the generated Atom +and RSS feeds will contain incorrect date information if your locale is not UTC. Pelican issues a warning in case this setting is not defined, as it was not -mandatory in old versions. +mandatory in previous versions. -Have a look at `the wikipedia page`_ to get a list of values to set your -timezone. +Have a look at `the wikipedia page`_ to get a list of valid timezone values. .. _the wikipedia page: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones @@ -124,9 +126,9 @@ timezone. Date format and locale ---------------------- -If no DATE_FORMAT is set, fallback to DEFAULT_DATE_FORMAT. If you need to -maintain multiple languages with different date format, you can set this dict -using language name (``lang`` in your posts) as key. About available format +If no DATE_FORMAT is set, fall back to DEFAULT_DATE_FORMAT. If you need to +maintain multiple languages with different date formats, you can set this dict +using language name (``lang`` in your posts) as key. Regarding available format codes, see `strftime document of python`_ : DATE_FORMAT = { @@ -140,8 +142,8 @@ You can set locale to further control date format: 'en_US', 'ja_JP' # On Unix/Linux ) -Also, it is possible to set different locale settings for each language, if you -put (locale, format) tuple in dict, and this will override the LOCALE setting +Also, it is possible to set different locale settings for each language. If you +put (locale, format) tuples in the dict, this will override the LOCALE setting above: # On Unix/Linux @@ -156,8 +158,9 @@ above: 'jp': ('jpn','%Y-%m-%d(%a)'), } -For available list of `locales on Windows`_ . On Unix/Linux usually you can get -a list of available locales with command ``locale -a``, see manpage `locale(1)`_ for help. +This is a list of available `locales on Windows`_ . On Unix/Linux, usually you +can get a list of available locales via the ``locale -a`` command; see manpage +`locale(1)`_ for more information. .. _strftime document of python: http://docs.python.org/library/datetime.html#strftime-strptime-behavior @@ -169,26 +172,26 @@ a list of available locales with command ``locale -a``, see manpage `locale(1)`_ Feed settings ============= -By default, pelican uses atom feeds. However, it is possible to use RSS feeds -instead, at your covenience. +By default, Pelican uses Atom feeds. However, it is also possible to use RSS +feeds if you prefer. Pelican generates category feeds as well as feeds for all your articles. It does -not generate feeds for tags per default, but it is possible to do so using +not generate feeds for tags by default, but it is possible to do so using the ``TAG_FEED`` and ``TAG_FEED_RSS`` settings: ================================================ ===================================================== -Setting name (default value) what does it do? +Setting name (default value) What does it do? ================================================ ===================================================== -`CATEGORY_FEED` ('feeds/%s.atom.xml'[2]_) Where to put the atom categories feeds. -`CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the categories rss feeds. -`FEED` (``'feeds/all.atom.xml'``) relative url to output the atom feed. -`FEED_RSS` (``None``, i.e. no RSS) relative url to output the rss feed. -`TAG_FEED` (``None``, ie no tag feed) relative url to output the tags atom feed. It should - be defined using a "%s" matchin the tag name -`TAG_FEED_RSS` (``None``, ie no RSS tag feed) relative url to output the tag RSS feed -`FEED_MAX_ITEMS` Maximum number of items allowed in a feed. Feeds are - unrestricted by default. +`CATEGORY_FEED` ('feeds/%s.atom.xml'[2]_) Where to put the category Atom feeds. +`CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the category RSS feeds. +`FEED` (``'feeds/all.atom.xml'``) Relative URL to output the Atom feed. +`FEED_RSS` (``None``, i.e. no RSS) Relative URL to output the RSS feed. +`TAG_FEED` (``None``, ie no tag feed) Relative URL to output the tag Atom feed. It should + be defined using a "%s" match in the tag name. +`TAG_FEED_RSS` (``None``, ie no RSS tag feed) Relative URL to output the tag RSS feed +`FEED_MAX_ITEMS` Maximum number of items allowed in a feed. Feed item + quantity is unrestricted by default. ================================================ ===================================================== .. [2] %s is the name of the category. @@ -196,14 +199,15 @@ Setting name (default value) what does it do? Pagination ========== -The default behaviour of pelican is to list all the articles titles alongside -with a short description of them on the index page. While it works pretty well -for little to medium blogs, it is convenient to have a way to paginate this. +The default behaviour of Pelican is to list all the article titles along +with a short description on the index page. While it works pretty well +for small-to-medium blogs, for sites with large quantity of articles it would +be convenient to have a way to paginate the list. You can use the following settings to configure the pagination. ================================================ ===================================================== -Setting name (default value) what does it do? +Setting name (default value) What does it do? ================================================ ===================================================== `DEFAULT_ORPHANS` (0) The minimum number of articles allowed on the last page. Use this when you don't want to @@ -220,11 +224,11 @@ If you want to generate a tag cloud with all your tags, you can do so using the following settings. ================================================ ===================================================== -Setting name (default value) what does it do? +Setting name (default value) What does it do? ================================================ ===================================================== `TAG_CLOUD_STEPS` (4) Count of different font sizes in the tag cloud. -`TAG_CLOUD_MAX_ITEMS` (100) Maximum tags count in the cloud. +`TAG_CLOUD_MAX_ITEMS` (100) Maximum number of tags in the cloud. ================================================ ===================================================== The default theme does not support tag clouds, but it is pretty easy to add:: @@ -235,34 +239,34 @@ The default theme does not support tag clouds, but it is pretty easy to add:: {% endfor %} -You should then also define a CSS with the appropriate classes (tag-0 to tag-N, where -N matches `TAG_CLOUD_STEPS` -1. +You should then also define a CSS style with the appropriate classes (tag-0 to tag-N, where +N matches `TAG_CLOUD_STEPS` -1). Translations ============ -Pelican offers a way to translate articles. See the section on getting started for -more information about that. +Pelican offers a way to translate articles. See the Getting Started section for +more information. ================================================ ===================================================== -Setting name (default value) what does it do? +Setting name (default value) What does it do? ================================================ ===================================================== `DEFAULT_LANG` (``'en'``) The default language to use. -`TRANSLATION_FEED` ('feeds/all-%s.atom.xml'[3]_) Where to put the RSS feed for translations. +`TRANSLATION_FEED` ('feeds/all-%s.atom.xml'[3]_) Where to put the feed for translations. ================================================ ===================================================== .. [3] %s is the language -Ordering contents +Ordering content ================= ================================================ ===================================================== -Setting name (default value) what does it do? +Setting name (default value) What does it do? ================================================ ===================================================== -`REVERSE_ARCHIVE_ORDER` (``False``) Reverse the archives order. (True makes it in - descending order: the newer first) -`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True makes it in - descending order, default is alphabetically) +`REVERSE_ARCHIVE_ORDER` (``False``) Reverse the archives list order. (True: orders by date + in descending order, with newer articles first.) +`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True: lists by reverse + alphabetical order; default lists alphabetically.) ================================================ ===================================================== Theming @@ -272,45 +276,45 @@ Theming is addressed in a dedicated section (see :ref:`theming-pelican`). However, here are the settings that are related to theming. ================================================ ===================================================== -Setting name (default value) what does it do? +Setting name (default value) What does it do? ================================================ ===================================================== -`THEME` theme to use to produce the output. can be the +`THEME` Theme to use to produce the output. Can be the complete static path to a theme folder, or chosen between the list of default themes (see below) `THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default - values is `static`, but if your theme has + value is `static`, but if your theme has other static paths, you can put them here. -`CSS_FILE` (``'main.css'``) specify the CSS file you want to load +`CSS_FILE` (``'main.css'``) Specify the CSS file you want to load. ================================================ ===================================================== -By default, two themes are availablee. You can specify them using the `-t` option: +By default, two themes are available. You can specify them using the `-t` option: * notmyidea * simple (a synonym for "full text" :) -You can define your own theme too, and specify it's emplacement in the same -way (be sure to specify the full absolute path to it). +You can define your own theme too, and specify its placement in the same +manner. (Be sure to specify the full absolute path to it.) Here is `a guide on how to create your theme -`_ +`_ You can find a list of themes at http://github.com/ametaireau/pelican-themes. -Pelican comes with :doc:`pelican-themes` a small script for managing themes. +Pelican comes with :doc:`pelican-themes`, a small script for managing themes. The `notmyidea` theme can make good use of the following settings. I recommend -to use them too in your themes. +using them in your themes as well. ======================= ======================================================= -Setting name what does it do ? +Setting name What does it do ? ======================= ======================================================= -`DISQUS_SITENAME` Pelican can handle disqus comments, specify the - sitename you've filled in on disqus -`GITHUB_URL` Your github URL (if you have one), it will then - use it to create a github ribbon. -`GOOGLE_ANALYTICS` 'UA-XXXX-YYYY' to activate google analytics. -`MENUITEMS` A list of tuples (Title, Url) for additional menu +`DISQUS_SITENAME` Pelican can handle Disqus comments. Specify the + Disqus sitename identifier here. +`GITHUB_URL` Your GitHub URL (if you have one). It will then + use this information to create a GitHub ribbon. +`GOOGLE_ANALYTICS` 'UA-XXXX-YYYY' to activate Google Analytics. +`MENUITEMS` A list of tuples (Title, URL) for additional menu items to appear at the beginning of the main menu. `PIWIK_URL` URL to your Piwik server - without 'http://' at the beginning. @@ -318,17 +322,17 @@ Setting name what does it do ? you have to include this setting too. (optional) `PIWIK_SITE_ID` ID for the monitored website. You can find the ID in the Piwik admin interface > settings > websites. -`LINKS` A list of tuples (Title, Url) for links to appear on +`LINKS` A list of tuples (Title, URL) for links to appear on the header. -`SOCIAL` A list of tuples (Title, Url) to appear in the +`SOCIAL` A list of tuples (Title, URL) to appear in the "social" section. -`TWITTER_USERNAME` Allows to add a button on the articles to tweet about - them. Add you twitter username if you want this - button to appear. +`TWITTER_USERNAME` Allows for adding a button to articles to encourage + others to tweet about them. Add your Twitter username + if you want this button to appear. ======================= ======================================================= -In addition, you can use the "wide" version of the `notmyidea` theme, by -adding that in your configuration:: +In addition, you can use the "wide" version of the `notmyidea` theme by +adding the following to your configuration:: CSS_FILE = "wide.css" diff --git a/docs/themes.rst b/docs/themes.rst index a20fd099..e0583882 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -1,10 +1,10 @@ .. _theming-pelican: -How to create themes for pelican +How to create themes for Pelican ################################ Pelican uses the great `jinja2 `_ templating engine to -generate it's HTML output. The jinja2 syntax is really simple. If you want to +generate its HTML output. The jinja2 syntax is really simple. If you want to create your own theme, feel free to take inspiration from the "simple" theme, which is available `here `_ @@ -29,179 +29,183 @@ To make your own theme, you must follow the following structure:: ├── tag.html // processed for each tag └── tags.html // must list all the tags. Can be a tag cloud. -* `static` contains all the static content. It will be copied on the output - `theme/static` folder then. I've put the css and image folders, but they are +* `static` contains all the static assets, which will be copied to the output + `theme/static` folder. I've put the CSS and image folders here, but they are just examples. Put what you need here. * `templates` contains all the templates that will be used to generate the content. - I've just put the mandatory templates here, you can define your own if it helps - you to organize yourself while doing the theme. + I've just put the mandatory templates here; you can define your own if it helps + you keep things organized while creating your theme. Templates and variables ======================= -It's using a simple syntax, that you can embbed into your html pages. -This document describes which templates should exist on a theme, and which -variables will be passed to each template, while generating it. +The idea is to use a simple syntax that you can embed into your HTML pages. +This document describes which templates should exist in a theme, and which +variables will be passed to each template at generation time. All templates will receive the variables defined in your settings file, if they -are in caps. You can access them directly. +are in all-caps. You can access them directly. Common variables ---------------- -All of those settings will be given to all templates. +All of these settings will be available to all templates. ============= =================================================== Variable Description ============= =================================================== -articles That's the list of articles, ordered desc. by date - all the elements are `Article` objects, so you can - access their properties (e.g. title, summary, author - etc.). -dates The same list of article, but ordered by date, - ascending. -tags A dict containing each tags (keys), and the list of - relative articles. -categories A dict containing each category (keys), and the - list of relative articles. -pages The list of pages. +articles The list of articles, ordered descending by date + All the elements are `Article` objects, so you can + access their attributes (e.g. title, summary, author + etc.) +dates The same list of articles, but ordered by date, + ascending +tags A key-value dict containing the tags (the keys) and + the list of respective articles (the values) +categories A key-value dict containing the categories (keys) + and the list of respective articles (values) +pages The list of pages ============= =================================================== index.html ---------- -Home page of your blog, will finally remain at output/index.html. +This is the home page of your blog, generated at output/index.html. -If pagination is active, next pages will remain at output/index`n`.html. +If pagination is active, subsequent pages will reside in output/index`n`.html. =================== =================================================== Variable Description =================== =================================================== -articles_paginator A paginator object of article list. -articles_page The current page of articles. -dates_paginator A paginator object of article list, ordered by date, - ascending. +articles_paginator A paginator object for the list of articles +articles_page The current page of articles +dates_paginator A paginator object for the article list, ordered by + date, ascending. dates_page The current page of articles, ordered by date, ascending. -page_name 'index'. Useful for pagination links. +page_name 'index' -- useful for pagination links =================== =================================================== author.html ------------- -This template will be processed for each of the existing authors, and will -finally remain at output/author/`author_name`.html. +This template will be processed for each of the existing authors, with +output generated at output/author/`author_name`.html. -If pagination is active, next pages will remain at +If pagination is active, subsequent pages will reside at output/author/`author_name``n`.html. =================== =================================================== Variable Description =================== =================================================== -author The name of the author being processed. -articles Articles of this author. -dates Articles of this author, but ordered by date, - ascending. -articles_paginator A paginator object of article list. -articles_page The current page of articles. -dates_paginator A paginator object of article list, ordered by date, - ascending. +author The name of the author being processed +articles Articles by this author +dates Articles by this author, but ordered by date, + ascending +articles_paginator A paginator object for the list of articles +articles_page The current page of articles +dates_paginator A paginator object for the article list, ordered by + date, ascending. dates_page The current page of articles, ordered by date, ascending. -page_name 'author/`author_name`'. Useful for pagination - links. +page_name 'author/`author_name`' -- useful for pagination + links =================== =================================================== category.html ------------- -This template will be processed for each of the existing categories, and will -finally remain at output/category/`category_name`.html. +This template will be processed for each of the existing categories, with +output generated at output/category/`category_name`.html. -If pagination is active, next pages will remain at +If pagination is active, subsequent pages will reside at output/category/`category_name``n`.html. =================== =================================================== Variable Description =================== =================================================== -category The name of the category being processed. -articles Articles of this category. -dates Articles of this category, but ordered by date, - ascending. -articles_paginator A paginator object of article list. -articles_page The current page of articles. -dates_paginator A paginator object of article list, ordered by date, - ascending. +category The name of the category being processed +articles Articles for this category +dates Articles for this category, but ordered by date, + ascending +articles_paginator A paginator object for the list of articles +articles_page The current page of articles +dates_paginator A paginator object for the list of articles, + ordered by date, ascending dates_page The current page of articles, ordered by date, - ascending. -page_name 'category/`category_name`'. Useful for pagination - links. + ascending +page_name 'category/`category_name`' -- useful for pagination + links =================== =================================================== article.html ------------- -This template will be processed for each article. .html files will be output -in output/`article_name`.html. Here are the specific variables it gets. +This template will be processed for each article, with .html files saved +as output/`article_name`.html. Here are the specific variables it gets. ============= =================================================== Variable Description ============= =================================================== -article The article object to be displayed. -category The name of the category of the current article. +article The article object to be displayed +category The name of the category for the current article ============= =================================================== page.html --------- -For each page, this template will be processed. It will create .html files in -output/`page_name`.html. +This template will be processed for each page, with corresponding .html files +saved as output/`page_name`.html. ============= =================================================== Variable Description ============= =================================================== -page The page object to be displayed. You can access to - its title, slug and content. +page The page object to be displayed. You can access its + title, slug, and content. ============= =================================================== tag.html -------- -For each tag, this template will be processed. It will create .html files in -output/tag/`tag_name`.html. +This template will be processed for each tag, with corresponding .html files +saved as output/tag/`tag_name`.html. -If pagination is active, next pages will remain at +If pagination is active, subsequent pages will reside at output/tag/`tag_name``n`.html. =================== =================================================== Variable Description =================== =================================================== -tag The name of the tag being processed. -articles Articles related to this tag. +tag The name of the tag being processed +articles Articles related to this tag dates Articles related to this tag, but ordered by date, - ascending. -articles_paginator A paginator object of article list. -articles_page The current page of articles. -dates_paginator A paginator object of article list, ordered by date, - ascending. + ascending +articles_paginator A paginator object for the list of articles +articles_page The current page of articles +dates_paginator A paginator object for the list of articles, + ordered by date, ascending dates_page The current page of articles, ordered by date, - ascending. -page_name 'tag/`tag_name`'. Useful for pagination links. + ascending +page_name 'tag/`tag_name`' -- useful for pagination links =================== =================================================== Inheritance =========== -Since version 3, pelican supports inheritance from the ``simple`` theme, so you can reuse the templates of the ``simple`` theme in your own themes: +Since version 3.0, Pelican supports inheritance from the ``simple`` theme, so +you can re-use the ``simple`` theme templates in your own themes. -If one of the mandatory files in the ``templates/`` directory of your theme is missing, it will be replaced by the matching template from the ``simple`` theme, so if the HTML structure of a template of the ``simple`` theme is right for you, you don't have to rewrite it from scratch. +If one of the mandatory files in the ``templates/`` directory of your theme is +missing, it will be replaced by the matching template from the ``simple`` theme. +So if the HTML structure of a template in the ``simple`` theme is right for you, +you don't have to write a new template from scratch. -You can also extend templates of the ``simple`` themes in your own themes by using the ``{% extends %}`` directive as in the following example: +You can also extend templates from the ``simple`` themes in your own themes by using the ``{% extends %}`` directive as in the following example: .. code-block:: html+jinja - {% extends "!simple/index.html" %} + {% extends "!simple/index.html" %} {% extends "index.html" %} @@ -226,10 +230,10 @@ The first file is the ``templates/base.html`` template: {% endblock %} -1. On the first line, we extend the ``base.html`` template of the ``simple`` theme, so we don't have to rewrite the entire file. -2. On the third line, we open the ``head`` block which has already been defined in the ``simple`` theme +1. On the first line, we extend the ``base.html`` template from the ``simple`` theme, so we don't have to rewrite the entire file. +2. On the third line, we open the ``head`` block which has already been defined in the ``simple`` theme. 3. On the fourth line, the function ``super()`` keeps the content previously inserted in the ``head`` block. -4. On the fifth line, we append a stylesheet to the page +4. On the fifth line, we append a stylesheet to the page. 5. On the last line, we close the ``head`` block. This file will be extended by all the other templates, so the stylesheet will be linked from all pages. diff --git a/docs/tips.rst b/docs/tips.rst index 9ff7f9ce..6ddc3d33 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -1,22 +1,22 @@ Tips #### -Here are some tips about pelican, which you might find useful. +Here are some tips about Pelican that you might find useful. -Publishing to github +Publishing to GitHub ==================== -Github comes with an interesting "pages" feature: you can upload things there -and it will be available directly from their servers. As pelican is a static +GitHub comes with an interesting "pages" feature: you can upload things there +and it will be available directly from their servers. As Pelican is a static file generator, we can take advantage of this. The excellent `ghp-import `_ makes this -eally easy. You would have to install it:: +really easy. You will have to install it:: $ pip install ghp-import -Then, considering a repository containing your articles, you would simply have -to run pelican and upload the output to github:: +Then, given a repository containing your articles, you would simply have +to run Pelican and upload the output to GitHub:: $ pelican -s pelican.conf.py . $ ghp-import output @@ -24,8 +24,8 @@ to run pelican and upload the output to github:: And that's it. -If you want you can put that directly into a post commit hook, so each time you -commit, your blog is up to date on github! +If you want, you can put that directly into a post-commit hook, so each time you +commit, your blog is up to date on GitHub! Put the following into `.git/hooks/post-commit`:: From 4861a15774c176e13f6e5ba811cf48762428622d Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 6 Mar 2012 08:12:15 -0800 Subject: [PATCH 0045/2344] Update outdated links to documentation and add Contribute link to README for issue #227 --- README.rst | 9 +++++---- pelican/themes/notmyidea/templates/base.html | 2 +- pelican/themes/simple/templates/base.html | 4 ++-- setup.py | 4 ++-- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/README.rst b/README.rst index 0a27bdcd..b521d430 100644 --- a/README.rst +++ b/README.rst @@ -39,14 +39,15 @@ Source code You can access the source code via git at: https://github.com/ametaireau/pelican -If you feel hackish, have a look at the `pelican's internals explanation +If you feel hackish, have a look at the explanation of `Pelican's internals `_. Feedback / Contact us -===================== +--------------------- -If you want to see new features in Pelican, don't hesitate to tell me, to clone -the repository, etc. That's open source, dude! +If you want to see new features in Pelican, don't hesitate to offer suggestions, +clone the repository, etc. There are many ways to `contribute +`_. That's open source, dude! Contact me at "alexis at notmyidea dot org" for any request/feedback! You can also join the team at `#pelican on irc.freenode.org diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index a34b5d5a..4a4c70c6 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -71,7 +71,7 @@
- Proudly powered by pelican, which takes great advantages of python. + Proudly powered by Pelican, which takes great advantage of Python.

The theme is by Smashing Magazine, thanks!

diff --git a/pelican/themes/simple/templates/base.html b/pelican/themes/simple/templates/base.html index dc266773..a8fad2db 100644 --- a/pelican/themes/simple/templates/base.html +++ b/pelican/themes/simple/templates/base.html @@ -29,8 +29,8 @@ {% endblock %} diff --git a/setup.py b/setup.py index e01448ed..9b299085 100755 --- a/setup.py +++ b/setup.py @@ -20,10 +20,10 @@ if sys.platform.startswith('win'): setup( name = "pelican", version = VERSION, - url = 'http://alexis.notmyidea.org/pelican/', + url = 'http://pelican.notmyidea.org/', author = 'Alexis Metaireau', author_email = 'alexis@notmyidea.org', - description = "A tool to generate a static blog, with restructured text (or markdown) input files.", + description = "A tool to generate a static blog from reStructuredText or Markdown input files.", long_description=open('README.rst').read(), packages = ['pelican'], include_package_data = True, From 67540997307caac11e4f61567a7edc2440adc9d5 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Thu, 22 Dec 2011 15:13:12 +0000 Subject: [PATCH 0046/2344] Create a Category class which has a url property --- pelican/contents.py | 20 +++++++++++++++++++ pelican/generators.py | 4 ++-- pelican/readers.py | 2 ++ .../notmyidea/templates/article_infos.html | 2 +- .../notmyidea/templates/categories.html | 2 +- .../themes/simple/templates/categories.html | 2 +- 6 files changed, 27 insertions(+), 5 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 49f30316..aab6b330 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -143,6 +143,26 @@ class Quote(Page): base_properties = ('author', 'date') +class Category(object): + def __init__(self, category): + self.category = unicode(category) + + def __hash__(self): + return hash(self.category) + + def __eq__(self, other): + return self.category == unicode(other) + + def __str__(self): + return str(self.category) + + def __unicode__(self): + return self.category + + @property + def url(self): + return 'category/%s.html' % self + def is_valid_content(content, f): try: content.check_properties() diff --git a/pelican/generators.py b/pelican/generators.py index 6715126a..116c0b0b 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -187,7 +187,7 @@ class ArticlesGenerator(Generator): category_template = self.get_template('category') for cat, articles in self.categories: dates = [article for article in self.dates if article in articles] - write('category/%s.html' % cat, category_template, self.context, + write(cat.url, category_template, self.context, category=cat, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, page_name='category/%s' % cat) @@ -228,7 +228,7 @@ class ArticlesGenerator(Generator): category = os.path.basename(os.path.dirname(f)).decode('utf-8') if category != '': - metadata['category'] = unicode(category) + metadata['category'] = Category(category) if 'date' not in metadata.keys()\ and self.settings['FALLBACK_ON_FS_DATE']: diff --git a/pelican/readers.py b/pelican/readers.py index ee3ecd2c..1a62237a 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -15,6 +15,7 @@ except ImportError: Markdown = False import re +from pelican.contents import Category from pelican.utils import get_date, open @@ -22,6 +23,7 @@ _METADATA_PROCESSORS = { 'tags': lambda x: map(unicode.strip, unicode(x).split(',')), 'date': lambda x: get_date(x), 'status': unicode.strip, + 'category': Category, } def _process_metadata(name, value): diff --git a/pelican/themes/notmyidea/templates/article_infos.html b/pelican/themes/notmyidea/templates/article_infos.html index e1803be8..09ecd595 100644 --- a/pelican/themes/notmyidea/templates/article_infos.html +++ b/pelican/themes/notmyidea/templates/article_infos.html @@ -8,7 +8,7 @@ By {{ article.author }} {% endif %} -

In {{ article.category }}. {% if PDF_PROCESSOR %}get the pdf{% endif %}

+

In {{ article.category }}. {% if PDF_PROCESSOR %}get the pdf{% endif %}

{% include 'taglist.html' %} {% include 'translations.html' %}
diff --git a/pelican/themes/notmyidea/templates/categories.html b/pelican/themes/notmyidea/templates/categories.html index 7e4bd2c9..e4d9d0a7 100644 --- a/pelican/themes/notmyidea/templates/categories.html +++ b/pelican/themes/notmyidea/templates/categories.html @@ -2,7 +2,7 @@ {% block content %}
    {% for category, articles in categories %} -
  • {{ category }}
  • +
  • {{ category }}
  • {% endfor %}
{% endblock %} diff --git a/pelican/themes/simple/templates/categories.html b/pelican/themes/simple/templates/categories.html index 7e4bd2c9..e29be0ca 100644 --- a/pelican/themes/simple/templates/categories.html +++ b/pelican/themes/simple/templates/categories.html @@ -2,7 +2,7 @@ {% block content %}
    {% for category, articles in categories %} -
  • {{ category }}
  • +
  • {{ category }}
  • {% endfor %}
{% endblock %} From f9ed01bb643ab6ad30d06517751f9002568bd0fd Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Thu, 22 Dec 2011 15:43:44 +0000 Subject: [PATCH 0047/2344] Create a Tag class which has a url property --- pelican/contents.py | 20 +++++++++++++++++++ pelican/generators.py | 2 +- pelican/readers.py | 4 ++-- .../themes/notmyidea/templates/taglist.html | 2 +- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index aab6b330..cca01911 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -163,6 +163,26 @@ class Category(object): def url(self): return 'category/%s.html' % self +class Tag(object): + def __init__(self, tag): + self.tag = unicode.strip(tag) + + def __hash__(self): + return hash(self.tag) + + def __eq__(self, other): + return self.tag == unicode(tag) + + def __str__(self): + return str(self.tag) + + def __unicode__(self): + return self.tag + + @property + def url(self): + return 'tag/%s.html' % self + def is_valid_content(content, f): try: content.check_properties() diff --git a/pelican/generators.py b/pelican/generators.py index 116c0b0b..816a6755 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -179,7 +179,7 @@ class ArticlesGenerator(Generator): for tag, articles in self.tags.items(): articles.sort(key=attrgetter('date'), reverse=True) dates = [article for article in self.dates if article in articles] - write('tag/%s.html' % tag, tag_template, self.context, tag=tag, + write(tag.url, tag_template, self.context, tag=tag, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, page_name='tag/%s' % tag) diff --git a/pelican/readers.py b/pelican/readers.py index 1a62237a..6011c272 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -15,12 +15,12 @@ except ImportError: Markdown = False import re -from pelican.contents import Category +from pelican.contents import Category, Tag from pelican.utils import get_date, open _METADATA_PROCESSORS = { - 'tags': lambda x: map(unicode.strip, unicode(x).split(',')), + 'tags': lambda x: map(Tag, unicode(x).split(',')), 'date': lambda x: get_date(x), 'status': unicode.strip, 'category': Category, diff --git a/pelican/themes/notmyidea/templates/taglist.html b/pelican/themes/notmyidea/templates/taglist.html index 0f4862d0..c792fd7d 100644 --- a/pelican/themes/notmyidea/templates/taglist.html +++ b/pelican/themes/notmyidea/templates/taglist.html @@ -1,2 +1,2 @@ -{% if article.tags %}

tags: {% for tag in article.tags %}{{ tag }}{% endfor %}

{% endif %} +{% if article.tags %}

tags: {% for tag in article.tags %}{{ tag }}{% endfor %}

{% endif %} {% if PDF_PROCESSOR %}

get the pdf

{% endif %} From ff9c7861497e9056df911bed95d26567b97749d3 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Thu, 22 Dec 2011 16:22:34 +0000 Subject: [PATCH 0048/2344] Create a Author class which has a url property --- pelican/contents.py | 47 +++++++++---------- pelican/generators.py | 2 +- pelican/readers.py | 3 +- .../notmyidea/templates/article_infos.html | 2 +- pelican/themes/simple/templates/article.html | 2 +- pelican/themes/simple/templates/index.html | 2 +- 6 files changed, 28 insertions(+), 30 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index cca01911..8cd36186 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -37,9 +37,9 @@ class Page(object): # default author to the one in settings if not defined if not hasattr(self, 'author'): if 'AUTHOR' in settings: - self.author = settings['AUTHOR'] + self.author = Author(settings['AUTHOR']) else: - self.author = getenv('USER', 'John Doe') + self.author = Author(getenv('USER', 'John Doe')) warning(u"Author of `{0}' unknow, assuming that his name is `{1}'".format(filename or self.title, self.author)) # manage languages @@ -142,47 +142,44 @@ class Article(Page): class Quote(Page): base_properties = ('author', 'date') - -class Category(object): - def __init__(self, category): - self.category = unicode(category) +class URLWrapper(object): + def __init__(self, name): + self.name = unicode(name) def __hash__(self): - return hash(self.category) + return hash(self.name) def __eq__(self, other): - return self.category == unicode(other) + return self.name == unicode(other) def __str__(self): - return str(self.category) + return str(self.name) def __unicode__(self): - return self.category + return self.name + @property + def url(self): + return '%s.html' % self.name + +class Category(URLWrapper): @property def url(self): return 'category/%s.html' % self -class Tag(object): - def __init__(self, tag): - self.tag = unicode.strip(tag) - - def __hash__(self): - return hash(self.tag) - - def __eq__(self, other): - return self.tag == unicode(tag) - - def __str__(self): - return str(self.tag) - - def __unicode__(self): - return self.tag +class Tag(URLWrapper): + def __init__(self, name): + self.name = unicode.strip(name) @property def url(self): return 'tag/%s.html' % self +class Author(URLWrapper): + @property + def url(self): + return 'author/%s.html' % self + def is_valid_content(content, f): try: content.check_properties() diff --git a/pelican/generators.py b/pelican/generators.py index 816a6755..d9d584a4 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -195,7 +195,7 @@ class ArticlesGenerator(Generator): author_template = self.get_template('author') for aut, articles in self.authors: dates = [article for article in self.dates if article in articles] - write('author/%s.html' % aut, author_template, self.context, + write(aut.url, author_template, self.context, author=aut, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, page_name='author/%s' % aut) diff --git a/pelican/readers.py b/pelican/readers.py index 6011c272..e760b662 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -15,7 +15,7 @@ except ImportError: Markdown = False import re -from pelican.contents import Category, Tag +from pelican.contents import Category, Tag, Author from pelican.utils import get_date, open @@ -24,6 +24,7 @@ _METADATA_PROCESSORS = { 'date': lambda x: get_date(x), 'status': unicode.strip, 'category': Category, + 'author': Author, } def _process_metadata(name, value): diff --git a/pelican/themes/notmyidea/templates/article_infos.html b/pelican/themes/notmyidea/templates/article_infos.html index 09ecd595..a1993a09 100644 --- a/pelican/themes/notmyidea/templates/article_infos.html +++ b/pelican/themes/notmyidea/templates/article_infos.html @@ -5,7 +5,7 @@ {% if article.author %}
- By {{ article.author }} + By {{ article.author }}
{% endif %}

In {{ article.category }}. {% if PDF_PROCESSOR %}get the pdf{% endif %}

diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index 30d31fb6..d6c96a13 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -8,7 +8,7 @@ {% if article.author %}
- By {{ article.author }} + By {{ article.author }}
{% endif %} diff --git a/pelican/themes/simple/templates/index.html b/pelican/themes/simple/templates/index.html index fd8545df..ad2a3b2e 100644 --- a/pelican/themes/simple/templates/index.html +++ b/pelican/themes/simple/templates/index.html @@ -11,7 +11,7 @@

{{ article.title }}

{{ article.summary }}
From a39787c1a2c32dc936dba9ace73a0fcef0b73098 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Fri, 23 Dec 2011 22:01:32 +0000 Subject: [PATCH 0049/2344] Add settings to change the URL's and SAVE_AS paths Example usage: * ARTICLE_URL = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/' * ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html' This removes CLEAN_URLS and ARTICLE_PERMALINK_STRUCTURE because these new settings can produce the same result. --- docs/settings.rst | 54 +++++++++++++++++++++++-------------- pelican/contents.py | 62 +++++++++++++++++++++++++++---------------- pelican/generators.py | 17 +----------- pelican/settings.py | 9 ++++++- 4 files changed, 82 insertions(+), 60 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 2d40d4ec..b93c8c11 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -24,12 +24,7 @@ Basic settings ================================================ ===================================================== Setting name (default value) What does it do? ================================================ ===================================================== -`ARTICLE_PERMALINK_STRUCTURE` (``''``) Empty by default. Enables some customization of URL - structure (see below for more detail). `AUTHOR` Default author (put your name) -`CLEAN_URLS` (``False``) If set to `True`, the URLs will not be suffixed by - `.html`, so you will have to setup URL rewriting on - your web server. `DATE_FORMATS` (``{}``) If you do manage multiple languages, you can set the date formatting here. See "Date format and locales" section below for details. @@ -79,16 +74,14 @@ Setting name (default value) What does it do? .. [#] Default is the system locale. -Article permalink structure ---------------------------- +URL Settings +------------ -This setting allows you to output your articles sorted by date, provided that -you specify a format as specified below. This format follows the Python -``datetime`` directives: - -* %Y: Year with century as a decimal number. -* %m: Month as a decimal number [01,12]. -* %d: Day of the month as a decimal number [01,31]. +You can customize the URL's and locations where files will be saved. The URL's and +SAVE_AS variables use python's format strings. These variables allow you to place +your articles in a location such as '{slug}/index.html' and link to then as +'{slug}' for clean urls. These settings give you the flexibility to place your +articles and pages anywhere you want. Note: If you specify a datetime directive, it will be substituted using the input files' date metadata attribute. If the date is not specified for a @@ -99,15 +92,36 @@ information. Also, you can use other file metadata attributes as well: -* category: '%(category)s' -* author: '%(author)s' -* tags: '%(tags)s' -* date: '%(date)s' +* slug +* date +* lang +* author +* category Example usage: -* '/%Y/%m/' will render something like '/2011/07/sample-post.html'. -* '/%Y/%(category)s/' will render something like '/2011/life/sample-post.html'. +* ARTICLE_URL = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/' +* ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html' + +This would save your articles in something like '/posts/2011/Aug/07/sample-post/index.html', +and the URL to this would be '/posts/2011/Aug/07/sample-post/'. + +================================================ ===================================================== +Setting name (default value) what does it do? +================================================ ===================================================== +`ARTICLE_URL` ('{slug}.html') The URL to refer to an ARTICLE. +`ARTICLE_SAVE_AS` ('{slug}.html') The place where we will save an article. +`ARTICLE_LANG_URL` ('{slug}-{lang}.html') The URL to refer to an ARTICLE which doesn't use the + default language. +`ARTICLE_LANG_SAVE_AS` ('{slug}-{lang}.html' The place where we will save an article which + doesn't use the default language. +`PAGE_URL` ('pages/{slug}.html') The URL we will use to link to a page. +`PAGE_SAVE_AS` ('pages/{slug}.html') The location we will save the page. +`PAGE_LANG_URL` ('pages/{slug}-{lang}.html') The URL we will use to link to a page which doesn't + use the default language. +`PAGE_LANG_SAVE_AS` ('pages/{slug}-{lang}.html') The location we will save the page which doesn't + use the default language. +================================================ ===================================================== Timezone -------- diff --git a/pelican/contents.py b/pelican/contents.py index 8cd36186..bc42d41e 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -24,6 +24,7 @@ class Page(object): if not settings: settings = _DEFAULT_CONFIG + self.settings = settings self._content = content self.translations = [] @@ -55,29 +56,6 @@ class Page(object): if not hasattr(self, 'slug') and hasattr(self, 'title'): self.slug = slugify(self.title) - # create save_as from the slug (+lang) - if not hasattr(self, 'save_as') and hasattr(self, 'slug'): - if self.in_default_lang: - if settings.get('CLEAN_URLS', False): - self.save_as = '%s/index.html' % self.slug - else: - self.save_as = '%s.html' % self.slug - - clean_url = '%s/' % self.slug - else: - if settings.get('CLEAN_URLS', False): - self.save_as = '%s-%s/index.html' % (self.slug, self.lang) - else: - self.save_as = '%s-%s.html' % (self.slug, self.lang) - - clean_url = '%s-%s/' % (self.slug, self.lang) - - # change the save_as regarding the settings - if settings.get('CLEAN_URLS', False): - self.url = clean_url - elif hasattr(self, 'save_as'): - self.url = self.save_as - if filename: self.filename = filename @@ -115,6 +93,30 @@ class Page(object): if not hasattr(self, prop): raise NameError(prop) + @property + def url_format(self): + return { + 'slug': getattr(self, 'slug', ''), + 'lang': getattr(self, 'lang', 'en'), + 'date': getattr(self, 'date', datetime.now()), + 'author': self.author, + 'category': getattr(self, 'category', 'misc'), + } + + @property + def url(self): + if self.in_default_lang: + return self.settings.get('PAGE_URL', 'pages/{slug}.html').format(**self.url_format) + + return self.settings.get('PAGE_LANG_URL', 'pages/{slug}-{lang}.html').format(**self.url_format) + + @property + def save_as(self): + if self.in_default_lang: + return self.settings.get('PAGE_SAVE_AS', 'pages/{slug}.html').format(**self.url_format) + + return self.settings.get('PAGE_LANG_SAVE_AS', 'pages/{slug}-{lang}.html').format(**self.url_format) + @property def content(self): if hasattr(self, "_get_content"): @@ -138,6 +140,20 @@ class Page(object): class Article(Page): mandatory_properties = ('title', 'date', 'category') + @property + def url(self): + if self.in_default_lang: + return self.settings.get('ARTICLE_URL', '{slug}.html').format(**self.url_format) + + return self.settings.get('ARTICLE_LANG_URL', '{slug}-{lang}.html').format(**self.url_format) + + @property + def save_as(self): + if self.in_default_lang: + return self.settings.get('ARTICLE_SAVE_AS', '{slug}.html').format(**self.url_format) + + return self.settings.get('ARTICLE_LANG_SAVE_AS', '{slug}-{lang}.html').format(**self.url_format) + class Quote(Page): base_properties = ('author', 'date') diff --git a/pelican/generators.py b/pelican/generators.py index d9d584a4..7ad3d276 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -239,21 +239,6 @@ class ArticlesGenerator(Generator): if not is_valid_content(article, f): continue - add_to_url = u'' - if 'ARTICLE_PERMALINK_STRUCTURE' in self.settings: - article_permalink_structure = self.settings['ARTICLE_PERMALINK_STRUCTURE'] - article_permalink_structure = article_permalink_structure.lstrip('/').replace('%(', "%%(") - - # try to substitute any python datetime directive - add_to_url = article.date.strftime(article_permalink_structure) - # try to substitute any article metadata in rest file - add_to_url = add_to_url % article.__dict__ - add_to_url = [slugify(i) for i in add_to_url.split('/')] - add_to_url = os.path.join(*add_to_url) - - article.url = urlparse.urljoin(add_to_url, article.url) - article.save_as = urlparse.urljoin(add_to_url, article.save_as) - if article.status == "published": if hasattr(article, 'tags'): for tag in article.tags: @@ -348,7 +333,7 @@ class PagesGenerator(Generator): def generate_output(self, writer): for page in chain(self.translations, self.pages): - writer.write_file('pages/%s' % page.save_as, self.get_template('page'), + writer.write_file(page.save_as, self.get_template('page'), self.context, page=page, relative_urls = self.settings.get('RELATIVE_URLS')) diff --git a/pelican/settings.py b/pelican/settings.py index cf6b23e5..ec6ec483 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -26,7 +26,14 @@ _DEFAULT_CONFIG = {'PATH': None, 'REVERSE_ARCHIVE_ORDER': False, 'REVERSE_CATEGORY_ORDER': False, 'DELETE_OUTPUT_DIRECTORY': False, - 'CLEAN_URLS': False, # use /blah/ instead /blah.html in urls + 'ARTICLE_URL': '{slug}.html', + 'ARTICLE_SAVE_AS': '{slug}.html', + 'ARTICLE_LANG_URL': '{slug}-{lang}.html', + 'ARTICLE_LANG_SAVE_AS': '{slug}-{lang}.html', + 'PAGE_URL': 'pages/{slug}.html', + 'PAGE_SAVE_AS': 'pages/{slug}.html', + 'PAGE_LANG_URL': 'pages/{slug}-{lang}.html', + 'PAGE_LANG_SAVE_AS': 'pages/{slug}-{lang}.html', 'RELATIVE_URLS': True, 'DEFAULT_LANG': 'en', 'TAG_CLOUD_STEPS': 4, From 44cf2ad400629ea9d85dd598d837a35adcfaed85 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Fri, 23 Dec 2011 23:43:32 +0000 Subject: [PATCH 0050/2344] Support configurable URL's & SAVE_AS path for Author, Category and Tag --- docs/settings.rst | 6 +++++ pelican/contents.py | 29 +++++++++++++++------ pelican/generators.py | 8 +++--- pelican/readers.py | 60 +++++++++++++++++++++---------------------- 4 files changed, 60 insertions(+), 43 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index b93c8c11..69e2adc8 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -121,6 +121,12 @@ Setting name (default value) what does it do? use the default language. `PAGE_LANG_SAVE_AS` ('pages/{slug}-{lang}.html') The location we will save the page which doesn't use the default language. +`AUTHOR_URL` ('author/{name}.html') The URL to use for an author. +`AUTHOR_SAVE_AS` ('author/{name}.html') The location to save an author. +`CATEGORY_URL` ('category/{name}.html') The URL to use for a category. +`CATEGORY_SAVE_AS` ('category/{name}.html') The location to save a category. +`TAG_URL` ('tag/{name}.html') The URL to use for a tag. +`TAG_SAVE_AS` ('tag/{name}.html') The location to save the tag page. ================================================ ===================================================== Timezone diff --git a/pelican/contents.py b/pelican/contents.py index bc42d41e..316a0e56 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -38,9 +38,9 @@ class Page(object): # default author to the one in settings if not defined if not hasattr(self, 'author'): if 'AUTHOR' in settings: - self.author = Author(settings['AUTHOR']) + self.author = Author(settings['AUTHOR'], settings) else: - self.author = Author(getenv('USER', 'John Doe')) + self.author = Author(getenv('USER', 'John Doe'), settings) warning(u"Author of `{0}' unknow, assuming that his name is `{1}'".format(filename or self.title, self.author)) # manage languages @@ -159,8 +159,9 @@ class Quote(Page): base_properties = ('author', 'date') class URLWrapper(object): - def __init__(self, name): + def __init__(self, name, settings): self.name = unicode(name) + self.settings = settings def __hash__(self): return hash(self.name) @@ -181,20 +182,32 @@ class URLWrapper(object): class Category(URLWrapper): @property def url(self): - return 'category/%s.html' % self + return self.settings.get('CATEGORY_URL', 'category/{name}.html').format(name=self.name) + + @property + def save_as(self): + return self.settings.get('CATEGORY_SAVE_AS', 'category/{name}.html').format(name=self.name) class Tag(URLWrapper): - def __init__(self, name): - self.name = unicode.strip(name) + def __init__(self, name, *args, **kwargs): + super(Tag, self).__init__(unicode.strip(name), *args, **kwargs) @property def url(self): - return 'tag/%s.html' % self + return self.settings.get('TAG_URL', 'tag/{name}.html').format(name=self.name) + + @property + def save_as(self): + return self.settings.get('TAG_SAVE_AS', 'tag/{name}.html').format(name=self.name) class Author(URLWrapper): @property def url(self): - return 'author/%s.html' % self + return self.settings.get('AUTHOR_URL', 'author/{name}.html').format(name=self.name) + + @property + def save_as(self): + return self.settings.get('AUTHOR_SAVE_AS', 'author/{name}.html').format(name=self.name) def is_valid_content(content, f): try: diff --git a/pelican/generators.py b/pelican/generators.py index 7ad3d276..38bfb5b8 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -179,7 +179,7 @@ class ArticlesGenerator(Generator): for tag, articles in self.tags.items(): articles.sort(key=attrgetter('date'), reverse=True) dates = [article for article in self.dates if article in articles] - write(tag.url, tag_template, self.context, tag=tag, + write(tag.save_as, tag_template, self.context, tag=tag, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, page_name='tag/%s' % tag) @@ -187,7 +187,7 @@ class ArticlesGenerator(Generator): category_template = self.get_template('category') for cat, articles in self.categories: dates = [article for article in self.dates if article in articles] - write(cat.url, category_template, self.context, + write(cat.save_as, category_template, self.context, category=cat, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, page_name='category/%s' % cat) @@ -195,7 +195,7 @@ class ArticlesGenerator(Generator): author_template = self.get_template('author') for aut, articles in self.authors: dates = [article for article in self.dates if article in articles] - write(aut.url, author_template, self.context, + write(aut.save_as, author_template, self.context, author=aut, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, page_name='author/%s' % aut) @@ -228,7 +228,7 @@ class ArticlesGenerator(Generator): category = os.path.basename(os.path.dirname(f)).decode('utf-8') if category != '': - metadata['category'] = Category(category) + metadata['category'] = Category(category, self.settings) if 'date' not in metadata.keys()\ and self.settings['FALLBACK_ON_FS_DATE']: diff --git a/pelican/readers.py b/pelican/readers.py index e760b662..814f81d2 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -15,28 +15,30 @@ except ImportError: Markdown = False import re -from pelican.contents import Category, Tag, Author +from pelican.contents import Category, Tag, Author, URLWrapper from pelican.utils import get_date, open _METADATA_PROCESSORS = { - 'tags': lambda x: map(Tag, unicode(x).split(',')), - 'date': lambda x: get_date(x), - 'status': unicode.strip, + 'tags': lambda x, y: [Tag(tag, y) for tag in unicode(x).split(',')], + 'date': lambda x, y: get_date(x), + 'status': lambda x,y: unicode.strip(x), 'category': Category, 'author': Author, } -def _process_metadata(name, value): - if name.lower() in _METADATA_PROCESSORS: - return _METADATA_PROCESSORS[name.lower()](value) - return value - - class Reader(object): enabled = True extensions = None + def __init__(self, settings): + self.settings = settings + + def process_metadata(self, name, value): + if name.lower() in _METADATA_PROCESSORS: + return _METADATA_PROCESSORS[name.lower()](value, self.settings) + return value + class _FieldBodyTranslator(HTMLTranslator): def astext(self): @@ -54,29 +56,25 @@ def render_node_to_html(document, node): node.walkabout(visitor) return visitor.astext() -def get_metadata(document): - """Return the dict containing document metadata""" - output = {} - for docinfo in document.traverse(docutils.nodes.docinfo): - for element in docinfo.children: - if element.tagname == 'field': # custom fields (e.g. summary) - name_elem, body_elem = element.children - name = name_elem.astext() - value = render_node_to_html(document, body_elem) - else: # standard fields (e.g. address) - name = element.tagname - value = element.astext() - - output[name] = _process_metadata(name, value) - return output - - class RstReader(Reader): enabled = bool(docutils) extension = "rst" def _parse_metadata(self, document): - return get_metadata(document) + """Return the dict containing document metadata""" + output = {} + for docinfo in document.traverse(docutils.nodes.docinfo): + for element in docinfo.children: + if element.tagname == 'field': # custom fields (e.g. summary) + name_elem, body_elem = element.children + name = name_elem.astext() + value = render_node_to_html(document, body_elem) + else: # standard fields (e.g. address) + name = element.tagname + value = element.astext() + + output[name] = self.process_metadata(name, value) + return output def _get_publisher(self, filename): extra_params = {'initial_header_level': '2'} @@ -113,7 +111,7 @@ class MarkdownReader(Reader): metadata = {} for name, value in md.Meta.items(): name = name.lower() - metadata[name] = _process_metadata(name, value[0]) + metadata[name] = self.process_metadata(name, value[0]) return content, metadata @@ -129,7 +127,7 @@ class HtmlReader(Reader): key = i.split(':')[0][5:].strip() value = i.split(':')[-1][:-3].strip() name = key.lower() - metadata[name] = _process_metadata(name, value) + metadata[name] = self.process_metadata(name, value) return content, metadata @@ -143,7 +141,7 @@ def read_file(filename, fmt=None, settings=None): fmt = filename.split('.')[-1] if fmt not in _EXTENSIONS.keys(): raise TypeError('Pelican does not know how to parse %s' % filename) - reader = _EXTENSIONS[fmt]() + reader = _EXTENSIONS[fmt](settings) settings_key = '%s_EXTENSIONS' % fmt.upper() if settings and settings_key in settings: reader.extensions = settings[settings_key] From 9ba55c28b4cf22a74879f9a836af7e62fe3d9276 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sat, 24 Dec 2011 00:37:18 +0000 Subject: [PATCH 0051/2344] Support CLEAN_URLS and ARTICLE_PERMALINK_STRUCTURE for backwards compatibility --- pelican/__init__.py | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/pelican/__init__.py b/pelican/__init__.py index 710c9ff1..e7e90f56 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -1,5 +1,6 @@ import argparse import os, sys +import re import time from pelican.generators import (ArticlesGenerator, PagesGenerator, @@ -26,6 +27,42 @@ class Pelican(object): if self.path.endswith('/'): self.path = self.path[:-1] + if settings.get('CLEAN_URLS', False): + log.warning('Found deprecated `CLEAN_URLS` in settings. Modifing' + ' the following settings for the same behaviour.') + + settings['ARTICLE_URL'] = '{slug}/' + settings['ARTICLE_LANG_URL'] = '{slug}-{lang}/' + settings['PAGE_URL'] = 'pages/{slug}/' + settings['PAGE_LANG_URL'] = 'pages/{slug}-{lang}/' + + for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', + 'PAGE_LANG_URL'): + log.warning("%s = '%s'" % (setting, settings[setting])) + + if settings.get('ARTICLE_PERMALINK_STRUCTURE', False): + log.warning('Found deprecated `ARTICLE_PERMALINK_STRUCTURE` in' + ' settings. Modifing the following settings for' + ' the same behaviour.') + + structure = settings['ARTICLE_PERMALINK_STRUCTURE'] + + # Convert %(variable) into {variable}. + structure = re.sub('%\((\w+)\)s', '{\g<1>}', structure) + + # Convert %x into {date:%x} for strftime + structure = re.sub('(%[A-z])', '{date:\g<1>}', structure) + + # Strip a / prefix + structure = re.sub('^/', '', structure) + + for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', + 'PAGE_LANG_URL', 'ARTICLE_SAVE_AS', + 'ARTICLE_LANG_SAVE_AS', 'PAGE_SAVE_AS', + 'PAGE_LANG_SAVE_AS'): + settings[setting] = os.path.join(structure, settings[setting]) + log.warning("%s = '%s'" % (setting, settings[setting])) + # define the default settings self.settings = settings self.theme = theme or settings['THEME'] From c5816c9c5a242a3d5c3b26eb0b844fe2f79f52a2 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Thu, 1 Mar 2012 14:19:46 +0000 Subject: [PATCH 0052/2344] Make these patches compatible with upstream master --- pelican/contents.py | 2 +- pelican/generators.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 316a0e56..12da22ef 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -98,7 +98,7 @@ class Page(object): return { 'slug': getattr(self, 'slug', ''), 'lang': getattr(self, 'lang', 'en'), - 'date': getattr(self, 'date', datetime.now()), + 'date': getattr(self, 'date', datetime.datetime.now()), 'author': self.author, 'category': getattr(self, 'category', 'misc'), } diff --git a/pelican/generators.py b/pelican/generators.py index 38bfb5b8..12bd20af 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -13,7 +13,7 @@ from operator import attrgetter, itemgetter from jinja2 import Environment, FileSystemLoader, PrefixLoader, ChoiceLoader from jinja2.exceptions import TemplateNotFound -from pelican.contents import Article, Page, is_valid_content +from pelican.contents import Article, Page, Category, is_valid_content from pelican.log import * from pelican.readers import read_file from pelican.utils import copy, process_translations, open From 8bf0a22eb0a49cad133958cbd2145febb9e1228d Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 2 Mar 2012 16:32:05 +0100 Subject: [PATCH 0053/2344] fix encoding errors error was:codeEncodeError: 'ascii' codec can't encode character u'\xe9' [..] --- pelican/contents.py | 28 ++++++++++++++-------------- pelican/generators.py | 7 +++---- 2 files changed, 17 insertions(+), 18 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 12da22ef..90bc189d 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -106,16 +106,16 @@ class Page(object): @property def url(self): if self.in_default_lang: - return self.settings.get('PAGE_URL', 'pages/{slug}.html').format(**self.url_format) + return self.settings.get('PAGE_URL', u'pages/{slug}.html').format(**self.url_format) - return self.settings.get('PAGE_LANG_URL', 'pages/{slug}-{lang}.html').format(**self.url_format) + return self.settings.get('PAGE_LANG_URL', u'pages/{slug}-{lang}.html').format(**self.url_format) @property def save_as(self): if self.in_default_lang: - return self.settings.get('PAGE_SAVE_AS', 'pages/{slug}.html').format(**self.url_format) + return self.settings.get('PAGE_SAVE_AS', u'pages/{slug}.html').format(**self.url_format) - return self.settings.get('PAGE_LANG_SAVE_AS', 'pages/{slug}-{lang}.html').format(**self.url_format) + return self.settings.get('PAGE_LANG_SAVE_AS', u'pages/{slug}-{lang}.html').format(**self.url_format) @property def content(self): @@ -143,16 +143,16 @@ class Article(Page): @property def url(self): if self.in_default_lang: - return self.settings.get('ARTICLE_URL', '{slug}.html').format(**self.url_format) + return self.settings.get('ARTICLE_URL', u'{slug}.html').format(**self.url_format) - return self.settings.get('ARTICLE_LANG_URL', '{slug}-{lang}.html').format(**self.url_format) + return self.settings.get('ARTICLE_LANG_URL', u'{slug}-{lang}.html').format(**self.url_format) @property def save_as(self): if self.in_default_lang: - return self.settings.get('ARTICLE_SAVE_AS', '{slug}.html').format(**self.url_format) + return self.settings.get('ARTICLE_SAVE_AS', u'{slug}.html').format(**self.url_format) - return self.settings.get('ARTICLE_LANG_SAVE_AS', '{slug}-{lang}.html').format(**self.url_format) + return self.settings.get('ARTICLE_LANG_SAVE_AS', u'{slug}-{lang}.html').format(**self.url_format) class Quote(Page): @@ -182,11 +182,11 @@ class URLWrapper(object): class Category(URLWrapper): @property def url(self): - return self.settings.get('CATEGORY_URL', 'category/{name}.html').format(name=self.name) + return self.settings.get('CATEGORY_URL', u'category/{name}.html').format(name=self.name) @property def save_as(self): - return self.settings.get('CATEGORY_SAVE_AS', 'category/{name}.html').format(name=self.name) + return self.settings.get('CATEGORY_SAVE_AS', u'category/{name}.html').format(name=self.name) class Tag(URLWrapper): def __init__(self, name, *args, **kwargs): @@ -194,20 +194,20 @@ class Tag(URLWrapper): @property def url(self): - return self.settings.get('TAG_URL', 'tag/{name}.html').format(name=self.name) + return self.settings.get('TAG_URL', u'tag/{name}.html').format(name=self.name) @property def save_as(self): - return self.settings.get('TAG_SAVE_AS', 'tag/{name}.html').format(name=self.name) + return self.settings.get('TAG_SAVE_AS', u'tag/{name}.html').format(name=self.name) class Author(URLWrapper): @property def url(self): - return self.settings.get('AUTHOR_URL', 'author/{name}.html').format(name=self.name) + return self.settings.get('AUTHOR_URL', u'author/{name}.html').format(name=self.name) @property def save_as(self): - return self.settings.get('AUTHOR_SAVE_AS', 'author/{name}.html').format(name=self.name) + return self.settings.get('AUTHOR_SAVE_AS', u'author/{name}.html').format(name=self.name) def is_valid_content(content, f): try: diff --git a/pelican/generators.py b/pelican/generators.py index 12bd20af..47ebb941 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -182,7 +182,7 @@ class ArticlesGenerator(Generator): write(tag.save_as, tag_template, self.context, tag=tag, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, - page_name='tag/%s' % tag) + page_name=u'tag/%s' % tag) category_template = self.get_template('category') for cat, articles in self.categories: @@ -190,7 +190,7 @@ class ArticlesGenerator(Generator): write(cat.save_as, category_template, self.context, category=cat, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, - page_name='category/%s' % cat) + page_name=u'category/%s' % cat) author_template = self.get_template('author') for aut, articles in self.authors: @@ -198,7 +198,7 @@ class ArticlesGenerator(Generator): write(aut.save_as, author_template, self.context, author=aut, articles=articles, dates=dates, paginated={'articles': articles, 'dates': dates}, - page_name='author/%s' % aut) + page_name=u'author/%s' % aut) for article in self.drafts: write('drafts/%s.html' % article.slug, article_template, self.context, @@ -212,7 +212,6 @@ class ArticlesGenerator(Generator): files = self.get_files(self.path, exclude=['pages',]) all_articles = [] for f in files: - try: content, metadata = read_file(f, settings=self.settings) except Exception, e: From bfd0e63e3d4b7a6b006024611e0451f4e39fbd7a Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 2 Mar 2012 23:19:03 +0100 Subject: [PATCH 0054/2344] fix pages urls --- pelican/themes/notmyidea/templates/base.html | 2 +- pelican/themes/notmyidea/templates/index.html | 2 +- pelican/themes/simple/templates/base.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 4a4c70c6..12086dc7 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -31,7 +31,7 @@ {% endfor %} {% if DISPLAY_PAGES_ON_MENU %} {% for page in PAGES %} -
  • {{ page.title }}
  • +
  • {{ page.title }}
  • {% endfor %} {% endif %} {% for cat, null in categories %} diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index 217bacf2..f81275ae 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -53,7 +53,7 @@

    Pages

    {% for page in PAGES %} -
  • {{ page.title }}
  • +
  • {{ page.title }}
  • {% endfor %}
    {% endif %} diff --git a/pelican/themes/simple/templates/base.html b/pelican/themes/simple/templates/base.html index a8fad2db..a1017219 100644 --- a/pelican/themes/simple/templates/base.html +++ b/pelican/themes/simple/templates/base.html @@ -17,7 +17,7 @@ {% endfor %} {% if DISPLAY_PAGES_ON_MENU %} {% for p in PAGES %} - {{ p.title }} + {{ p.title }} {% endfor %} {% else %} {% for cat, null in categories %} From c2b8caed3f75bb7f52065bf21226f8a41ac76519 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Mon, 5 Mar 2012 23:33:25 +0100 Subject: [PATCH 0055/2344] fix test test_article_with_metadata error was: ERROR: test_article_with_metadata (tests.test_readers.RstReaderTest) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/bruno/dev/pelican/tests/test_readers.py", line 22, in test_article_with_metadata reader = readers.RstReader() TypeError: __init__() takes exactly 2 arguments (1 given) --- tests/test_readers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_readers.py b/tests/test_readers.py index 1e920e09..120b3125 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -19,7 +19,7 @@ def _filename(*args): class RstReaderTest(unittest2.TestCase): def test_article_with_metadata(self): - reader = readers.RstReader() + reader = readers.RstReader({}) content, metadata = reader.read(_filename('article_with_metadata.rst')) expected = { 'category': 'yeah', From 8f8933d991fd5e9da1a22cc6e3d2beced83f6c7d Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Mon, 5 Mar 2012 23:48:18 +0100 Subject: [PATCH 0056/2344] fix test test_save_as ERROR: test_save_as (tests.test_contents.TestPage) If a lang is not the default lang, save_as should be set ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/bruno/dev/pelican/tests/test_contents.py", line 63, in test_save_as page.save_as = 'foo-bar.html' AttributeError: can't set attribute --- tests/test_contents.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/test_contents.py b/tests/test_contents.py index 9772fac5..1abb125d 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -60,12 +60,12 @@ class TestPage(TestCase): """ # if a title is defined, save_as should be set page = Page(**self.page_kwargs) - page.save_as = 'foo-bar.html' + self.assertEqual(page.save_as, "pages/foo-bar.html") # if a language is defined, save_as should include it accordingly self.page_kwargs['metadata'].update({'lang': 'fr', }) page = Page(**self.page_kwargs) - self.assertEqual(page.save_as, "foo-bar-fr.html") + self.assertEqual(page.save_as, "pages/foo-bar-fr.html") def test_datetime(self): """If DATETIME is set to a tuple, it should be used to override LOCALE From 352d2047b433983231f1849ddfd81b46e609d940 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Tue, 6 Mar 2012 17:57:29 +0100 Subject: [PATCH 0057/2344] MOAR TYPOGRAPHY --- README.rst | 2 +- docs/index.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index b521d430..2f66e54c 100644 --- a/README.rst +++ b/README.rst @@ -32,7 +32,7 @@ more information. Why the name "Pelican"? ------------------------ -Heh, you didn't notice? "Pelican" is an anagram for "Calepin" ;) +Heh, you didn't notice? "Pelican" is an anagram for « Calepin » ;) Source code ----------- diff --git a/docs/index.rst b/docs/index.rst index c6638997..1389f132 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -29,7 +29,7 @@ Pelican currently supports: Why the name "Pelican" ? ======================== -Heh, you didn't notice? "Pelican" is an anagram for "Calepin" ;) +Heh, you didn't notice? "Pelican" is an anagram for « Calepin » ;) Source code =========== From 1f32624e8bb33926d7d836ddf3b71772a2efb88e Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 7 Mar 2012 10:14:47 +0000 Subject: [PATCH 0058/2344] use a try / except to check if argparse is a needed dependency --- setup.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 9b299085..6c3a72a1 100755 --- a/setup.py +++ b/setup.py @@ -6,7 +6,10 @@ import platform VERSION = "3.0" # find a better way to do so. requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'pytz'] -if sys.version_info < (2,7): + +try: + import argparse +except ImportError: requires.append('argparse') scripts = ['bin/pelican', 'tools/pelican-themes', 'tools/pelican-import', 'tools/pelican-quickstart'] From 8009324a3be63e4c04e7d5dea0a50cb3a04bc68a Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 7 Mar 2012 10:33:46 +0000 Subject: [PATCH 0059/2344] restructure the whole way scripts are created, using setuptools magic to take care of creating .exe wrappers for windows. To make this work needed to - rename modules with a "-" in it (not a valid name) - add an __init__.py to the tools directory - create an entry point dictionary which stores the right associations --- setup.py | 17 ++++++------- tools/__init__.py | 0 tools/pelican-import.bat | 1 - tools/pelican-quickstart.bat | 1 - tools/pelican-themes.bat | 1 - tools/{pelican-import => pelican_import.py} | 24 +++++++++---------- ...lican-quickstart => pelican_quickstart.py} | 0 tools/{pelican-themes => pelican_themes.py} | 0 8 files changed, 20 insertions(+), 24 deletions(-) create mode 100644 tools/__init__.py delete mode 100755 tools/pelican-import.bat delete mode 100755 tools/pelican-quickstart.bat delete mode 100755 tools/pelican-themes.bat rename tools/{pelican-import => pelican_import.py} (98%) rename tools/{pelican-quickstart => pelican_quickstart.py} (100%) rename tools/{pelican-themes => pelican_themes.py} (100%) diff --git a/setup.py b/setup.py index 6c3a72a1..6556193d 100755 --- a/setup.py +++ b/setup.py @@ -12,13 +12,14 @@ try: except ImportError: requires.append('argparse') -scripts = ['bin/pelican', 'tools/pelican-themes', 'tools/pelican-import', 'tools/pelican-quickstart'] - -if sys.platform.startswith('win'): - scripts += [ - 'bin/pelican.bat', 'tools/pelican-themes.bat', - 'tools/pelican-import.bat', 'tools/pelican-quickstart.bat' - ] +entry_points = { + 'console_scripts': [ + 'pelican = pelican:main', + 'pelican-import = tools.pelican_import:main', + 'pelican-quickstart = tools.pelican_quickstart:main', + 'pelican-themes = tools.pelican_themes:main' + ] +} setup( name = "pelican", @@ -31,7 +32,7 @@ setup( packages = ['pelican'], include_package_data = True, install_requires = requires, - scripts = scripts, + entry_points = entry_points, classifiers = ['Development Status :: 5 - Production/Stable', 'Environment :: Console', 'License :: OSI Approved :: GNU Affero General Public License v3', diff --git a/tools/__init__.py b/tools/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tools/pelican-import.bat b/tools/pelican-import.bat deleted file mode 100755 index 674e1fd7..00000000 --- a/tools/pelican-import.bat +++ /dev/null @@ -1 +0,0 @@ -@python "%~dpn0" %* diff --git a/tools/pelican-quickstart.bat b/tools/pelican-quickstart.bat deleted file mode 100755 index 674e1fd7..00000000 --- a/tools/pelican-quickstart.bat +++ /dev/null @@ -1 +0,0 @@ -@python "%~dpn0" %* diff --git a/tools/pelican-themes.bat b/tools/pelican-themes.bat deleted file mode 100755 index 674e1fd7..00000000 --- a/tools/pelican-themes.bat +++ /dev/null @@ -1 +0,0 @@ -@python "%~dpn0" %* diff --git a/tools/pelican-import b/tools/pelican_import.py similarity index 98% rename from tools/pelican-import rename to tools/pelican_import.py index 3a931afd..261bff4c 100755 --- a/tools/pelican-import +++ b/tools/pelican_import.py @@ -231,18 +231,7 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): fs.write(header + content) -def main(input_type, input, out_markup, output_path, dircat=False): - if input_type == 'wordpress': - fields = wp2fields(input) - elif input_type == 'dotclear': - fields = dc2fields(input) - elif input_type == 'feed': - fields = feed2fields(input) - - fields2pelican(fields, out_markup, output_path, dircat=dircat) - - -if __name__ == '__main__': +def main(): parser = argparse.ArgumentParser( description="Transform feed, Wordpress or Dotclear files to rst files." "Be sure to have pandoc installed") @@ -280,4 +269,13 @@ if __name__ == '__main__': error("Couldn't create the output folder: " + args.output) exit() - main(input_type, args.input, args.markup, args.output, dircat=args.dircat) + input_type, input, out_markup, output_path, dircat=False = input_type, args.input, args.markup, args.output, args.dircat + + if input_type == 'wordpress': + fields = wp2fields(input) + elif input_type == 'dotclear': + fields = dc2fields(input) + elif input_type == 'feed': + fields = feed2fields(input) + + fields2pelican(fields, out_markup, output_path, dircat=dircat) diff --git a/tools/pelican-quickstart b/tools/pelican_quickstart.py similarity index 100% rename from tools/pelican-quickstart rename to tools/pelican_quickstart.py diff --git a/tools/pelican-themes b/tools/pelican_themes.py similarity index 100% rename from tools/pelican-themes rename to tools/pelican_themes.py From 7c78f232b4b10a31607815469fb7cf276a807468 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 7 Mar 2012 10:34:14 +0000 Subject: [PATCH 0060/2344] remove unused imports --- setup.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.py b/setup.py index 6556193d..910499de 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,5 @@ #!/usr/bin/env python from setuptools import setup -import sys -import platform VERSION = "3.0" # find a better way to do so. From 8f7b08a01cd5a8ff679946996d35f285380ab93d Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 7 Mar 2012 10:38:08 +0000 Subject: [PATCH 0061/2344] remove now useless if __name__ == '__main__' checks and clean up the old pelican script in bin --- bin/pelican | 3 --- bin/pelican.bat | 1 - pelican/__init__.py | 4 ---- tools/pelican_import.py | 1 + tools/pelican_quickstart.py | 3 --- tools/pelican_themes.py | 3 --- 6 files changed, 1 insertion(+), 14 deletions(-) delete mode 100755 bin/pelican delete mode 100755 bin/pelican.bat diff --git a/bin/pelican b/bin/pelican deleted file mode 100755 index 3fe2ee57..00000000 --- a/bin/pelican +++ /dev/null @@ -1,3 +0,0 @@ -#!/usr/bin/env python -from pelican import main -main() diff --git a/bin/pelican.bat b/bin/pelican.bat deleted file mode 100755 index 674e1fd7..00000000 --- a/bin/pelican.bat +++ /dev/null @@ -1 +0,0 @@ -@python "%~dpn0" %* diff --git a/pelican/__init__.py b/pelican/__init__.py index 710c9ff1..a0b5704c 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -158,7 +158,3 @@ def main(): raise else: sys.exit(getattr(e, 'exitcode', 1)) - - -if __name__ == '__main__': - main() diff --git a/tools/pelican_import.py b/tools/pelican_import.py index 261bff4c..e7f8e051 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -269,6 +269,7 @@ def main(): error("Couldn't create the output folder: " + args.output) exit() + # TODO: refactor this long assignment input_type, input, out_markup, output_path, dircat=False = input_type, args.input, args.markup, args.output, args.dircat if input_type == 'wordpress': diff --git a/tools/pelican_quickstart.py b/tools/pelican_quickstart.py index 4048c2bf..56c22f10 100755 --- a/tools/pelican_quickstart.py +++ b/tools/pelican_quickstart.py @@ -270,6 +270,3 @@ Please answer the following questions so this script can generate the files need print('Error: {0}'.format(e)) print('Done. Your new project is available at %s' % CONF['basedir']) - -if __name__ == '__main__': - main() diff --git a/tools/pelican_themes.py b/tools/pelican_themes.py index 78df4a48..3d35bb5d 100755 --- a/tools/pelican_themes.py +++ b/tools/pelican_themes.py @@ -212,6 +212,3 @@ def clean(v=False): c+=1 print("\nRemoved {0} broken links".format(c)) - -if __name__ == '__main__': - main() From 4eb20c5d82cf59ae60a765d5af4f723157fed2b6 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 7 Mar 2012 12:00:32 +0000 Subject: [PATCH 0062/2344] global declaration is only needed if it's necessary to modify a module level variable, to declare it and use it read only it's not necessary --- pelican/log.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pelican/log.py b/pelican/log.py index 2790aed3..8ec44cad 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -4,7 +4,6 @@ from logging import CRITICAL, ERROR, WARN, INFO, DEBUG from logging import critical, error, info, warning, warn, debug from logging import Formatter, getLogger, StreamHandler -global ANSI ANSI = { 'gray' : lambda(text) : u'\033[1;30m' + unicode(text) + u'\033[1;m', 'red' : lambda(text) : u'\033[1;31m' + unicode(text) + u'\033[1;m', From 2e0e893a9b1119465c69c5204a03894ab955bcfb Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 7 Mar 2012 12:14:13 +0000 Subject: [PATCH 0063/2344] fix three print statement --- tools/pelican_import.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/pelican_import.py b/tools/pelican_import.py index e7f8e051..b883f7fc 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -71,7 +71,7 @@ def dc2fields(file): else: posts.append(line) - print "%i posts read." % len(posts) + print("%i posts read." % len(posts)) for post in posts: fields = post.split('","') @@ -205,7 +205,7 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): else: out_filename = os.path.join(output_path, filename+ext) - print out_filename + print(out_filename) if in_markup == "html": html_filename = os.path.join(output_path, filename+'.html') @@ -259,7 +259,7 @@ def main(): elif args.feed: input_type = 'feed' else: - print "you must provide either --wpfile, --dotclear or --feed options" + print("you must provide either --wpfile, --dotclear or --feed options") exit() if not os.path.exists(args.output): From 20af8fd378d693c5c0cf59a6c12fad0800945ece Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 7 Mar 2012 12:17:39 +0000 Subject: [PATCH 0064/2344] refactoring of the ANSI dictionary, removing all the repeated code --- pelican/log.py | 46 ++++++++++++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 18 deletions(-) diff --git a/pelican/log.py b/pelican/log.py index 8ec44cad..1cb76e16 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -4,26 +4,36 @@ from logging import CRITICAL, ERROR, WARN, INFO, DEBUG from logging import critical, error, info, warning, warn, debug from logging import Formatter, getLogger, StreamHandler -ANSI = { - 'gray' : lambda(text) : u'\033[1;30m' + unicode(text) + u'\033[1;m', - 'red' : lambda(text) : u'\033[1;31m' + unicode(text) + u'\033[1;m', - 'green' : lambda(text) : u'\033[1;32m' + unicode(text) + u'\033[1;m', - 'yellow' : lambda(text) : u'\033[1;33m' + unicode(text) + u'\033[1;m', - 'blue' : lambda(text) : u'\033[1;34m' + unicode(text) + u'\033[1;m', - 'magenta' : lambda(text) : u'\033[1;35m' + unicode(text) + u'\033[1;m', - 'cyan' : lambda(text) : u'\033[1;36m' + unicode(text) + u'\033[1;m', - 'white' : lambda(text) : u'\033[1;37m' + unicode(text) + u'\033[1;m', - 'bgred' : lambda(text) : u'\033[1;41m' + unicode(text) + u'\033[1;m', - 'bggreen' : lambda(text) : u'\033[1;42m' + unicode(text) + u'\033[1;m', - 'bgbrown' : lambda(text) : u'\033[1;43m' + unicode(text) + u'\033[1;m', - 'bgblue' : lambda(text) : u'\033[1;44m' + unicode(text) + u'\033[1;m', - 'bgmagenta' : lambda(text) : u'\033[1;45m' + unicode(text) + u'\033[1;m', - 'bgcyan' : lambda(text) : u'\033[1;46m' + unicode(text) + u'\033[1;m', - 'bggray' : lambda(text) : u'\033[1;47m' + unicode(text) + u'\033[1;m', - 'bgyellow' : lambda(text) : u'\033[1;43m' + unicode(text) + u'\033[1;m', - 'bggrey' : lambda(text) : u'\033[1;100m' + unicode(text) + u'\033[1;m' + +RESET_TERM = u'\033[1;m' + + +def term_color(code): + return lambda text: code + unicode(text) + RESET_TERM + + +COLOR_CODES = { + 'gray': u'\033[1;30m', + 'red': u'\033[1;31m', + 'green': u'\033[1;32m', + 'yellow': u'\033[1;33m', + 'blue': u'\033[1;34m', + 'magenta': u'\033[1;35m', + 'cyan': u'\033[1;36m', + 'white': u'\033[1;37m', + 'bgred': u'\033[1;41m', + 'bggreen': u'\033[1;42m', + 'bgbrown': u'\033[1;43m', + 'bgblue': u'\033[1;44m', + 'bgmagenta': u'\033[1;45m', + 'bgcyan': u'\033[1;46m', + 'bggray': u'\033[1;47m', + 'bgyellow': u'\033[1;43m', + 'bggrey': u'\033[1;100m', } +ANSI = dict((col, term_color(code)) for col, code in COLOR_CODES.items()) + class ANSIFormatter(Formatter): """ From dd07ddb0b018c94e0ca1c04a9be3cbefdf42b028 Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Fri, 9 Mar 2012 02:03:15 +0200 Subject: [PATCH 0065/2344] Make sure test passes for dates formatted as utf-8 --- tests/test_contents.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/test_contents.py b/tests/test_contents.py index 9772fac5..e4c98741 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -82,7 +82,8 @@ class TestPage(TestCase): page_kwargs['metadata']['date'] = dt page = Page( **page_kwargs) - self.assertEqual(page.locale_date, dt.strftime(_DEFAULT_CONFIG['DEFAULT_DATE_FORMAT'])) + self.assertEqual(page.locale_date, + unicode(dt.strftime(_DEFAULT_CONFIG['DEFAULT_DATE_FORMAT']), 'utf-8')) page_kwargs['settings'] = {x:_DEFAULT_CONFIG[x] for x in _DEFAULT_CONFIG} From 7240460688a9dcf438cd8f9c8edb931700b2375f Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 9 Mar 2012 15:33:34 +0100 Subject: [PATCH 0066/2344] Update the CHANGELOG for 2.8 --- CHANGELOG | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 57056826..3d34ad20 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,9 +1,21 @@ -3.0 +2.8 * dotclear importer -* Markdown extensions -* Theme extensions -* Plugins support +* Allow the usage of markdown extensions +* Themes are now easily extensible +* Don't output pagination information if there is only one page. +* Add a page per author, with all their articles +* Improved the test suite +* Made the themes more easy to extend +* Removed Skribit support +* Added a "pelican-quickstart" script +* Fixed timezone-related issues +* Add some scripts for windows support +* Date can be specified in seconds +* Never fail when generating posts (skip and continue) +* Allow the use of future dates +* Support having different timezones per languages. +* Enhanced the documentation 2.7 From 0298d412dc595436df995eed540ea462b7df8161 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 9 Mar 2012 15:36:29 +0100 Subject: [PATCH 0067/2344] updated CHANGELOG --- CHANGELOG | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 3d34ad20..e68c6f0d 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,9 @@ +X.X + +* Refactored the way URL are handled. +* Improved the english documentation +* Fixed packaging using setuptools entrypoints + 2.8 * dotclear importer From df25dec30a3aee09bc1b75f35419886e5ea77bfd Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 9 Mar 2012 16:17:09 +0100 Subject: [PATCH 0068/2344] Use the with statement when opening files. --- pelican/generators.py | 3 ++- pelican/readers.py | 18 +++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 47ebb941..9d5607e2 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -375,7 +375,8 @@ class PdfGenerator(Generator): filename = obj.slug + ".pdf" output_pdf=os.path.join(output_path, filename) # print "Generating pdf for", obj.filename, " in ", output_pdf - self.pdfcreator.createPdf(text=open(obj.filename), output=output_pdf) + with open(obj.filename) as f: + self.pdfcreator.createPdf(text=f, output=output_pdf) info(u' [ok] writing %s' % output_pdf) def generate_context(self): diff --git a/pelican/readers.py b/pelican/readers.py index 814f81d2..c4c12280 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -121,20 +121,20 @@ class HtmlReader(Reader): def read(self, filename): """Parse content and metadata of (x)HTML files""" - content = open(filename) - metadata = {'title':'unnamed'} - for i in self._re.findall(content): - key = i.split(':')[0][5:].strip() - value = i.split(':')[-1][:-3].strip() - name = key.lower() - metadata[name] = self.process_metadata(name, value) - - return content, metadata + with open(filename) as content: + metadata = {'title': 'unnamed'} + for i in self._re.findall(content): + key = i.split(':')[0][5:].strip() + value = i.split(':')[-1][:-3].strip() + name = key.lower() + metadata[name] = self.process_metadata(name, value) + return content, metadata _EXTENSIONS = dict((cls.extension, cls) for cls in Reader.__subclasses__()) + def read_file(filename, fmt=None, settings=None): """Return a reader object using the given format.""" if not fmt: From 6cde7fd27a6faf062e52bca9e3e2645e487191b3 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 9 Mar 2012 16:21:38 +0100 Subject: [PATCH 0069/2344] PEP8-ify. Wrap to 80 chars, sanitize imports. --- pelican/__init__.py | 44 ++++++++++++---------- pelican/contents.py | 26 ++++++++----- pelican/generators.py | 85 +++++++++++++++++++++++-------------------- pelican/paginator.py | 3 +- pelican/readers.py | 18 +++++---- pelican/settings.py | 25 +++++++------ pelican/utils.py | 20 ++++++---- pelican/writers.py | 31 +++++++++------- 8 files changed, 142 insertions(+), 110 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index bbd0b679..8de68d69 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -1,5 +1,6 @@ import argparse -import os, sys +import os +import sys import re import time @@ -69,7 +70,8 @@ class Pelican(object): output_path = output_path or settings['OUTPUT_PATH'] self.output_path = os.path.realpath(output_path) self.markup = markup or settings['MARKUP'] - self.delete_outputdir = delete_outputdir or settings['DELETE_OUTPUT_DIRECTORY'] + self.delete_outputdir = delete_outputdir \ + or settings['DELETE_OUTPUT_DIRECTORY'] # find the theme in pelican.theme if the given one does not exists if not os.path.exists(self.theme): @@ -112,7 +114,6 @@ class Pelican(object): if hasattr(p, 'generate_output'): p.generate_output(writer) - def get_generator_classes(self): generators = [ArticlesGenerator, PagesGenerator, StaticGenerator] if self.settings['PDF_GENERATOR']: @@ -123,7 +124,6 @@ class Pelican(object): return Writer(self.output_path, settings=self.settings) - def main(): parser = argparse.ArgumentParser(description="""A tool to generate a static blog, with restructured text input files.""") @@ -134,32 +134,38 @@ def main(): help='Path where to find the theme templates. If not specified, it' 'will use the default one included with pelican.') parser.add_argument('-o', '--output', dest='output', - help='Where to output the generated files. If not specified, a directory' - ' will be created, named "output" in the current path.') + help='Where to output the generated files. If not specified, a ' + 'directory will be created, named "output" in the current path.') parser.add_argument('-m', '--markup', default=None, dest='markup', help='the list of markup language to use (rst or md). Please indicate ' 'them separated by commas') parser.add_argument('-s', '--settings', dest='settings', default='', help='the settings of the application. Default to False.') - parser.add_argument('-d', '--delete-output-directory', dest='delete_outputdir', + parser.add_argument('-d', '--delete-output-directory', + dest='delete_outputdir', action='store_true', help='Delete the output directory.') - parser.add_argument('-v', '--verbose', action='store_const', const=log.INFO, dest='verbosity', - help='Show all messages') - parser.add_argument('-q', '--quiet', action='store_const', const=log.CRITICAL, dest='verbosity', - help='Show only critical errors') - parser.add_argument('-D', '--debug', action='store_const', const=log.DEBUG, dest='verbosity', - help='Show all message, including debug messages') + parser.add_argument('-v', '--verbose', action='store_const', + const=log.INFO, dest='verbosity', + help='Show all messages') + parser.add_argument('-q', '--quiet', action='store_const', + const=log.CRITICAL, dest='verbosity', + help='Show only critical errors') + parser.add_argument('-D', '--debug', action='store_const', + const=log.DEBUG, dest='verbosity', + help='Show all message, including debug messages') parser.add_argument('--version', action='version', version=__version__, help='Print the pelican version and exit') - parser.add_argument('-r', '--autoreload', dest='autoreload', action='store_true', - help="Relaunch pelican each time a modification occurs on the content" - "files") + parser.add_argument('-r', '--autoreload', dest='autoreload', + action='store_true', + help="Relaunch pelican each time a modification occurs" + " on the content files") args = parser.parse_args() log.init(args.verbosity) - # Split the markup languages only if some have been given. Otherwise, populate - # the variable with None. - markup = [a.strip().lower() for a in args.markup.split(',')] if args.markup else None + # Split the markup languages only if some have been given. Otherwise, + # populate the variable with None. + markup = [a.strip().lower() for a in args.markup.split(',')]\ + if args.markup else None settings = read_settings(args.settings) diff --git a/pelican/contents.py b/pelican/contents.py index 90bc189d..b408ff58 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -1,13 +1,14 @@ # -*- coding: utf-8 -*- -import datetime +from datetime import datetime from os import getenv from sys import platform, stdin import locale -from pelican.log import * +from pelican.log import warning, error from pelican.settings import _DEFAULT_CONFIG from pelican.utils import slugify, truncate_html_words + class Page(object): """Represents a page Given a content, and metadata, create an adequate object. @@ -41,7 +42,8 @@ class Page(object): self.author = Author(settings['AUTHOR'], settings) else: self.author = Author(getenv('USER', 'John Doe'), settings) - warning(u"Author of `{0}' unknow, assuming that his name is `{1}'".format(filename or self.title, self.author)) + warning(u"Author of `{0}' unknow, assuming that his name is " + "`{1}'".format(filename or self.title, self.author)) # manage languages self.in_default_lang = True @@ -71,16 +73,19 @@ class Page(object): self.date_format = self.date_format[1] if hasattr(self, 'date'): + encoded_date = self.date.strftime( + self.date_format.encode('ascii', 'xmlcharrefreplace')) + if platform == 'win32': - self.locale_date = self.date.strftime(self.date_format.encode('ascii','xmlcharrefreplace')).decode(stdin.encoding) + self.locale_date = encoded_date.decode(stdin.encoding) else: - self.locale_date = self.date.strftime(self.date_format.encode('ascii','xmlcharrefreplace')).decode('utf') + self.locale_date = encoded_date.decode('utf') # manage status if not hasattr(self, 'status'): self.status = settings['DEFAULT_STATUS'] if not settings['WITH_FUTURE_DATES']: - if hasattr(self, 'date') and self.date > datetime.datetime.now(): + if hasattr(self, 'date') and self.date > datetime.now(): self.status = 'draft' # set summary @@ -98,7 +103,7 @@ class Page(object): return { 'slug': getattr(self, 'slug', ''), 'lang': getattr(self, 'lang', 'en'), - 'date': getattr(self, 'date', datetime.datetime.now()), + 'date': getattr(self, 'date', datetime.now()), 'author': self.author, 'category': getattr(self, 'category', 'misc'), } @@ -133,8 +138,8 @@ class Page(object): """Dummy function""" pass - summary = property(_get_summary, _set_summary, - "Summary of the article. Based on the content. Can't be set") + summary = property(_get_summary, _set_summary, "Summary of the article." + "Based on the content. Can't be set") class Article(Page): @@ -214,5 +219,6 @@ def is_valid_content(content, f): content.check_properties() return True except NameError, e: - error(u"Skipping %s: impossible to find informations about '%s'" % (f, e)) + error(u"Skipping %s: impossible to find informations about '%s'"\ + % (f, e)) return False diff --git a/pelican/generators.py b/pelican/generators.py index 9d5607e2..ee95545e 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -3,7 +3,6 @@ import os import datetime import math import random -import urlparse from collections import defaultdict from functools import partial @@ -14,10 +13,9 @@ from jinja2 import Environment, FileSystemLoader, PrefixLoader, ChoiceLoader from jinja2.exceptions import TemplateNotFound from pelican.contents import Article, Page, Category, is_valid_content -from pelican.log import * +from pelican.log import warning, error, debug, info from pelican.readers import read_file from pelican.utils import copy, process_translations, open -from pelican.utils import slugify class Generator(object): @@ -33,17 +31,23 @@ class Generator(object): # templates cache self._templates = {} - self._templates_path = os.path.expanduser(os.path.join(self.theme, 'templates')) - simple_loader = FileSystemLoader(os.path.join(os.path.dirname(os.path.abspath(__file__)), "themes", "simple", "templates")) + self._templates_path = os.path.expanduser( + os.path.join(self.theme, 'templates')) + + theme_path = os.path.join(os.path.dirname(os.path.abspath(__file__))) + + simple_loader = FileSystemLoader(theme_path, + "themes", "simple", "templates") self._env = Environment( loader=ChoiceLoader([ FileSystemLoader(self._templates_path), - simple_loader, # implicit inheritance - PrefixLoader({'!simple' : simple_loader}) # explicit inheritance + simple_loader, # implicit inheritance + PrefixLoader({'!simple': simple_loader}) # explicit one ]), extensions=self.settings.get('JINJA_EXTENSIONS', []), ) - debug('self._env.list_templates(): {0}'.format(self._env.list_templates())) + + debug('template list: {0}'.format(self._env.list_templates())) # get custom Jinja filters from user settings custom_filters = self.settings.get('JINJA_FILTERS', {}) @@ -58,8 +62,8 @@ class Generator(object): try: self._templates[name] = self._env.get_template(name + '.html') except TemplateNotFound: - raise Exception('[templates] unable to load %s.html from %s' % ( - name, self._templates_path)) + raise Exception('[templates] unable to load %s.html from %s' \ + % (name, self._templates_path)) return self._templates[name] def get_files(self, path, exclude=[], extensions=None): @@ -75,7 +79,7 @@ class Generator(object): try: iter = os.walk(path, followlinks=True) - except TypeError: # python 2.5 does not support followlinks + except TypeError: # python 2.5 does not support followlinks iter = os.walk(path) for root, dirs, temp_files in iter: @@ -102,7 +106,7 @@ class ArticlesGenerator(Generator): def __init__(self, *args, **kwargs): """initialize properties""" - self.articles = [] # only articles in default language + self.articles = [] # only articles in default language self.translations = [] self.dates = {} self.tags = defaultdict(list) @@ -138,7 +142,8 @@ class ArticlesGenerator(Generator): if 'TAG_FEED_RSS' in self.settings: writer.write_feed(arts, self.context, - self.settings['TAG_FEED_RSS'] % tag, feed_type='rss') + self.settings['TAG_FEED_RSS'] % tag, + feed_type='rss') translations_feeds = defaultdict(list) for article in chain(self.articles, self.translations): @@ -149,14 +154,11 @@ class ArticlesGenerator(Generator): writer.write_feed(items, self.context, self.settings['TRANSLATION_FEED'] % lang) - def generate_pages(self, writer): """Generate the pages on the disk""" - write = partial( - writer.write_file, - relative_urls = self.settings.get('RELATIVE_URLS') - ) + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) # to minimize the number of relative path stuff modification # in writer, articles pass first @@ -171,8 +173,10 @@ class ArticlesGenerator(Generator): paginated = {} if template in PAGINATED_TEMPLATES: paginated = {'articles': self.articles, 'dates': self.dates} - write('%s.html' % template, self.get_template(template), self.context, - blog=True, paginated=paginated, page_name=template) + + write('%s.html' % template, self.get_template(template), + self.context, blog=True, paginated=paginated, + page_name=template) # and subfolders after that tag_template = self.get_template('tag') @@ -201,15 +205,14 @@ class ArticlesGenerator(Generator): page_name=u'author/%s' % aut) for article in self.drafts: - write('drafts/%s.html' % article.slug, article_template, self.context, - article=article, category=article.category) - + write('drafts/%s.html' % article.slug, article_template, + self.context, article=article, category=article.category) def generate_context(self): """change the context""" # return the list of files to use - files = self.get_files(self.path, exclude=['pages',]) + files = self.get_files(self.path, exclude=['pages', ]) all_articles = [] for f in files: try: @@ -224,14 +227,16 @@ class ArticlesGenerator(Generator): if os.path.dirname(f) == self.path: category = self.settings['DEFAULT_CATEGORY'] else: - category = os.path.basename(os.path.dirname(f)).decode('utf-8') + category = os.path.basename(os.path.dirname(f))\ + .decode('utf-8') if category != '': metadata['category'] = Category(category, self.settings) if 'date' not in metadata.keys()\ and self.settings['FALLBACK_ON_FS_DATE']: - metadata['date'] = datetime.datetime.fromtimestamp(os.stat(f).st_ctime) + metadata['date'] = datetime.datetime.fromtimestamp( + os.stat(f).st_ctime) article = Article(content, metadata, settings=self.settings, filename=f) @@ -265,7 +270,7 @@ class ArticlesGenerator(Generator): for tag in getattr(article, 'tags', []): tag_cloud[tag] += 1 - tag_cloud = sorted(tag_cloud.items(), key = itemgetter(1), reverse = True) + tag_cloud = sorted(tag_cloud.items(), key=itemgetter(1), reverse=True) tag_cloud = tag_cloud[:self.settings.get('TAG_CLOUD_MAX_ITEMS')] tags = map(itemgetter(1), tag_cloud) @@ -277,9 +282,8 @@ class ArticlesGenerator(Generator): self.tag_cloud = [ ( tag, - int( - math.floor(steps - (steps - 1) * math.log(count) / (math.log(max_count)or 1)) - ) + int(math.floor(steps - (steps - 1) * math.log(count) + / (math.log(max_count)or 1))) ) for tag, count in tag_cloud ] @@ -290,14 +294,13 @@ class ArticlesGenerator(Generator): # order the categories per name self.categories = list(self.categories.items()) - self.categories.sort(reverse=self.settings.get('REVERSE_CATEGORY_ORDER')) + self.categories.sort(reverse=self.settings['REVERSE_CATEGORY_ORDER']) self.authors = list(self.authors.items()) self.authors.sort() - self._update_context(('articles', 'dates', 'tags', 'categories', 'tag_cloud', 'authors')) - - + self._update_context(('articles', 'dates', 'tags', 'categories', + 'tag_cloud', 'authors')) def generate_output(self, writer): self.generate_feeds(writer) @@ -334,7 +337,7 @@ class PagesGenerator(Generator): for page in chain(self.translations, self.pages): writer.write_file(page.save_as, self.get_template('page'), self.context, page=page, - relative_urls = self.settings.get('RELATIVE_URLS')) + relative_urls=self.settings.get('RELATIVE_URLS')) class StaticGenerator(Generator): @@ -345,8 +348,8 @@ class StaticGenerator(Generator): final_path=None): """Copy all the paths from source to destination""" for path in paths: - copy(path, source, os.path.join(output_path, destination), final_path, - overwrite=True) + copy(path, source, os.path.join(output_path, destination), + final_path, overwrite=True) def generate_output(self, writer): self._copy_paths(self.settings['STATIC_PATHS'], self.path, @@ -356,7 +359,8 @@ class StaticGenerator(Generator): # copy all the files needed for source, destination in self.settings['FILES_TO_COPY']: - copy(source, self.path, self.output_path, destination, overwrite=True) + copy(source, self.path, self.output_path, destination, + overwrite=True) class PdfGenerator(Generator): @@ -365,7 +369,8 @@ class PdfGenerator(Generator): def __init__(self, *args, **kwargs): try: from rst2pdf.createpdf import RstToPdf - self.pdfcreator = RstToPdf(breakside=0, stylesheets=['twelvepoint']) + self.pdfcreator = RstToPdf(breakside=0, + stylesheets=['twelvepoint']) except ImportError: raise Exception("unable to find rst2pdf") super(PdfGenerator, self).__init__(*args, **kwargs) @@ -373,7 +378,7 @@ class PdfGenerator(Generator): def _create_pdf(self, obj, output_path): if obj.filename.endswith(".rst"): filename = obj.slug + ".pdf" - output_pdf=os.path.join(output_path, filename) + output_pdf = os.path.join(output_path, filename) # print "Generating pdf for", obj.filename, " in ", output_pdf with open(obj.filename) as f: self.pdfcreator.createPdf(text=f, output=output_pdf) diff --git a/pelican/paginator.py b/pelican/paginator.py index 89e081ca..fe871491 100644 --- a/pelican/paginator.py +++ b/pelican/paginator.py @@ -1,6 +1,7 @@ # From django.core.paginator from math import ceil + class Paginator(object): def __init__(self, object_list, per_page, orphans=0): self.object_list = object_list @@ -39,6 +40,7 @@ class Paginator(object): return range(1, self.num_pages + 1) page_range = property(_get_page_range) + class Page(object): def __init__(self, object_list, number, paginator): self.object_list = object_list @@ -82,4 +84,3 @@ class Page(object): if self.number == self.paginator.num_pages: return self.paginator.count return self.number * self.paginator.per_page - diff --git a/pelican/readers.py b/pelican/readers.py index c4c12280..5bbbfb30 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -6,27 +6,28 @@ try: from docutils.writers.html4css1 import HTMLTranslator # import the directives to have pygments support - from pelican import rstdirectives + from pelican import rstdirectives # NOQA except ImportError: core = False try: from markdown import Markdown except ImportError: - Markdown = False + Markdown = False # NOQA import re -from pelican.contents import Category, Tag, Author, URLWrapper +from pelican.contents import Category, Tag, Author from pelican.utils import get_date, open _METADATA_PROCESSORS = { 'tags': lambda x, y: [Tag(tag, y) for tag in unicode(x).split(',')], 'date': lambda x, y: get_date(x), - 'status': lambda x,y: unicode.strip(x), + 'status': lambda x, y: unicode.strip(x), 'category': Category, 'author': Author, } + class Reader(object): enabled = True extensions = None @@ -39,6 +40,7 @@ class Reader(object): return _METADATA_PROCESSORS[name.lower()](value, self.settings) return value + class _FieldBodyTranslator(HTMLTranslator): def astext(self): @@ -56,6 +58,7 @@ def render_node_to_html(document, node): node.walkabout(visitor) return visitor.astext() + class RstReader(Reader): enabled = bool(docutils) extension = "rst" @@ -65,11 +68,11 @@ class RstReader(Reader): output = {} for docinfo in document.traverse(docutils.nodes.docinfo): for element in docinfo.children: - if element.tagname == 'field': # custom fields (e.g. summary) + if element.tagname == 'field': # custom fields (e.g. summary) name_elem, body_elem = element.children name = name_elem.astext() value = render_node_to_html(document, body_elem) - else: # standard fields (e.g. address) + else: # standard fields (e.g. address) name = element.tagname value = element.astext() @@ -78,7 +81,8 @@ class RstReader(Reader): def _get_publisher(self, filename): extra_params = {'initial_header_level': '2'} - pub = docutils.core.Publisher(destination_class=docutils.io.StringOutput) + pub = docutils.core.Publisher( + destination_class=docutils.io.StringOutput) pub.set_components('standalone', 'restructuredtext', 'html') pub.process_programmatic_settings(None, extra_params, None) pub.set_source(source_path=filename) diff --git a/pelican/settings.py b/pelican/settings.py index ec6ec483..fcabd518 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- import os +from os.path import isabs import locale from pelican import log @@ -10,8 +11,8 @@ _DEFAULT_CONFIG = {'PATH': None, 'THEME': DEFAULT_THEME, 'OUTPUT_PATH': 'output/', 'MARKUP': ('rst', 'md'), - 'STATIC_PATHS': ['images',], - 'THEME_STATIC_PATHS': ['static',], + 'STATIC_PATHS': ['images', ], + 'THEME_STATIC_PATHS': ['static', ], 'FEED': 'feeds/all.atom.xml', 'CATEGORY_FEED': 'feeds/%s.atom.xml', 'TRANSLATION_FEED': 'feeds/all-%s.atom.xml', @@ -44,7 +45,7 @@ _DEFAULT_CONFIG = {'PATH': None, 'DEFAULT_DATE_FORMAT': '%a %d %B %Y', 'DATE_FORMATS': {}, 'JINJA_EXTENSIONS': [], - 'LOCALE': '', # default to user locale + 'LOCALE': '', # default to user locale 'DEFAULT_PAGINATION': False, 'DEFAULT_ORPHANS': 0, 'DEFAULT_METADATA': (), @@ -53,6 +54,7 @@ _DEFAULT_CONFIG = {'PATH': None, 'ARTICLE_PERMALINK_STRUCTURE': '' } + def read_settings(filename): """Load a Python file into a dictionary. """ @@ -67,9 +69,10 @@ def read_settings(filename): # Make the paths relative to the settings file for path in ['PATH', 'OUTPUT_PATH']: if path in context: - if context[path] is not None and not os.path.isabs(context[path]): - # FIXME: - context[path] = os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(filename), context[path]))) + if context[path] is not None and not isabs(context[path]): + context[path] = os.path.abspath(os.path.normpath( + os.path.join(os.path.dirname(filename), context[path])) + ) # if locales is not a list, make it one locales = context['LOCALE'] @@ -84,17 +87,17 @@ def read_settings(filename): for locale_ in locales: try: locale.setlocale(locale.LC_ALL, locale_) - break # break if it is successfull + break # break if it is successfull except locale.Error: pass else: log.warn("LOCALE option doesn't contain a correct value") if not 'TIMEZONE' in context: - log.warn("No timezone information specified in the settings. Assuming your "\ - "timezone is UTC for feed generation. "\ - "Check http://docs.notmyidea.org/alexis/pelican/settings.html#timezone "\ - "for more information") + log.warn("No timezone information specified in the settings. Assuming" + " your timezone is UTC for feed generation. Check " + "http://docs.notmyidea.org/alexis/pelican/settings.html#timezone " + "for more information") # set the locale return context diff --git a/pelican/utils.py b/pelican/utils.py index c2daae03..93541cc0 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -19,7 +19,7 @@ def get_date(string): string = re.sub(' +', ' ', string) formats = ['%Y-%m-%d %H:%M', '%Y/%m/%d %H:%M', '%Y-%m-%d', '%Y/%m/%d', - '%d-%m-%Y', '%Y-%d-%m', # Weird ones + '%d-%m-%Y', '%Y-%d-%m', # Weird ones '%d/%m/%Y', '%d.%m.%Y', '%d.%m.%Y %H:%M', '%Y-%m-%d %H:%M:%S'] for date_format in formats: @@ -48,6 +48,7 @@ def slugify(value): value = unicode(re.sub('[^\w\s-]', '', value).strip().lower()) return re.sub('[-\s]+', '-', value) + def copy(path, source, destination, destination_path=None, overwrite=False): """Copy path from origin to destination. @@ -57,8 +58,8 @@ def copy(path, source, destination, destination_path=None, overwrite=False): :param source: the source dir :param destination: the destination dir :param destination_path: the destination path (optional) - :param overwrite: wether to overwrite the destination if already exists or not - + :param overwrite: wether to overwrite the destination if already exists or + not """ if not destination_path: destination_path = path @@ -109,7 +110,8 @@ def truncate_html_words(s, num, end_text='...'): length = int(num) if length <= 0: return u'' - html4_singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', 'hr', 'input') + html4_singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', + 'hr', 'input') # Set up regular expressions re_words = re.compile(r'&.*?;|<.*?>|(\w[\w-]*)', re.U) @@ -147,8 +149,9 @@ def truncate_html_words(s, num, end_text='...'): except ValueError: pass else: - # SGML: An end tag closes, back to the matching start tag, all unclosed intervening start tags with omitted end tags - open_tags = open_tags[i+1:] + # SGML: An end tag closes, back to the matching start tag, + # all unclosed intervening start tags with omitted end tags + open_tags = open_tags[i + 1:] else: # Add it to the start of the open tags list open_tags.insert(0, tagname) @@ -195,7 +198,7 @@ def process_translations(content_list): default_lang_items = items[:1] if not slug: - warning('empty slug for %r' %( default_lang_items[0].filename,)) + warning('empty slug for %r' % (default_lang_items[0].filename,)) index.extend(default_lang_items) translations.extend(filter( lambda x: x not in default_lang_items, @@ -233,7 +236,8 @@ def files_changed(path, extensions): def set_date_tzinfo(d, tz_name=None): """ Date without tzinfo shoudbe utc. - This function set the right tz to date that aren't utc and don't have tzinfo + This function set the right tz to date that aren't utc and don't have + tzinfo. """ if tz_name is not None: tz = pytz.timezone(tz_name) diff --git a/pelican/writers.py b/pelican/writers.py index 814de40c..b27443be 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -8,7 +8,7 @@ import re from feedgenerator import Atom1Feed, Rss201rev2Feed from pelican.paginator import Paginator -from pelican.log import * +from pelican.log import info from pelican.utils import get_relative_path, set_date_tzinfo @@ -28,7 +28,6 @@ class Writer(object): description=context.get('SITESUBTITLE', '')) return feed - def _add_item_to_the_feed(self, feed, item): feed.add_item( @@ -44,8 +43,8 @@ class Writer(object): def write_feed(self, elements, context, filename=None, feed_type='atom'): """Generate a feed with the list of articles provided - Return the feed. If no output_path or filename is specified, just return - the feed object. + Return the feed. If no output_path or filename is specified, just + return the feed object. :param elements: the articles to put on the feed. :param context: the context to get the feed metadata. @@ -56,7 +55,7 @@ class Writer(object): locale.setlocale(locale.LC_ALL, 'C') try: self.site_url = context.get('SITEURL', get_relative_path(filename)) - self.feed_url= '%s/%s' % (self.site_url, filename) + self.feed_url = '%s/%s' % (self.site_url, filename) feed = self._create_new_feed(feed_type, context) @@ -132,7 +131,7 @@ class Writer(object): self.settings.get('DEFAULT_PAGINATION'), self.settings.get('DEFAULT_ORPHANS')) else: - paginators[key] = Paginator(object_list, len(object_list), 0) + paginators[key] = Paginator(object_list, len(object_list)) # generated pages, and write for page_num in range(paginators.values()[0].num_pages): @@ -140,9 +139,10 @@ class Writer(object): paginated_name = name for key in paginators.iterkeys(): paginator = paginators[key] - page = paginator.page(page_num+1) - paginated_localcontext.update({'%s_paginator' % key: paginator, - '%s_page' % key: page}) + page = paginator.page(page_num + 1) + paginated_localcontext.update( + {'%s_paginator' % key: paginator, + '%s_page' % key: page}) if page_num > 0: ext = '.' + paginated_name.rsplit('.')[-1] paginated_name = paginated_name.replace(ext, @@ -160,8 +160,8 @@ class Writer(object): relative paths. :param name: name of the file to output. - :param context: dict that will be passed to the templates, which need to - be updated. + :param context: dict that will be passed to the templates, which need + to be updated. """ def _update_content(name, input): """Change all the relatives paths of the input content to relatives @@ -184,9 +184,12 @@ class Writer(object): def replacer(m): relative_path = m.group('path') - dest_path = os.path.normpath( os.sep.join( (get_relative_path(name), - "static", relative_path) ) ) - return m.group('markup') + m.group('quote') + dest_path + m.group('quote') + dest_path = os.path.normpath( + os.sep.join((get_relative_path(name), "static", + relative_path))) + + return m.group('markup') + m.group('quote') + dest_path \ + + m.group('quote') return hrefs.sub(replacer, content) From 8a442e726a7e0fe1f52e1542a9eb6ab1e4b5942e Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 9 Mar 2012 16:22:28 +0100 Subject: [PATCH 0070/2344] Don't specify the default when accessing settings. There is no need to do this, since all the default values are already provided in the default settings dict (in settings.py) --- pelican/contents.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index b408ff58..99740168 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -111,16 +111,14 @@ class Page(object): @property def url(self): if self.in_default_lang: - return self.settings.get('PAGE_URL', u'pages/{slug}.html').format(**self.url_format) - - return self.settings.get('PAGE_LANG_URL', u'pages/{slug}-{lang}.html').format(**self.url_format) + return self.settings['PAGE_URL'].format(**self.url_format) + return self.settings['PAGE_LANG_URL'].format(**self.url_format) @property def save_as(self): if self.in_default_lang: - return self.settings.get('PAGE_SAVE_AS', u'pages/{slug}.html').format(**self.url_format) - - return self.settings.get('PAGE_LANG_SAVE_AS', u'pages/{slug}-{lang}.html').format(**self.url_format) + return self.settings['PAGE_SAVE_AS'].format(**self.url_format) + return self.settings['PAGE_LANG_SAVE_AS'].format(**self.url_format) @property def content(self): @@ -148,21 +146,20 @@ class Article(Page): @property def url(self): if self.in_default_lang: - return self.settings.get('ARTICLE_URL', u'{slug}.html').format(**self.url_format) - - return self.settings.get('ARTICLE_LANG_URL', u'{slug}-{lang}.html').format(**self.url_format) + return self.settings['ARTICLE_URL'].format(**self.url_format) + return self.settings['ARTICLE_LANG_URL'].format(**self.url_format) @property def save_as(self): if self.in_default_lang: - return self.settings.get('ARTICLE_SAVE_AS', u'{slug}.html').format(**self.url_format) - - return self.settings.get('ARTICLE_LANG_SAVE_AS', u'{slug}-{lang}.html').format(**self.url_format) + return self.settings['ARTICLE_SAVE_AS'].format(**self.url_format) + return self.settings['ARTICLE_LANG_SAVE_AS'].format(**self.url_format) class Quote(Page): base_properties = ('author', 'date') + class URLWrapper(object): def __init__(self, name, settings): self.name = unicode(name) @@ -184,14 +181,16 @@ class URLWrapper(object): def url(self): return '%s.html' % self.name + class Category(URLWrapper): @property def url(self): - return self.settings.get('CATEGORY_URL', u'category/{name}.html').format(name=self.name) + return self.settings['CATEGORY_URL'].format(name=self.name) @property def save_as(self): - return self.settings.get('CATEGORY_SAVE_AS', u'category/{name}.html').format(name=self.name) + return self.settings['CATEGORY_SAVE_AS'].format(name=self.name) + class Tag(URLWrapper): def __init__(self, name, *args, **kwargs): @@ -199,20 +198,22 @@ class Tag(URLWrapper): @property def url(self): - return self.settings.get('TAG_URL', u'tag/{name}.html').format(name=self.name) + return self.settings['TAG_URL'].format(name=self.name) @property def save_as(self): - return self.settings.get('TAG_SAVE_AS', u'tag/{name}.html').format(name=self.name) + return self.settings['TAG_SAVE_AS'].format(name=self.name) + class Author(URLWrapper): @property def url(self): - return self.settings.get('AUTHOR_URL', u'author/{name}.html').format(name=self.name) + return self.settings['AUTHOR_URL'].format(name=self.name) @property def save_as(self): - return self.settings.get('AUTHOR_SAVE_AS', u'author/{name}.html').format(name=self.name) + return self.settings['AUTHOR_SAVE_AS'].format(name=self.name) + def is_valid_content(content, f): try: From 542b8b87058b73d25a713ffa62acb69afc97aff0 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 9 Mar 2012 16:27:23 +0100 Subject: [PATCH 0071/2344] add a 'coding standards' section in the contributors' guide --- docs/contribute.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/contribute.rst b/docs/contribute.rst index 84b99293..fcf8d5c0 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -38,3 +38,12 @@ The tests live in "pelican/tests" and you can run them using the "discover" feature of unittest2:: $ unit2 discover + +Coding standards +================ + +Try to respect what is described in the PEP8 +(http://www.python.org/dev/peps/pep-0008/) when providing patches. This can be +eased by the pep8 tool (http://pypi.python.org/pypi/pep8) or by Flake8, which +will give you some other cool hints about what's good or wrong +(http://pypi.python.org/pypi/flake8/) From 5e26062fd037f267206cbba40c06e271786131ff Mon Sep 17 00:00:00 2001 From: saghul Date: Sat, 10 Mar 2012 11:32:22 +0100 Subject: [PATCH 0072/2344] Fix for issue #233 --- pelican/generators.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index ee95545e..5def01ab 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -36,8 +36,8 @@ class Generator(object): theme_path = os.path.join(os.path.dirname(os.path.abspath(__file__))) - simple_loader = FileSystemLoader(theme_path, - "themes", "simple", "templates") + simple_loader = FileSystemLoader(os.path.join(theme_path, + "themes", "simple", "templates")) self._env = Environment( loader=ChoiceLoader([ FileSystemLoader(self._templates_path), From a7ea166fd256b5a25a2942195a08437cf62d4ffe Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 10 Mar 2012 12:21:54 +0100 Subject: [PATCH 0073/2344] fix #233 --- pelican/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 5def01ab..6ba12cf4 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -34,7 +34,7 @@ class Generator(object): self._templates_path = os.path.expanduser( os.path.join(self.theme, 'templates')) - theme_path = os.path.join(os.path.dirname(os.path.abspath(__file__))) + theme_path = os.path.dirname(os.path.abspath(__file__)) simple_loader = FileSystemLoader(os.path.join(theme_path, "themes", "simple", "templates")) From fd1fbca520f06c10b8100c1272976cfe03c70f56 Mon Sep 17 00:00:00 2001 From: m-r-r Date: Sat, 10 Mar 2012 12:25:05 +0100 Subject: [PATCH 0074/2344] Removed small errors in pelican-quickstart --- tools/pelican_quickstart.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/pelican_quickstart.py b/tools/pelican_quickstart.py index 56c22f10..04fc20be 100755 --- a/tools/pelican_quickstart.py +++ b/tools/pelican_quickstart.py @@ -40,7 +40,7 @@ html: clean $$(OUTPUTDIR)/index.html \t@echo 'Done' $$(OUTPUTDIR)/%.html: -\t$$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(CONFFILE) +\t$$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(CONFFILE) $$(PELICANOPTS) clean: \trm -fr $$(OUTPUTDIR) @@ -94,7 +94,7 @@ DEFAULT_PAGINATION = $default_pagination CONF = { 'pelican' : 'pelican', - 'pelicanopts' : None, + 'pelicanopts' : '', 'basedir': '.', 'ftp_host': 'localhost', 'ftp_user': 'anonymous', @@ -103,7 +103,7 @@ CONF = { 'ssh_user': 'root', 'ssh_target_dir': '/var/www', 'dropbox_dir' : '~/Dropbox/Public/', - 'default_pagination' : 7, + 'default_pagination' : 10, 'lang': 'en' } From 8499ce3340d993fcc61d4d8268df739b9169ea20 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sat, 10 Mar 2012 13:23:50 +0100 Subject: [PATCH 0075/2344] add some url and saveas settings that weren't present in the default settings dict --- pelican/settings.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pelican/settings.py b/pelican/settings.py index fcabd518..6ed76f46 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -35,6 +35,12 @@ _DEFAULT_CONFIG = {'PATH': None, 'PAGE_SAVE_AS': 'pages/{slug}.html', 'PAGE_LANG_URL': 'pages/{slug}-{lang}.html', 'PAGE_LANG_SAVE_AS': 'pages/{slug}-{lang}.html', + 'CATEGORY_URL': 'category/{name}.html', + 'CATEGORY_SAVE_AS': 'category/{name}.html', + 'TAG_URL': 'tag/{name}.html', + 'TAG_SAVE_AS': 'tag/{name}.html', + 'AUTHOR_URL': u'author/{name}.html', + 'AUTHOR_SAVE_AS': u'author/{name}.html', 'RELATIVE_URLS': True, 'DEFAULT_LANG': 'en', 'TAG_CLOUD_STEPS': 4, From 1c2f631723e12b414a5f2c50ac461fa1e81d0e2a Mon Sep 17 00:00:00 2001 From: draftcode Date: Sat, 10 Mar 2012 20:04:09 +0900 Subject: [PATCH 0076/2344] Avoid #226. --- tests/test_contents.py | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/tests/test_contents.py b/tests/test_contents.py index b44d151f..e058e721 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -1,9 +1,9 @@ # -*- coding: utf-8 -*- from __future__ import with_statement try: - from unittest2 import TestCase + from unittest2 import TestCase, skip except ImportError, e: - from unittest import TestCase + from unittest import TestCase, skip from pelican.contents import Page from pelican.settings import _DEFAULT_CONFIG @@ -94,6 +94,18 @@ class TestPage(TestCase): locale = 'ja_JP.utf8' page_kwargs['settings']['DATE_FORMATS'] = {'jp':(locale,'%Y-%m-%d(%a)')} page_kwargs['metadata']['lang'] = 'jp' - page = Page( **page_kwargs) - self.assertEqual(page.locale_date, u'2015-09-13(\u65e5)') - # above is unicode in Japanese: 2015-09-13() + + import locale as locale_module + try: + page = Page( **page_kwargs) + self.assertEqual(page.locale_date, u'2015-09-13(\u65e5)') + # above is unicode in Japanese: 2015-09-13() + except locale_module.Error: + # The constructor of ``Page`` will try to set the locale to + # ``ja_JP.utf8``. But this attempt will failed when there is no + # such locale in the system. You can see which locales there are + # in your system with ``locale -a`` command. + # + # Until we find some other method to test this functionality, we + # will simply skip this test. + skip("There is no locale %s in this system." % locale) From 1194764ed1ddcce797fb1895668ccc5e97137c93 Mon Sep 17 00:00:00 2001 From: draftcode Date: Sat, 10 Mar 2012 21:18:01 +0900 Subject: [PATCH 0077/2344] Do not create feeds when their filenames are set to None. --- docs/settings.rst | 4 +++- pelican/generators.py | 47 ++++++++++++++++++++++------------------ tests/test_generators.py | 36 ++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 22 deletions(-) create mode 100644 tests/test_generators.py diff --git a/docs/settings.rst b/docs/settings.rst index 69e2adc8..b08b5bcb 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -199,7 +199,6 @@ Pelican generates category feeds as well as feeds for all your articles. It does not generate feeds for tags by default, but it is possible to do so using the ``TAG_FEED`` and ``TAG_FEED_RSS`` settings: - ================================================ ===================================================== Setting name (default value) What does it do? ================================================ ===================================================== @@ -214,6 +213,9 @@ Setting name (default value) What does it do? quantity is unrestricted by default. ================================================ ===================================================== +If you don't want to generate some of these feeds, set ``None`` to the +variables above. + .. [2] %s is the name of the category. Pagination diff --git a/pelican/generators.py b/pelican/generators.py index 6ba12cf4..ccfdb39f 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -118,41 +118,46 @@ class ArticlesGenerator(Generator): def generate_feeds(self, writer): """Generate the feeds from the current context, and output files.""" - writer.write_feed(self.articles, self.context, self.settings['FEED']) - - if 'FEED_RSS' in self.settings: + if self.settings.get('FEED'): writer.write_feed(self.articles, self.context, - self.settings['FEED_RSS'], feed_type='rss') + self.settings['FEED']) + + if self.settings.get('FEED_RSS'): + writer.write_feed(self.articles, self.context, + self.settings['FEED_RSS'], feed_type='rss') for cat, arts in self.categories: arts.sort(key=attrgetter('date'), reverse=True) - writer.write_feed(arts, self.context, - self.settings['CATEGORY_FEED'] % cat) - - if 'CATEGORY_FEED_RSS' in self.settings: + if self.settings.get('CATEGORY_FEED'): writer.write_feed(arts, self.context, - self.settings['CATEGORY_FEED_RSS'] % cat, - feed_type='rss') + self.settings['CATEGORY_FEED'] % cat) - if 'TAG_FEED' in self.settings: + if self.settings.get('CATEGORY_FEED_RSS'): + writer.write_feed(arts, self.context, + self.settings['CATEGORY_FEED_RSS'] % cat, + feed_type='rss') + + if self.settings.get('TAG_FEED') or self.settings.get('TAG_FEED_RSS'): for tag, arts in self.tags.items(): arts.sort(key=attrgetter('date'), reverse=True) - writer.write_feed(arts, self.context, - self.settings['TAG_FEED'] % tag) + if self.settings.get('TAG_FEED'): + writer.write_feed(arts, self.context, + self.settings['TAG_FEED'] % tag) - if 'TAG_FEED_RSS' in self.settings: + if self.settings.get('TAG_FEED_RSS'): writer.write_feed(arts, self.context, self.settings['TAG_FEED_RSS'] % tag, feed_type='rss') - translations_feeds = defaultdict(list) - for article in chain(self.articles, self.translations): - translations_feeds[article.lang].append(article) + if self.settings.get('TRANSLATION_FEED'): + translations_feeds = defaultdict(list) + for article in chain(self.articles, self.translations): + translations_feeds[article.lang].append(article) - for lang, items in translations_feeds.items(): - items.sort(key=attrgetter('date'), reverse=True) - writer.write_feed(items, self.context, - self.settings['TRANSLATION_FEED'] % lang) + for lang, items in translations_feeds.items(): + items.sort(key=attrgetter('date'), reverse=True) + writer.write_feed(items, self.context, + self.settings['TRANSLATION_FEED'] % lang) def generate_pages(self, writer): """Generate the pages on the disk""" diff --git a/tests/test_generators.py b/tests/test_generators.py new file mode 100644 index 00000000..94088c34 --- /dev/null +++ b/tests/test_generators.py @@ -0,0 +1,36 @@ +# -*- coding: utf-8 -*- +from __future__ import with_statement +try: + from unittest2 import TestCase +except ImportError, e: + from unittest import TestCase + +from pelican.generators import ArticlesGenerator +from pelican.settings import _DEFAULT_CONFIG + +class TestArticlesGenerator(TestCase): + + def test_generate_feeds(self): + + class FakeWriter(object): + def __init__(self): + self.called = False + + def write_feed(self, *args, **kwargs): + self.called = True + + generator = ArticlesGenerator(None, {'FEED': _DEFAULT_CONFIG['FEED']}, + None, _DEFAULT_CONFIG['THEME'], None, + None) + writer = FakeWriter() + generator.generate_feeds(writer) + assert writer.called, ("The feed should be written, " + "if settings['FEED'] is specified.") + + generator = ArticlesGenerator(None, {'FEED': None}, None, + _DEFAULT_CONFIG['THEME'], None, None) + writer = FakeWriter() + generator.generate_feeds(writer) + assert not writer.called, ("If settings['FEED'] is None, " + "the feed should not be generated.") + From 3bdc769134a57d6ce62f2d80b095061d91bacb2f Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 01:14:22 +0100 Subject: [PATCH 0078/2344] Factorize some code about URL wrapping. --- pelican/contents.py | 69 +++++++++++++++------------------------------ 1 file changed, 22 insertions(+), 47 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 99740168..900061ad 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -2,6 +2,7 @@ from datetime import datetime from os import getenv from sys import platform, stdin +import functools import locale from pelican.log import warning, error @@ -108,17 +109,13 @@ class Page(object): 'category': getattr(self, 'category', 'misc'), } - @property - def url(self): - if self.in_default_lang: - return self.settings['PAGE_URL'].format(**self.url_format) - return self.settings['PAGE_LANG_URL'].format(**self.url_format) + def _expand_settings(self, key): + fq_key = ('%s_%s' % (self.__class__.__name__, key)).upper() + return self.settings[fq_key].format(**self.url_format) - @property - def save_as(self): - if self.in_default_lang: - return self.settings['PAGE_SAVE_AS'].format(**self.url_format) - return self.settings['PAGE_LANG_SAVE_AS'].format(**self.url_format) + def get_url_setting(self, key): + key = key if self.in_default_lang else 'lang_%s' % key + return self._expand_settings(key) @property def content(self): @@ -139,22 +136,13 @@ class Page(object): summary = property(_get_summary, _set_summary, "Summary of the article." "Based on the content. Can't be set") + url = property(functools.partial(get_url_setting, key='url')) + save_as = property(functools.partial(get_url_setting, key='save_as')) + class Article(Page): mandatory_properties = ('title', 'date', 'category') - @property - def url(self): - if self.in_default_lang: - return self.settings['ARTICLE_URL'].format(**self.url_format) - return self.settings['ARTICLE_LANG_URL'].format(**self.url_format) - - @property - def save_as(self): - if self.in_default_lang: - return self.settings['ARTICLE_SAVE_AS'].format(**self.url_format) - return self.settings['ARTICLE_LANG_SAVE_AS'].format(**self.url_format) - class Quote(Page): base_properties = ('author', 'date') @@ -163,8 +151,12 @@ class Quote(Page): class URLWrapper(object): def __init__(self, name, settings): self.name = unicode(name) + self.slug = slugify(self.name) self.settings = settings + def as_dict(self): + return self.__dict__ + def __hash__(self): return hash(self.name) @@ -177,42 +169,25 @@ class URLWrapper(object): def __unicode__(self): return self.name - @property - def url(self): - return '%s.html' % self.name + def _from_settings(self, key): + setting = "%s_%s" % (self.__class__.__name__.upper(), key) + return self.settings[setting].format(**self.as_dict()) + + url = property(functools.partial(_from_settings, key='URL')) + save_as = property(functools.partial(_from_settings, key='SAVE_AS')) class Category(URLWrapper): - @property - def url(self): - return self.settings['CATEGORY_URL'].format(name=self.name) - - @property - def save_as(self): - return self.settings['CATEGORY_SAVE_AS'].format(name=self.name) + pass class Tag(URLWrapper): def __init__(self, name, *args, **kwargs): super(Tag, self).__init__(unicode.strip(name), *args, **kwargs) - @property - def url(self): - return self.settings['TAG_URL'].format(name=self.name) - - @property - def save_as(self): - return self.settings['TAG_SAVE_AS'].format(name=self.name) - class Author(URLWrapper): - @property - def url(self): - return self.settings['AUTHOR_URL'].format(name=self.name) - - @property - def save_as(self): - return self.settings['AUTHOR_SAVE_AS'].format(name=self.name) + pass def is_valid_content(content, f): From 1ec2779f5e4470c6ed19b56d16185c6174ab520c Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 01:16:02 +0100 Subject: [PATCH 0079/2344] Make the readers tests a bit more verbose. --- tests/test_readers.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/test_readers.py b/tests/test_readers.py index 120b3125..2d023462 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -1,8 +1,8 @@ # coding: utf-8 try: - import unittest2 + import unittest2 as unittest except ImportError, e: - import unittest as unittest2 + import unittest import datetime import os @@ -12,11 +12,12 @@ from pelican import readers CUR_DIR = os.path.dirname(__file__) CONTENT_PATH = os.path.join(CUR_DIR, 'content') + def _filename(*args): return os.path.join(CONTENT_PATH, *args) -class RstReaderTest(unittest2.TestCase): +class RstReaderTest(unittest.TestCase): def test_article_with_metadata(self): reader = readers.RstReader({}) @@ -29,4 +30,6 @@ class RstReaderTest(unittest2.TestCase): 'date': datetime.datetime(2010, 12, 2, 10, 14), 'tags': ['foo', 'bar', 'foobar'], } - self.assertDictEqual(metadata, expected) + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) From 1c219d14bb36ea4f12dda3f987a7c843ba2cec40 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 01:16:32 +0100 Subject: [PATCH 0080/2344] Use the slug as default URL for tags and authors. --- pelican/settings.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/settings.py b/pelican/settings.py index 6ed76f46..d62acf42 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -37,10 +37,10 @@ _DEFAULT_CONFIG = {'PATH': None, 'PAGE_LANG_SAVE_AS': 'pages/{slug}-{lang}.html', 'CATEGORY_URL': 'category/{name}.html', 'CATEGORY_SAVE_AS': 'category/{name}.html', - 'TAG_URL': 'tag/{name}.html', - 'TAG_SAVE_AS': 'tag/{name}.html', - 'AUTHOR_URL': u'author/{name}.html', - 'AUTHOR_SAVE_AS': u'author/{name}.html', + 'TAG_URL': 'tag/{slug}.html', + 'TAG_SAVE_AS': 'tag/{slug}.html', + 'AUTHOR_URL': u'author/{slug}.html', + 'AUTHOR_SAVE_AS': u'author/{slug}.html', 'RELATIVE_URLS': True, 'DEFAULT_LANG': 'en', 'TAG_CLOUD_STEPS': 4, From 0ca9997e107f67fc4e8eebd0511809e254b11f58 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Tue, 6 Mar 2012 00:29:56 +0100 Subject: [PATCH 0081/2344] paths for finding articles and pages are now parametrable --- pelican/generators.py | 10 ++++++---- pelican/settings.py | 4 ++++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 6ba12cf4..ac2cd865 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -211,10 +211,10 @@ class ArticlesGenerator(Generator): def generate_context(self): """change the context""" - # return the list of files to use - files = self.get_files(self.path, exclude=['pages', ]) all_articles = [] - for f in files: + for f in self.get_files( + os.path.join(self.path, self.settings['ARTICLE_DIR']), + exclude=self.settings['ARTICLE_EXCLUDES']): try: content, metadata = read_file(f, settings=self.settings) except Exception, e: @@ -316,7 +316,9 @@ class PagesGenerator(Generator): def generate_context(self): all_pages = [] - for f in self.get_files(os.sep.join((self.path, 'pages'))): + for f in self.get_files( + os.path.join(self.path, self.settings['PAGE_DIR']), + exclude=self.settings['PAGE_EXCLUDES']): try: content, metadata = read_file(f) except Exception, e: diff --git a/pelican/settings.py b/pelican/settings.py index 6ed76f46..1b31582f 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -8,6 +8,10 @@ from pelican import log DEFAULT_THEME = os.sep.join([os.path.dirname(os.path.abspath(__file__)), "themes/notmyidea"]) _DEFAULT_CONFIG = {'PATH': None, + 'ARTICLE_DIR': '', + 'ARTICLE_EXCLUDES': ('pages',), + 'PAGE_DIR': 'pages', + 'PAGE_EXCLUDES': (), 'THEME': DEFAULT_THEME, 'OUTPUT_PATH': 'output/', 'MARKUP': ('rst', 'md'), From aef7418bdf2094b8e6edc5b2e6300bf8a60bb851 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Tue, 6 Mar 2012 00:45:22 +0100 Subject: [PATCH 0082/2344] add docs for new page/article paths settings --- docs/settings.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/settings.rst b/docs/settings.rst index 69e2adc8..31183be3 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -52,6 +52,10 @@ Setting name (default value) What does it do? supported extensions. `OUTPUT_PATH` (``'output/'``) Where to output the generated files. `PATH` (``None``) Path to look at for input files. +`PAGE_DIR' (``'pages'``) Directory to look at for pages. +`PAGE_EXCLUDES' (``()``) A list of directories to exclude when looking for pages. +`ARTICLE_DIR' (``''``) Directory to look at for articles. +`ARTICLE_EXCLUDES': (``('pages',)``) A list of directories to exclude when looking for articles. `PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions of your documents. You will need to install `rst2pdf`. From d6be2fb44cfb39afc41bf4a3ce1dd842d549da06 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 01:59:04 +0100 Subject: [PATCH 0083/2344] Put deprecation code in a separate place --- pelican/__init__.py | 83 +++++++++++++++++++++++++-------------------- pelican/settings.py | 2 +- 2 files changed, 47 insertions(+), 38 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 8de68d69..dcdbdcb6 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -6,7 +6,7 @@ import time from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, PdfGenerator) -from pelican.settings import read_settings +from pelican.settings import read_settings, _DEFAULT_CONFIG from pelican.utils import clean_output_dir, files_changed from pelican.writers import Writer from pelican import log @@ -20,6 +20,9 @@ class Pelican(object): """Read the settings, and performs some checks on the environment before doing anything else. """ + if settings is None: + settings = _DEFAULT_CONFIG + self.path = path or settings['PATH'] if not self.path: raise Exception('you need to specify a path containing the content' @@ -28,44 +31,11 @@ class Pelican(object): if self.path.endswith('/'): self.path = self.path[:-1] - if settings.get('CLEAN_URLS', False): - log.warning('Found deprecated `CLEAN_URLS` in settings. Modifing' - ' the following settings for the same behaviour.') - - settings['ARTICLE_URL'] = '{slug}/' - settings['ARTICLE_LANG_URL'] = '{slug}-{lang}/' - settings['PAGE_URL'] = 'pages/{slug}/' - settings['PAGE_LANG_URL'] = 'pages/{slug}-{lang}/' - - for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', - 'PAGE_LANG_URL'): - log.warning("%s = '%s'" % (setting, settings[setting])) - - if settings.get('ARTICLE_PERMALINK_STRUCTURE', False): - log.warning('Found deprecated `ARTICLE_PERMALINK_STRUCTURE` in' - ' settings. Modifing the following settings for' - ' the same behaviour.') - - structure = settings['ARTICLE_PERMALINK_STRUCTURE'] - - # Convert %(variable) into {variable}. - structure = re.sub('%\((\w+)\)s', '{\g<1>}', structure) - - # Convert %x into {date:%x} for strftime - structure = re.sub('(%[A-z])', '{date:\g<1>}', structure) - - # Strip a / prefix - structure = re.sub('^/', '', structure) - - for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', - 'PAGE_LANG_URL', 'ARTICLE_SAVE_AS', - 'ARTICLE_LANG_SAVE_AS', 'PAGE_SAVE_AS', - 'PAGE_LANG_SAVE_AS'): - settings[setting] = os.path.join(structure, settings[setting]) - log.warning("%s = '%s'" % (setting, settings[setting])) - # define the default settings self.settings = settings + + self._handle_deprecation() + self.theme = theme or settings['THEME'] output_path = output_path or settings['OUTPUT_PATH'] self.output_path = os.path.realpath(output_path) @@ -82,6 +52,45 @@ class Pelican(object): else: raise Exception("Impossible to find the theme %s" % theme) + def _handle_deprecation(self): + + if self.settings.get('CLEAN_URLS', False): + log.warning('Found deprecated `CLEAN_URLS` in settings. Modifing' + ' the following settings for the same behaviour.') + + self.settings['ARTICLE_URL'] = '{slug}/' + self.settings['ARTICLE_LANG_URL'] = '{slug}-{lang}/' + self.settings['PAGE_URL'] = 'pages/{slug}/' + self.settings['PAGE_LANG_URL'] = 'pages/{slug}-{lang}/' + + for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', + 'PAGE_LANG_URL'): + log.warning("%s = '%s'" % (setting, self.settings[setting])) + + if self.settings.get('ARTICLE_PERMALINK_STRUCTURE', False): + log.warning('Found deprecated `ARTICLE_PERMALINK_STRUCTURE` in' + ' settings. Modifing the following settings for' + ' the same behaviour.') + + structure = self.settings['ARTICLE_PERMALINK_STRUCTURE'] + + # Convert %(variable) into {variable}. + structure = re.sub('%\((\w+)\)s', '{\g<1>}', structure) + + # Convert %x into {date:%x} for strftime + structure = re.sub('(%[A-z])', '{date:\g<1>}', structure) + + # Strip a / prefix + structure = re.sub('^/', '', structure) + + for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', + 'PAGE_LANG_URL', 'ARTICLE_SAVE_AS', + 'ARTICLE_LANG_SAVE_AS', 'PAGE_SAVE_AS', + 'PAGE_LANG_SAVE_AS'): + self.settings[setting] = os.path.join(structure, + self.settings[setting]) + log.warning("%s = '%s'" % (setting, self.settings[setting])) + def run(self): """Run the generators and return""" diff --git a/pelican/settings.py b/pelican/settings.py index d62acf42..bfc8e940 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -61,7 +61,7 @@ _DEFAULT_CONFIG = {'PATH': None, } -def read_settings(filename): +def read_settings(filename=None): """Load a Python file into a dictionary. """ context = _DEFAULT_CONFIG.copy() From fbf89687cc05c0656e7efc69befde6c790ec66b4 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 01:59:58 +0100 Subject: [PATCH 0084/2344] start functional testing --- tests/support.py | 18 ++++++++++++++++++ tests/test_pelican.py | 31 +++++++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 tests/support.py create mode 100644 tests/test_pelican.py diff --git a/tests/support.py b/tests/support.py new file mode 100644 index 00000000..0cd757a6 --- /dev/null +++ b/tests/support.py @@ -0,0 +1,18 @@ +from contextlib import contextmanager + +from tempfile import mkdtemp +from shutil import rmtree + + +@contextmanager +def temporary_folder(): + """creates a temporary folder, return it and delete it afterwards. + + This allows to do something like this in tests: + + >>> with temporary_folder() as d: + # do whatever you want + """ + tempdir = mkdtemp() + yield tempdir + rmtree(tempdir) diff --git a/tests/test_pelican.py b/tests/test_pelican.py new file mode 100644 index 00000000..dce4fadc --- /dev/null +++ b/tests/test_pelican.py @@ -0,0 +1,31 @@ +import unittest +import os + +from support import temporary_folder + +from pelican import Pelican +from pelican.settings import read_settings + +SAMPLES_PATH = os.path.abspath(os.sep.join( + (os.path.dirname(os.path.abspath(__file__)), "..", "samples"))) + +INPUT_PATH = os.path.join(SAMPLES_PATH, "content") +SAMPLE_CONFIG = os.path.join(SAMPLES_PATH, "pelican.conf.py") + + +class TestPelican(unittest.TestCase): + # general functional testing for pelican. Basically, this test case tries + # to run pelican in different situations and see how it behaves + + def test_basic_generation_works(self): + # when running pelican without settings, it should pick up the default + # ones and generate the output without raising any exception / issuing + # any warning. + with temporary_folder() as temp_path: + pelican = Pelican(path=INPUT_PATH, output_path=temp_path) + pelican.run() + + # the same thing with a specified set of settins should work + with temporary_folder() as temp_path: + pelican = Pelican(path=INPUT_PATH, output_path=temp_path, + settings=read_settings(SAMPLE_CONFIG)) From d43bd1dcb80801dfabfba661afa81a790816ee28 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 02:48:36 +0100 Subject: [PATCH 0085/2344] Add a way to use Typogrify to enhance the generated HTML. --- docs/settings.rst | 5 +++++ pelican/readers.py | 14 +++++++++++++- pelican/settings.py | 3 ++- tests/content/article.rst | 4 ++++ tests/test_readers.py | 17 +++++++++++++++++ 5 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 tests/content/article.rst diff --git a/docs/settings.rst b/docs/settings.rst index 69e2adc8..6780c6ae 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -69,6 +69,11 @@ Setting name (default value) What does it do? `TIMEZONE` The timezone used in the date information, to generate Atom and RSS feeds. See the "timezone" section below for more info. +`TYPOGRIFY` (``False``) If set to true, some + additional transformations will be done on the + generated HTML, using the `Typogrify + `_ + library ================================================ ===================================================== .. [#] Default is the system locale. diff --git a/pelican/readers.py b/pelican/readers.py index 5bbbfb30..a581e458 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -143,12 +143,24 @@ def read_file(filename, fmt=None, settings=None): """Return a reader object using the given format.""" if not fmt: fmt = filename.split('.')[-1] + if fmt not in _EXTENSIONS.keys(): raise TypeError('Pelican does not know how to parse %s' % filename) + reader = _EXTENSIONS[fmt](settings) settings_key = '%s_EXTENSIONS' % fmt.upper() + if settings and settings_key in settings: reader.extensions = settings[settings_key] + if not reader.enabled: raise ValueError("Missing dependencies for %s" % fmt) - return reader.read(filename) + + content, metadata = reader.read(filename) + + # eventually filter the content with typogrify if asked so + if settings and settings['TYPOGRIFY']: + from typogrify import Typogrify + content = Typogrify.typogrify(content) + + return content, metadata diff --git a/pelican/settings.py b/pelican/settings.py index bfc8e940..8cb06e90 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -57,7 +57,8 @@ _DEFAULT_CONFIG = {'PATH': None, 'DEFAULT_METADATA': (), 'FILES_TO_COPY': (), 'DEFAULT_STATUS': 'published', - 'ARTICLE_PERMALINK_STRUCTURE': '' + 'ARTICLE_PERMALINK_STRUCTURE': '', + 'TYPOGRIFY': False, } diff --git a/tests/content/article.rst b/tests/content/article.rst new file mode 100644 index 00000000..1707ab03 --- /dev/null +++ b/tests/content/article.rst @@ -0,0 +1,4 @@ +Article title +############# + +This is some content. With some stuff to "typogrify". diff --git a/tests/test_readers.py b/tests/test_readers.py index 2d023462..d4f0aecf 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -33,3 +33,20 @@ class RstReaderTest(unittest.TestCase): for key, value in expected.items(): self.assertEquals(value, metadata[key], key) + + def test_typogrify(self): + # if nothing is specified in the settings, the content should be + # unmodified + content, _ = readers.read_file(_filename('article.rst')) + expected = "

    This is some content. With some stuff to "\ + ""typogrify".

    \n" + + self.assertEqual(content, expected) + + # otherwise, typogrify should be applied + content, _ = readers.read_file(_filename('article.rst'), + settings={'TYPOGRIFY': True}) + expected = "

    This is some content. With some stuff to "\ + "“typogrify”.

    \n" + + self.assertEqual(content, expected) From 6a4f4a55b421f71acfb915d3e3b3027b5934322f Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 02:52:40 +0100 Subject: [PATCH 0086/2344] updated the changelog --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index e68c6f0d..ef9bc070 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -3,6 +3,7 @@ X.X * Refactored the way URL are handled. * Improved the english documentation * Fixed packaging using setuptools entrypoints +* Added typogrify support 2.8 From cfd050b0f29928dd31e4a994c58566f49e23d2c2 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 03:02:12 +0100 Subject: [PATCH 0087/2344] Add a CSS file for typogrify on the notmyidea theme --- pelican/themes/notmyidea/static/css/main.css | 1 + pelican/themes/notmyidea/static/css/typogrify.css | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 pelican/themes/notmyidea/static/css/typogrify.css diff --git a/pelican/themes/notmyidea/static/css/main.css b/pelican/themes/notmyidea/static/css/main.css index b3677771..7534790f 100644 --- a/pelican/themes/notmyidea/static/css/main.css +++ b/pelican/themes/notmyidea/static/css/main.css @@ -10,6 +10,7 @@ /* Imports */ @import url("reset.css"); @import url("pygment.css"); +@import url("typogrify.css"); @import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz&subset=latin); /***** Global *****/ diff --git a/pelican/themes/notmyidea/static/css/typogrify.css b/pelican/themes/notmyidea/static/css/typogrify.css new file mode 100644 index 00000000..c9b34dc8 --- /dev/null +++ b/pelican/themes/notmyidea/static/css/typogrify.css @@ -0,0 +1,3 @@ +.caps {font-size:.92em;} +.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;} +.dquo {margin-left:-.38em;} From 3c983d62c9ef426e9d08e9a7f3f05ae9090cb304 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 11:25:30 +0100 Subject: [PATCH 0088/2344] change the tests to use the mock library instead of a custom mocking system --- CHANGELOG | 1 + tests/test_generators.py | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 18 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index ef9bc070..46aa68a5 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -4,6 +4,7 @@ X.X * Improved the english documentation * Fixed packaging using setuptools entrypoints * Added typogrify support +* Added a way to disable feed generation 2.8 diff --git a/tests/test_generators.py b/tests/test_generators.py index 94088c34..20929622 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -1,36 +1,28 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement try: - from unittest2 import TestCase + import unittest2 as unittest except ImportError, e: - from unittest import TestCase + import unittest # NOQA from pelican.generators import ArticlesGenerator from pelican.settings import _DEFAULT_CONFIG -class TestArticlesGenerator(TestCase): +from mock import MagicMock + + +class TestArticlesGenerator(unittest.TestCase): def test_generate_feeds(self): - class FakeWriter(object): - def __init__(self): - self.called = False - - def write_feed(self, *args, **kwargs): - self.called = True - generator = ArticlesGenerator(None, {'FEED': _DEFAULT_CONFIG['FEED']}, None, _DEFAULT_CONFIG['THEME'], None, None) - writer = FakeWriter() + writer = MagicMock() generator.generate_feeds(writer) - assert writer.called, ("The feed should be written, " - "if settings['FEED'] is specified.") + writer.write_feed.assert_called_with([], None, 'feeds/all.atom.xml') generator = ArticlesGenerator(None, {'FEED': None}, None, _DEFAULT_CONFIG['THEME'], None, None) - writer = FakeWriter() + writer = MagicMock() generator.generate_feeds(writer) - assert not writer.called, ("If settings['FEED'] is None, " - "the feed should not be generated.") - + self.assertFalse(writer.write_feed.called) From c393b011c43fb359844484b5e7dcf971e00e7226 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 15:50:53 +0100 Subject: [PATCH 0089/2344] cleaning --- pelican/utils.py | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index 93541cc0..eead1ac9 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -169,13 +169,11 @@ def truncate_html_words(s, num, end_text='...'): def process_translations(content_list): - """ Finds all translation and returns - tuple with two lists (index, translations). - Index list includes items in default language - or items which have no variant in default language. + """ Finds all translation and returns tuple with two lists (index, + translations). Index list includes items in default language or items + which have no variant in default language. - Also, for each content_list item, it - sets attribute 'translations' + Also, for each content_list item, it sets attribute 'translations' """ content_list.sort(key=attrgetter('slug')) grouped_by_slugs = groupby(content_list, attrgetter('slug')) @@ -185,10 +183,7 @@ def process_translations(content_list): for slug, items in grouped_by_slugs: items = list(items) # find items with default language - default_lang_items = filter( - attrgetter('in_default_lang'), - items - ) + default_lang_items = filter(attrgetter('in_default_lang'), items) len_ = len(default_lang_items) if len_ > 1: warning(u'there are %s variants of "%s"' % (len_, slug)) From 32355f546373a1dcc4faa4d426f71c4552642956 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 15:51:48 +0100 Subject: [PATCH 0090/2344] add some more tests for the utils module --- tests/support.py | 10 +++++- tests/test_utils.py | 75 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 tests/test_utils.py diff --git a/tests/support.py b/tests/support.py index 0cd757a6..5829fe78 100644 --- a/tests/support.py +++ b/tests/support.py @@ -1,8 +1,9 @@ from contextlib import contextmanager - from tempfile import mkdtemp from shutil import rmtree +from pelican.contents import Article + @contextmanager def temporary_folder(): @@ -16,3 +17,10 @@ def temporary_folder(): tempdir = mkdtemp() yield tempdir rmtree(tempdir) + + +def get_article(title, slug, content, lang, extra_metadata=None): + metadata = {'slug': slug, 'title': title, 'lang': lang} + if extra_metadata is not None: + metadata.update(extra_metadata) + return Article(content, metadata=metadata) diff --git a/tests/test_utils.py b/tests/test_utils.py new file mode 100644 index 00000000..9654825e --- /dev/null +++ b/tests/test_utils.py @@ -0,0 +1,75 @@ +# -*- coding: utf-8 -*- +try: + import unittest2 as unittest +except ImportError: + import unittest # NOQA +import datetime + +from pelican import utils +from pelican.contents import Article + +from support import get_article + + +class TestUtils(unittest.TestCase): + + def test_get_date(self): + # valid ones + date = datetime.datetime(year=2012, month=11, day=22) + date_hour = datetime.datetime(year=2012, month=11, day=22, hour=22, + minute=11) + date_hour_sec = datetime.datetime(year=2012, month=11, day=22, hour=22, + minute=11, second=10) + dates = {'2012-11-22': date, + '2012/11/22': date, + '2012-11-22 22:11': date_hour, + '2012/11/22 22:11': date_hour, + '22-11-2012': date, + '22/11/2012': date, + '22.11.2012': date, + '2012-22-11': date, + '22.11.2012 22:11': date_hour, + '2012-11-22 22:11:10': date_hour_sec} + + for value, expected in dates.items(): + self.assertEquals(utils.get_date(value), expected, value) + + # invalid ones + invalid_dates = ('2010-110-12', 'yay') + for item in invalid_dates: + self.assertRaises(ValueError, utils.get_date, item) + + def test_slugify(self): + + samples = (('this is a test', 'this-is-a-test'), + ('this is a test', 'this-is-a-test'), + (u'this → is ← a ↑ test', 'this-is-a-test'), + ('this--is---a test', 'this-is-a-test')) + + for value, expected in samples: + self.assertEquals(utils.slugify(value), expected) + + def test_get_relative_path(self): + + samples = (('/test/test', '../../.'), + ('/test/test/', '../../../.'), + ('/', '../.')) + + for value, expected in samples: + self.assertEquals(utils.get_relative_path(value), expected) + + def test_process_translations(self): + # create a bunch of articles + fr_article1 = get_article(lang='fr', slug='yay', title='Un titre', + content='en français') + en_article1 = get_article(lang='en', slug='yay', title='A title', + content='in english') + + articles = [fr_article1, en_article1] + + index, trans = utils.process_translations(articles) + + self.assertIn(en_article1, index) + self.assertIn(fr_article1, trans) + self.assertNotIn(en_article1, trans) + self.assertNotIn(fr_article1, index) From 48b318d29e8ba9d84897997ee5d1982b574afb6a Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 17:05:46 +0100 Subject: [PATCH 0091/2344] skip typogrify if not installed --- tests/test_readers.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/test_readers.py b/tests/test_readers.py index d4f0aecf..c0b8cc41 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -26,7 +26,8 @@ class RstReaderTest(unittest.TestCase): 'category': 'yeah', 'author': u'Alexis Métaireau', 'title': 'This is a super article !', - 'summary': 'Multi-line metadata should be supported\nas well as inline markup.', + 'summary': 'Multi-line metadata should be supported\nas well as'\ + ' inline markup.', 'date': datetime.datetime(2010, 12, 2, 10, 14), 'tags': ['foo', 'bar', 'foobar'], } @@ -43,10 +44,13 @@ class RstReaderTest(unittest.TestCase): self.assertEqual(content, expected) - # otherwise, typogrify should be applied - content, _ = readers.read_file(_filename('article.rst'), - settings={'TYPOGRIFY': True}) - expected = "

    This is some content. With some stuff to "\ - "“typogrify”.

    \n" + try: + # otherwise, typogrify should be applied + content, _ = readers.read_file(_filename('article.rst'), + settings={'TYPOGRIFY': True}) + expected = "

    This is some content. With some stuff to "\ + "“typogrify”.

    \n" - self.assertEqual(content, expected) + self.assertEqual(content, expected) + except ImportError: + return unittest.skip('need the typogrify distribution') From 912b1dbc1a25a9a5079b21649a8f0aa8b3db3b68 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 17:05:59 +0100 Subject: [PATCH 0092/2344] test travis-ci --- .travis.yml | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..bb1f5af1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,8 @@ +language: python +python: + - "2.6" + - "2.7" +install: + - pip install nose --use-mirrors + - pip install . --use-mirrors +script: nosetests -s tests From d42b6d9ad7682c55e5beae9d90f9f6607cfc9b65 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 17:20:04 +0100 Subject: [PATCH 0093/2344] fix nose --- tox.ini | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 462abf09..e1ca32f2 100644 --- a/tox.ini +++ b/tox.ini @@ -1,12 +1,13 @@ [tox] -envlist = py25,py26,py27 +envlist = py26,py27 [testenv] -commands=py.test +commands = nosetests -s tests deps = + nose Jinja2 Pygments docutils feedgenerator unittest2 - pytest + mock From 2827a6df47e2c9a08f286183dcb3b5323c98b1b7 Mon Sep 17 00:00:00 2001 From: draftcode Date: Mon, 12 Mar 2012 01:22:54 +0900 Subject: [PATCH 0094/2344] Fixed some typos. --- pelican/__init__.py | 20 ++++++++++---------- pelican/contents.py | 2 +- pelican/utils.py | 6 +++--- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index dcdbdcb6..0b53dbcc 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -25,7 +25,7 @@ class Pelican(object): self.path = path or settings['PATH'] if not self.path: - raise Exception('you need to specify a path containing the content' + raise Exception('You need to specify a path containing the content' ' (see pelican --help for more information)') if self.path.endswith('/'): @@ -138,7 +138,7 @@ def main(): static blog, with restructured text input files.""") parser.add_argument(dest='path', nargs='?', - help='Path where to find the content files') + help='Path where to find the content files.') parser.add_argument('-t', '--theme-path', dest='theme', help='Path where to find the theme templates. If not specified, it' 'will use the default one included with pelican.') @@ -146,28 +146,28 @@ def main(): help='Where to output the generated files. If not specified, a ' 'directory will be created, named "output" in the current path.') parser.add_argument('-m', '--markup', default=None, dest='markup', - help='the list of markup language to use (rst or md). Please indicate ' - 'them separated by commas') + help='The list of markup language to use (rst or md). Please indicate ' + 'them separated by commas.') parser.add_argument('-s', '--settings', dest='settings', default='', - help='the settings of the application. Default to False.') + help='The settings of the application. Default to False.') parser.add_argument('-d', '--delete-output-directory', dest='delete_outputdir', action='store_true', help='Delete the output directory.') parser.add_argument('-v', '--verbose', action='store_const', const=log.INFO, dest='verbosity', - help='Show all messages') + help='Show all messages.') parser.add_argument('-q', '--quiet', action='store_const', const=log.CRITICAL, dest='verbosity', - help='Show only critical errors') + help='Show only critical errors.') parser.add_argument('-D', '--debug', action='store_const', const=log.DEBUG, dest='verbosity', - help='Show all message, including debug messages') + help='Show all message, including debug messages.') parser.add_argument('--version', action='version', version=__version__, - help='Print the pelican version and exit') + help='Print the pelican version and exit.') parser.add_argument('-r', '--autoreload', dest='autoreload', action='store_true', help="Relaunch pelican each time a modification occurs" - " on the content files") + " on the content files.") args = parser.parse_args() log.init(args.verbosity) diff --git a/pelican/contents.py b/pelican/contents.py index 900061ad..4f424461 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -43,7 +43,7 @@ class Page(object): self.author = Author(settings['AUTHOR'], settings) else: self.author = Author(getenv('USER', 'John Doe'), settings) - warning(u"Author of `{0}' unknow, assuming that his name is " + warning(u"Author of `{0}' unknown, assuming that his name is " "`{1}'".format(filename or self.title, self.author)) # manage languages diff --git a/pelican/utils.py b/pelican/utils.py index eead1ac9..1b84f108 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -14,7 +14,7 @@ from pelican.log import warning, info def get_date(string): """Return a datetime object from a string. - If no format matches the given date, raise a ValuEerror + If no format matches the given date, raise a ValueError. """ string = re.sub(' +', ' ', string) formats = ['%Y-%m-%d %H:%M', '%Y/%m/%d %H:%M', @@ -58,8 +58,8 @@ def copy(path, source, destination, destination_path=None, overwrite=False): :param source: the source dir :param destination: the destination dir :param destination_path: the destination path (optional) - :param overwrite: wether to overwrite the destination if already exists or - not + :param overwrite: whether to overwrite the destination if already exists + or not """ if not destination_path: destination_path = path From 3cb18303f6203f84b32e2f4c8bdf48430d7311ff Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 17:26:59 +0100 Subject: [PATCH 0095/2344] fix python 2.6 support --- tests/test_contents.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/tests/test_contents.py b/tests/test_contents.py index e058e721..ed9885b6 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -3,18 +3,19 @@ from __future__ import with_statement try: from unittest2 import TestCase, skip except ImportError, e: - from unittest import TestCase, skip + from unittest import TestCase, skip # NOQA from pelican.contents import Page from pelican.settings import _DEFAULT_CONFIG + class TestPage(TestCase): def setUp(self): super(TestPage, self).setUp() self.page_kwargs = { 'content': 'content', - 'metadata':{ + 'metadata': { 'title': 'foo bar', 'author': 'Blogger', }, @@ -72,32 +73,38 @@ class TestPage(TestCase): """ from datetime import datetime from sys import platform - dt = datetime(2015,9,13) + dt = datetime(2015, 9, 13) # make a deep copy of page_kawgs - page_kwargs = {key:self.page_kwargs[key] for key in self.page_kwargs} + page_kwargs = dict([(key, self.page_kwargs[key]) for key in + self.page_kwargs]) for key in page_kwargs: - if not isinstance(page_kwargs[key], dict): break - page_kwargs[key] = {subkey:page_kwargs[key][subkey] for subkey in page_kwargs[key]} + if not isinstance(page_kwargs[key], dict): + break + page_kwargs[key] = dict([(subkey, page_kwargs[key][subkey]) + for subkey in page_kwargs[key]]) # set its date to dt page_kwargs['metadata']['date'] = dt - page = Page( **page_kwargs) + page = Page(**page_kwargs) self.assertEqual(page.locale_date, - unicode(dt.strftime(_DEFAULT_CONFIG['DEFAULT_DATE_FORMAT']), 'utf-8')) + unicode(dt.strftime(_DEFAULT_CONFIG['DEFAULT_DATE_FORMAT']), + 'utf-8')) + page_kwargs['settings'] = dict([(x, _DEFAULT_CONFIG[x]) for x in + _DEFAULT_CONFIG]) - page_kwargs['settings'] = {x:_DEFAULT_CONFIG[x] for x in _DEFAULT_CONFIG} # I doubt this can work on all platforms ... if platform == "win32": locale = 'jpn' else: locale = 'ja_JP.utf8' - page_kwargs['settings']['DATE_FORMATS'] = {'jp':(locale,'%Y-%m-%d(%a)')} + page_kwargs['settings']['DATE_FORMATS'] = {'jp': (locale, + '%Y-%m-%d(%a)')} page_kwargs['metadata']['lang'] = 'jp' import locale as locale_module try: - page = Page( **page_kwargs) + page = Page(**page_kwargs) self.assertEqual(page.locale_date, u'2015-09-13(\u65e5)') # above is unicode in Japanese: 2015-09-13() except locale_module.Error: From 08b40c7967cdf5ef0780f1f2b4d41d29b31d6578 Mon Sep 17 00:00:00 2001 From: draftcode Date: Mon, 12 Mar 2012 01:33:30 +0900 Subject: [PATCH 0096/2344] Make names of metadata lower. --- pelican/readers.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index a581e458..632c72b9 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -36,8 +36,8 @@ class Reader(object): self.settings = settings def process_metadata(self, name, value): - if name.lower() in _METADATA_PROCESSORS: - return _METADATA_PROCESSORS[name.lower()](value, self.settings) + if name in _METADATA_PROCESSORS: + return _METADATA_PROCESSORS[name](value, self.settings) return value @@ -75,6 +75,7 @@ class RstReader(Reader): else: # standard fields (e.g. address) name = element.tagname value = element.astext() + name = name.lower() output[name] = self.process_metadata(name, value) return output From c05b743fa64696625762a09fe2aabb05195a1dfd Mon Sep 17 00:00:00 2001 From: draftcode Date: Mon, 12 Mar 2012 01:40:27 +0900 Subject: [PATCH 0097/2344] Add mock to dev_requirements. --- dev_requirements.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/dev_requirements.txt b/dev_requirements.txt index 198880ec..c7f53682 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -4,3 +4,4 @@ docutils feedgenerator unittest2 pytz +mock From 9cc7efbe12fea30018eafd0a92c7186304ec8600 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 18:02:57 +0100 Subject: [PATCH 0098/2344] add requirements to travis-ci --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index bb1f5af1..8f5dc3a3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,6 @@ python: - "2.6" - "2.7" install: - - pip install nose --use-mirrors + - pip install nose unittest2 mock --use-mirrors - pip install . --use-mirrors script: nosetests -s tests From e95b26bf204d684882b711ad6cc817fba16dda7a Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 11 Mar 2012 18:07:08 +0100 Subject: [PATCH 0099/2344] Add travis-ci build-image support on the README --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 2f66e54c..5012bb9c 100644 --- a/README.rst +++ b/README.rst @@ -1,6 +1,8 @@ Pelican ####### +.. image:: https://secure.travis-ci.org/ametaireau/pelican.png?branch=master + Pelican is a simple weblog generator, written in `Python `_. * Write your weblog entries directly with your editor of choice (vim!) From a4ce10d88e76e60a5da6579d3d04d79ba0d02b7a Mon Sep 17 00:00:00 2001 From: draftcode Date: Mon, 12 Mar 2012 02:24:26 +0900 Subject: [PATCH 0100/2344] Add a test for readers. --- tests/content/article_with_uppercase_metadata.rst | 6 ++++++ tests/test_readers.py | 8 ++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/content/article_with_uppercase_metadata.rst diff --git a/tests/content/article_with_uppercase_metadata.rst b/tests/content/article_with_uppercase_metadata.rst new file mode 100644 index 00000000..e26cdd13 --- /dev/null +++ b/tests/content/article_with_uppercase_metadata.rst @@ -0,0 +1,6 @@ + +This is a super article ! +######################### + +:Category: Yeah + diff --git a/tests/test_readers.py b/tests/test_readers.py index d4f0aecf..4472d7fe 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -34,6 +34,14 @@ class RstReaderTest(unittest.TestCase): for key, value in expected.items(): self.assertEquals(value, metadata[key], key) + def test_article_metadata_key_lowercase(self): + """Keys of metadata should be lowercase.""" + reader = readers.RstReader({}) + content, metadata = reader.read(_filename('article_with_uppercase_metadata.rst')) + + self.assertIn('category', metadata, "Key should be lowercase.") + self.assertEquals('Yeah', metadata.get('category'), "Value keeps cases.") + def test_typogrify(self): # if nothing is specified in the settings, the content should be # unmodified From 89a481f8e77a96970e03dc0576cb4156fb53c4a1 Mon Sep 17 00:00:00 2001 From: Thanos Lefteris Date: Sun, 11 Mar 2012 21:00:38 +0200 Subject: [PATCH 0101/2344] Match closing tag --- pelican/themes/simple/templates/archives.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/themes/simple/templates/archives.html b/pelican/themes/simple/templates/archives.html index e6364efa..1ea9b58f 100644 --- a/pelican/themes/simple/templates/archives.html +++ b/pelican/themes/simple/templates/archives.html @@ -1,6 +1,6 @@ {% extends "base.html" %} {% block content %} -

    Archives for {{ SITENAME }}

    +

    Archives for {{ SITENAME }}

    {% for article in dates %} From acad3e864d6fc729ce08407e619b61da7846f792 Mon Sep 17 00:00:00 2001 From: Thanos Lefteris Date: Sun, 11 Mar 2012 21:08:18 +0200 Subject: [PATCH 0102/2344] Double-quote HTML attribute --- pelican/themes/notmyidea/templates/archives.html | 2 +- pelican/themes/simple/templates/archives.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/themes/notmyidea/templates/archives.html b/pelican/themes/notmyidea/templates/archives.html index 5ba2c817..f7f1c400 100644 --- a/pelican/themes/notmyidea/templates/archives.html +++ b/pelican/themes/notmyidea/templates/archives.html @@ -6,7 +6,7 @@
    {% for article in dates %}
    {{ article.locale_date }}
    -
    {{ article.title }}
    +
    {{ article.title }}
    {% endfor %}
    diff --git a/pelican/themes/simple/templates/archives.html b/pelican/themes/simple/templates/archives.html index e6364efa..c1a9087e 100644 --- a/pelican/themes/simple/templates/archives.html +++ b/pelican/themes/simple/templates/archives.html @@ -5,7 +5,7 @@
    {% for article in dates %}
    {{ article.locale_date }}
    -
    {{ article.title }}
    +
    {{ article.title }}
    {% endfor %}
    {% endblock %} From e097175a77d94d41d8979c3fb4718b44c0e067b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Raimbault?= Date: Tue, 13 Mar 2012 02:14:38 +0100 Subject: [PATCH 0103/2344] Import not used of BeautifulSoup --- tools/pelican_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/pelican_import.py b/tools/pelican_import.py index b883f7fc..c0d8bf1c 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -38,7 +38,7 @@ def wp2fields(xml): def dc2fields(file): """Opens a Dotclear export file, and yield pelican fields""" - from BeautifulSoup import BeautifulStoneSoup, BeautifulSoup + from BeautifulSoup import BeautifulStoneSoup in_cat = False in_post = False From c4f96b108f54a1968334767c93eb9d59dcb7f5b8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Raimbault?= Date: Tue, 13 Mar 2012 02:16:11 +0100 Subject: [PATCH 0104/2344] Don't set unused fields of Dotclear post --- tools/pelican_import.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/pelican_import.py b/tools/pelican_import.py index c0d8bf1c..14f06138 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -85,10 +85,10 @@ def dc2fields(file): post_creadt = fields[6] # post_upddt = fields[7] # post_password = fields[8] - post_type = fields[9] + # post_type = fields[9] post_format = fields[10] - post_url = fields[11] - post_lang = fields[12] + # post_url = fields[11] + # post_lang = fields[12] post_title = fields[13] post_excerpt = fields[14] post_excerpt_xhtml = fields[15] From fec605b5775f0f9dba6e78a99f99dddcf09b8b5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Raimbault?= Date: Tue, 13 Mar 2012 02:17:06 +0100 Subject: [PATCH 0105/2344] Fix way to handle OSError (error doesn't exist) A better way would to use sys.stderr.write or PY3 print(file=sys.stderr) --- tools/pelican_import.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/pelican_import.py b/tools/pelican_import.py index 14f06138..12c3597f 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -2,6 +2,7 @@ import argparse import os +import sys import time from codecs import open @@ -259,14 +260,14 @@ def main(): elif args.feed: input_type = 'feed' else: - print("you must provide either --wpfile, --dotclear or --feed options") + print("You must provide either --wpfile, --dotclear or --feed options") exit() if not os.path.exists(args.output): try: os.mkdir(args.output) except OSError: - error("Couldn't create the output folder: " + args.output) + print("Unable to create the output folder: " + args.output) exit() # TODO: refactor this long assignment From d7f0b1637e1f6ed4c0ea54f3e314981c72581292 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Raimbault?= Date: Tue, 13 Mar 2012 02:20:33 +0100 Subject: [PATCH 0106/2344] Cleanup awful line with TODO in pelican-import --- tools/pelican_import.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/tools/pelican_import.py b/tools/pelican_import.py index 12c3597f..8a425776 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -270,14 +270,11 @@ def main(): print("Unable to create the output folder: " + args.output) exit() - # TODO: refactor this long assignment - input_type, input, out_markup, output_path, dircat=False = input_type, args.input, args.markup, args.output, args.dircat - if input_type == 'wordpress': - fields = wp2fields(input) + fields = wp2fields(args.input) elif input_type == 'dotclear': - fields = dc2fields(input) + fields = dc2fields(args.input) elif input_type == 'feed': - fields = feed2fields(input) + fields = feed2fields(args.input) - fields2pelican(fields, out_markup, output_path, dircat=dircat) + fields2pelican(fields, args.markup, args.output, dircat=args.dircat or False) From 2f79d5f0526bb2fa6efd4755349d2673298ba608 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Raimbault?= Date: Tue, 13 Mar 2012 16:52:28 +0100 Subject: [PATCH 0107/2344] Improve error handling when pandoc is missing --- tools/pelican_import.py | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/tools/pelican_import.py b/tools/pelican_import.py index 8a425776..b89740df 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -2,6 +2,7 @@ import argparse import os +import subprocess import sys import time @@ -217,7 +218,20 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): content = content.replace("\n", "
    \n") fp.write(content) - os.system('pandoc --normalize --reference-links --from=html --to=%s -o "%s" "%s"' % (out_markup, out_filename, html_filename)) + cmd = 'pandoc --normalize --reference-links --from=html --to={0} -o "{1}" "{2}"'.format( + out_markup, out_filename, html_filename) + + try: + rc = subprocess.call(cmd, shell=True) + if rc < 0: + print("Child was terminated by signal %d" % -rc) + exit() + elif rc > 0: + print("Please, check your Pandoc installation.") + exit() + except OSError, e: + print("Pandoc execution failed: %s" % e) + exit() os.remove(html_filename) From ff2426c4ad9e24c52d9a1d02f9c841d4a6438d00 Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 13 Mar 2012 17:10:20 +0100 Subject: [PATCH 0108/2344] Fix for #245: return the summary of an article based on the :summary: metadata if it is set, else troncate the content. --- pelican/contents.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 4f424461..d8ccf9f3 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -89,9 +89,9 @@ class Page(object): if hasattr(self, 'date') and self.date > datetime.now(): self.status = 'draft' - # set summary - if not hasattr(self, 'summary'): - self.summary = truncate_html_words(self.content, 50) + # store the :summary: metadata if it is set + if 'summary' in metadata: + self._summary = metadata['summary'] def check_properties(self): """test that each mandatory property is set.""" @@ -126,8 +126,12 @@ class Page(object): return content def _get_summary(self): - """Returns the summary of an article, based on to the content""" - return truncate_html_words(self.content, 50) + """Returns the summary of an article, based on the :summary: metadata + if it is set, else troncate the content.""" + if hasattr(self, '_summary'): + return self._summary + else: + return truncate_html_words(self.content, 50) def _set_summary(self, summary): """Dummy function""" From c4418555223315455be8178c86aab1a980335a8a Mon Sep 17 00:00:00 2001 From: Simon Date: Tue, 13 Mar 2012 17:15:25 +0100 Subject: [PATCH 0109/2344] add a test for the summary metadata --- tests/test_contents.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/test_contents.py b/tests/test_contents.py index ed9885b6..8e1407dc 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -8,14 +8,20 @@ except ImportError, e: from pelican.contents import Page from pelican.settings import _DEFAULT_CONFIG +from jinja2.utils import generate_lorem_ipsum + +# generate one paragraph, enclosed with

    +TEST_CONTENT = str(generate_lorem_ipsum(n=1)) +TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False) class TestPage(TestCase): def setUp(self): super(TestPage, self).setUp() self.page_kwargs = { - 'content': 'content', + 'content': TEST_CONTENT, 'metadata': { + 'summary': TEST_SUMMARY, 'title': 'foo bar', 'author': 'Blogger', }, @@ -27,11 +33,11 @@ class TestPage(TestCase): """ metadata = {'foo': 'bar', 'foobar': 'baz', 'title': 'foobar', } - page = Page('content', metadata=metadata) + page = Page(TEST_CONTENT, metadata=metadata) for key, value in metadata.items(): self.assertTrue(hasattr(page, key)) self.assertEqual(value, getattr(page, key)) - self.assertEqual(page.content, 'content') + self.assertEqual(page.content, TEST_CONTENT) def test_mandatory_properties(self): """If the title is not set, must throw an exception.""" @@ -39,6 +45,11 @@ class TestPage(TestCase): page = Page(**self.page_kwargs) page.check_properties() + def test_summary_from_metadata(self): + """If a :summary: metadata is given, it should be used.""" + page = Page(**self.page_kwargs) + self.assertEqual(page.summary, TEST_SUMMARY) + def test_slug(self): """If a title is given, it should be used to generate the slug.""" page = Page(**self.page_kwargs) From 4f95b9f05c9cf2d5f48786fb6831318e37a1f762 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 14 Mar 2012 09:38:36 +0100 Subject: [PATCH 0110/2344] remove useless .keys() for key in dict expressions --- pelican/generators.py | 5 ++--- pelican/readers.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 2987dcfe..71208430 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -227,7 +227,7 @@ class ArticlesGenerator(Generator): continue # if no category is set, use the name of the path as a category - if 'category' not in metadata.keys(): + if 'category' not in metadata: if os.path.dirname(f) == self.path: category = self.settings['DEFAULT_CATEGORY'] @@ -238,8 +238,7 @@ class ArticlesGenerator(Generator): if category != '': metadata['category'] = Category(category, self.settings) - if 'date' not in metadata.keys()\ - and self.settings['FALLBACK_ON_FS_DATE']: + if 'date' not in metadata and self.settings['FALLBACK_ON_FS_DATE']: metadata['date'] = datetime.datetime.fromtimestamp( os.stat(f).st_ctime) diff --git a/pelican/readers.py b/pelican/readers.py index 632c72b9..d4e13b4d 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -145,7 +145,7 @@ def read_file(filename, fmt=None, settings=None): if not fmt: fmt = filename.split('.')[-1] - if fmt not in _EXTENSIONS.keys(): + if fmt not in _EXTENSIONS: raise TypeError('Pelican does not know how to parse %s' % filename) reader = _EXTENSIONS[fmt](settings) From 39bdbcfd86bc0f3025ec82b51d86892796356c10 Mon Sep 17 00:00:00 2001 From: Simon Date: Wed, 14 Mar 2012 12:36:55 +0100 Subject: [PATCH 0111/2344] files_changed: cleanup and add a test --- pelican/utils.py | 3 --- tests/test_utils.py | 22 ++++++++++++++++++++-- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index 1b84f108..7ffd9eb9 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -210,9 +210,6 @@ LAST_MTIME = 0 def files_changed(path, extensions): """Return True if the files have changed since the last check""" - def with_extension(f): - return any(f.endswith(ext) for ext in extensions) - def file_times(path): """Return the last time files have been modified""" for root, dirs, files in os.walk(path): diff --git a/tests/test_utils.py b/tests/test_utils.py index 9654825e..40f710d9 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -3,11 +3,12 @@ try: import unittest2 as unittest except ImportError: import unittest # NOQA + +import os import datetime +import time from pelican import utils -from pelican.contents import Article - from support import get_article @@ -73,3 +74,20 @@ class TestUtils(unittest.TestCase): self.assertIn(fr_article1, trans) self.assertNotIn(en_article1, trans) self.assertNotIn(fr_article1, index) + + def test_files_changed(self): + "Test if file changes are correctly detected" + + path = os.path.join(os.path.dirname(__file__), 'content') + filename = os.path.join(path, 'article_with_metadata.rst') + changed = utils.files_changed(path, 'rst') + self.assertEquals(changed, True) + + changed = utils.files_changed(path, 'rst') + self.assertEquals(changed, False) + + t = time.time() + os.utime(filename, (t, t)) + changed = utils.files_changed(path, 'rst') + self.assertEquals(changed, True) + self.assertAlmostEqual(utils.LAST_MTIME, t, places=2) From 4bac1ee7451cda501bb7826f808f11ff12574cf4 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 14 Mar 2012 19:54:28 +0000 Subject: [PATCH 0112/2344] - remove default=None with argparse is redundant since it's the default value already. - use the argparse.ArgumentDefaultsHelpFormatter as the formatter_class, to print out automatically the default values --- pelican/__init__.py | 9 +++++---- tools/pelican_import.py | 3 ++- tools/pelican_quickstart.py | 10 ++++++---- 3 files changed, 13 insertions(+), 9 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 0b53dbcc..5ffcc3b5 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -135,7 +135,8 @@ class Pelican(object): def main(): parser = argparse.ArgumentParser(description="""A tool to generate a - static blog, with restructured text input files.""") + static blog, with restructured text input files.""", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument(dest='path', nargs='?', help='Path where to find the content files.') @@ -145,11 +146,11 @@ def main(): parser.add_argument('-o', '--output', dest='output', help='Where to output the generated files. If not specified, a ' 'directory will be created, named "output" in the current path.') - parser.add_argument('-m', '--markup', default=None, dest='markup', + parser.add_argument('-m', '--markup', dest='markup', help='The list of markup language to use (rst or md). Please indicate ' 'them separated by commas.') - parser.add_argument('-s', '--settings', dest='settings', default='', - help='The settings of the application. Default to False.') + parser.add_argument('-s', '--settings', dest='settings', + help='The settings of the application.') parser.add_argument('-d', '--delete-output-directory', dest='delete_outputdir', action='store_true', help='Delete the output directory.') diff --git a/tools/pelican_import.py b/tools/pelican_import.py index b883f7fc..bfa0f623 100755 --- a/tools/pelican_import.py +++ b/tools/pelican_import.py @@ -234,7 +234,8 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): def main(): parser = argparse.ArgumentParser( description="Transform feed, Wordpress or Dotclear files to rst files." - "Be sure to have pandoc installed") + "Be sure to have pandoc installed", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument(dest='input', help='The input file to read') parser.add_argument('--wpfile', action='store_true', dest='wpfile', diff --git a/tools/pelican_quickstart.py b/tools/pelican_quickstart.py index 04fc20be..4427be65 100755 --- a/tools/pelican_quickstart.py +++ b/tools/pelican_quickstart.py @@ -193,14 +193,16 @@ def ask(question, answer=str, default=None, l=None): def main(): - parser = argparse.ArgumentParser(description="A kickstarter for pelican") + parser = argparse.ArgumentParser( + description="A kickstarter for pelican", + formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('-p', '--path', default=".", help="The path to generate the blog into") - parser.add_argument('-t', '--title', default=None, metavar="title", + parser.add_argument('-t', '--title', metavar="title", help='Set the title of the website') - parser.add_argument('-a', '--author', default=None, metavar="author", + parser.add_argument('-a', '--author', metavar="author", help='Set the author name of the website') - parser.add_argument('-l', '--lang', default=None, metavar="lang", + parser.add_argument('-l', '--lang', metavar="lang", help='Set the default lang of the website') args = parser.parse_args() From ec31832c5cf5f1bdfcf42a6719648c7c5efdffb2 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 14 Mar 2012 20:04:58 +0000 Subject: [PATCH 0113/2344] - reorganize imports and remove unused import - remove trailing spaces at the end of the generated files --- tools/pelican_quickstart.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/pelican_quickstart.py b/tools/pelican_quickstart.py index 04fc20be..f2ec9e88 100755 --- a/tools/pelican_quickstart.py +++ b/tools/pelican_quickstart.py @@ -1,10 +1,13 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -import os, sys, argparse, string +import os +import string +import argparse + from pelican import __version__ -TEMPLATES={ +TEMPLATES = { 'Makefile' : ''' PELICAN=$pelican PELICANOPTS=$pelicanopts @@ -60,7 +63,7 @@ github: $$(OUTPUTDIR)/index.html \tgit push origin gh-pages .PHONY: html help clean ftp_upload ssh_upload dropbox_upload github - ''', +''', 'pelican.conf.py': '''#!/usr/bin/env python # -*- coding: utf-8 -*- # @@ -87,9 +90,7 @@ SOCIAL = ( ) DEFAULT_PAGINATION = $default_pagination - - - ''' +''' } CONF = { From d01606e86d126e46d63a16a72b5f10bbe8162d01 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Wed, 14 Mar 2012 20:06:13 +0000 Subject: [PATCH 0114/2344] remove unused class _dict --- tools/pelican_quickstart.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/tools/pelican_quickstart.py b/tools/pelican_quickstart.py index f2ec9e88..2358161e 100755 --- a/tools/pelican_quickstart.py +++ b/tools/pelican_quickstart.py @@ -109,17 +109,6 @@ CONF = { } -class _dict(dict): - def __init__(self, *args, **kwargs): - dict.__init__(self, *args, **kwargs) - - def __getitem__(self, i): - return dict.get(self,i,None) - - def has_key(k): - return True - - def ask(question, answer=str, default=None, l=None): if answer == str: r = '' From 10fc8a733d7e8f8c99f31101067c77a8ae7c7c6c Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Thu, 15 Mar 2012 00:17:01 +0000 Subject: [PATCH 0115/2344] fix warnings and errors from settings.rst --- docs/settings.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/settings.rst b/docs/settings.rst index 9eb46439..c9b58d04 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -160,6 +160,8 @@ maintain multiple languages with different date formats, you can set this dict using language name (``lang`` in your posts) as key. Regarding available format codes, see `strftime document of python`_ : +.. parsed-literal:: + DATE_FORMAT = { 'en': '%a, %d %b %Y', 'jp': '%Y-%m-%d(%a)', @@ -167,6 +169,8 @@ codes, see `strftime document of python`_ : You can set locale to further control date format: +.. parsed-literal:: + LOCALE = ('usa', 'jpn', # On Windows 'en_US', 'ja_JP' # On Unix/Linux ) @@ -175,6 +179,7 @@ Also, it is possible to set different locale settings for each language. If you put (locale, format) tuples in the dict, this will override the LOCALE setting above: +.. parsed-literal:: # On Unix/Linux DATE_FORMAT = { 'en': ('en_US','%a, %d %b %Y'), From 7f8f6e8a7e0a4d9b8c313f22e65eb1b4ea055513 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Thu, 15 Mar 2012 00:17:50 +0000 Subject: [PATCH 0116/2344] the sys.path should not contain the _themes directory, which is not a python package --- docs/conf.py | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 4c4530e2..b4a58992 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -14,7 +14,6 @@ release = version # -- Options for HTML output --------------------------------------------------- -sys.path.append(os.path.abspath('_themes')) html_theme_path = ['_themes'] html_theme = 'pelican' From 020c1400e22ec1b3f45e7bf5c4ec404223b83a6a Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Thu, 15 Mar 2012 00:23:07 +0000 Subject: [PATCH 0117/2344] add the pelican path to the sys.path, to be able to use autodoc --- docs/conf.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/conf.py b/docs/conf.py index b4a58992..6c4e1ce5 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,8 @@ # -*- coding: utf-8 -*- import sys, os +sys.path.append(os.path.abspath('..')) + # -- General configuration ----------------------------------------------------- templates_path = ['_templates'] extensions = ['sphinx.ext.autodoc',] From 99852ebda8e581a9ecf2710761bb35dbcef89734 Mon Sep 17 00:00:00 2001 From: Dana Woodman Date: Thu, 15 Mar 2012 11:59:58 -0700 Subject: [PATCH 0118/2344] `MD_EXTENSIONS` should be a list not a tuple. --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index c9b58d04..b98b649e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -46,7 +46,7 @@ Setting name (default value) What does it do? `MARKUP` (``('rst', 'md')``) A list of available markup languages you want to use. For the moment, the only available values are `rst` and `md`. -`MD_EXTENSIONS` (``('codehilite','extra')``) A list of the extensions that the Markdown processor +`MD_EXTENSIONS` (``['codehilite','extra']``) A list of the extensions that the Markdown processor will use. Refer to the extensions chapter in the Python-Markdown documentation for a complete list of supported extensions. From 2ff3db8f517772c6b9c57fb35a8572827551694b Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Thu, 15 Mar 2012 19:37:49 +0000 Subject: [PATCH 0119/2344] fix the reset term code to make it work also on OSX --- pelican/log.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/log.py b/pelican/log.py index 1cb76e16..027743d0 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -5,7 +5,7 @@ from logging import critical, error, info, warning, warn, debug from logging import Formatter, getLogger, StreamHandler -RESET_TERM = u'\033[1;m' +RESET_TERM = u'\033[0;m' def term_color(code): From 74c2449d8f0fe4e6ae8c237835b438f87dfc9aad Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Fri, 16 Mar 2012 14:27:26 +0000 Subject: [PATCH 0120/2344] add version information in __init__.py and import them from setup.py and conf.py --- docs/conf.py | 6 ++++-- pelican/__init__.py | 4 +++- setup.py | 4 ++-- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 6c4e1ce5..ac2d67ee 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -3,6 +3,8 @@ import sys, os sys.path.append(os.path.abspath('..')) +from pelican import __version__, __major__ + # -- General configuration ----------------------------------------------------- templates_path = ['_templates'] extensions = ['sphinx.ext.autodoc',] @@ -11,8 +13,8 @@ master_doc = 'index' project = u'Pelican' copyright = u'2010, Alexis Metaireau and contributors' exclude_patterns = ['_build'] -version = "2" -release = version +version = __version__ +release = __major__ # -- Options for HTML output --------------------------------------------------- diff --git a/pelican/__init__.py b/pelican/__init__.py index 5ffcc3b5..780938a7 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -11,7 +11,9 @@ from pelican.utils import clean_output_dir, files_changed from pelican.writers import Writer from pelican import log -__version__ = "3.0" +__major__ = 3 +__minor__ = 0 +__version__ = "{0}.{1}".format(__major__, __minor__) class Pelican(object): diff --git a/setup.py b/setup.py index 910499de..d26ad5f4 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from setuptools import setup -VERSION = "3.0" # find a better way to do so. +from pelican import __version__ requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'pytz'] @@ -21,7 +21,7 @@ entry_points = { setup( name = "pelican", - version = VERSION, + version = __version__, url = 'http://pelican.notmyidea.org/', author = 'Alexis Metaireau', author_email = 'alexis@notmyidea.org', From df8b71f8110566351db3fdc358fcf8ff65d6bdcf Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Fri, 16 Mar 2012 14:27:51 +0000 Subject: [PATCH 0121/2344] remove unused *bat include --- MANIFEST.in | 1 - 1 file changed, 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index fc46d905..a092ecd0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -2,4 +2,3 @@ include *.rst global-include *.py recursive-include pelican *.html *.css *png include LICENSE -global-include *.bat From 26078ecc175764c138b8415c70ba85aecbb81565 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Fri, 16 Mar 2012 14:50:26 +0000 Subject: [PATCH 0122/2344] remove unused colors and refactor more how the escaping is done --- pelican/log.py | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/pelican/log.py b/pelican/log.py index 027743d0..c5e9b688 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -8,31 +8,25 @@ from logging import Formatter, getLogger, StreamHandler RESET_TERM = u'\033[0;m' -def term_color(code): - return lambda text: code + unicode(text) + RESET_TERM +def start_color(index): + return u'\033[1;{0}m'.format(index) + + +def term_color(color): + code = COLOR_CODES[color] + return lambda text: start_color(code) + unicode(text) + RESET_TERM COLOR_CODES = { - 'gray': u'\033[1;30m', - 'red': u'\033[1;31m', - 'green': u'\033[1;32m', - 'yellow': u'\033[1;33m', - 'blue': u'\033[1;34m', - 'magenta': u'\033[1;35m', - 'cyan': u'\033[1;36m', - 'white': u'\033[1;37m', - 'bgred': u'\033[1;41m', - 'bggreen': u'\033[1;42m', - 'bgbrown': u'\033[1;43m', - 'bgblue': u'\033[1;44m', - 'bgmagenta': u'\033[1;45m', - 'bgcyan': u'\033[1;46m', - 'bggray': u'\033[1;47m', - 'bgyellow': u'\033[1;43m', - 'bggrey': u'\033[1;100m', + 'red': 31, + 'yellow': 33, + 'cyan': 36, + 'white': 37, + 'bgred': 41, + 'bggrey': 100, } -ANSI = dict((col, term_color(code)) for col, code in COLOR_CODES.items()) +ANSI = dict((col, term_color(col)) for col in COLOR_CODES) class ANSIFormatter(Formatter): From 173133dbf34b322511feb36663e189709e505949 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Fri, 16 Mar 2012 14:53:28 +0000 Subject: [PATCH 0123/2344] remove couple of extra spaces --- pelican/log.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/log.py b/pelican/log.py index c5e9b688..8811b372 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -1,6 +1,6 @@ import os import sys -from logging import CRITICAL, ERROR, WARN, INFO, DEBUG +from logging import CRITICAL, ERROR, WARN, INFO, DEBUG from logging import critical, error, info, warning, warn, debug from logging import Formatter, getLogger, StreamHandler @@ -74,7 +74,7 @@ class DummyFormatter(object): and not sys.platform.startswith('win'): return ANSIFormatter(*args, **kwargs) else: - return TextFormatter( *args, **kwargs) + return TextFormatter(*args, **kwargs) def init(level=None, logger=getLogger(), handler=StreamHandler()): From 4e4af9d011625f79c04a6ab1d55de892dbaf5149 Mon Sep 17 00:00:00 2001 From: Andrea Crotti Date: Fri, 16 Mar 2012 18:53:08 +0000 Subject: [PATCH 0124/2344] move tools in pelican.tools and add the pelican.tools package to setup.py --- {tools => pelican/tools}/__init__.py | 0 {tools => pelican/tools}/pelican_import.py | 0 {tools => pelican/tools}/pelican_quickstart.py | 0 {tools => pelican/tools}/pelican_themes.py | 0 setup.py | 8 ++++---- 5 files changed, 4 insertions(+), 4 deletions(-) rename {tools => pelican/tools}/__init__.py (100%) rename {tools => pelican/tools}/pelican_import.py (100%) rename {tools => pelican/tools}/pelican_quickstart.py (100%) rename {tools => pelican/tools}/pelican_themes.py (100%) diff --git a/tools/__init__.py b/pelican/tools/__init__.py similarity index 100% rename from tools/__init__.py rename to pelican/tools/__init__.py diff --git a/tools/pelican_import.py b/pelican/tools/pelican_import.py similarity index 100% rename from tools/pelican_import.py rename to pelican/tools/pelican_import.py diff --git a/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py similarity index 100% rename from tools/pelican_quickstart.py rename to pelican/tools/pelican_quickstart.py diff --git a/tools/pelican_themes.py b/pelican/tools/pelican_themes.py similarity index 100% rename from tools/pelican_themes.py rename to pelican/tools/pelican_themes.py diff --git a/setup.py b/setup.py index 910499de..a8e0f57d 100755 --- a/setup.py +++ b/setup.py @@ -13,9 +13,9 @@ except ImportError: entry_points = { 'console_scripts': [ 'pelican = pelican:main', - 'pelican-import = tools.pelican_import:main', - 'pelican-quickstart = tools.pelican_quickstart:main', - 'pelican-themes = tools.pelican_themes:main' + 'pelican-import = pelican.tools.pelican_import:main', + 'pelican-quickstart = pelican.tools.pelican_quickstart:main', + 'pelican-themes = pelican.tools.pelican_themes:main' ] } @@ -27,7 +27,7 @@ setup( author_email = 'alexis@notmyidea.org', description = "A tool to generate a static blog from reStructuredText or Markdown input files.", long_description=open('README.rst').read(), - packages = ['pelican'], + packages = ['pelican', 'pelican.tools'], include_package_data = True, install_requires = requires, entry_points = entry_points, From c75ab513daa0c4b78d2f0ebfd23077fcc6b158e2 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 16 Mar 2012 19:59:03 +0100 Subject: [PATCH 0125/2344] use 'summary' rather than ':summary:' in comments --- pelican/contents.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index d8ccf9f3..2a7dc22a 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -89,7 +89,7 @@ class Page(object): if hasattr(self, 'date') and self.date > datetime.now(): self.status = 'draft' - # store the :summary: metadata if it is set + # store the summary metadata if it is set if 'summary' in metadata: self._summary = metadata['summary'] @@ -126,7 +126,7 @@ class Page(object): return content def _get_summary(self): - """Returns the summary of an article, based on the :summary: metadata + """Returns the summary of an article, based on the summary metadata if it is set, else troncate the content.""" if hasattr(self, '_summary'): return self._summary From 3dcedb60d83e80ecfd16d6440f21f7cfe110bcef Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 16 Mar 2012 20:56:00 +0100 Subject: [PATCH 0126/2344] add irc support to travis-ci --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 8f5dc3a3..89a2ebde 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,3 +6,5 @@ install: - pip install nose unittest2 mock --use-mirrors - pip install . --use-mirrors script: nosetests -s tests +notifications: + irc: "irc.freenode.org#pelican" From 8b846b9fe2eaff627b411ef6af1f9ba1bae2a5b8 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 16 Mar 2012 21:12:48 +0100 Subject: [PATCH 0127/2344] restore back to hardcoded version in setup.py due to import hell --- setup.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/setup.py b/setup.py index 1f75131b..67bbae80 100755 --- a/setup.py +++ b/setup.py @@ -1,8 +1,6 @@ #!/usr/bin/env python from setuptools import setup -from pelican import __version__ - requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'pytz'] try: @@ -16,12 +14,12 @@ entry_points = { 'pelican-import = pelican.tools.pelican_import:main', 'pelican-quickstart = pelican.tools.pelican_quickstart:main', 'pelican-themes = pelican.tools.pelican_themes:main' - ] + ] } setup( name = "pelican", - version = __version__, + version = "3.0", url = 'http://pelican.notmyidea.org/', author = 'Alexis Metaireau', author_email = 'alexis@notmyidea.org', From 4819a830037ec56466a4d0fb35f6441db663774e Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 16 Mar 2012 21:13:24 +0100 Subject: [PATCH 0128/2344] Fix #171. Handle unicode filenames --- pelican/contents.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index 2a7dc22a..3386dba9 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -42,9 +42,10 @@ class Page(object): if 'AUTHOR' in settings: self.author = Author(settings['AUTHOR'], settings) else: + title = filename.decode('utf-8') if filename else self.title self.author = Author(getenv('USER', 'John Doe'), settings) warning(u"Author of `{0}' unknown, assuming that his name is " - "`{1}'".format(filename or self.title, self.author)) + "`{1}'".format(title, self.author)) # manage languages self.in_default_lang = True From cbc609c8f00277efbbb2e17becbc36054526d48f Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 16 Mar 2012 21:23:34 +0100 Subject: [PATCH 0129/2344] only notify build is okay if it was failing previously --- .travis.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 89a2ebde..823c1172 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,4 +7,7 @@ install: - pip install . --use-mirrors script: nosetests -s tests notifications: - irc: "irc.freenode.org#pelican" + irc: + channels: + - "irc.freenode.org#pelican" + on_success: change From 8819d026002bca0e865aa15c00b061190432ec4c Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 16 Mar 2012 20:27:26 -0700 Subject: [PATCH 0130/2344] Allow for serving feeds from a separate domain. This (indirectly) enables support for FeedBurner. Added docs for FeedBurner configuration. Clarify how defining the SITEURL attribute affects URL structure. Closes #177. --- docs/settings.rst | 55 ++++++++++++++++---- pelican/settings.py | 1 + pelican/themes/notmyidea/static/css/main.css | 4 +- pelican/themes/notmyidea/templates/base.html | 8 +-- samples/pelican.conf.py | 1 + 5 files changed, 51 insertions(+), 18 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index b98b649e..301f3d34 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -62,10 +62,13 @@ Setting name (default value) What does it do? `RELATIVE_URLS` (``True``) Defines whether Pelican should use relative URLs or not. `SITENAME` (``'A Pelican Blog'``) Your site name -`SITEURL` Base URL of your website. Note that this is - not a way to tell Pelican whether to use relative URLs - or static ones. You should instead use the - `RELATIVE_URL` setting for that purpose. +`SITEURL` Base URL of your website. Not defined by default, + which means the base URL is assumed to be "/" with a + root-relative URL structure. If `SITEURL` is specified + explicitly, URLs will be generated with an absolute + URL structure (including the domain). If you want to + use relative URLs instead of root-relative or absolute + URLs, you should instead use the `RELATIVE_URL` setting. `STATIC_PATHS` (``['images']``) The static paths you want to have accessible on the output path "static". By default, Pelican will copy the 'images' folder to the @@ -86,10 +89,10 @@ Setting name (default value) What does it do? URL Settings ------------ -You can customize the URL's and locations where files will be saved. The URL's and -SAVE_AS variables use python's format strings. These variables allow you to place -your articles in a location such as '{slug}/index.html' and link to then as -'{slug}' for clean urls. These settings give you the flexibility to place your +You can customize the URLs and locations where files will be saved. The URLs and +SAVE_AS variables use Python's format strings. These variables allow you to place +your articles in a location such as '{slug}/index.html' and link to them as +'{slug}' for clean URLs. These settings give you the flexibility to place your articles and pages anywhere you want. Note: If you specify a datetime directive, it will be substituted using the @@ -216,15 +219,26 @@ the ``TAG_FEED`` and ``TAG_FEED_RSS`` settings: ================================================ ===================================================== Setting name (default value) What does it do? ================================================ ===================================================== -`CATEGORY_FEED` ('feeds/%s.atom.xml'[2]_) Where to put the category Atom feeds. -`CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the category RSS feeds. +`FEED_DOMAIN` (``None``, i.e. base URL is "/") The domain prepended to feed URLs. Since feed URLs + should always be absolute, it is highly recommended + to define this (e.g., "http://feeds.example.com"). If + you have already explicitly defined SITEURL (see + above) and want to use the same domain for your + feeds, you can just set: `FEED_DOMAIN = SITEURL` `FEED` (``'feeds/all.atom.xml'``) Relative URL to output the Atom feed. `FEED_RSS` (``None``, i.e. no RSS) Relative URL to output the RSS feed. -`TAG_FEED` (``None``, ie no tag feed) Relative URL to output the tag Atom feed. It should +`CATEGORY_FEED` ('feeds/%s.atom.xml'[2]_) Where to put the category Atom feeds. +`CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the category RSS feeds. +`TAG_FEED` (``None``, i.e. no tag feed) Relative URL to output the tag Atom feed. It should be defined using a "%s" match in the tag name. `TAG_FEED_RSS` (``None``, ie no RSS tag feed) Relative URL to output the tag RSS feed `FEED_MAX_ITEMS` Maximum number of items allowed in a feed. Feed item quantity is unrestricted by default. +`FEED_MAIN_URL` (``'feeds/all.atom.xml'``) URL appended to domain for the main Atom feed and + used to populate its `` in the base template. + Useful when you want the feed link to differ from the + filesystem path, such as when using web server + aliases/rewrites or FeedBurner (see below). ================================================ ===================================================== If you don't want to generate some of these feeds, set ``None`` to the @@ -232,6 +246,25 @@ variables above. .. [2] %s is the name of the category. +FeedBurner +---------- + +If you want to use FeedBurner for your primary Atom feed, there are two +primary fields to configure in the `FeedBurner +`_ interface: "Original Feed" and "Feed Address". +If using the default Pelican `FEED` attribute and assuming your feeds +are served from the `www.example.com` domain, you would enter +`http://www.example.com/feeds/all.atom.xml` in the "Original Feed" field in +FeedBurner. + +For the "Feed Address" field in the FeedBurner interface, you may choose +whatever suffix you prefer. In your Pelican settings, assign this suffix to +the `FEED_MAIN_URL` setting. So if your FeedBurner feed address is set to +`http://feeds.feedburner.com/myblogfeed`, in your Pelican settings you would +set: `FEED_MAIN_URL = "myblogfeed"`. Then set the `FEED_DOMAIN` setting to +`http://feeds.feedburner.com`, or `http://feeds.example.com` if you are using +a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature). + Pagination ========== diff --git a/pelican/settings.py b/pelican/settings.py index b38a99fd..59dc5922 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -18,6 +18,7 @@ _DEFAULT_CONFIG = {'PATH': None, 'STATIC_PATHS': ['images', ], 'THEME_STATIC_PATHS': ['static', ], 'FEED': 'feeds/all.atom.xml', + 'FEED_MAIN_URL': 'feeds/all.atom.xml', 'CATEGORY_FEED': 'feeds/%s.atom.xml', 'TRANSLATION_FEED': 'feeds/all-%s.atom.xml', 'FEED_MAX_ITEMS': '', diff --git a/pelican/themes/notmyidea/static/css/main.css b/pelican/themes/notmyidea/static/css/main.css index 7534790f..28c98b99 100644 --- a/pelican/themes/notmyidea/static/css/main.css +++ b/pelican/themes/notmyidea/static/css/main.css @@ -26,8 +26,6 @@ body { text-align: left; } - - /* Headings */ h1 {font-size: 2em } h2 {font-size: 1.571em} /* 22px */ @@ -304,7 +302,7 @@ img.left, figure.left {float: right; margin: 0 0 2em 2em;} .social a[href*='digg.com'] {background-image: url('../images/icons/digg.png');} .social a[href*='facebook.com'] {background-image: url('../images/icons/facebook.png');} .social a[href*='last.fm'], .social a[href*='lastfm.'] {background-image: url('../images/icons/lastfm.png');} - .social a[href*='atom.xml'] {background-image: url('../images/icons/rss.png');} + .social a[type$='atom+xml'], .social a[type$='rss+xml'] {background-image: url('../images/icons/rss.png');} .social a[href*='twitter.com'] {background-image: url('../images/icons/twitter.png');} .social a[href*='linkedin.com'] {background-image: url('../images/icons/linkedin.png');} diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 12086dc7..0fd388cf 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -4,9 +4,9 @@ {% block title %}{{ SITENAME }}{%endblock%} - + {% if FEED_RSS %} - + {% endif %} + + + + + + + + + +

    + +
    + +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/archives.html b/tests/output/basic/archives.html new file mode 100644 index 00000000..840dfa02 --- /dev/null +++ b/tests/output/basic/archives.html @@ -0,0 +1,94 @@ + + + + A Pelican Blog + + + + + + + + + + + + + + + + + +
    +

    Archives for A Pelican Blog

    + +
    + +
    Fri 15 October 2010
    +
    Unbelievable !
    + +
    Wed 20 October 2010
    +
    Oh yeah !
    + +
    Thu 02 December 2010
    +
    This is a super article !
    + +
    Thu 17 February 2011
    +
    Article 1
    + +
    Thu 17 February 2011
    +
    Article 2
    + +
    Thu 17 February 2011
    +
    Article 3
    + +
    Wed 20 April 2011
    +
    A markdown powered article
    + +
    Wed 29 February 2012
    +
    Second article
    + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/article-1.html b/tests/output/basic/article-1.html new file mode 100644 index 00000000..c1199371 --- /dev/null +++ b/tests/output/basic/article-1.html @@ -0,0 +1,90 @@ + + + + Article 1 + + + + + + + + + + + + + + + + + +
    +
    +

    Article 1

    +
    +
    + + Thu 17 February 2011 + + + +
    + By bruno +
    + +

    In cat1.

    + + + +
    +

    Article 1

    + +
    + + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/article-2.html b/tests/output/basic/article-2.html new file mode 100644 index 00000000..62dd0368 --- /dev/null +++ b/tests/output/basic/article-2.html @@ -0,0 +1,90 @@ + + + + Article 2 + + + + + + + + + + + + + + + + + +
    +
    +

    Article 2

    +
    +
    + + Thu 17 February 2011 + + + +
    + By bruno +
    + +

    In cat1.

    + + + +
    +

    Article 2

    + +
    + + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/article-3.html b/tests/output/basic/article-3.html new file mode 100644 index 00000000..9fd6df0a --- /dev/null +++ b/tests/output/basic/article-3.html @@ -0,0 +1,90 @@ + + + + Article 3 + + + + + + + + + + + + + + + + + +
    +
    +

    Article 3

    +
    +
    + + Thu 17 February 2011 + + + +
    + By bruno +
    + +

    In cat1.

    + + + +
    +

    Article 3

    + +
    + + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/author/alexis-metaireau.html b/tests/output/basic/author/alexis-metaireau.html new file mode 100644 index 00000000..eda5498d --- /dev/null +++ b/tests/output/basic/author/alexis-metaireau.html @@ -0,0 +1,151 @@ + + + + A Pelican Blog - Alexis Métaireau + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + +
    +
    + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/author/bruno.html b/tests/output/basic/author/bruno.html new file mode 100644 index 00000000..fdc1da37 --- /dev/null +++ b/tests/output/basic/author/bruno.html @@ -0,0 +1,281 @@ + + + + A Pelican Blog - bruno + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. + + + + + + + +
    4. + + + + + + + +
    5. + + + + + + +
    +
    + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/categories.html b/tests/output/basic/categories.html new file mode 100644 index 00000000..5ffb220d --- /dev/null +++ b/tests/output/basic/categories.html @@ -0,0 +1,74 @@ + + + + A Pelican Blog + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/category/bar.html b/tests/output/basic/category/bar.html new file mode 100644 index 00000000..07dcae9e --- /dev/null +++ b/tests/output/basic/category/bar.html @@ -0,0 +1,109 @@ + + + + A Pelican Blog - bar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/category/cat1.html b/tests/output/basic/category/cat1.html new file mode 100644 index 00000000..bee9d918 --- /dev/null +++ b/tests/output/basic/category/cat1.html @@ -0,0 +1,208 @@ + + + + A Pelican Blog - cat1 + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. + + + + + + +
    +
    + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/category/content.html b/tests/output/basic/category/content.html new file mode 100644 index 00000000..1c09459d --- /dev/null +++ b/tests/output/basic/category/content.html @@ -0,0 +1,146 @@ + + + + A Pelican Blog - content + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + +
    +
    + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/category/yeah.html b/tests/output/basic/category/yeah.html new file mode 100644 index 00000000..cc146893 --- /dev/null +++ b/tests/output/basic/category/yeah.html @@ -0,0 +1,110 @@ + + + + A Pelican Blog - yeah + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/drafts/a-draft-article.html b/tests/output/basic/drafts/a-draft-article.html new file mode 100644 index 00000000..59b6223f --- /dev/null +++ b/tests/output/basic/drafts/a-draft-article.html @@ -0,0 +1,91 @@ + + + + A draft article + + + + + + + + + + + + + + + + + +
    +
    +

    A draft article

    +
    +
    + + Fri 02 March 2012 + + + +
    + By bruno +
    + +

    In content.

    + + + +
    +

    This is a draft article, it should live under the /drafts/ folder and not be +listed anywhere else.

    + +
    + + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/feeds/all-en.atom.xml b/tests/output/basic/feeds/all-en.atom.xml new file mode 100644 index 00000000..c9fe8270 --- /dev/null +++ b/tests/output/basic/feeds/all-en.atom.xml @@ -0,0 +1,25 @@ + +A Pelican Blog../.2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbruno.././second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00Zbruno.././a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbruno.././article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00Zbruno.././article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00Zbruno.././article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00ZAlexis Métaireau.././this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00ZAlexis Métaireau.././oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Unbelievable !2010-10-15T20:30:00Zbruno.././unbelievable.html<p>Or completely awesome. Depends the needs.</p> + \ No newline at end of file diff --git a/tests/output/basic/feeds/all-fr.atom.xml b/tests/output/basic/feeds/all-fr.atom.xml new file mode 100644 index 00000000..606e5186 --- /dev/null +++ b/tests/output/basic/feeds/all-fr.atom.xml @@ -0,0 +1,4 @@ + +A Pelican Blog../.2012-03-02T14:01:01ZTrop bien !2012-03-02T14:01:01Zbruno.././oh-yeah-fr.html<p>Et voila du contenu en français</p> +Deuxième article2012-02-29T00:00:00Zbruno.././second-article-fr.html<p>Ceci est un article, en français.</p> + \ No newline at end of file diff --git a/tests/output/basic/feeds/all.atom.xml b/tests/output/basic/feeds/all.atom.xml new file mode 100644 index 00000000..3bb7d2fd --- /dev/null +++ b/tests/output/basic/feeds/all.atom.xml @@ -0,0 +1,25 @@ + +A Pelican Blog../.2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbruno.././second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00Zbruno.././a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbruno.././article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00Zbruno.././article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00Zbruno.././article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00ZAlexis Métaireau.././this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00ZAlexis Métaireau.././oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Unbelievable !2010-10-15T20:30:00Zbruno.././unbelievable.html<p>Or completely awesome. Depends the needs.</p> + \ No newline at end of file diff --git a/tests/output/basic/feeds/bar.atom.xml b/tests/output/basic/feeds/bar.atom.xml new file mode 100644 index 00000000..6ce45518 --- /dev/null +++ b/tests/output/basic/feeds/bar.atom.xml @@ -0,0 +1,8 @@ + +A Pelican Blog../.2010-10-20T10:14:00ZOh yeah !2010-10-20T10:14:00ZAlexis Métaireau.././oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> + \ No newline at end of file diff --git a/tests/output/basic/feeds/cat1.atom.xml b/tests/output/basic/feeds/cat1.atom.xml new file mode 100644 index 00000000..f66c2e73 --- /dev/null +++ b/tests/output/basic/feeds/cat1.atom.xml @@ -0,0 +1,5 @@ + +A Pelican Blog../.2011-04-20T00:00:00ZA markdown powered article2011-04-20T00:00:00Zbruno.././a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbruno.././article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00Zbruno.././article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00Zbruno.././article-3.html<p>Article 3</p> + \ No newline at end of file diff --git a/tests/output/basic/feeds/content.atom.xml b/tests/output/basic/feeds/content.atom.xml new file mode 100644 index 00000000..0cf53aa7 --- /dev/null +++ b/tests/output/basic/feeds/content.atom.xml @@ -0,0 +1,4 @@ + +A Pelican Blog../.2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbruno.././second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00Zbruno.././unbelievable.html<p>Or completely awesome. Depends the needs.</p> + \ No newline at end of file diff --git a/tests/output/basic/feeds/yeah.atom.xml b/tests/output/basic/feeds/yeah.atom.xml new file mode 100644 index 00000000..7fd8e9f2 --- /dev/null +++ b/tests/output/basic/feeds/yeah.atom.xml @@ -0,0 +1,14 @@ + +A Pelican Blog../.2010-12-02T10:14:00ZThis is a super article !2010-12-02T10:14:00ZAlexis Métaireau.././this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> + \ No newline at end of file diff --git a/tests/output/basic/index.html b/tests/output/basic/index.html new file mode 100644 index 00000000..be97e8c8 --- /dev/null +++ b/tests/output/basic/index.html @@ -0,0 +1,359 @@ + + + + A Pelican Blog + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. + + + + + + + +
    4. + + + + + + + +
    5. + + + + + + + +
    6. +
      +

      Oh yeah !

      +
      + +
      + +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more + +
      +
    7. + + + + + + + +
    8. + + + + + + +
    +
    + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/oh-yeah-fr.html b/tests/output/basic/oh-yeah-fr.html new file mode 100644 index 00000000..55eec103 --- /dev/null +++ b/tests/output/basic/oh-yeah-fr.html @@ -0,0 +1,95 @@ + + + + Trop bien ! + + + + + + + + + + + + + + + + + +
    +
    +

    Trop bien !

    +
    +
    + + Fri 02 March 2012 + + + +
    + By bruno +
    + +

    In content.

    + + + +Translations: + + en + + +
    +

    Et voila du contenu en français

    + +
    + + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/oh-yeah.html b/tests/output/basic/oh-yeah.html new file mode 100644 index 00000000..4b650e7d --- /dev/null +++ b/tests/output/basic/oh-yeah.html @@ -0,0 +1,100 @@ + + + + Oh yeah ! + + + + + + + + + + + + + + + + + +
    +
    +

    Oh yeah !

    +
    + +
    +

    Why not ?

    +

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

    +alternate text +
    + +
    + + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/pages/this-is-a-test-page.html b/tests/output/basic/pages/this-is-a-test-page.html new file mode 100644 index 00000000..0162232c --- /dev/null +++ b/tests/output/basic/pages/this-is-a-test-page.html @@ -0,0 +1,70 @@ + + + + This is a test page + + + + + + + + + + + + + + + + + +
    +

    This is a test page

    + +

    Just an image.

    +alternate text + +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/second-article-fr.html b/tests/output/basic/second-article-fr.html new file mode 100644 index 00000000..704971d2 --- /dev/null +++ b/tests/output/basic/second-article-fr.html @@ -0,0 +1,95 @@ + + + + Deuxième article + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/second-article.html b/tests/output/basic/second-article.html new file mode 100644 index 00000000..94043446 --- /dev/null +++ b/tests/output/basic/second-article.html @@ -0,0 +1,95 @@ + + + + Second article + + + + + + + + + + + + + + + + + +
    + +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/tag/bar.html b/tests/output/basic/tag/bar.html new file mode 100644 index 00000000..8fc4e143 --- /dev/null +++ b/tests/output/basic/tag/bar.html @@ -0,0 +1,229 @@ + + + + A Pelican Blog - bar + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. +
      +

      Oh yeah !

      +
      + +
      + +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more + +
      +
    4. + + + + + + +
    +
    + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/tag/baz.html b/tests/output/basic/tag/baz.html new file mode 100644 index 00000000..9f773873 --- /dev/null +++ b/tests/output/basic/tag/baz.html @@ -0,0 +1,151 @@ + + + + A Pelican Blog - baz + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + +
    +
    + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/tag/foo.html b/tests/output/basic/tag/foo.html new file mode 100644 index 00000000..73de8459 --- /dev/null +++ b/tests/output/basic/tag/foo.html @@ -0,0 +1,185 @@ + + + + A Pelican Blog - foo + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + +
    +
    + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/tag/foobar.html b/tests/output/basic/tag/foobar.html new file mode 100644 index 00000000..55ddfe78 --- /dev/null +++ b/tests/output/basic/tag/foobar.html @@ -0,0 +1,110 @@ + + + + A Pelican Blog - foobar + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/tag/oh.html b/tests/output/basic/tag/oh.html new file mode 100644 index 00000000..a8839f52 --- /dev/null +++ b/tests/output/basic/tag/oh.html @@ -0,0 +1,109 @@ + + + + A Pelican Blog - oh + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/tag/yeah.html b/tests/output/basic/tag/yeah.html new file mode 100644 index 00000000..5ff2b2e0 --- /dev/null +++ b/tests/output/basic/tag/yeah.html @@ -0,0 +1,109 @@ + + + + A Pelican Blog - yeah + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/tags.html b/tests/output/basic/tags.html new file mode 100644 index 00000000..e69de29b diff --git a/tests/output/basic/theme/css/main.css b/tests/output/basic/theme/css/main.css new file mode 100644 index 00000000..28c98b99 --- /dev/null +++ b/tests/output/basic/theme/css/main.css @@ -0,0 +1,423 @@ +/* + Name: Smashing HTML5 + Date: July 2009 + Description: Sample layout for HTML5 and CSS3 goodness. + Version: 1.0 + Author: Enrique Ramírez + Autor URI: http://enrique-ramirez.com +*/ + +/* Imports */ +@import url("reset.css"); +@import url("pygment.css"); +@import url("typogrify.css"); +@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz&subset=latin); + +/***** Global *****/ +/* Body */ +body { + background: #F5F4EF; + color: #000305; + font-size: 87.5%; /* Base font size: 14px */ + font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; + line-height: 1.429; + margin: 0; + padding: 0; + text-align: left; +} + +/* Headings */ +h1 {font-size: 2em } +h2 {font-size: 1.571em} /* 22px */ +h3 {font-size: 1.429em} /* 20px */ +h4 {font-size: 1.286em} /* 18px */ +h5 {font-size: 1.143em} /* 16px */ +h6 {font-size: 1em} /* 14px */ + +h1, h2, h3, h4, h5, h6 { + font-weight: 400; + line-height: 1.1; + margin-bottom: .8em; + font-family: 'Yanone Kaffeesatz', arial, serif; +} + +h3, h4, h5, h6 { margin-top: .8em; } + +hr { border: 2px solid #EEEEEE; } + +/* Anchors */ +a {outline: 0;} +a img {border: 0px; text-decoration: none;} +a:link, a:visited { + color: #C74350; + padding: 0 1px; + text-decoration: underline; +} +a:hover, a:active { + background-color: #C74350; + color: #fff; + text-decoration: none; + text-shadow: 1px 1px 1px #333; +} + +h1 a:hover { + background-color: inherit +} + +/* Paragraphs */ +p {margin-bottom: 1.143em;} + +strong, b {font-weight: bold;} +em, i {font-style: italic;} + +::-moz-selection {background: #F6CF74; color: #fff;} +::selection {background: #F6CF74; color: #fff;} + +/* Lists */ +ul { + list-style: outside disc; + margin: 1em 0 1.5em 1.5em; +} + +ol { + list-style: outside decimal; + margin: 1em 0 1.5em 1.5em; +} + +.post-info { + float:right; + margin:10px; + padding:5px; +} + +.post-info p{ + margin-bottom: 1px; +} + +.readmore { float: right } + +dl {margin: 0 0 1.5em 0;} +dt {font-weight: bold;} +dd {margin-left: 1.5em;} + +pre{background-color: #000; padding: 10px; color: #fff; margin: 10px; overflow: auto;} + +/* Quotes */ +blockquote { + margin: 20px; + font-style: italic; +} +cite {} + +q {} + +/* Tables */ +table {margin: .5em auto 1.5em auto; width: 98%;} + + /* Thead */ + thead th {padding: .5em .4em; text-align: left;} + thead td {} + + /* Tbody */ + tbody td {padding: .5em .4em;} + tbody th {} + + tbody .alt td {} + tbody .alt th {} + + /* Tfoot */ + tfoot th {} + tfoot td {} + +/* HTML5 tags */ +header, section, footer, +aside, nav, article, figure { + display: block; +} + +/***** Layout *****/ +.body {clear: both; margin: 0 auto; width: 800px;} +img.right figure.right {float: right; margin: 0 0 2em 2em;} +img.left, figure.left {float: right; margin: 0 0 2em 2em;} + +/* + Header +*****************/ +#banner { + margin: 0 auto; + padding: 2.5em 0 0 0; +} + + /* Banner */ + #banner h1 {font-size: 3.571em; line-height: 0;} + #banner h1 a:link, #banner h1 a:visited { + color: #000305; + display: block; + font-weight: bold; + margin: 0 0 .6em .2em; + text-decoration: none; + width: 427px; + } + #banner h1 a:hover, #banner h1 a:active { + background: none; + color: #C74350; + text-shadow: none; + } + + #banner h1 strong {font-size: 0.36em; font-weight: normal;} + + /* Main Nav */ + #banner nav { + background: #000305; + font-size: 1.143em; + height: 40px; + line-height: 30px; + margin: 0 auto 2em auto; + padding: 0; + text-align: center; + width: 800px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + + #banner nav ul {list-style: none; margin: 0 auto; width: 800px;} + #banner nav li {float: left; display: inline; margin: 0;} + + #banner nav a:link, #banner nav a:visited { + color: #fff; + display: inline-block; + height: 30px; + padding: 5px 1.5em; + text-decoration: none; + } + #banner nav a:hover, #banner nav a:active, + #banner nav .active a:link, #banner nav .active a:visited { + background: #C74451; + color: #fff; + text-shadow: none !important; + } + + #banner nav li:first-child a { + border-top-left-radius: 5px; + -moz-border-radius-topleft: 5px; + -webkit-border-top-left-radius: 5px; + + border-bottom-left-radius: 5px; + -moz-border-radius-bottomleft: 5px; + -webkit-border-bottom-left-radius: 5px; + } + +/* + Featured +*****************/ +#featured { + background: #fff; + margin-bottom: 2em; + overflow: hidden; + padding: 20px; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +#featured figure { + border: 2px solid #eee; + float: right; + margin: 0.786em 2em 0 5em; + width: 248px; +} +#featured figure img {display: block; float: right;} + +#featured h2 {color: #C74451; font-size: 1.714em; margin-bottom: 0.333em;} +#featured h3 {font-size: 1.429em; margin-bottom: .5em;} + +#featured h3 a:link, #featured h3 a:visited {color: #000305; text-decoration: none;} +#featured h3 a:hover, #featured h3 a:active {color: #fff;} + +/* + Body +*****************/ +#content { + background: #fff; + margin-bottom: 2em; + overflow: hidden; + padding: 20px 20px; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +/* + Extras +*****************/ +#extras {margin: 0 auto 3em auto; overflow: hidden;} + +#extras ul {list-style: none; margin: 0;} +#extras li {border-bottom: 1px solid #fff;} +#extras h2 { + color: #C74350; + font-size: 1.429em; + margin-bottom: .25em; + padding: 0 3px; +} + +#extras a:link, #extras a:visited { + color: #444; + display: block; + border-bottom: 1px solid #F4E3E3; + text-decoration: none; + padding: .3em .25em; +} + +#extras a:hover, #extras a:active {color: #fff;} + + /* Blogroll */ + #extras .blogroll { + float: left; + width: 615px; + } + + #extras .blogroll li {float: left; margin: 0 20px 0 0; width: 185px;} + + /* Social */ + #extras .social { + float: right; + width: 175px; + } + + #extras div[class='social'] a { + background-repeat: no-repeat; + background-position: 3px 6px; + padding-left: 25px; + } + + /* Icons */ + .social a[href*='delicious.com'] {background-image: url('../images/icons/delicious.png');} + .social a[href*='digg.com'] {background-image: url('../images/icons/digg.png');} + .social a[href*='facebook.com'] {background-image: url('../images/icons/facebook.png');} + .social a[href*='last.fm'], .social a[href*='lastfm.'] {background-image: url('../images/icons/lastfm.png');} + .social a[type$='atom+xml'], .social a[type$='rss+xml'] {background-image: url('../images/icons/rss.png');} + .social a[href*='twitter.com'] {background-image: url('../images/icons/twitter.png');} + .social a[href*='linkedin.com'] {background-image: url('../images/icons/linkedin.png');} + +/* + About +*****************/ +#about { + background: #fff; + font-style: normal; + margin-bottom: 2em; + overflow: hidden; + padding: 20px; + text-align: left; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +#about .primary {float: left; width: 165px;} +#about .primary strong {color: #C64350; display: block; font-size: 1.286em;} +#about .photo {float: left; margin: 5px 20px;} + +#about .url:link, #about .url:visited {text-decoration: none;} + +#about .bio {float: right; width: 500px;} + +/* + Footer +*****************/ +#contentinfo {padding-bottom: 2em; text-align: right;} + +/***** Sections *****/ +/* Blog */ +.hentry { + display: block; + clear: both; + border-bottom: 1px solid #eee; + padding: 1.5em 0; +} +li:last-child .hentry, #content > .hentry {border: 0; margin: 0;} +#content > .hentry {padding: 1em 0;} +.hentry img{display : none ;} +.entry-title {font-size: 3em; margin-bottom: 10px; margin-top: 0;} +.entry-title a:link, .entry-title a:visited {text-decoration: none; color: #333;} +.entry-title a:visited {background-color: #fff;} + +.hentry .post-info * {font-style: normal;} + + /* Content */ + .hentry footer {margin-bottom: 2em;} + .hentry footer address {display: inline;} + #posts-list footer address {display: block;} + + /* Blog Index */ + #posts-list {list-style: none; margin: 0;} + #posts-list .hentry {padding-left: 10px; position: relative;} + + #posts-list footer { + left: 10px; + position: relative; + float: left; + top: 0.5em; + width: 190px; + } + + /* About the Author */ + #about-author { + background: #f9f9f9; + clear: both; + font-style: normal; + margin: 2em 0; + padding: 10px 20px 15px 20px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + + #about-author strong { + color: #C64350; + clear: both; + display: block; + font-size: 1.429em; + } + + #about-author .photo {border: 1px solid #ddd; float: left; margin: 5px 1em 0 0;} + + /* Comments */ + #comments-list {list-style: none; margin: 0 1em;} + #comments-list blockquote { + background: #f8f8f8; + clear: both; + font-style: normal; + margin: 0; + padding: 15px 20px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + #comments-list footer {color: #888; padding: .5em 1em 0 0; text-align: right;} + + #comments-list li:nth-child(2n) blockquote {background: #F5f5f5;} + + /* Add a Comment */ + #add-comment label {clear: left; float: left; text-align: left; width: 150px;} + #add-comment input[type='text'], + #add-comment input[type='email'], + #add-comment input[type='url'] {float: left; width: 200px;} + + #add-comment textarea {float: left; height: 150px; width: 495px;} + + #add-comment p.req {clear: both; margin: 0 .5em 1em 0; text-align: right;} + + #add-comment input[type='submit'] {float: right; margin: 0 .5em;} + #add-comment * {margin-bottom: .5em;} diff --git a/tests/output/basic/theme/css/pygment.css b/tests/output/basic/theme/css/pygment.css new file mode 100644 index 00000000..594b0fa3 --- /dev/null +++ b/tests/output/basic/theme/css/pygment.css @@ -0,0 +1,205 @@ +.hll { +background-color:#FFFFCC; +} +.c { +color:#408090; +font-style:italic; +} +.err { +border:1px solid #FF0000; +} +.k { +color:#007020; +font-weight:bold; +} +.o { +color:#666666; +} +.cm { +color:#408090; +font-style:italic; +} +.cp { +color:#007020; +} +.c1 { +color:#408090; +font-style:italic; +} +.cs { +background-color:#FFF0F0; +color:#408090; +} +.gd { +color:#A00000; +} +.ge { +font-style:italic; +} +.gr { +color:#FF0000; +} +.gh { +color:#000080; +font-weight:bold; +} +.gi { +color:#00A000; +} +.go { +color:#303030; +} +.gp { +color:#C65D09; +font-weight:bold; +} +.gs { +font-weight:bold; +} +.gu { +color:#800080; +font-weight:bold; +} +.gt { +color:#0040D0; +} +.kc { +color:#007020; +font-weight:bold; +} +.kd { +color:#007020; +font-weight:bold; +} +.kn { +color:#007020; +font-weight:bold; +} +.kp { +color:#007020; +} +.kr { +color:#007020; +font-weight:bold; +} +.kt { +color:#902000; +} +.m { +color:#208050; +} +.s { +color:#4070A0; +} +.na { +color:#4070A0; +} +.nb { +color:#007020; +} +.nc { +color:#0E84B5; +font-weight:bold; +} +.no { +color:#60ADD5; +} +.nd { +color:#555555; +font-weight:bold; +} +.ni { +color:#D55537; +font-weight:bold; +} +.ne { +color:#007020; +} +.nf { +color:#06287E; +} +.nl { +color:#002070; +font-weight:bold; +} +.nn { +color:#0E84B5; +font-weight:bold; +} +.nt { +color:#062873; +font-weight:bold; +} +.nv { +color:#BB60D5; +} +.ow { +color:#007020; +font-weight:bold; +} +.w { +color:#BBBBBB; +} +.mf { +color:#208050; +} +.mh { +color:#208050; +} +.mi { +color:#208050; +} +.mo { +color:#208050; +} +.sb { +color:#4070A0; +} +.sc { +color:#4070A0; +} +.sd { +color:#4070A0; +font-style:italic; +} +.s2 { +color:#4070A0; +} +.se { +color:#4070A0; +font-weight:bold; +} +.sh { +color:#4070A0; +} +.si { +color:#70A0D0; +font-style:italic; +} +.sx { +color:#C65D09; +} +.sr { +color:#235388; +} +.s1 { +color:#4070A0; +} +.ss { +color:#517918; +} +.bp { +color:#007020; +} +.vc { +color:#BB60D5; +} +.vg { +color:#BB60D5; +} +.vi { +color:#BB60D5; +} +.il { +color:#208050; +} diff --git a/tests/output/basic/theme/css/reset.css b/tests/output/basic/theme/css/reset.css new file mode 100644 index 00000000..1e217566 --- /dev/null +++ b/tests/output/basic/theme/css/reset.css @@ -0,0 +1,52 @@ +/* + Name: Reset Stylesheet + Description: Resets browser's default CSS + Author: Eric Meyer + Author URI: http://meyerweb.com/eric/tools/css/reset/ +*/ + +/* v1.0 | 20080212 */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + background: transparent; + border: 0; + font-size: 100%; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; +} + +body {line-height: 1;} + +ol, ul {list-style: none;} + +blockquote, q {quotes: none;} + +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} + +/* remember to define focus styles! */ +:focus { + outline: 0; +} + +/* remember to highlight inserts somehow! */ +ins {text-decoration: none;} +del {text-decoration: line-through;} + +/* tables still need 'cellspacing="0"' in the markup */ +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/tests/output/basic/theme/css/typogrify.css b/tests/output/basic/theme/css/typogrify.css new file mode 100644 index 00000000..c9b34dc8 --- /dev/null +++ b/tests/output/basic/theme/css/typogrify.css @@ -0,0 +1,3 @@ +.caps {font-size:.92em;} +.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;} +.dquo {margin-left:-.38em;} diff --git a/tests/output/basic/theme/css/wide.css b/tests/output/basic/theme/css/wide.css new file mode 100644 index 00000000..3376f4c7 --- /dev/null +++ b/tests/output/basic/theme/css/wide.css @@ -0,0 +1,43 @@ +@import url("main.css"); + +body { + font:1.3em/1.3 "Hoefler Text","Georgia",Georgia,serif,sans-serif; +} + +.body, #banner nav, #banner nav ul, #about, #featured, #content{ + width: inherit; +} + +#banner nav { + -moz-border-radius: 0px; + margin-bottom: 0px; +} + +#banner nav ul{ + padding-right: 50px; +} + +#banner nav li{ + float: right; +} + +#banner nav li:first-child a { + -moz-border-radius: 0px; +} + +#banner h1 { + margin-bottom: -18px; +} + +#featured, #extras { + padding: 50px; +} + +#featured { + padding-top: 20px; +} + +#extras { + padding-top: 0px; + padding-bottom: 0px; +} diff --git a/tests/output/basic/theme/images/icons/delicious.png b/tests/output/basic/theme/images/icons/delicious.png new file mode 100644 index 0000000000000000000000000000000000000000..c6ce246a4602f8f74e75ea8cfe9f5a00daceeb33 GIT binary patch literal 963 zcmV;!13dhRP)6?8>dbVG7wVRUJ4ZXi@?ZDjy5FfTVRFgbe517iRH0~|?2 zK~y-6Ws<#bTV))DpZogtjeX;f*md33No`1zmc&$+7>H1WP&XnFV&q?F7ZxN~K zI2_i~X=|=poxD)3){1kpXG^wzH)G`%n@9Vdqh@z9)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GxNkhUPq-2wz)=f;d|VTS>(_pozKqU?$^1Owke!?hd2rd&Yas!y5|W3+lTtY z!z}DSdabr?Qi6+9A|etm)g_qyLlP1B=gm)K`S?d7BI4Eq5fQOrB!9hrQs&YV^7qRp z7QGM0p8UXThn4QPSBP)lMHdUGR-5+ev-GB}(w$#GXS3*$Av)h&Vdd0mg5PeU%O!HV zMiS5;aca`gZ*9{qBCi% zwUAF?iaAuy$I}{@62$Y6SYsQj=uRIhTT$bq7frj6{xp7O*Nmx-Io0hc+Y3_?M%yHe z262>Cw^!CiWpLK0R3;#J&y{nbj~!kB0000Wd_Fj7M_G{R}1CBkLw_JJn z>DQmab*CL>?Ok)>!PFzy{Acg}|Np;3*ZSPGC!W6l5w&pt&tHEg9=P)1$FJ6%7tcO? zWxgW&B*^ZPAirP+hi5m^K%69RcNc~ZR#^`qhqJ&VvY3H^TNs2H8D`Cq01C2~c>21s z-{R(FQ&rw_X(1C(sL|8KF+}2W>G_L%hZJ~NFD#lIs%=oPMZxdy|Meo%9>~ox&zv>K zB$L~r*j87(8A5T-G@yGywqOA)@^N literal 0 HcmV?d00001 diff --git a/tests/output/basic/theme/images/icons/rss.png b/tests/output/basic/theme/images/icons/rss.png new file mode 100644 index 0000000000000000000000000000000000000000..7d4e85d981cbecb04b76dab5a234dc4690bd15ab GIT binary patch literal 896 zcmV-`1AqL9P)6?8>dbVG7wVRUJ4ZXi@?ZDjy5FfTVRFgbe517iRH0@+DK zK~y-6O_EE9990yCzjLd)r^ifBchXK`gN{uSqd0=7kbqhEAc*5eg)D?1#7z(k=t4x? zNsw9SGD{(noh~9MD2X6K0zO7JK4L<2NIQAV^f*1~?yBm#RrlWGqBZ!h4jlgP{QMl@ zU+I@e9$=>SEYtNmqqUus!wx3gi-~73je=sdif|T*ZW7`utw+wuWACgAfSy0TMEK!t zYE6(SC>(?md;vs&h4d<9>k!o-OF=;&Jh2#spFTJsviuSC-JmTPu0b(`Yz>m@kp2nd zRUig43#A1DSVeq#S1i(h1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-6WjkSOxqI8lZby8$e#HGsFt|IeRjDqpm zML6j5KgJ&}?sjk?L0=gaEkZEWxnu^x*ouKGV-T<%#5XgzvxIM_;z0uk!Pqr1>k3VF z%#~A>m=_FUVuf*a1bYTq;^qW4X5)ydX*`^pjC>R_4c + + + This is a super article ! + + + + + + + + + + + + + + + + + +
    +
    +

    This is a super article !

    +
    + +

    Some content here !

    +
    +

    This is a simple title

    +

    And here comes the cool stuff.

    +alternate text +alternate text +
    +>>> from ipdb import set_trace
    +>>> set_trace()
    +
    +

    → And now try with some utf8 hell: ééé

    +
    + +
    + + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/unbelievable.html b/tests/output/basic/unbelievable.html new file mode 100644 index 00000000..4c6e6b07 --- /dev/null +++ b/tests/output/basic/unbelievable.html @@ -0,0 +1,90 @@ + + + + Unbelievable ! + + + + + + + + + + + + + + + + + +
    +
    +

    Unbelievable !

    +
    +
    + + Fri 15 October 2010 + + + +
    + By bruno +
    + +

    In content.

    + + + +
    +

    Or completely awesome. Depends the needs.

    + +
    + + +
    +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/a-markdown-powered-article.html b/tests/output/custom/a-markdown-powered-article.html new file mode 100644 index 00000000..c001278a --- /dev/null +++ b/tests/output/custom/a-markdown-powered-article.html @@ -0,0 +1,157 @@ + + + + A markdown powered article + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    A markdown powered article

    +
    + +

    You're mutually oblivious.

    +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/archives.html b/tests/output/custom/archives.html new file mode 100644 index 00000000..e9393667 --- /dev/null +++ b/tests/output/custom/archives.html @@ -0,0 +1,149 @@ + + + + Alexis' log + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +

    Archives for Alexis' log

    + +
    + +
    Fri 15 October 2010
    +
    Unbelievable !
    + +
    Wed 20 October 2010
    +
    Oh yeah !
    + +
    Thu 02 December 2010
    +
    This is a super article !
    + +
    Thu 17 February 2011
    +
    Article 1
    + +
    Thu 17 February 2011
    +
    Article 2
    + +
    Thu 17 February 2011
    +
    Article 3
    + +
    Wed 20 April 2011
    +
    A markdown powered article
    + +
    Wed 29 February 2012
    +
    Second article
    + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/article-1.html b/tests/output/custom/article-1.html new file mode 100644 index 00000000..4bdb8f16 --- /dev/null +++ b/tests/output/custom/article-1.html @@ -0,0 +1,158 @@ + + + + Article 1 + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    Article 1

    +
    + +

    Article 1

    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/article-2.html b/tests/output/custom/article-2.html new file mode 100644 index 00000000..6a0bb442 --- /dev/null +++ b/tests/output/custom/article-2.html @@ -0,0 +1,158 @@ + + + + Article 2 + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    Article 2

    +
    + +

    Article 2

    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/article-3.html b/tests/output/custom/article-3.html new file mode 100644 index 00000000..8410b4f9 --- /dev/null +++ b/tests/output/custom/article-3.html @@ -0,0 +1,158 @@ + + + + Article 3 + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    Article 3

    +
    + +

    Article 3

    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/author/alexis-metaireau.html b/tests/output/custom/author/alexis-metaireau.html new file mode 100644 index 00000000..89893dd9 --- /dev/null +++ b/tests/output/custom/author/alexis-metaireau.html @@ -0,0 +1,271 @@ + + + + Alexis' log - Alexis Métaireau + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. + + + +

      + + Page 1 / 2 + + » + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/author/alexis-metaireau2.html b/tests/output/custom/author/alexis-metaireau2.html new file mode 100644 index 00000000..be2c0db2 --- /dev/null +++ b/tests/output/custom/author/alexis-metaireau2.html @@ -0,0 +1,291 @@ + + + + Alexis' log - Alexis Métaireau + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + +
    +
      + +
    1. +
      +

      Oh yeah !

      +
      + +
      + +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more +

      There are comments.

      +
      +
    2. + + + + + + + +
    3. + + + + + + + +
    4. + + + + + + + +
    5. + + + +

      + + + « + + + Page 2 / 2 + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/categories.html b/tests/output/custom/categories.html new file mode 100644 index 00000000..a1a44e5b --- /dev/null +++ b/tests/output/custom/categories.html @@ -0,0 +1,129 @@ + + + + Alexis' log + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/category/bar.html b/tests/output/custom/category/bar.html new file mode 100644 index 00000000..d2088eae --- /dev/null +++ b/tests/output/custom/category/bar.html @@ -0,0 +1,170 @@ + + + + Alexis' log - bar + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + + + + + + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/category/cat1.html b/tests/output/custom/category/cat1.html new file mode 100644 index 00000000..d0ac8972 --- /dev/null +++ b/tests/output/custom/category/cat1.html @@ -0,0 +1,269 @@ + + + + Alexis' log - cat1 + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. + + + +

      + + Page 1 / 1 + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/category/content.html b/tests/output/custom/category/content.html new file mode 100644 index 00000000..389d7707 --- /dev/null +++ b/tests/output/custom/category/content.html @@ -0,0 +1,207 @@ + + + + Alexis' log - content + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + +

      + + Page 1 / 1 + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/category/yeah.html b/tests/output/custom/category/yeah.html new file mode 100644 index 00000000..b70b36e7 --- /dev/null +++ b/tests/output/custom/category/yeah.html @@ -0,0 +1,171 @@ + + + + Alexis' log - yeah + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + + + + + + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/drafts/a-draft-article.html b/tests/output/custom/drafts/a-draft-article.html new file mode 100644 index 00000000..99f5ad68 --- /dev/null +++ b/tests/output/custom/drafts/a-draft-article.html @@ -0,0 +1,159 @@ + + + + A draft article + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    A draft article

    +
    + +

    This is a draft article, it should live under the /drafts/ folder and not be +listed anywhere else.

    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/feeds/all-en.atom.xml b/tests/output/custom/feeds/all-en.atom.xml new file mode 100644 index 00000000..7356cb17 --- /dev/null +++ b/tests/output/custom/feeds/all-en.atom.xml @@ -0,0 +1,25 @@ + +Alexis' loghttp://blog.notmyidea.org2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> + \ No newline at end of file diff --git a/tests/output/custom/feeds/all-fr.atom.xml b/tests/output/custom/feeds/all-fr.atom.xml new file mode 100644 index 00000000..27949d80 --- /dev/null +++ b/tests/output/custom/feeds/all-fr.atom.xml @@ -0,0 +1,4 @@ + +Alexis' loghttp://blog.notmyidea.org2012-03-02T14:01:01+01:00Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireauhttp://blog.notmyidea.org/oh-yeah-fr.html<p>Et voila du contenu en français</p> +Deuxième article2012-02-29T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/second-article-fr.html<p>Ceci est un article, en français.</p> + \ No newline at end of file diff --git a/tests/output/custom/feeds/all.atom.xml b/tests/output/custom/feeds/all.atom.xml new file mode 100644 index 00000000..ef6dbf52 --- /dev/null +++ b/tests/output/custom/feeds/all.atom.xml @@ -0,0 +1,25 @@ + +Alexis' loghttp://blog.notmyidea.org2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> + \ No newline at end of file diff --git a/tests/output/custom/feeds/all.rss.xml b/tests/output/custom/feeds/all.rss.xml new file mode 100644 index 00000000..a3f7eff9 --- /dev/null +++ b/tests/output/custom/feeds/all.rss.xml @@ -0,0 +1,25 @@ + +Alexis' loghttp://blog.notmyidea.orgWed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100http://blog.notmyidea.org/second-article.htmlfoobarbazA markdown powered articlehttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200http://blog.notmyidea.org/a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.org/article-1.html<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-1.htmlArticle 2http://blog.notmyidea.org/article-2.html<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-2.htmlArticle 3http://blog.notmyidea.org/article-3.html<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-3.htmlThis is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100http://blog.notmyidea.org/this-is-a-super-article.htmlfoobarfoobarOh yeah !http://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200http://blog.notmyidea.org/oh-yeah.htmlohbaryeahUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200http://blog.notmyidea.org/unbelievable.html \ No newline at end of file diff --git a/tests/output/custom/feeds/bar.atom.xml b/tests/output/custom/feeds/bar.atom.xml new file mode 100644 index 00000000..84ac9cda --- /dev/null +++ b/tests/output/custom/feeds/bar.atom.xml @@ -0,0 +1,8 @@ + +Alexis' loghttp://blog.notmyidea.org2010-10-20T10:14:00+02:00Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> + \ No newline at end of file diff --git a/tests/output/custom/feeds/bar.rss.xml b/tests/output/custom/feeds/bar.rss.xml new file mode 100644 index 00000000..bb5cb2b4 --- /dev/null +++ b/tests/output/custom/feeds/bar.rss.xml @@ -0,0 +1,8 @@ + +Alexis' loghttp://blog.notmyidea.orgWed, 20 Oct 2010 10:14:00 +0200Oh yeah !http://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200http://blog.notmyidea.org/oh-yeah.htmlohbaryeah \ No newline at end of file diff --git a/tests/output/custom/feeds/cat1.atom.xml b/tests/output/custom/feeds/cat1.atom.xml new file mode 100644 index 00000000..e0f01780 --- /dev/null +++ b/tests/output/custom/feeds/cat1.atom.xml @@ -0,0 +1,5 @@ + +Alexis' loghttp://blog.notmyidea.org2011-04-20T00:00:00+02:00A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-3.html<p>Article 3</p> + \ No newline at end of file diff --git a/tests/output/custom/feeds/cat1.rss.xml b/tests/output/custom/feeds/cat1.rss.xml new file mode 100644 index 00000000..0043b2fb --- /dev/null +++ b/tests/output/custom/feeds/cat1.rss.xml @@ -0,0 +1,5 @@ + +Alexis' loghttp://blog.notmyidea.orgWed, 20 Apr 2011 00:00:00 +0200A markdown powered articlehttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200http://blog.notmyidea.org/a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.org/article-1.html<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-1.htmlArticle 2http://blog.notmyidea.org/article-2.html<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-2.htmlArticle 3http://blog.notmyidea.org/article-3.html<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-3.html \ No newline at end of file diff --git a/tests/output/custom/feeds/content.atom.xml b/tests/output/custom/feeds/content.atom.xml new file mode 100644 index 00000000..c141a0aa --- /dev/null +++ b/tests/output/custom/feeds/content.atom.xml @@ -0,0 +1,4 @@ + +Alexis' loghttp://blog.notmyidea.org2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> + \ No newline at end of file diff --git a/tests/output/custom/feeds/content.rss.xml b/tests/output/custom/feeds/content.rss.xml new file mode 100644 index 00000000..9f36c97e --- /dev/null +++ b/tests/output/custom/feeds/content.rss.xml @@ -0,0 +1,4 @@ + +Alexis' loghttp://blog.notmyidea.orgWed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100http://blog.notmyidea.org/second-article.htmlfoobarbazUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200http://blog.notmyidea.org/unbelievable.html \ No newline at end of file diff --git a/tests/output/custom/feeds/yeah.atom.xml b/tests/output/custom/feeds/yeah.atom.xml new file mode 100644 index 00000000..4c6eed49 --- /dev/null +++ b/tests/output/custom/feeds/yeah.atom.xml @@ -0,0 +1,14 @@ + +Alexis' loghttp://blog.notmyidea.org2010-12-02T10:14:00+01:00This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> + \ No newline at end of file diff --git a/tests/output/custom/feeds/yeah.rss.xml b/tests/output/custom/feeds/yeah.rss.xml new file mode 100644 index 00000000..c4f5512e --- /dev/null +++ b/tests/output/custom/feeds/yeah.rss.xml @@ -0,0 +1,14 @@ + +Alexis' loghttp://blog.notmyidea.orgThu, 02 Dec 2010 10:14:00 +0100This is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100http://blog.notmyidea.org/this-is-a-super-article.htmlfoobarfoobar \ No newline at end of file diff --git a/tests/output/custom/index.html b/tests/output/custom/index.html new file mode 100644 index 00000000..2154ea99 --- /dev/null +++ b/tests/output/custom/index.html @@ -0,0 +1,276 @@ + + + + Alexis' log + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. + + + +

      + + Page 1 / 2 + + » + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/index2.html b/tests/output/custom/index2.html new file mode 100644 index 00000000..9604afd7 --- /dev/null +++ b/tests/output/custom/index2.html @@ -0,0 +1,286 @@ + + + + Alexis' log + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + +
    +
      + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. +
      +

      Oh yeah !

      +
      + +
      + +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more +

      There are comments.

      +
      +
    4. + + + + + + + +
    5. + + + +

      + + + « + + + Page 2 / 2 + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/oh-yeah-fr.html b/tests/output/custom/oh-yeah-fr.html new file mode 100644 index 00000000..e692105b --- /dev/null +++ b/tests/output/custom/oh-yeah-fr.html @@ -0,0 +1,163 @@ + + + + Trop bien ! + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    Trop bien !

    +
    + +

    Et voila du contenu en français

    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/oh-yeah.html b/tests/output/custom/oh-yeah.html new file mode 100644 index 00000000..6ffaad13 --- /dev/null +++ b/tests/output/custom/oh-yeah.html @@ -0,0 +1,168 @@ + + + + Oh yeah ! + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    Oh yeah !

    +
    + +
    +

    Why not ?

    +

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

    +alternate text +
    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/pages/this-is-a-test-page.html b/tests/output/custom/pages/this-is-a-test-page.html new file mode 100644 index 00000000..27d6ec69 --- /dev/null +++ b/tests/output/custom/pages/this-is-a-test-page.html @@ -0,0 +1,125 @@ + + + + This is a test page + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +

    This is a test page

    + +

    Just an image.

    +alternate text + +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/robots.txt b/tests/output/custom/robots.txt new file mode 100644 index 00000000..ae5b0d05 --- /dev/null +++ b/tests/output/custom/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /static/pictures diff --git a/tests/output/custom/second-article-fr.html b/tests/output/custom/second-article-fr.html new file mode 100644 index 00000000..b3b12af7 --- /dev/null +++ b/tests/output/custom/second-article-fr.html @@ -0,0 +1,163 @@ + + + + Deuxième article + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    Deuxième article

    +
    + +

    Ceci est un article, en français.

    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/second-article.html b/tests/output/custom/second-article.html new file mode 100644 index 00000000..4b31dc69 --- /dev/null +++ b/tests/output/custom/second-article.html @@ -0,0 +1,163 @@ + + + + Second article + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    Second article

    +
    + +

    This is some article, in english

    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/static/pictures/Fat_Cat.jpg b/tests/output/custom/static/pictures/Fat_Cat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d8a96d356be94e782aaf36ba4e47168435b56338 GIT binary patch literal 62675 zcmbTdbwE_j`|y31rMnv>mJVU*QgZ29I;BfMLK-9#1f+Ipq`L)_RwS2_?odDwq@^UR zclGxBeDB};zJEN=GrPll&Tvg!bFP^^d(G^x#b4_HsRm3P27o{yKn?u@er+)6ssy?^ z0f4$XFMtaG03kpE!T|8ll#h<2XeLIdmFP$g0s|m)`a9Btu>PbiXlD4!U1;Y1D}#Y% zVRTtSbc#YpD4HqJ=`=c0VEj|hZ<(wp3;+wAZlj~?Q_Meg;-VWU>&F2Y(Rl~xIFAVc zFe43hn7WoWnp`~{^;`p441~pngnp~=r_6s+RdsDW7O0@Ops)}C6%rPf7DB(pScFBS zMTDiHQUD7&0Dzv4tLH;?Z9oVrCIkQ&=+_^;e*Xa=Ku**@x^`aXl9H3Z@;*Lg18t^c+XaWB%ojXa*tvkpZD~$3Xm3|JUF7Nc=x-|3ote@}GQc zFaUu6<`bhC^Dk4Q8SAeMGn#Rb|Mchg_~HKL-`&Cc%j#&x|0~almJdbZ0KsS-1hRtANk)R82@7MzZm;pjQ=kt{1^W&kB^SZ=*E8c+X2n!doT3o z-b=9vi%N@$NsIomhyPFBZ=3vGRtH`7ce($R=lFY#&ia!N`&%z5TF>8d|FOs4_DzqD z{~1jYAyTw8-9qPR{8o_^k-RV<-@$q4_8q5qNx$o@O}pnowy{@;Ake=$Ju-+a)&7~@}zOZm?@ z7@(~R?_Z2h`A^y3mI^5Rx1QgZVp33L5m6CI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t)&2B+1uRXzufUIlI?iv`(TieZjGeX)>64h{htxNzm(ZK1uvQi)kk zVnzZT3zucUQZzPq0|Nsi1n=#Lyh^&XR_ZvTiU^>Xh?+3DQmj~!zH_-f__J)SmeWNH e6s_{nM>|BT5C{M{2e-KI=yG_A9_Ux}fB)G)VA)at literal 0 HcmV?d00001 diff --git a/tests/output/custom/static/pictures/Sushi.jpg b/tests/output/custom/static/pictures/Sushi.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e49e5f0ab53461187c2cf61ebc1f3befdc937aed GIT binary patch literal 28992 zcmbTdbzB@v_u$>Qy99T);1Jwla0YiLxCD0z?j9s)a18`^NbmqbgS!*lg74(s`@GNn zy`TMKcWb7)zFmE)x=wY~>8{f=FY_16bVnP@ll9oXtHWUm11xf!zA}F}O(k2KK|HEAnX81=28p0fqvZ#=B z01`PNj0;JpAQ1=p?|S~oWQ0HiaFBEt5^W-2|Ed!aa)RP-2mlEr?-wMFzyg4braVXn zq^JZT8%Il38!rlV4qkTlKPvoH=0B+{NJ*7~lZ}^+gB{>x=im@vhkSV`IJgA3An*pD zfCKM*i#E&k%-A{yQHYQYXwm z`REXa{fF@(4EK)=8H5p%|8CEp{zLqSAqXJ-!vqjU{zsk;BJY=s060Q)WP>n}|4*Aa z*x8}-|9f4b^Z&jEi4ZxMf0zZraQ|=>L{ap@zuWl{!WjQ>5ri=d|E}jx^{@V6h*|*f z3E?jt|Kvmc!+*LOs_1X|KO)foVwit1{J$9aUyS-M{!<Y4M&;Hl7 ze?!5+4Y}|F?EL@Rygy^|Pua46${j%(_NTndKPd$N+L!rf{~Kg7{5k%g@%U$a6GGyD zdXtMC6Ed2}Avq#{RK$e-Yfc$K7z*>hy#xIZLnHvqf8}Fg{yiG3Ao3LdlA-(;Q~kq# zs;7qVpC0~!unfokFBy)1G3USJ0j&S_IMlxw!2WMOfb(C5`WHk0ixF}E)>j=edXWCb z$hd!({WBtI|6vFMfcSsw{IkpRhEs}*n~R@|lZyjV1ur|76dyY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EsUTeTVSn?731bp42KLkj*l%PKI^Vb>3gRdQOqy&*-u1v!8!063=x}qy V9RVclK)_SR8Zrq#de{_0|JgZd7T*8> literal 0 HcmV?d00001 diff --git a/tests/output/custom/tag/bar.html b/tests/output/custom/tag/bar.html new file mode 100644 index 00000000..069276ad --- /dev/null +++ b/tests/output/custom/tag/bar.html @@ -0,0 +1,290 @@ + + + + Alexis' log - bar + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + +

    + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + + + + + +
    3. +
      +

      Oh yeah !

      +
      + +
      + +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more +

      There are comments.

      +
      +
    4. + + + +

      + + Page 1 / 1 + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/tag/baz.html b/tests/output/custom/tag/baz.html new file mode 100644 index 00000000..02d87aa1 --- /dev/null +++ b/tests/output/custom/tag/baz.html @@ -0,0 +1,212 @@ + + + + Alexis' log - baz + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + +

      + + Page 1 / 1 + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/tag/foo.html b/tests/output/custom/tag/foo.html new file mode 100644 index 00000000..2089003d --- /dev/null +++ b/tests/output/custom/tag/foo.html @@ -0,0 +1,246 @@ + + + + Alexis' log - foo + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + + + + + + +
    2. + + + +

      + + Page 1 / 1 + +

      + + + + +
    +
    + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/tag/foobar.html b/tests/output/custom/tag/foobar.html new file mode 100644 index 00000000..8187acd5 --- /dev/null +++ b/tests/output/custom/tag/foobar.html @@ -0,0 +1,171 @@ + + + + Alexis' log - foobar + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + + + + + + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/tag/oh.html b/tests/output/custom/tag/oh.html new file mode 100644 index 00000000..a27bb302 --- /dev/null +++ b/tests/output/custom/tag/oh.html @@ -0,0 +1,170 @@ + + + + Alexis' log - oh + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + + + + + + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/tag/yeah.html b/tests/output/custom/tag/yeah.html new file mode 100644 index 00000000..ac1ef4fa --- /dev/null +++ b/tests/output/custom/tag/yeah.html @@ -0,0 +1,170 @@ + + + + Alexis' log - yeah + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + + + + + + + + + + + + + + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/tags.html b/tests/output/custom/tags.html new file mode 100644 index 00000000..e69de29b diff --git a/tests/output/custom/theme/css/main.css b/tests/output/custom/theme/css/main.css new file mode 100644 index 00000000..28c98b99 --- /dev/null +++ b/tests/output/custom/theme/css/main.css @@ -0,0 +1,423 @@ +/* + Name: Smashing HTML5 + Date: July 2009 + Description: Sample layout for HTML5 and CSS3 goodness. + Version: 1.0 + Author: Enrique Ramírez + Autor URI: http://enrique-ramirez.com +*/ + +/* Imports */ +@import url("reset.css"); +@import url("pygment.css"); +@import url("typogrify.css"); +@import url(http://fonts.googleapis.com/css?family=Yanone+Kaffeesatz&subset=latin); + +/***** Global *****/ +/* Body */ +body { + background: #F5F4EF; + color: #000305; + font-size: 87.5%; /* Base font size: 14px */ + font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; + line-height: 1.429; + margin: 0; + padding: 0; + text-align: left; +} + +/* Headings */ +h1 {font-size: 2em } +h2 {font-size: 1.571em} /* 22px */ +h3 {font-size: 1.429em} /* 20px */ +h4 {font-size: 1.286em} /* 18px */ +h5 {font-size: 1.143em} /* 16px */ +h6 {font-size: 1em} /* 14px */ + +h1, h2, h3, h4, h5, h6 { + font-weight: 400; + line-height: 1.1; + margin-bottom: .8em; + font-family: 'Yanone Kaffeesatz', arial, serif; +} + +h3, h4, h5, h6 { margin-top: .8em; } + +hr { border: 2px solid #EEEEEE; } + +/* Anchors */ +a {outline: 0;} +a img {border: 0px; text-decoration: none;} +a:link, a:visited { + color: #C74350; + padding: 0 1px; + text-decoration: underline; +} +a:hover, a:active { + background-color: #C74350; + color: #fff; + text-decoration: none; + text-shadow: 1px 1px 1px #333; +} + +h1 a:hover { + background-color: inherit +} + +/* Paragraphs */ +p {margin-bottom: 1.143em;} + +strong, b {font-weight: bold;} +em, i {font-style: italic;} + +::-moz-selection {background: #F6CF74; color: #fff;} +::selection {background: #F6CF74; color: #fff;} + +/* Lists */ +ul { + list-style: outside disc; + margin: 1em 0 1.5em 1.5em; +} + +ol { + list-style: outside decimal; + margin: 1em 0 1.5em 1.5em; +} + +.post-info { + float:right; + margin:10px; + padding:5px; +} + +.post-info p{ + margin-bottom: 1px; +} + +.readmore { float: right } + +dl {margin: 0 0 1.5em 0;} +dt {font-weight: bold;} +dd {margin-left: 1.5em;} + +pre{background-color: #000; padding: 10px; color: #fff; margin: 10px; overflow: auto;} + +/* Quotes */ +blockquote { + margin: 20px; + font-style: italic; +} +cite {} + +q {} + +/* Tables */ +table {margin: .5em auto 1.5em auto; width: 98%;} + + /* Thead */ + thead th {padding: .5em .4em; text-align: left;} + thead td {} + + /* Tbody */ + tbody td {padding: .5em .4em;} + tbody th {} + + tbody .alt td {} + tbody .alt th {} + + /* Tfoot */ + tfoot th {} + tfoot td {} + +/* HTML5 tags */ +header, section, footer, +aside, nav, article, figure { + display: block; +} + +/***** Layout *****/ +.body {clear: both; margin: 0 auto; width: 800px;} +img.right figure.right {float: right; margin: 0 0 2em 2em;} +img.left, figure.left {float: right; margin: 0 0 2em 2em;} + +/* + Header +*****************/ +#banner { + margin: 0 auto; + padding: 2.5em 0 0 0; +} + + /* Banner */ + #banner h1 {font-size: 3.571em; line-height: 0;} + #banner h1 a:link, #banner h1 a:visited { + color: #000305; + display: block; + font-weight: bold; + margin: 0 0 .6em .2em; + text-decoration: none; + width: 427px; + } + #banner h1 a:hover, #banner h1 a:active { + background: none; + color: #C74350; + text-shadow: none; + } + + #banner h1 strong {font-size: 0.36em; font-weight: normal;} + + /* Main Nav */ + #banner nav { + background: #000305; + font-size: 1.143em; + height: 40px; + line-height: 30px; + margin: 0 auto 2em auto; + padding: 0; + text-align: center; + width: 800px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + + #banner nav ul {list-style: none; margin: 0 auto; width: 800px;} + #banner nav li {float: left; display: inline; margin: 0;} + + #banner nav a:link, #banner nav a:visited { + color: #fff; + display: inline-block; + height: 30px; + padding: 5px 1.5em; + text-decoration: none; + } + #banner nav a:hover, #banner nav a:active, + #banner nav .active a:link, #banner nav .active a:visited { + background: #C74451; + color: #fff; + text-shadow: none !important; + } + + #banner nav li:first-child a { + border-top-left-radius: 5px; + -moz-border-radius-topleft: 5px; + -webkit-border-top-left-radius: 5px; + + border-bottom-left-radius: 5px; + -moz-border-radius-bottomleft: 5px; + -webkit-border-bottom-left-radius: 5px; + } + +/* + Featured +*****************/ +#featured { + background: #fff; + margin-bottom: 2em; + overflow: hidden; + padding: 20px; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +#featured figure { + border: 2px solid #eee; + float: right; + margin: 0.786em 2em 0 5em; + width: 248px; +} +#featured figure img {display: block; float: right;} + +#featured h2 {color: #C74451; font-size: 1.714em; margin-bottom: 0.333em;} +#featured h3 {font-size: 1.429em; margin-bottom: .5em;} + +#featured h3 a:link, #featured h3 a:visited {color: #000305; text-decoration: none;} +#featured h3 a:hover, #featured h3 a:active {color: #fff;} + +/* + Body +*****************/ +#content { + background: #fff; + margin-bottom: 2em; + overflow: hidden; + padding: 20px 20px; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +/* + Extras +*****************/ +#extras {margin: 0 auto 3em auto; overflow: hidden;} + +#extras ul {list-style: none; margin: 0;} +#extras li {border-bottom: 1px solid #fff;} +#extras h2 { + color: #C74350; + font-size: 1.429em; + margin-bottom: .25em; + padding: 0 3px; +} + +#extras a:link, #extras a:visited { + color: #444; + display: block; + border-bottom: 1px solid #F4E3E3; + text-decoration: none; + padding: .3em .25em; +} + +#extras a:hover, #extras a:active {color: #fff;} + + /* Blogroll */ + #extras .blogroll { + float: left; + width: 615px; + } + + #extras .blogroll li {float: left; margin: 0 20px 0 0; width: 185px;} + + /* Social */ + #extras .social { + float: right; + width: 175px; + } + + #extras div[class='social'] a { + background-repeat: no-repeat; + background-position: 3px 6px; + padding-left: 25px; + } + + /* Icons */ + .social a[href*='delicious.com'] {background-image: url('../images/icons/delicious.png');} + .social a[href*='digg.com'] {background-image: url('../images/icons/digg.png');} + .social a[href*='facebook.com'] {background-image: url('../images/icons/facebook.png');} + .social a[href*='last.fm'], .social a[href*='lastfm.'] {background-image: url('../images/icons/lastfm.png');} + .social a[type$='atom+xml'], .social a[type$='rss+xml'] {background-image: url('../images/icons/rss.png');} + .social a[href*='twitter.com'] {background-image: url('../images/icons/twitter.png');} + .social a[href*='linkedin.com'] {background-image: url('../images/icons/linkedin.png');} + +/* + About +*****************/ +#about { + background: #fff; + font-style: normal; + margin-bottom: 2em; + overflow: hidden; + padding: 20px; + text-align: left; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +#about .primary {float: left; width: 165px;} +#about .primary strong {color: #C64350; display: block; font-size: 1.286em;} +#about .photo {float: left; margin: 5px 20px;} + +#about .url:link, #about .url:visited {text-decoration: none;} + +#about .bio {float: right; width: 500px;} + +/* + Footer +*****************/ +#contentinfo {padding-bottom: 2em; text-align: right;} + +/***** Sections *****/ +/* Blog */ +.hentry { + display: block; + clear: both; + border-bottom: 1px solid #eee; + padding: 1.5em 0; +} +li:last-child .hentry, #content > .hentry {border: 0; margin: 0;} +#content > .hentry {padding: 1em 0;} +.hentry img{display : none ;} +.entry-title {font-size: 3em; margin-bottom: 10px; margin-top: 0;} +.entry-title a:link, .entry-title a:visited {text-decoration: none; color: #333;} +.entry-title a:visited {background-color: #fff;} + +.hentry .post-info * {font-style: normal;} + + /* Content */ + .hentry footer {margin-bottom: 2em;} + .hentry footer address {display: inline;} + #posts-list footer address {display: block;} + + /* Blog Index */ + #posts-list {list-style: none; margin: 0;} + #posts-list .hentry {padding-left: 10px; position: relative;} + + #posts-list footer { + left: 10px; + position: relative; + float: left; + top: 0.5em; + width: 190px; + } + + /* About the Author */ + #about-author { + background: #f9f9f9; + clear: both; + font-style: normal; + margin: 2em 0; + padding: 10px 20px 15px 20px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + + #about-author strong { + color: #C64350; + clear: both; + display: block; + font-size: 1.429em; + } + + #about-author .photo {border: 1px solid #ddd; float: left; margin: 5px 1em 0 0;} + + /* Comments */ + #comments-list {list-style: none; margin: 0 1em;} + #comments-list blockquote { + background: #f8f8f8; + clear: both; + font-style: normal; + margin: 0; + padding: 15px 20px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + #comments-list footer {color: #888; padding: .5em 1em 0 0; text-align: right;} + + #comments-list li:nth-child(2n) blockquote {background: #F5f5f5;} + + /* Add a Comment */ + #add-comment label {clear: left; float: left; text-align: left; width: 150px;} + #add-comment input[type='text'], + #add-comment input[type='email'], + #add-comment input[type='url'] {float: left; width: 200px;} + + #add-comment textarea {float: left; height: 150px; width: 495px;} + + #add-comment p.req {clear: both; margin: 0 .5em 1em 0; text-align: right;} + + #add-comment input[type='submit'] {float: right; margin: 0 .5em;} + #add-comment * {margin-bottom: .5em;} diff --git a/tests/output/custom/theme/css/pygment.css b/tests/output/custom/theme/css/pygment.css new file mode 100644 index 00000000..594b0fa3 --- /dev/null +++ b/tests/output/custom/theme/css/pygment.css @@ -0,0 +1,205 @@ +.hll { +background-color:#FFFFCC; +} +.c { +color:#408090; +font-style:italic; +} +.err { +border:1px solid #FF0000; +} +.k { +color:#007020; +font-weight:bold; +} +.o { +color:#666666; +} +.cm { +color:#408090; +font-style:italic; +} +.cp { +color:#007020; +} +.c1 { +color:#408090; +font-style:italic; +} +.cs { +background-color:#FFF0F0; +color:#408090; +} +.gd { +color:#A00000; +} +.ge { +font-style:italic; +} +.gr { +color:#FF0000; +} +.gh { +color:#000080; +font-weight:bold; +} +.gi { +color:#00A000; +} +.go { +color:#303030; +} +.gp { +color:#C65D09; +font-weight:bold; +} +.gs { +font-weight:bold; +} +.gu { +color:#800080; +font-weight:bold; +} +.gt { +color:#0040D0; +} +.kc { +color:#007020; +font-weight:bold; +} +.kd { +color:#007020; +font-weight:bold; +} +.kn { +color:#007020; +font-weight:bold; +} +.kp { +color:#007020; +} +.kr { +color:#007020; +font-weight:bold; +} +.kt { +color:#902000; +} +.m { +color:#208050; +} +.s { +color:#4070A0; +} +.na { +color:#4070A0; +} +.nb { +color:#007020; +} +.nc { +color:#0E84B5; +font-weight:bold; +} +.no { +color:#60ADD5; +} +.nd { +color:#555555; +font-weight:bold; +} +.ni { +color:#D55537; +font-weight:bold; +} +.ne { +color:#007020; +} +.nf { +color:#06287E; +} +.nl { +color:#002070; +font-weight:bold; +} +.nn { +color:#0E84B5; +font-weight:bold; +} +.nt { +color:#062873; +font-weight:bold; +} +.nv { +color:#BB60D5; +} +.ow { +color:#007020; +font-weight:bold; +} +.w { +color:#BBBBBB; +} +.mf { +color:#208050; +} +.mh { +color:#208050; +} +.mi { +color:#208050; +} +.mo { +color:#208050; +} +.sb { +color:#4070A0; +} +.sc { +color:#4070A0; +} +.sd { +color:#4070A0; +font-style:italic; +} +.s2 { +color:#4070A0; +} +.se { +color:#4070A0; +font-weight:bold; +} +.sh { +color:#4070A0; +} +.si { +color:#70A0D0; +font-style:italic; +} +.sx { +color:#C65D09; +} +.sr { +color:#235388; +} +.s1 { +color:#4070A0; +} +.ss { +color:#517918; +} +.bp { +color:#007020; +} +.vc { +color:#BB60D5; +} +.vg { +color:#BB60D5; +} +.vi { +color:#BB60D5; +} +.il { +color:#208050; +} diff --git a/tests/output/custom/theme/css/reset.css b/tests/output/custom/theme/css/reset.css new file mode 100644 index 00000000..1e217566 --- /dev/null +++ b/tests/output/custom/theme/css/reset.css @@ -0,0 +1,52 @@ +/* + Name: Reset Stylesheet + Description: Resets browser's default CSS + Author: Eric Meyer + Author URI: http://meyerweb.com/eric/tools/css/reset/ +*/ + +/* v1.0 | 20080212 */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + background: transparent; + border: 0; + font-size: 100%; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; +} + +body {line-height: 1;} + +ol, ul {list-style: none;} + +blockquote, q {quotes: none;} + +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} + +/* remember to define focus styles! */ +:focus { + outline: 0; +} + +/* remember to highlight inserts somehow! */ +ins {text-decoration: none;} +del {text-decoration: line-through;} + +/* tables still need 'cellspacing="0"' in the markup */ +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/tests/output/custom/theme/css/typogrify.css b/tests/output/custom/theme/css/typogrify.css new file mode 100644 index 00000000..c9b34dc8 --- /dev/null +++ b/tests/output/custom/theme/css/typogrify.css @@ -0,0 +1,3 @@ +.caps {font-size:.92em;} +.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;} +.dquo {margin-left:-.38em;} diff --git a/tests/output/custom/theme/css/wide.css b/tests/output/custom/theme/css/wide.css new file mode 100644 index 00000000..3376f4c7 --- /dev/null +++ b/tests/output/custom/theme/css/wide.css @@ -0,0 +1,43 @@ +@import url("main.css"); + +body { + font:1.3em/1.3 "Hoefler Text","Georgia",Georgia,serif,sans-serif; +} + +.body, #banner nav, #banner nav ul, #about, #featured, #content{ + width: inherit; +} + +#banner nav { + -moz-border-radius: 0px; + margin-bottom: 0px; +} + +#banner nav ul{ + padding-right: 50px; +} + +#banner nav li{ + float: right; +} + +#banner nav li:first-child a { + -moz-border-radius: 0px; +} + +#banner h1 { + margin-bottom: -18px; +} + +#featured, #extras { + padding: 50px; +} + +#featured { + padding-top: 20px; +} + +#extras { + padding-top: 0px; + padding-bottom: 0px; +} diff --git a/tests/output/custom/theme/images/icons/delicious.png b/tests/output/custom/theme/images/icons/delicious.png new file mode 100644 index 0000000000000000000000000000000000000000..c6ce246a4602f8f74e75ea8cfe9f5a00daceeb33 GIT binary patch literal 963 zcmV;!13dhRP)6?8>dbVG7wVRUJ4ZXi@?ZDjy5FfTVRFgbe517iRH0~|?2 zK~y-6Ws<#bTV))DpZogtjeX;f*md33No`1zmc&$+7>H1WP&XnFV&q?F7ZxN~K zI2_i~X=|=poxD)3){1kpXG^wzH)G`%n@9Vdqh@z9)$_-#O6KsOno1r{oLaey`u-PV zY3aS2^Ye4>S8M03dc96IlcH2Q#q{(nf8K*{zJqcRIvv=4D%`zi;68GBwb9|D4{t8% zQt846H*S2cctHWJrs7#s6F7hZ$1zC814fk;8_#?Ee8=nS(J0;psU1TjL;w;PhJ&dS zcwv_A5bPl|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$#GXS3*$Av)h&Vdd0mg5PeU%O!HV zMiS5;aca`gZ*9{qBCi% zwUAF?iaAuy$I}{@62$Y6SYsQj=uRIhTT$bq7frj6{xp7O*Nmx-Io0hc+Y3_?M%yHe z262>Cw^!CiWpLK0R3;#J&y{nbj~!kB0000Wd_Fj7M_G{R}1CBkLw_JJn z>DQmab*CL>?Ok)>!PFzy{Acg}|Np;3*ZSPGC!W6l5w&pt&tHEg9=P)1$FJ6%7tcO? zWxgW&B*^ZPAirP+hi5m^K%69RcNc~ZR#^`qhqJ&VvY3H^TNs2H8D`Cq01C2~c>21s z-{R(FQ&rw_X(1C(sL|8KF+}2W>G_L%hZJ~NFD#lIs%=oPMZxdy|Meo%9>~ox&zv>K zB$L~r*j87(8A5T-G@yGywqOA)@^N literal 0 HcmV?d00001 diff --git a/tests/output/custom/theme/images/icons/rss.png b/tests/output/custom/theme/images/icons/rss.png new file mode 100644 index 0000000000000000000000000000000000000000..7d4e85d981cbecb04b76dab5a234dc4690bd15ab GIT binary patch literal 896 zcmV-`1AqL9P)6?8>dbVG7wVRUJ4ZXi@?ZDjy5FfTVRFgbe517iRH0@+DK zK~y-6O_EE9990yCzjLd)r^ifBchXK`gN{uSqd0=7kbqhEAc*5eg)D?1#7z(k=t4x? zNsw9SGD{(noh~9MD2X6K0zO7JK4L<2NIQAV^f*1~?yBm#RrlWGqBZ!h4jlgP{QMl@ zU+I@e9$=>SEYtNmqqUus!wx3gi-~73je=sdif|T*ZW7`utw+wuWACgAfSy0TMEK!t zYE6(SC>(?md;vs&h4d<9>k!o-OF=;&Jh2#spFTJsviuSC-JmTPu0b(`Yz>m@kp2nd zRUig43#A1DSVeq#S1i(h1~UbNA&f4<@Dez{166^UU6a|4zzqNaQ-P|7a=jCiUOUL} z3N#kr{$pS>NV;Hq6WHcusMH{MFwq3?pM*wCy57Y0p#2u?K8oJnF^Tc@i}3sB(5is` z&ujoKf??Y|8_dk3zrBZk^(0()1>IOi0VRT`KZE-Y!JwQ_MM0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+ + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    This is a super article !

    +
    + +

    Some content here !

    +
    +

    This is a simple title

    +

    And here comes the cool stuff.

    +alternate text +alternate text +
    +>>> from ipdb import set_trace
    +>>> set_trace()
    +
    +

    → And now try with some utf8 hell: ééé

    +
    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/unbelievable.html b/tests/output/custom/unbelievable.html new file mode 100644 index 00000000..b7730421 --- /dev/null +++ b/tests/output/custom/unbelievable.html @@ -0,0 +1,158 @@ + + + + Unbelievable ! + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +
    +

    Unbelievable !

    +
    + +

    Or completely awesome. Depends the needs.

    + +
    + +
    +

    Comments !

    +
    + +
    + + +
    +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file From 2f1f6b5b436d25a7ff13bccd096a1da226f56261 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 30 Mar 2012 13:44:57 +0200 Subject: [PATCH 0154/2344] test that the output of the samples pelican project is correct (functionnal testing) --- tests/test_pelican.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/tests/test_pelican.py b/tests/test_pelican.py index ce270955..80e5fc7f 100644 --- a/tests/test_pelican.py +++ b/tests/test_pelican.py @@ -1,13 +1,15 @@ import unittest import os +from filecmp import dircmp from .support import temporary_folder from pelican import Pelican from pelican.settings import read_settings -SAMPLES_PATH = os.path.abspath(os.sep.join( - (os.path.dirname(os.path.abspath(__file__)), "..", "samples"))) +CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) +SAMPLES_PATH = os.path.abspath(os.sep.join((CURRENT_DIR, "..", "samples"))) +OUTPUT_PATH = os.path.abspath(os.sep.join((CURRENT_DIR, "output"))) INPUT_PATH = os.path.join(SAMPLES_PATH, "content") SAMPLE_CONFIG = os.path.join(SAMPLES_PATH, "pelican.conf.py") @@ -24,8 +26,18 @@ class TestPelican(unittest.TestCase): with temporary_folder() as temp_path: pelican = Pelican(path=INPUT_PATH, output_path=temp_path) pelican.run() + diff = dircmp(temp_path, os.sep.join((OUTPUT_PATH, "basic"))) + self.assertEqual(diff.left_only, []) + self.assertEqual(diff.right_only, []) + self.assertEqual(diff.diff_files, []) - # the same thing with a specified set of settins should work + def test_custom_generation_works(self): + # the same thing with a specified set of settings should work with temporary_folder() as temp_path: pelican = Pelican(path=INPUT_PATH, output_path=temp_path, settings=read_settings(SAMPLE_CONFIG)) + pelican.run() + diff = dircmp(temp_path, os.sep.join((OUTPUT_PATH, "custom"))) + self.assertEqual(diff.left_only, []) + self.assertEqual(diff.right_only, []) + self.assertEqual(diff.diff_files, []) From 64e12b18099ea580d832791b75005cff38e7bf9e Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 30 Mar 2012 14:20:55 +0200 Subject: [PATCH 0155/2344] fix missing and tags --- pelican/themes/notmyidea/templates/index.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index f81275ae..69dc4622 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -19,7 +19,7 @@

    Other articles


    -
      +
        {% endif %} {# other items #} {% else %} @@ -44,17 +44,17 @@ or not articles_page.has_previous() and loop.length > 1) %} {% include 'pagination.html' %} {% endif %} -{% endfor %} - {% if loop.length > 1 or articles_page.has_previous() %} -
      -
    -{% endif %} + {% if loop.last %} + + + {% endif %} + {% endfor %} {% else %}

    Pages

    -{% for page in PAGES %} -
  • {{ page.title }}
  • -{% endfor %} + {% for page in PAGES %} +
  • {{ page.title }}
  • + {% endfor %}
    {% endif %} {% endblock content %} From abadedffeca0ccf53b3219593410d7851c0f8592 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 30 Mar 2012 14:23:12 +0200 Subject: [PATCH 0156/2344] update output for functionnal testing --- tests/output/basic/author/alexis-metaireau.html | 11 ++++++----- tests/output/basic/author/bruno.html | 15 ++++++++++----- tests/output/basic/category/bar.html | 5 ++++- tests/output/basic/category/cat1.html | 13 ++++++++----- tests/output/basic/category/content.html | 11 ++++++----- tests/output/basic/category/yeah.html | 5 ++++- tests/output/basic/index.html | 17 ++++++++++++----- tests/output/basic/tag/bar.html | 13 ++++++++----- tests/output/basic/tag/baz.html | 11 ++++++----- tests/output/basic/tag/foo.html | 12 +++++++----- tests/output/basic/tag/foobar.html | 5 ++++- tests/output/basic/tag/oh.html | 5 ++++- tests/output/basic/tag/yeah.html | 5 ++++- .../output/custom/author/alexis-metaireau.html | 13 ++++++++----- .../output/custom/author/alexis-metaireau2.html | 11 +++++++---- tests/output/custom/category/bar.html | 5 ++++- tests/output/custom/category/cat1.html | 13 ++++++++----- tests/output/custom/category/content.html | 11 ++++++----- tests/output/custom/category/yeah.html | 5 ++++- tests/output/custom/index.html | 13 ++++++++----- tests/output/custom/index2.html | 11 +++++++---- tests/output/custom/tag/bar.html | 13 ++++++++----- tests/output/custom/tag/baz.html | 11 ++++++----- tests/output/custom/tag/foo.html | 12 +++++++----- tests/output/custom/tag/foobar.html | 5 ++++- tests/output/custom/tag/oh.html | 5 ++++- tests/output/custom/tag/yeah.html | 5 ++++- 27 files changed, 168 insertions(+), 93 deletions(-) diff --git a/tests/output/basic/author/alexis-metaireau.html b/tests/output/basic/author/alexis-metaireau.html index eda5498d..ab68482d 100644 --- a/tests/output/basic/author/alexis-metaireau.html +++ b/tests/output/basic/author/alexis-metaireau.html @@ -83,12 +83,13 @@ YEAH !

    Other articles


    -
      +
        + @@ -124,11 +125,11 @@ as well as inline markup. - + +
      +
    + - - -
    diff --git a/tests/output/basic/author/bruno.html b/tests/output/basic/author/bruno.html index fdc1da37..1e2dc655 100644 --- a/tests/output/basic/author/bruno.html +++ b/tests/output/basic/author/bruno.html @@ -72,12 +72,13 @@

    Other articles


    -
      +
        + @@ -112,6 +113,7 @@ + @@ -146,6 +148,7 @@ + @@ -180,6 +183,7 @@ + @@ -219,6 +223,7 @@ Translations: + @@ -254,11 +259,11 @@ Translations: - + +
      +
    + - -
    -
    diff --git a/tests/output/basic/category/bar.html b/tests/output/basic/category/bar.html index 07dcae9e..b268dd53 100644 --- a/tests/output/basic/category/bar.html +++ b/tests/output/basic/category/bar.html @@ -85,7 +85,10 @@ YEAH !

    - + + +
    + diff --git a/tests/output/basic/category/cat1.html b/tests/output/basic/category/cat1.html index bee9d918..e92fd0df 100644 --- a/tests/output/basic/category/cat1.html +++ b/tests/output/basic/category/cat1.html @@ -72,12 +72,13 @@

    Other articles


    -
      +
        + @@ -112,6 +113,7 @@ + @@ -146,6 +148,7 @@ + @@ -181,11 +184,11 @@ - + +
      +
    + - - -
    diff --git a/tests/output/basic/category/content.html b/tests/output/basic/category/content.html index 1c09459d..0eec912c 100644 --- a/tests/output/basic/category/content.html +++ b/tests/output/basic/category/content.html @@ -78,12 +78,13 @@ Translations:

    Other articles


    -
      +
        + @@ -119,11 +120,11 @@ Translations: - + +
      +
    + - -
    -
    diff --git a/tests/output/basic/category/yeah.html b/tests/output/basic/category/yeah.html index cc146893..ccb531f1 100644 --- a/tests/output/basic/category/yeah.html +++ b/tests/output/basic/category/yeah.html @@ -86,7 +86,10 @@ - + + +
    + diff --git a/tests/output/basic/index.html b/tests/output/basic/index.html index be97e8c8..8a2091b9 100644 --- a/tests/output/basic/index.html +++ b/tests/output/basic/index.html @@ -78,12 +78,13 @@ Translations:

    Other articles


    -
      +
        + @@ -117,6 +118,7 @@ Translations: + @@ -151,6 +153,7 @@ Translations: + @@ -185,6 +188,7 @@ Translations: + @@ -219,6 +223,7 @@ Translations: + @@ -253,6 +258,7 @@ as well as inline markup. + @@ -297,6 +303,7 @@ YEAH !

        + @@ -332,11 +339,11 @@ YEAH !

        - + +
      +
    + - - -
    diff --git a/tests/output/basic/tag/bar.html b/tests/output/basic/tag/bar.html index 8fc4e143..4afb4bfd 100644 --- a/tests/output/basic/tag/bar.html +++ b/tests/output/basic/tag/bar.html @@ -78,12 +78,13 @@ Translations:

    Other articles


    -
      +
        + @@ -123,6 +124,7 @@ Translations: + @@ -157,6 +159,7 @@ as well as inline markup. + @@ -202,11 +205,11 @@ YEAH !

        - + +
      +
    + - -
    -
    diff --git a/tests/output/basic/tag/baz.html b/tests/output/basic/tag/baz.html index 9f773873..b8df58e3 100644 --- a/tests/output/basic/tag/baz.html +++ b/tests/output/basic/tag/baz.html @@ -78,12 +78,13 @@ Translations:

    Other articles


    -
      +
        + @@ -124,11 +125,11 @@ Translations: - + +
      +
    + - -
    -
    diff --git a/tests/output/basic/tag/foo.html b/tests/output/basic/tag/foo.html index 73de8459..20cf293a 100644 --- a/tests/output/basic/tag/foo.html +++ b/tests/output/basic/tag/foo.html @@ -78,12 +78,13 @@ Translations:

    Other articles


    -
      +
        + @@ -123,6 +124,7 @@ Translations: + @@ -158,11 +160,11 @@ as well as inline markup. - + +
      +
    + - -
    -
    diff --git a/tests/output/basic/tag/foobar.html b/tests/output/basic/tag/foobar.html index 55ddfe78..0a5eeb3b 100644 --- a/tests/output/basic/tag/foobar.html +++ b/tests/output/basic/tag/foobar.html @@ -86,7 +86,10 @@ - + + +
    + diff --git a/tests/output/basic/tag/oh.html b/tests/output/basic/tag/oh.html index a8839f52..563c0f2e 100644 --- a/tests/output/basic/tag/oh.html +++ b/tests/output/basic/tag/oh.html @@ -85,7 +85,10 @@ YEAH !

    - + + + + diff --git a/tests/output/basic/tag/yeah.html b/tests/output/basic/tag/yeah.html index 5ff2b2e0..4b18b7e3 100644 --- a/tests/output/basic/tag/yeah.html +++ b/tests/output/basic/tag/yeah.html @@ -85,7 +85,10 @@ YEAH !

    - + + + + diff --git a/tests/output/custom/author/alexis-metaireau.html b/tests/output/custom/author/alexis-metaireau.html index 89893dd9..1a373e5d 100644 --- a/tests/output/custom/author/alexis-metaireau.html +++ b/tests/output/custom/author/alexis-metaireau.html @@ -80,12 +80,13 @@

    Other articles


    -
      +
        + @@ -120,6 +121,7 @@ + @@ -154,6 +156,7 @@ + @@ -197,11 +200,11 @@

        - + +
      +
    + - - -
    diff --git a/tests/output/custom/author/alexis-metaireau2.html b/tests/output/custom/author/alexis-metaireau2.html index be2c0db2..43ded360 100644 --- a/tests/output/custom/author/alexis-metaireau2.html +++ b/tests/output/custom/author/alexis-metaireau2.html @@ -99,6 +99,7 @@ YEAH !

    + @@ -138,6 +139,7 @@ Translations: + @@ -172,6 +174,7 @@ as well as inline markup. + @@ -217,11 +220,11 @@ as well as inline markup.

    - + + +
    + - - -
    diff --git a/tests/output/custom/category/bar.html b/tests/output/custom/category/bar.html index d2088eae..809a2bdf 100644 --- a/tests/output/custom/category/bar.html +++ b/tests/output/custom/category/bar.html @@ -99,7 +99,10 @@ YEAH !

    - + + +
    + diff --git a/tests/output/custom/category/cat1.html b/tests/output/custom/category/cat1.html index d0ac8972..fa6c6556 100644 --- a/tests/output/custom/category/cat1.html +++ b/tests/output/custom/category/cat1.html @@ -80,12 +80,13 @@

    Other articles


    -
      +
        + @@ -120,6 +121,7 @@ + @@ -154,6 +156,7 @@ + @@ -195,11 +198,11 @@

        - + +
      +
    + - - -
    diff --git a/tests/output/custom/category/content.html b/tests/output/custom/category/content.html index 389d7707..16651436 100644 --- a/tests/output/custom/category/content.html +++ b/tests/output/custom/category/content.html @@ -86,12 +86,13 @@ Translations:

    Other articles


    -
      +
        + @@ -133,11 +134,11 @@ Translations:

        - + +
      +
    + - -
    -
    diff --git a/tests/output/custom/category/yeah.html b/tests/output/custom/category/yeah.html index b70b36e7..3c9af4e2 100644 --- a/tests/output/custom/category/yeah.html +++ b/tests/output/custom/category/yeah.html @@ -100,7 +100,10 @@ - + + +
    + diff --git a/tests/output/custom/index.html b/tests/output/custom/index.html index 2154ea99..466a4db4 100644 --- a/tests/output/custom/index.html +++ b/tests/output/custom/index.html @@ -86,12 +86,13 @@ Translations:

    Other articles


    -
      +
        + @@ -125,6 +126,7 @@ Translations: + @@ -159,6 +161,7 @@ Translations: + @@ -202,11 +205,11 @@ Translations:

        - + +
      +
    + - - -
    diff --git a/tests/output/custom/index2.html b/tests/output/custom/index2.html index 9604afd7..9262d717 100644 --- a/tests/output/custom/index2.html +++ b/tests/output/custom/index2.html @@ -89,6 +89,7 @@ + @@ -123,6 +124,7 @@ as well as inline markup. + @@ -167,6 +169,7 @@ YEAH !

    + @@ -212,11 +215,11 @@ YEAH !

    - + + +
    + - - -
    diff --git a/tests/output/custom/tag/bar.html b/tests/output/custom/tag/bar.html index 069276ad..bf468bf2 100644 --- a/tests/output/custom/tag/bar.html +++ b/tests/output/custom/tag/bar.html @@ -86,12 +86,13 @@ Translations:

    Other articles


    -
      +
        + @@ -131,6 +132,7 @@ Translations: + @@ -165,6 +167,7 @@ as well as inline markup. + @@ -216,11 +219,11 @@ YEAH !

        - + +
      +
    + - -
    -
    diff --git a/tests/output/custom/tag/baz.html b/tests/output/custom/tag/baz.html index 02d87aa1..34bcdbc3 100644 --- a/tests/output/custom/tag/baz.html +++ b/tests/output/custom/tag/baz.html @@ -86,12 +86,13 @@ Translations:

    Other articles


    -
      +
        + @@ -138,11 +139,11 @@ Translations:

        - + +
      +
    + - -
    -
    diff --git a/tests/output/custom/tag/foo.html b/tests/output/custom/tag/foo.html index 2089003d..c8f088f1 100644 --- a/tests/output/custom/tag/foo.html +++ b/tests/output/custom/tag/foo.html @@ -86,12 +86,13 @@ Translations:

    Other articles


    -
      +
        + @@ -131,6 +132,7 @@ Translations: + @@ -172,11 +174,11 @@ as well as inline markup.

        - + +
      +
    + - -
    -
    diff --git a/tests/output/custom/tag/foobar.html b/tests/output/custom/tag/foobar.html index 8187acd5..682a9b7d 100644 --- a/tests/output/custom/tag/foobar.html +++ b/tests/output/custom/tag/foobar.html @@ -100,7 +100,10 @@ - + + +
    + diff --git a/tests/output/custom/tag/oh.html b/tests/output/custom/tag/oh.html index a27bb302..9e8239a4 100644 --- a/tests/output/custom/tag/oh.html +++ b/tests/output/custom/tag/oh.html @@ -99,7 +99,10 @@ YEAH !

    - + + + + diff --git a/tests/output/custom/tag/yeah.html b/tests/output/custom/tag/yeah.html index ac1ef4fa..675a53cb 100644 --- a/tests/output/custom/tag/yeah.html +++ b/tests/output/custom/tag/yeah.html @@ -99,7 +99,10 @@ YEAH !

    - + + + + From 34310a61f5bf33a4a33db11178769e7e6f1daacc Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 31 Mar 2012 08:10:40 -0700 Subject: [PATCH 0157/2344] Feed link inside feed should use FEED_DOMAIN The initial work on enabling feeds to be served from a different domain than the site domain focused on the feed link displayed inside the base template. But there is also a feed link inside the generated feed itself, which this commit updates to use the FEED_DOMAIN value (if defined). Also, it turns out that the FEED_MAIN_URL setting is not necessary; the existing FEED and FEED_RSS functionality is simpler and can address the targeted use case just as easily. That attribute has been removed from the settings and template, along with corresponding changes to the docs. Refs #177. --- docs/settings.rst | 33 +++++++++----------- pelican/settings.py | 1 - pelican/themes/notmyidea/templates/base.html | 4 +-- pelican/writers.py | 3 +- 4 files changed, 18 insertions(+), 23 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 1ed36844..b7882075 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -235,11 +235,6 @@ Setting name (default value) What does it do? `TAG_FEED_RSS` (``None``, ie no RSS tag feed) Relative URL to output the tag RSS feed `FEED_MAX_ITEMS` Maximum number of items allowed in a feed. Feed item quantity is unrestricted by default. -`FEED_MAIN_URL` (``'feeds/all.atom.xml'``) URL appended to domain for the main Atom feed and - used to populate its `` in the base template. - Useful when you want the feed link to differ from the - filesystem path, such as when using web server - aliases/rewrites or FeedBurner (see below). ================================================ ===================================================== If you don't want to generate some of these feeds, set ``None`` to the @@ -250,21 +245,21 @@ variables above. FeedBurner ---------- -If you want to use FeedBurner for your primary Atom feed, there are two -primary fields to configure in the `FeedBurner -`_ interface: "Original Feed" and "Feed Address". -If using the default Pelican `FEED` attribute and assuming your feeds -are served from the `www.example.com` domain, you would enter -`http://www.example.com/feeds/all.atom.xml` in the "Original Feed" field in -FeedBurner. +If you want to use FeedBurner for your feed, you will likely need to decide +upon a unique identifier. For example, if your site were called "Thyme" and +hosted on the www.example.com domain, you might use "thymefeeds" as your +unique identifier, which we'll use throughout this section for illustrative +purposes. In your Pelican settings, set the `FEED` attribute to +"thymefeeds/main.xml" to create an Atom feed with an original address of +`http://www.example.com/thymefeeds/main.xml`. Set the `FEED_DOMAIN` attribute +to `http://feeds.feedburner.com`, or `http://feeds.example.com` if you are +using a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature). -For the "Feed Address" field in the FeedBurner interface, you may choose -whatever suffix you prefer. In your Pelican settings, assign this suffix to -the `FEED_MAIN_URL` setting. So if your FeedBurner feed address is set to -`http://feeds.feedburner.com/myblogfeed`, in your Pelican settings you would -set: `FEED_MAIN_URL = "myblogfeed"`. Then set the `FEED_DOMAIN` setting to -`http://feeds.feedburner.com`, or `http://feeds.example.com` if you are using -a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature). +There are two fields to configure in the `FeedBurner +`_ interface: "Original Feed" and "Feed +Address". In this example, the "Original Feed" would be +`http://www.example.com/thymefeeds/main.xml` and the "Feed Address" suffix +would be `thymefeeds/main.xml`. Pagination ========== diff --git a/pelican/settings.py b/pelican/settings.py index 9dea1e94..c0e30815 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -22,7 +22,6 @@ _DEFAULT_CONFIG = {'PATH': '.', 'STATIC_PATHS': ['images', ], 'THEME_STATIC_PATHS': ['static', ], 'FEED': 'feeds/all.atom.xml', - 'FEED_MAIN_URL': 'feeds/all.atom.xml', 'CATEGORY_FEED': 'feeds/%s.atom.xml', 'TRANSLATION_FEED': 'feeds/all-%s.atom.xml', 'FEED_MAX_ITEMS': '', diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 0fd388cf..f0f745e4 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -4,7 +4,7 @@ {% block title %}{{ SITENAME }}{%endblock%} - + {% if FEED_RSS %} {% endif %} @@ -56,7 +56,7 @@ diff --git a/tests/output/custom/categories.html b/tests/output/custom/categories.html index a1a44e5b..92830754 100644 --- a/tests/output/custom/categories.html +++ b/tests/output/custom/categories.html @@ -39,27 +39,27 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • +
    diff --git a/tests/output/custom/category/bar.html b/tests/output/custom/category/bar.html index 809a2bdf..53af38da 100644 --- a/tests/output/custom/category/bar.html +++ b/tests/output/custom/category/bar.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/category/cat1.html b/tests/output/custom/category/cat1.html index fa6c6556..94bb74a7 100644 --- a/tests/output/custom/category/cat1.html +++ b/tests/output/custom/category/cat1.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/category/content.html b/tests/output/custom/category/content.html index 16651436..7645d430 100644 --- a/tests/output/custom/category/content.html +++ b/tests/output/custom/category/content.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/category/yeah.html b/tests/output/custom/category/yeah.html index 3c9af4e2..dc20affb 100644 --- a/tests/output/custom/category/yeah.html +++ b/tests/output/custom/category/yeah.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/drafts/a-draft-article.html b/tests/output/custom/drafts/a-draft-article.html index 99f5ad68..e12e5bd7 100644 --- a/tests/output/custom/drafts/a-draft-article.html +++ b/tests/output/custom/drafts/a-draft-article.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/feeds/all-en.atom.xml b/tests/output/custom/feeds/all-en.atom.xml index 7356cb17..1b18c1bd 100644 --- a/tests/output/custom/feeds/all-en.atom.xml +++ b/tests/output/custom/feeds/all-en.atom.xml @@ -1,9 +1,9 @@ -Alexis' loghttp://blog.notmyidea.org2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/all-fr.atom.xml b/tests/output/custom/feeds/all-fr.atom.xml index 27949d80..1d42bb6e 100644 --- a/tests/output/custom/feeds/all-fr.atom.xml +++ b/tests/output/custom/feeds/all-fr.atom.xml @@ -1,4 +1,4 @@ -Alexis' loghttp://blog.notmyidea.org2012-03-02T14:01:01+01:00Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireauhttp://blog.notmyidea.org/oh-yeah-fr.html<p>Et voila du contenu en français</p> -Deuxième article2012-02-29T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/second-article-fr.html<p>Ceci est un article, en français.</p> +Alexis' loghttp://blog.notmyidea.org/2012-03-02T14:01:01+01:00Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireautag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +Deuxième article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/all.atom.xml b/tests/output/custom/feeds/all.atom.xml index ef6dbf52..9090f431 100644 --- a/tests/output/custom/feeds/all.atom.xml +++ b/tests/output/custom/feeds/all.atom.xml @@ -1,9 +1,9 @@ -Alexis' loghttp://blog.notmyidea.org2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/all.rss.xml b/tests/output/custom/feeds/all.rss.xml index a3f7eff9..b726e2d1 100644 --- a/tests/output/custom/feeds/all.rss.xml +++ b/tests/output/custom/feeds/all.rss.xml @@ -1,9 +1,9 @@ -Alexis' loghttp://blog.notmyidea.orgWed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> -Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100http://blog.notmyidea.org/second-article.htmlfoobarbazA markdown powered articlehttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200http://blog.notmyidea.org/a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.org/article-1.html<p>Article 1</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-1.htmlArticle 2http://blog.notmyidea.org/article-2.html<p>Article 2</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-2.htmlArticle 3http://blog.notmyidea.org/article-3.html<p>Article 3</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-3.htmlThis is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.orgsecond-article.html<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazA markdown powered articlehttp://blog.notmyidea.orga-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.orgarticle-1.html<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-1.htmlArticle 2http://blog.notmyidea.orgarticle-2.html<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-2.htmlArticle 3http://blog.notmyidea.orgarticle-3.html<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-3.htmlThis is a super article !http://blog.notmyidea.orgthis-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100http://blog.notmyidea.org/this-is-a-super-article.htmlfoobarfoobarOh yeah !http://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.htmlfoobarfoobarOh yeah !http://blog.notmyidea.orgoh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200http://blog.notmyidea.org/oh-yeah.htmlohbaryeahUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> -Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200http://blog.notmyidea.org/unbelievable.html \ No newline at end of file +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:oh-yeah.htmlohbaryeahUnbelievable !http://blog.notmyidea.orgunbelievable.html<p>Or completely awesome. Depends the needs.</p> +Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.html \ No newline at end of file diff --git a/tests/output/custom/feeds/bar.atom.xml b/tests/output/custom/feeds/bar.atom.xml index 84ac9cda..93961545 100644 --- a/tests/output/custom/feeds/bar.atom.xml +++ b/tests/output/custom/feeds/bar.atom.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org2010-10-20T10:14:00+02:00Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +Alexis' loghttp://blog.notmyidea.org/2010-10-20T10:14:00+02:00Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> diff --git a/tests/output/custom/feeds/bar.rss.xml b/tests/output/custom/feeds/bar.rss.xml index bb5cb2b4..0a9d0f9d 100644 --- a/tests/output/custom/feeds/bar.rss.xml +++ b/tests/output/custom/feeds/bar.rss.xml @@ -1,8 +1,8 @@ -Alexis' loghttp://blog.notmyidea.orgWed, 20 Oct 2010 10:14:00 +0200Oh yeah !http://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +Alexis' loghttp://blog.notmyidea.org/Wed, 20 Oct 2010 10:14:00 +0200Oh yeah !http://blog.notmyidea.orgoh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200http://blog.notmyidea.org/oh-yeah.htmlohbaryeah \ No newline at end of file +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:oh-yeah.htmlohbaryeah \ No newline at end of file diff --git a/tests/output/custom/feeds/cat1.atom.xml b/tests/output/custom/feeds/cat1.atom.xml index e0f01780..4fce560d 100644 --- a/tests/output/custom/feeds/cat1.atom.xml +++ b/tests/output/custom/feeds/cat1.atom.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org2011-04-20T00:00:00+02:00A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/article-3.html<p>Article 3</p> +Alexis' loghttp://blog.notmyidea.org/2011-04-20T00:00:00+02:00A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/cat1.rss.xml b/tests/output/custom/feeds/cat1.rss.xml index 0043b2fb..d322572b 100644 --- a/tests/output/custom/feeds/cat1.rss.xml +++ b/tests/output/custom/feeds/cat1.rss.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.orgWed, 20 Apr 2011 00:00:00 +0200A markdown powered articlehttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200http://blog.notmyidea.org/a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.org/article-1.html<p>Article 1</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-1.htmlArticle 2http://blog.notmyidea.org/article-2.html<p>Article 2</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-2.htmlArticle 3http://blog.notmyidea.org/article-3.html<p>Article 3</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100http://blog.notmyidea.org/article-3.html \ No newline at end of file +Alexis' loghttp://blog.notmyidea.org/Wed, 20 Apr 2011 00:00:00 +0200A markdown powered articlehttp://blog.notmyidea.orga-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.orgarticle-1.html<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-1.htmlArticle 2http://blog.notmyidea.orgarticle-2.html<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-2.htmlArticle 3http://blog.notmyidea.orgarticle-3.html<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-3.html \ No newline at end of file diff --git a/tests/output/custom/feeds/content.atom.xml b/tests/output/custom/feeds/content.atom.xml index c141a0aa..6f93c8f4 100644 --- a/tests/output/custom/feeds/content.atom.xml +++ b/tests/output/custom/feeds/content.atom.xml @@ -1,4 +1,4 @@ -Alexis' loghttp://blog.notmyidea.org2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> -Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireauhttp://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/content.rss.xml b/tests/output/custom/feeds/content.rss.xml index 9f36c97e..74a322e7 100644 --- a/tests/output/custom/feeds/content.rss.xml +++ b/tests/output/custom/feeds/content.rss.xml @@ -1,4 +1,4 @@ -Alexis' loghttp://blog.notmyidea.orgWed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> -Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100http://blog.notmyidea.org/second-article.htmlfoobarbazUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> -Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200http://blog.notmyidea.org/unbelievable.html \ No newline at end of file +Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.orgsecond-article.html<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazUnbelievable !http://blog.notmyidea.orgunbelievable.html<p>Or completely awesome. Depends the needs.</p> +Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.html \ No newline at end of file diff --git a/tests/output/custom/feeds/yeah.atom.xml b/tests/output/custom/feeds/yeah.atom.xml index 4c6eed49..9a95fa03 100644 --- a/tests/output/custom/feeds/yeah.atom.xml +++ b/tests/output/custom/feeds/yeah.atom.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org2010-12-02T10:14:00+01:00This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireauhttp://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/2010-12-02T10:14:00+01:00This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> diff --git a/tests/output/custom/feeds/yeah.rss.xml b/tests/output/custom/feeds/yeah.rss.xml index c4f5512e..1c5884a2 100644 --- a/tests/output/custom/feeds/yeah.rss.xml +++ b/tests/output/custom/feeds/yeah.rss.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.orgThu, 02 Dec 2010 10:14:00 +0100This is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/Thu, 02 Dec 2010 10:14:00 +0100This is a super article !http://blog.notmyidea.orgthis-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -11,4 +11,4 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100http://blog.notmyidea.org/this-is-a-super-article.htmlfoobarfoobar \ No newline at end of file +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.htmlfoobarfoobar \ No newline at end of file diff --git a/tests/output/custom/index.html b/tests/output/custom/index.html index 466a4db4..ae77c625 100644 --- a/tests/output/custom/index.html +++ b/tests/output/custom/index.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/index2.html b/tests/output/custom/index2.html index 9262d717..797217ad 100644 --- a/tests/output/custom/index2.html +++ b/tests/output/custom/index2.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + @@ -115,8 +115,9 @@ - Multi-line metadata should be supported -as well as inline markup. +

    Multi-line metadata should be supported +as well as inline markup.

    + read more

    There are comments.

    diff --git a/tests/output/custom/oh-yeah-fr.html b/tests/output/custom/oh-yeah-fr.html index e692105b..b699b41c 100644 --- a/tests/output/custom/oh-yeah-fr.html +++ b/tests/output/custom/oh-yeah-fr.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/oh-yeah.html b/tests/output/custom/oh-yeah.html index 6ffaad13..b8263c1b 100644 --- a/tests/output/custom/oh-yeah.html +++ b/tests/output/custom/oh-yeah.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/pages/this-is-a-test-page.html b/tests/output/custom/pages/this-is-a-test-page.html index 27d6ec69..f176e761 100644 --- a/tests/output/custom/pages/this-is-a-test-page.html +++ b/tests/output/custom/pages/this-is-a-test-page.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/second-article-fr.html b/tests/output/custom/second-article-fr.html index b3b12af7..9e5b81ad 100644 --- a/tests/output/custom/second-article-fr.html +++ b/tests/output/custom/second-article-fr.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/second-article.html b/tests/output/custom/second-article.html index 4b31dc69..a769cee4 100644 --- a/tests/output/custom/second-article.html +++ b/tests/output/custom/second-article.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/tag/bar.html b/tests/output/custom/tag/bar.html index bf468bf2..5d6237cd 100644 --- a/tests/output/custom/tag/bar.html +++ b/tests/output/custom/tag/bar.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + @@ -158,8 +158,9 @@ Translations: - Multi-line metadata should be supported -as well as inline markup. +

    Multi-line metadata should be supported +as well as inline markup.

    + read more

    There are comments.

    diff --git a/tests/output/custom/tag/baz.html b/tests/output/custom/tag/baz.html index 34bcdbc3..e1be3d77 100644 --- a/tests/output/custom/tag/baz.html +++ b/tests/output/custom/tag/baz.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/tag/foo.html b/tests/output/custom/tag/foo.html index c8f088f1..3beabbb1 100644 --- a/tests/output/custom/tag/foo.html +++ b/tests/output/custom/tag/foo.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + @@ -158,8 +158,9 @@ Translations: - Multi-line metadata should be supported -as well as inline markup. +

    Multi-line metadata should be supported +as well as inline markup.

    + read more

    There are comments.

    diff --git a/tests/output/custom/tag/foobar.html b/tests/output/custom/tag/foobar.html index 682a9b7d..2da611ed 100644 --- a/tests/output/custom/tag/foobar.html +++ b/tests/output/custom/tag/foobar.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/tag/oh.html b/tests/output/custom/tag/oh.html index 9e8239a4..73db4505 100644 --- a/tests/output/custom/tag/oh.html +++ b/tests/output/custom/tag/oh.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/tag/yeah.html b/tests/output/custom/tag/yeah.html index 675a53cb..f72400a6 100644 --- a/tests/output/custom/tag/yeah.html +++ b/tests/output/custom/tag/yeah.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/theme/css/main.css b/tests/output/custom/theme/css/main.css index 28c98b99..92905076 100644 --- a/tests/output/custom/theme/css/main.css +++ b/tests/output/custom/theme/css/main.css @@ -111,6 +111,13 @@ cite {} q {} +div.note { + float: right; + margin: 5px; + font-size: 85%; + max-width: 300px; +} + /* Tables */ table {margin: .5em auto 1.5em auto; width: 98%;} diff --git a/tests/output/custom/this-is-a-super-article.html b/tests/output/custom/this-is-a-super-article.html index 2fd6b306..9ba6bb9b 100644 --- a/tests/output/custom/this-is-a-super-article.html +++ b/tests/output/custom/this-is-a-super-article.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + diff --git a/tests/output/custom/unbelievable.html b/tests/output/custom/unbelievable.html index b7730421..1b611efe 100644 --- a/tests/output/custom/unbelievable.html +++ b/tests/output/custom/unbelievable.html @@ -39,14 +39,14 @@ -
  • cat1
  • - -
  • bar
  • -
  • yeah
  • content
  • +
  • cat1
  • + +
  • bar
  • + From c4c49678f906897fe276831ab5e5261f16f757ac Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Wed, 4 Apr 2012 22:40:03 +0200 Subject: [PATCH 0174/2344] update basic output now that categories are correctly sorted pelican -o tests/output/basic/ samples/content/ --- tests/output/basic/a-markdown-powered-article.html | 4 ++-- tests/output/basic/archives.html | 4 ++-- tests/output/basic/article-1.html | 4 ++-- tests/output/basic/article-2.html | 4 ++-- tests/output/basic/article-3.html | 4 ++-- tests/output/basic/author/alexis-metaireau.html | 9 +++++---- tests/output/basic/author/bruno.html | 4 ++-- tests/output/basic/categories.html | 8 ++++---- tests/output/basic/category/bar.html | 4 ++-- tests/output/basic/category/cat1.html | 4 ++-- tests/output/basic/category/content.html | 4 ++-- tests/output/basic/category/yeah.html | 4 ++-- tests/output/basic/drafts/a-draft-article.html | 4 ++-- tests/output/basic/feeds/all-en.atom.xml | 14 +++++++------- tests/output/basic/feeds/all-fr.atom.xml | 4 ++-- tests/output/basic/feeds/all.atom.xml | 14 +++++++------- tests/output/basic/feeds/bar.atom.xml | 2 +- tests/output/basic/feeds/cat1.atom.xml | 6 +++--- tests/output/basic/feeds/content.atom.xml | 4 ++-- tests/output/basic/feeds/yeah.atom.xml | 2 +- tests/output/basic/index.html | 9 +++++---- tests/output/basic/oh-yeah-fr.html | 4 ++-- tests/output/basic/oh-yeah.html | 4 ++-- tests/output/basic/pages/this-is-a-test-page.html | 4 ++-- tests/output/basic/second-article-fr.html | 4 ++-- tests/output/basic/second-article.html | 4 ++-- tests/output/basic/tag/bar.html | 9 +++++---- tests/output/basic/tag/baz.html | 4 ++-- tests/output/basic/tag/foo.html | 9 +++++---- tests/output/basic/tag/foobar.html | 4 ++-- tests/output/basic/tag/oh.html | 4 ++-- tests/output/basic/tag/yeah.html | 4 ++-- tests/output/basic/theme/css/main.css | 7 +++++++ tests/output/basic/this-is-a-super-article.html | 4 ++-- tests/output/basic/unbelievable.html | 4 ++-- 35 files changed, 98 insertions(+), 87 deletions(-) diff --git a/tests/output/basic/a-markdown-powered-article.html b/tests/output/basic/a-markdown-powered-article.html index 32a863d6..d36ba32c 100644 --- a/tests/output/basic/a-markdown-powered-article.html +++ b/tests/output/basic/a-markdown-powered-article.html @@ -31,11 +31,11 @@ -
  • content
  • +
  • bar
  • cat1
  • -
  • bar
  • +
  • content
  • yeah
  • diff --git a/tests/output/basic/archives.html b/tests/output/basic/archives.html index 840dfa02..9aedb29d 100644 --- a/tests/output/basic/archives.html +++ b/tests/output/basic/archives.html @@ -31,11 +31,11 @@ -
  • content
  • +
  • bar
  • cat1
  • -
  • bar
  • +
  • content
  • yeah
  • diff --git a/tests/output/basic/article-1.html b/tests/output/basic/article-1.html index c1199371..e681b991 100644 --- a/tests/output/basic/article-1.html +++ b/tests/output/basic/article-1.html @@ -31,11 +31,11 @@ -
  • content
  • +
  • bar
  • cat1
  • -
  • bar
  • +
  • content
  • yeah
  • diff --git a/tests/output/basic/article-2.html b/tests/output/basic/article-2.html index 62dd0368..b56d18ba 100644 --- a/tests/output/basic/article-2.html +++ b/tests/output/basic/article-2.html @@ -31,11 +31,11 @@ -
  • content
  • +
  • bar
  • cat1
  • -
  • bar
  • +
  • content
  • yeah
  • diff --git a/tests/output/basic/article-3.html b/tests/output/basic/article-3.html index 9fd6df0a..0d2525e7 100644 --- a/tests/output/basic/article-3.html +++ b/tests/output/basic/article-3.html @@ -31,11 +31,11 @@ -
  • content
  • +
  • bar
  • cat1
  • -
  • bar
  • +
  • content
  • yeah
  • diff --git a/tests/output/basic/author/alexis-metaireau.html b/tests/output/basic/author/alexis-metaireau.html index ab68482d..6bf631eb 100644 --- a/tests/output/basic/author/alexis-metaireau.html +++ b/tests/output/basic/author/alexis-metaireau.html @@ -31,11 +31,11 @@ -
  • content
  • +
  • bar
  • cat1
  • -
  • bar
  • +
  • content
  • yeah
  • @@ -115,8 +115,9 @@ YEAH !

    - Multi-line metadata should be supported -as well as inline markup. +

    Multi-line metadata should be supported +as well as inline markup.

    + read more diff --git a/tests/output/basic/author/bruno.html b/tests/output/basic/author/bruno.html index 1e2dc655..f889c94e 100644 --- a/tests/output/basic/author/bruno.html +++ b/tests/output/basic/author/bruno.html @@ -31,11 +31,11 @@ -
  • content
  • +
  • bar
  • cat1
  • -
  • bar
  • +
  • content
  • yeah
  • diff --git a/tests/output/basic/categories.html b/tests/output/basic/categories.html index 5ffb220d..2430cc96 100644 --- a/tests/output/basic/categories.html +++ b/tests/output/basic/categories.html @@ -31,11 +31,11 @@ -
  • content
  • +
  • bar
  • cat1
  • -
  • bar
  • +
  • content
  • yeah
  • @@ -44,11 +44,11 @@
      -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/category/bar.html b/tests/output/basic/category/bar.html index b268dd53..77d0187b 100644 --- a/tests/output/basic/category/bar.html +++ b/tests/output/basic/category/bar.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/category/cat1.html b/tests/output/basic/category/cat1.html index e92fd0df..ba43f8f5 100644 --- a/tests/output/basic/category/cat1.html +++ b/tests/output/basic/category/cat1.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/category/content.html b/tests/output/basic/category/content.html index 0eec912c..9f44fa9e 100644 --- a/tests/output/basic/category/content.html +++ b/tests/output/basic/category/content.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/category/yeah.html b/tests/output/basic/category/yeah.html index ccb531f1..747cad37 100644 --- a/tests/output/basic/category/yeah.html +++ b/tests/output/basic/category/yeah.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/drafts/a-draft-article.html b/tests/output/basic/drafts/a-draft-article.html index 59b6223f..0b7f6899 100644 --- a/tests/output/basic/drafts/a-draft-article.html +++ b/tests/output/basic/drafts/a-draft-article.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/feeds/all-en.atom.xml b/tests/output/basic/feeds/all-en.atom.xml index c9fe8270..66c51fdf 100644 --- a/tests/output/basic/feeds/all-en.atom.xml +++ b/tests/output/basic/feeds/all-en.atom.xml @@ -1,9 +1,9 @@ -A Pelican Blog../.2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbruno.././second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00Zbruno.././a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbruno.././article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00Zbruno.././article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00Zbruno.././article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00ZAlexis Métaireau.././this-is-a-super-article.html<p>Some content here !</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbrunotag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00Zbrunotag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00ZAlexis Métaireau.././oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00Zbruno.././unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00Zbrunotag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/all-fr.atom.xml b/tests/output/basic/feeds/all-fr.atom.xml index 606e5186..2de714bb 100644 --- a/tests/output/basic/feeds/all-fr.atom.xml +++ b/tests/output/basic/feeds/all-fr.atom.xml @@ -1,4 +1,4 @@ -A Pelican Blog../.2012-03-02T14:01:01ZTrop bien !2012-03-02T14:01:01Zbruno.././oh-yeah-fr.html<p>Et voila du contenu en français</p> -Deuxième article2012-02-29T00:00:00Zbruno.././second-article-fr.html<p>Ceci est un article, en français.</p> +A Pelican Blog.././2012-03-02T14:01:01ZTrop bien !2012-03-02T14:01:01Zbrunotag:../.,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +Deuxième article2012-02-29T00:00:00Zbrunotag:../.,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/all.atom.xml b/tests/output/basic/feeds/all.atom.xml index 3bb7d2fd..c496adf7 100644 --- a/tests/output/basic/feeds/all.atom.xml +++ b/tests/output/basic/feeds/all.atom.xml @@ -1,9 +1,9 @@ -A Pelican Blog../.2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbruno.././second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00Zbruno.././a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbruno.././article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00Zbruno.././article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00Zbruno.././article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00ZAlexis Métaireau.././this-is-a-super-article.html<p>Some content here !</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbrunotag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00Zbrunotag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00ZAlexis Métaireau.././oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00Zbruno.././unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00Zbrunotag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/bar.atom.xml b/tests/output/basic/feeds/bar.atom.xml index 6ce45518..066ae95f 100644 --- a/tests/output/basic/feeds/bar.atom.xml +++ b/tests/output/basic/feeds/bar.atom.xml @@ -1,5 +1,5 @@ -A Pelican Blog../.2010-10-20T10:14:00ZOh yeah !2010-10-20T10:14:00ZAlexis Métaireau.././oh-yeah.html<div class="section" id="why-not"> +A Pelican Blog.././2010-10-20T10:14:00ZOh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> diff --git a/tests/output/basic/feeds/cat1.atom.xml b/tests/output/basic/feeds/cat1.atom.xml index f66c2e73..3a4af6a6 100644 --- a/tests/output/basic/feeds/cat1.atom.xml +++ b/tests/output/basic/feeds/cat1.atom.xml @@ -1,5 +1,5 @@ -A Pelican Blog../.2011-04-20T00:00:00ZA markdown powered article2011-04-20T00:00:00Zbruno.././a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbruno.././article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00Zbruno.././article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00Zbruno.././article-3.html<p>Article 3</p> +A Pelican Blog.././2011-04-20T00:00:00ZA markdown powered article2011-04-20T00:00:00Zbrunotag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-3.html<p>Article 3</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/content.atom.xml b/tests/output/basic/feeds/content.atom.xml index 0cf53aa7..e35b840f 100644 --- a/tests/output/basic/feeds/content.atom.xml +++ b/tests/output/basic/feeds/content.atom.xml @@ -1,4 +1,4 @@ -A Pelican Blog../.2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbruno.././second-article.html<p>This is some article, in english</p> -Unbelievable !2010-10-15T20:30:00Zbruno.././unbelievable.html<p>Or completely awesome. Depends the needs.</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbrunotag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00Zbrunotag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/yeah.atom.xml b/tests/output/basic/feeds/yeah.atom.xml index 7fd8e9f2..5ae933f4 100644 --- a/tests/output/basic/feeds/yeah.atom.xml +++ b/tests/output/basic/feeds/yeah.atom.xml @@ -1,5 +1,5 @@ -A Pelican Blog../.2010-12-02T10:14:00ZThis is a super article !2010-12-02T10:14:00ZAlexis Métaireau.././this-is-a-super-article.html<p>Some content here !</p> +A Pelican Blog.././2010-12-02T10:14:00ZThis is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> diff --git a/tests/output/basic/index.html b/tests/output/basic/index.html index 8a2091b9..9bc1a2f9 100644 --- a/tests/output/basic/index.html +++ b/tests/output/basic/index.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • @@ -249,8 +249,9 @@ Translations: - Multi-line metadata should be supported -as well as inline markup. +

      Multi-line metadata should be supported +as well as inline markup.

      + read more diff --git a/tests/output/basic/oh-yeah-fr.html b/tests/output/basic/oh-yeah-fr.html index 55eec103..b380252e 100644 --- a/tests/output/basic/oh-yeah-fr.html +++ b/tests/output/basic/oh-yeah-fr.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/oh-yeah.html b/tests/output/basic/oh-yeah.html index 4b650e7d..dfa1d178 100644 --- a/tests/output/basic/oh-yeah.html +++ b/tests/output/basic/oh-yeah.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/pages/this-is-a-test-page.html b/tests/output/basic/pages/this-is-a-test-page.html index 0162232c..cc282243 100644 --- a/tests/output/basic/pages/this-is-a-test-page.html +++ b/tests/output/basic/pages/this-is-a-test-page.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/second-article-fr.html b/tests/output/basic/second-article-fr.html index 704971d2..e6244aa8 100644 --- a/tests/output/basic/second-article-fr.html +++ b/tests/output/basic/second-article-fr.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/second-article.html b/tests/output/basic/second-article.html index 94043446..3dec8d70 100644 --- a/tests/output/basic/second-article.html +++ b/tests/output/basic/second-article.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/tag/bar.html b/tests/output/basic/tag/bar.html index 4afb4bfd..bc4ffc9c 100644 --- a/tests/output/basic/tag/bar.html +++ b/tests/output/basic/tag/bar.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • @@ -150,8 +150,9 @@ Translations: - Multi-line metadata should be supported -as well as inline markup. +

      Multi-line metadata should be supported +as well as inline markup.

      + read more diff --git a/tests/output/basic/tag/baz.html b/tests/output/basic/tag/baz.html index b8df58e3..523e6f71 100644 --- a/tests/output/basic/tag/baz.html +++ b/tests/output/basic/tag/baz.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/tag/foo.html b/tests/output/basic/tag/foo.html index 20cf293a..49cc3fd8 100644 --- a/tests/output/basic/tag/foo.html +++ b/tests/output/basic/tag/foo.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • @@ -150,8 +150,9 @@ Translations: - Multi-line metadata should be supported -as well as inline markup. +

      Multi-line metadata should be supported +as well as inline markup.

      + read more diff --git a/tests/output/basic/tag/foobar.html b/tests/output/basic/tag/foobar.html index 0a5eeb3b..1817aa88 100644 --- a/tests/output/basic/tag/foobar.html +++ b/tests/output/basic/tag/foobar.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/tag/oh.html b/tests/output/basic/tag/oh.html index 563c0f2e..3ff36f49 100644 --- a/tests/output/basic/tag/oh.html +++ b/tests/output/basic/tag/oh.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/tag/yeah.html b/tests/output/basic/tag/yeah.html index 4b18b7e3..76ca35a3 100644 --- a/tests/output/basic/tag/yeah.html +++ b/tests/output/basic/tag/yeah.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/theme/css/main.css b/tests/output/basic/theme/css/main.css index 28c98b99..92905076 100644 --- a/tests/output/basic/theme/css/main.css +++ b/tests/output/basic/theme/css/main.css @@ -111,6 +111,13 @@ cite {} q {} +div.note { + float: right; + margin: 5px; + font-size: 85%; + max-width: 300px; +} + /* Tables */ table {margin: .5em auto 1.5em auto; width: 98%;} diff --git a/tests/output/basic/this-is-a-super-article.html b/tests/output/basic/this-is-a-super-article.html index cb12da2d..b2cf0392 100644 --- a/tests/output/basic/this-is-a-super-article.html +++ b/tests/output/basic/this-is-a-super-article.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • diff --git a/tests/output/basic/unbelievable.html b/tests/output/basic/unbelievable.html index 4c6e6b07..6380a2a3 100644 --- a/tests/output/basic/unbelievable.html +++ b/tests/output/basic/unbelievable.html @@ -31,11 +31,11 @@ -
    • content
    • +
    • bar
    • cat1
    • -
    • bar
    • +
    • content
    • yeah
    • From c430ab57ba1c2276f0a150cd8c6467fdb12a01b5 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Wed, 4 Apr 2012 22:48:11 +0200 Subject: [PATCH 0175/2344] mock getenv to always return the same value for $USER --- tests/test_pelican.py | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tests/test_pelican.py b/tests/test_pelican.py index 49328ebe..1192dfe1 100644 --- a/tests/test_pelican.py +++ b/tests/test_pelican.py @@ -6,6 +6,8 @@ except ImportError: import os from filecmp import dircmp +from mock import patch + from .support import temporary_folder from pelican import Pelican @@ -28,12 +30,15 @@ class TestPelican(unittest.TestCase): # ones and generate the output without raising any exception / issuing # any warning. with temporary_folder() as temp_path: - pelican = Pelican(path=INPUT_PATH, output_path=temp_path) - pelican.run() - diff = dircmp(temp_path, os.sep.join((OUTPUT_PATH, "basic"))) - self.assertEqual(diff.left_only, []) - self.assertEqual(diff.right_only, []) - self.assertEqual(diff.diff_files, []) + with patch("pelican.contents.getenv") as mock_getenv: + # force getenv('USER') to always return the same value + mock_getenv.return_value = "Dummy Author" + pelican = Pelican(path=INPUT_PATH, output_path=temp_path) + pelican.run() + diff = dircmp(temp_path, os.sep.join((OUTPUT_PATH, "basic"))) + self.assertEqual(diff.left_only, []) + self.assertEqual(diff.right_only, []) + self.assertEqual(diff.diff_files, []) def test_custom_generation_works(self): # the same thing with a specified set of settings should work From 912ffe4a912a4e4760015c003dc7d0a6b2cc3c44 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Wed, 4 Apr 2012 22:49:12 +0200 Subject: [PATCH 0176/2344] update basic output with $USER="Dummy Author" USER="Dummy Author" pelican -o tests/output/basic/ samples/content/ --- tests/output/basic/a-markdown-powered-article.html | 2 +- tests/output/basic/article-1.html | 2 +- tests/output/basic/article-2.html | 2 +- tests/output/basic/article-3.html | 2 +- .../basic/author/{bruno.html => dummy-author.html} | 14 +++++++------- tests/output/basic/category/cat1.html | 8 ++++---- tests/output/basic/category/content.html | 4 ++-- tests/output/basic/drafts/a-draft-article.html | 2 +- tests/output/basic/feeds/all-en.atom.xml | 10 +++++----- tests/output/basic/feeds/all-fr.atom.xml | 4 ++-- tests/output/basic/feeds/all.atom.xml | 10 +++++----- tests/output/basic/feeds/cat1.atom.xml | 6 +++--- tests/output/basic/feeds/content.atom.xml | 4 ++-- tests/output/basic/index.html | 12 ++++++------ tests/output/basic/oh-yeah-fr.html | 2 +- tests/output/basic/second-article-fr.html | 2 +- tests/output/basic/second-article.html | 2 +- tests/output/basic/tag/bar.html | 4 ++-- tests/output/basic/tag/baz.html | 4 ++-- tests/output/basic/tag/foo.html | 4 ++-- tests/output/basic/unbelievable.html | 2 +- 21 files changed, 51 insertions(+), 51 deletions(-) rename tests/output/basic/author/{bruno.html => dummy-author.html} (92%) diff --git a/tests/output/basic/a-markdown-powered-article.html b/tests/output/basic/a-markdown-powered-article.html index d36ba32c..9cb92c4b 100644 --- a/tests/output/basic/a-markdown-powered-article.html +++ b/tests/output/basic/a-markdown-powered-article.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In cat1.

      diff --git a/tests/output/basic/article-1.html b/tests/output/basic/article-1.html index e681b991..5f1d7c1d 100644 --- a/tests/output/basic/article-1.html +++ b/tests/output/basic/article-1.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In cat1.

      diff --git a/tests/output/basic/article-2.html b/tests/output/basic/article-2.html index b56d18ba..d6dbf74b 100644 --- a/tests/output/basic/article-2.html +++ b/tests/output/basic/article-2.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In cat1.

      diff --git a/tests/output/basic/article-3.html b/tests/output/basic/article-3.html index 0d2525e7..8dc806c1 100644 --- a/tests/output/basic/article-3.html +++ b/tests/output/basic/article-3.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In cat1.

      diff --git a/tests/output/basic/author/bruno.html b/tests/output/basic/author/dummy-author.html similarity index 92% rename from tests/output/basic/author/bruno.html rename to tests/output/basic/author/dummy-author.html index f889c94e..cf23f899 100644 --- a/tests/output/basic/author/bruno.html +++ b/tests/output/basic/author/dummy-author.html @@ -1,7 +1,7 @@ - A Pelican Blog - bruno + A Pelican Blog - Dummy Author @@ -57,7 +57,7 @@
      - By bruno + By Dummy Author

      In cat1.

      @@ -96,7 +96,7 @@
      - By bruno + By Dummy Author

      In cat1.

      @@ -131,7 +131,7 @@
      - By bruno + By Dummy Author

      In cat1.

      @@ -166,7 +166,7 @@
      - By bruno + By Dummy Author

      In cat1.

      @@ -201,7 +201,7 @@
      - By bruno + By Dummy Author

      In content.

      @@ -241,7 +241,7 @@ Translations:
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/category/cat1.html b/tests/output/basic/category/cat1.html index ba43f8f5..1d8d67e8 100644 --- a/tests/output/basic/category/cat1.html +++ b/tests/output/basic/category/cat1.html @@ -57,7 +57,7 @@
      - By bruno + By Dummy Author

      In cat1.

      @@ -96,7 +96,7 @@
      - By bruno + By Dummy Author

      In cat1.

      @@ -131,7 +131,7 @@
      - By bruno + By Dummy Author

      In cat1.

      @@ -166,7 +166,7 @@
      - By bruno + By Dummy Author

      In cat1.

      diff --git a/tests/output/basic/category/content.html b/tests/output/basic/category/content.html index 9f44fa9e..19ceef2c 100644 --- a/tests/output/basic/category/content.html +++ b/tests/output/basic/category/content.html @@ -57,7 +57,7 @@
      - By bruno + By Dummy Author

      In content.

      @@ -102,7 +102,7 @@ Translations:
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/drafts/a-draft-article.html b/tests/output/basic/drafts/a-draft-article.html index 0b7f6899..32a11e69 100644 --- a/tests/output/basic/drafts/a-draft-article.html +++ b/tests/output/basic/drafts/a-draft-article.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/feeds/all-en.atom.xml b/tests/output/basic/feeds/all-en.atom.xml index 66c51fdf..e10386d5 100644 --- a/tests/output/basic/feeds/all-en.atom.xml +++ b/tests/output/basic/feeds/all-en.atom.xml @@ -1,8 +1,8 @@ -A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbrunotag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00Zbrunotag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-3.html<p>Article 3</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> @@ -21,5 +21,5 @@ YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00Zbrunotag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/all-fr.atom.xml b/tests/output/basic/feeds/all-fr.atom.xml index 2de714bb..3243f840 100644 --- a/tests/output/basic/feeds/all-fr.atom.xml +++ b/tests/output/basic/feeds/all-fr.atom.xml @@ -1,4 +1,4 @@ -A Pelican Blog.././2012-03-02T14:01:01ZTrop bien !2012-03-02T14:01:01Zbrunotag:../.,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> -Deuxième article2012-02-29T00:00:00Zbrunotag:../.,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> +A Pelican Blog.././2012-03-02T14:01:01ZTrop bien !2012-03-02T14:01:01ZDummy Authortag:../.,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +Deuxième article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/all.atom.xml b/tests/output/basic/feeds/all.atom.xml index c496adf7..7cdadf5d 100644 --- a/tests/output/basic/feeds/all.atom.xml +++ b/tests/output/basic/feeds/all.atom.xml @@ -1,8 +1,8 @@ -A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbrunotag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00Zbrunotag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-3.html<p>Article 3</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> @@ -21,5 +21,5 @@ YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00Zbrunotag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/cat1.atom.xml b/tests/output/basic/feeds/cat1.atom.xml index 3a4af6a6..05b21f75 100644 --- a/tests/output/basic/feeds/cat1.atom.xml +++ b/tests/output/basic/feeds/cat1.atom.xml @@ -1,5 +1,5 @@ -A Pelican Blog.././2011-04-20T00:00:00ZA markdown powered article2011-04-20T00:00:00Zbrunotag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00Zbrunotag:../.,2011-02-17:article-3.html<p>Article 3</p> +A Pelican Blog.././2011-04-20T00:00:00ZA markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/content.atom.xml b/tests/output/basic/feeds/content.atom.xml index e35b840f..d255cc8a 100644 --- a/tests/output/basic/feeds/content.atom.xml +++ b/tests/output/basic/feeds/content.atom.xml @@ -1,4 +1,4 @@ -A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Zbrunotag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> -Unbelievable !2010-10-15T20:30:00Zbrunotag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/index.html b/tests/output/basic/index.html index 9bc1a2f9..1f247443 100644 --- a/tests/output/basic/index.html +++ b/tests/output/basic/index.html @@ -57,7 +57,7 @@
      - By bruno + By Dummy Author

      In content.

      @@ -102,7 +102,7 @@ Translations:
      - By bruno + By Dummy Author

      In cat1.

      @@ -136,7 +136,7 @@ Translations:
      - By bruno + By Dummy Author

      In cat1.

      @@ -171,7 +171,7 @@ Translations:
      - By bruno + By Dummy Author

      In cat1.

      @@ -206,7 +206,7 @@ Translations:
      - By bruno + By Dummy Author

      In cat1.

      @@ -322,7 +322,7 @@ YEAH !

      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/oh-yeah-fr.html b/tests/output/basic/oh-yeah-fr.html index b380252e..186791b5 100644 --- a/tests/output/basic/oh-yeah-fr.html +++ b/tests/output/basic/oh-yeah-fr.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/second-article-fr.html b/tests/output/basic/second-article-fr.html index e6244aa8..9f9838dc 100644 --- a/tests/output/basic/second-article-fr.html +++ b/tests/output/basic/second-article-fr.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/second-article.html b/tests/output/basic/second-article.html index 3dec8d70..13f56e4c 100644 --- a/tests/output/basic/second-article.html +++ b/tests/output/basic/second-article.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/tag/bar.html b/tests/output/basic/tag/bar.html index bc4ffc9c..8ffd84d8 100644 --- a/tests/output/basic/tag/bar.html +++ b/tests/output/basic/tag/bar.html @@ -57,7 +57,7 @@
      - By bruno + By Dummy Author

      In content.

      @@ -102,7 +102,7 @@ Translations:
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/tag/baz.html b/tests/output/basic/tag/baz.html index 523e6f71..ea01a199 100644 --- a/tests/output/basic/tag/baz.html +++ b/tests/output/basic/tag/baz.html @@ -57,7 +57,7 @@
      - By bruno + By Dummy Author

      In content.

      @@ -102,7 +102,7 @@ Translations:
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/tag/foo.html b/tests/output/basic/tag/foo.html index 49cc3fd8..ea674062 100644 --- a/tests/output/basic/tag/foo.html +++ b/tests/output/basic/tag/foo.html @@ -57,7 +57,7 @@
      - By bruno + By Dummy Author

      In content.

      @@ -102,7 +102,7 @@ Translations:
      - By bruno + By Dummy Author

      In content.

      diff --git a/tests/output/basic/unbelievable.html b/tests/output/basic/unbelievable.html index 6380a2a3..581e8318 100644 --- a/tests/output/basic/unbelievable.html +++ b/tests/output/basic/unbelievable.html @@ -54,7 +54,7 @@
      - By bruno + By Dummy Author

      In content.

      From 03fdefb158cd495c960c6637bf7f7deb99a9f1de Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Wed, 4 Apr 2012 23:18:11 +0200 Subject: [PATCH 0177/2344] add instructions to regenerate the output of functional tests --- docs/contribute.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/contribute.rst b/docs/contribute.rst index fcf8d5c0..e33f8ab4 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -39,6 +39,14 @@ The tests live in "pelican/tests" and you can run them using the $ unit2 discover +If you have made changes that affect the output of a pelican generated weblog, +then you should update the output used by functional tests. +To do so, you can use the 2 following commands:: + + $ pelican -o tests/output/custom/ -s samples/pelican.conf.py \ + samples/content/ + $ pelican -o tests/output/basic/ samples/content/ + Coding standards ================ From cfebb37c6464d42432da0694eb6665004b7efedb Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Thu, 5 Apr 2012 06:47:15 +0200 Subject: [PATCH 0178/2344] fix command to regenerate the output of basic functional test the command needs to be prefixed by USER="Dummy Author" which is the author name value mocked in the corresponding functional test. --- docs/contribute.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index e33f8ab4..3960b3f9 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -45,7 +45,7 @@ To do so, you can use the 2 following commands:: $ pelican -o tests/output/custom/ -s samples/pelican.conf.py \ samples/content/ - $ pelican -o tests/output/basic/ samples/content/ + $ USER="Dummy Author" pelican -o tests/output/basic/ samples/content/ Coding standards ================ From b509fe70cd90d077242223865b87612d845b851f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9my=20HUBSCHER?= Date: Fri, 6 Apr 2012 09:55:15 +0200 Subject: [PATCH 0179/2344] Add rsync_upload --- pelican/tools/pelican_quickstart.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 7ade62e9..43e2a537 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -52,6 +52,9 @@ clean: dropbox_upload: $$(OUTPUTDIR)/index.html \tcp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) +rsync_upload: $$(OUTPUTDIR)/index.html +\trsync --delete -rvz -e ssh $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) + ssh_upload: $$(OUTPUTDIR)/index.html \tscp -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) From 7b657032ae921bde783e75cb97232be1b80932f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20M=C3=BChlenschulte?= Date: Fri, 6 Apr 2012 21:54:11 +0200 Subject: [PATCH 0180/2344] added rsync_upload to the generated Makefile --- pelican/tools/pelican_quickstart.py | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 43e2a537..752113ba 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -28,15 +28,16 @@ SSH_TARGET_DIR=$ssh_target_dir DROPBOX_DIR=$dropbox_dir help: -\t@echo 'Makefile for a pelican Web site ' -\t@echo ' ' -\t@echo 'Usage: ' -\t@echo ' make html (re)generate the web site ' -\t@echo ' make clean remove the generated files ' -\t@echo ' ftp_upload upload the web site using FTP ' -\t@echo ' ssh_upload upload the web site using SSH ' -\t@echo ' dropbox_upload upload the web site using Dropbox ' -\t@echo ' ' +\t@echo 'Makefile for a pelican Web site ' +\t@echo ' ' +\t@echo 'Usage: ' +\t@echo ' make html (re)generate the web site ' +\t@echo ' make clean remove the generated files ' +\t@echo ' ftp_upload upload the web site using FTP ' +\t@echo ' ssh_upload upload the web site using SSH ' +\t@echo ' dropbox_upload upload the web site using Dropbox ' +\t@echo ' rsync_upload upload the web site using rsync/ssh' +\t@echo ' ' html: clean $$(OUTPUTDIR)/index.html @@ -58,6 +59,9 @@ rsync_upload: $$(OUTPUTDIR)/index.html ssh_upload: $$(OUTPUTDIR)/index.html \tscp -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) +rsync_upload: $$(OUTPUTDIR)/index. +\trsync -e ssh -P -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) + ftp_upload: $$(OUTPUTDIR)/index.html \tlftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" @@ -65,7 +69,7 @@ github: $$(OUTPUTDIR)/index.html \tghp-import $$(OUTPUTDIR) \tgit push origin gh-pages -.PHONY: html help clean ftp_upload ssh_upload dropbox_upload github +.PHONY: html help clean ftp_upload ssh_upload rsync_upload dropbox_upload github ''', 'pelican.conf.py': '''#!/usr/bin/env python From 405cc66637458071ad8e1fd12e85e44ae06a10d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20M=C3=BChlenschulte?= Date: Sat, 7 Apr 2012 11:01:31 +0200 Subject: [PATCH 0181/2344] added missing file extension in make file generation (index.html) --- pelican/tools/pelican_quickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 752113ba..2f63029b 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -59,7 +59,7 @@ rsync_upload: $$(OUTPUTDIR)/index.html ssh_upload: $$(OUTPUTDIR)/index.html \tscp -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) -rsync_upload: $$(OUTPUTDIR)/index. +rsync_upload: $$(OUTPUTDIR)/index.html \trsync -e ssh -P -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) ftp_upload: $$(OUTPUTDIR)/index.html From ae97cbfb72ccb0c5e716cfe546eeb646ab15b3e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Raimbault?= Date: Sat, 7 Apr 2012 17:33:23 +0200 Subject: [PATCH 0182/2344] Fix misspelling of ssh_target_dir in quickstart --- pelican/tools/pelican_quickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 43e2a537..0365ca62 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -231,7 +231,7 @@ Please answer the following questions so this script can generate the files need if ask('Do you want to upload your website using SSH ?', answer=bool, default=False): CONF['ssh_host'] = ask('What is the hostname of your SSH server ?', str, CONF['ssh_host']) CONF['ssh_user'] = ask('What is your username on this server ?', str, CONF['ssh_user']) - CONF['ssh_traget_dir'] = ask('Where do you want to put your website on this server ?', str, CONF['ssh_target_dir']) + CONF['ssh_target_dir'] = ask('Where do you want to put your website on this server ?', str, CONF['ssh_target_dir']) if ask('Do you want to upload your website using Dropbox ?', answer=bool, default=False): CONF['dropbox_dir'] = ask('Where is your Dropbox directory ?', str, CONF['dropbox_dir']) From 28a1e0f432f5727aea672795b889c8955708a50e Mon Sep 17 00:00:00 2001 From: Dafydd Crosby Date: Sat, 7 Apr 2012 18:02:40 -0600 Subject: [PATCH 0183/2344] Fix some typos and grammar --- pelican/__init__.py | 7 ++++--- pelican/contents.py | 4 ++-- pelican/generators.py | 2 +- pelican/tools/pelican_quickstart.py | 4 ++-- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index c2766646..9afbb6cc 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -61,8 +61,9 @@ class Pelican(object): def _handle_deprecation(self): if self.settings.get('CLEAN_URLS', False): - logger.warning('Found deprecated `CLEAN_URLS` in settings. Modifing' - ' the following settings for the same behaviour.') + logger.warning('Found deprecated `CLEAN_URLS` in settings. ' + ' Modifying the following settings for the + ' same behaviour.') self.settings['ARTICLE_URL'] = '{slug}/' self.settings['ARTICLE_LANG_URL'] = '{slug}-{lang}/' @@ -75,7 +76,7 @@ class Pelican(object): if self.settings.get('ARTICLE_PERMALINK_STRUCTURE', False): logger.warning('Found deprecated `ARTICLE_PERMALINK_STRUCTURE` in' - ' settings. Modifing the following settings for' + ' settings. Modifying the following settings for' ' the same behaviour.') structure = self.settings['ARTICLE_PERMALINK_STRUCTURE'] diff --git a/pelican/contents.py b/pelican/contents.py index 42de4560..593822a9 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -63,7 +63,7 @@ class Page(object): self.in_default_lang = (self.lang == default_lang) - # create the slug if not existing, fro mthe title + # create the slug if not existing, from the title if not hasattr(self, 'slug') and hasattr(self, 'title'): self.slug = slugify(self.title) @@ -135,7 +135,7 @@ class Page(object): def _get_summary(self): """Returns the summary of an article, based on the summary metadata - if it is set, else troncate the content.""" + if it is set, else truncate the content.""" if hasattr(self, '_summary'): return self._summary else: diff --git a/pelican/generators.py b/pelican/generators.py index d7ebb0b0..9f4de79b 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -351,7 +351,7 @@ class PagesGenerator(Generator): class StaticGenerator(Generator): - """copy static paths (what you want to cpy, like images, medias etc. + """copy static paths (what you want to copy, like images, medias etc. to output""" def _copy_paths(self, paths, source, destination, output_path, diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 43e2a537..dffd4391 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -202,7 +202,7 @@ def main(): print('''Welcome to pelican-quickstart v{v}. -This script will help you creating a new Pelican based website. +This script will help you create a new Pelican-based website. Please answer the following questions so this script can generate the files needed by Pelican. @@ -211,7 +211,7 @@ Please answer the following questions so this script can generate the files need CONF['basedir'] = os.path.abspath(ask('Where do you want to create your new Web site ?', answer=str, default=args.path)) CONF['sitename'] = ask('How will you call your Web site ?', answer=str, default=args.title) CONF['author'] = ask('Who will be the author of this Web site ?', answer=str, default=args.author) - CONF['lang'] = ask('What will be the default language of this Web site ?', str, args.lang or CONF['lang'], 2) + CONF['lang'] = ask('What will be the default language of this Web site ?', str, args.lang or CONF['lang'], 2) CONF['with_pagination'] = ask('Do you want to enable article pagination ?', bool, bool(CONF['default_pagination'])) From 1b978bac6d9c6fba967e2686c4fc1db416f317cf Mon Sep 17 00:00:00 2001 From: Matt Bowcock Date: Mon, 9 Apr 2012 22:45:58 -0400 Subject: [PATCH 0184/2344] Added markdown option to importer documentation. Issue #292 --- docs/importer.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/importer.rst b/docs/importer.rst index 377820af..d1b37684 100644 --- a/docs/importer.rst +++ b/docs/importer.rst @@ -23,7 +23,7 @@ Usage """"" | pelican-import [-h] [--wpfile] [--dotclear] [--feed] [-o OUTPUT] -| [--dir-cat] +| [-m MARKUP][--dir-cat] | input Optional arguments: @@ -35,6 +35,7 @@ Optional arguments: --feed Feed to parse -o OUTPUT, --output OUTPUT Output path + -m MARKUP Output markup --dir-cat Put files in directories with categories name Examples From 75febf4bfd25557c6c3db5edf09008b17d8ad158 Mon Sep 17 00:00:00 2001 From: Matt Bowcock Date: Tue, 10 Apr 2012 00:15:12 -0400 Subject: [PATCH 0185/2344] Add support for multiple file extensions per file reader. Conflicts: pelican/readers.py --- pelican/readers.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/pelican/readers.py b/pelican/readers.py index 917d8614..326782ed 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -65,7 +65,11 @@ def render_node_to_html(document, node): class RstReader(Reader): enabled = bool(docutils) +<<<<<<< HEAD extension = "rst" +======= + extension = ['rst'] +>>>>>>> f1de695... Add support for multiple file extensions per file reader. def _parse_metadata(self, document): """Return the dict containing document metadata""" @@ -111,7 +115,11 @@ class RstReader(Reader): class MarkdownReader(Reader): enabled = bool(Markdown) +<<<<<<< HEAD extension = "md" +======= + extension = ['md', 'markdown', 'mkd'] +>>>>>>> f1de695... Add support for multiple file extensions per file reader. extensions = ['codehilite', 'extra'] def read(self, filename): @@ -128,7 +136,11 @@ class MarkdownReader(Reader): class HtmlReader(Reader): +<<<<<<< HEAD extension = "html" +======= + extension = ['html', 'htm'] +>>>>>>> f1de695... Add support for multiple file extensions per file reader. _re = re.compile('\<\!\-\-\#\s?[A-z0-9_-]*\s?\:s?[A-z0-9\s_-]*\s?\-\-\>') def read(self, filename): From d4e632dfa8fbcf2ff8ba09deb60fa68f162d453f Mon Sep 17 00:00:00 2001 From: Matt Bowcock Date: Tue, 10 Apr 2012 00:32:01 -0400 Subject: [PATCH 0186/2344] Unit test failed due to missing trailing comma in tuple. Fixed. --- pelican/readers.py | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 326782ed..1ffe4cc0 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -65,11 +65,7 @@ def render_node_to_html(document, node): class RstReader(Reader): enabled = bool(docutils) -<<<<<<< HEAD - extension = "rst" -======= extension = ['rst'] ->>>>>>> f1de695... Add support for multiple file extensions per file reader. def _parse_metadata(self, document): """Return the dict containing document metadata""" @@ -115,11 +111,7 @@ class RstReader(Reader): class MarkdownReader(Reader): enabled = bool(Markdown) -<<<<<<< HEAD - extension = "md" -======= extension = ['md', 'markdown', 'mkd'] ->>>>>>> f1de695... Add support for multiple file extensions per file reader. extensions = ['codehilite', 'extra'] def read(self, filename): @@ -136,11 +128,7 @@ class MarkdownReader(Reader): class HtmlReader(Reader): -<<<<<<< HEAD - extension = "html" -======= extension = ['html', 'htm'] ->>>>>>> f1de695... Add support for multiple file extensions per file reader. _re = re.compile('\<\!\-\-\#\s?[A-z0-9_-]*\s?\:s?[A-z0-9\s_-]*\s?\-\-\>') def read(self, filename): From c8323af63d5e3440c12eef968e6858a50d4adbdf Mon Sep 17 00:00:00 2001 From: Matt Bowcock Date: Tue, 10 Apr 2012 00:40:05 -0400 Subject: [PATCH 0187/2344] Fixed _EXTENSIONS dictionary definition. --- pelican/readers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pelican/readers.py b/pelican/readers.py index 1ffe4cc0..c5d9aa00 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -144,7 +144,11 @@ class HtmlReader(Reader): return content, metadata -_EXTENSIONS = dict((cls.extension, cls) for cls in Reader.__subclasses__()) +_EXTENSIONS = {} + +for cls in Reader.__subclasses__(): + for ext in cls.extension: + _EXTENSIONS[ext] = cls def read_file(filename, fmt=None, settings=None): From 424cfe1b1ed5e7d841d160d019b99b3162badb11 Mon Sep 17 00:00:00 2001 From: Aldiantoro Nugroho Date: Tue, 10 Apr 2012 17:30:42 +0800 Subject: [PATCH 0188/2344] Fixed hardcoded category url in base.html. --- pelican/themes/notmyidea/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index f0f745e4..c9f2c0c8 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -35,7 +35,7 @@ {% endfor %} {% endif %} {% for cat, null in categories %} -
    • {{ cat }}
    • +
    • {{ cat }}
    • {% endfor %}
    From 5e6945d380abd03f81f1ca997bc82b4be9fb8ac0 Mon Sep 17 00:00:00 2001 From: Matt Bowcock Date: Tue, 10 Apr 2012 12:51:16 -0400 Subject: [PATCH 0189/2344] Added facebook icon to default theme. --- .../notmyidea/static/images/icons/facebook.png | Bin 0 -> 300 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 pelican/themes/notmyidea/static/images/icons/facebook.png diff --git a/pelican/themes/notmyidea/static/images/icons/facebook.png b/pelican/themes/notmyidea/static/images/icons/facebook.png new file mode 100644 index 0000000000000000000000000000000000000000..a7914b497369c55feba7defc9a3ea5bec424ecfc GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa2=EDU{r~^Jb>s{nN~l=<`rQ{G z*EMNgZp)TeGt$L@YM4rb{DK+IJaKeh4CFB;dAqwXbg;^L06Clm9+AaB8pQTsa66f8 z2V~fKx;Tb#Tu)ADV02S85J*U9G7veylX_i&!&z12Q~+;~Q|gK~r==k=&T|S@G#cDE zb^5gT;nTtbJUf;eFfcqx6@I vWMyh@WooHyU}$AvU~RtQ2a1N={FKbJO57T}vIJa!8W=oX{an^LB{Ts5Vp3XV literal 0 HcmV?d00001 From 6888a046362316f98fb3aaf2982ca246ad724f30 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Thu, 12 Apr 2012 19:38:59 -0700 Subject: [PATCH 0190/2344] Issue #311 Catch BeautifulSoup ImportError. --- pelican/tools/pelican_import.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 57c4fc22..a4d64c67 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -13,7 +13,12 @@ from pelican.utils import slugify def wp2fields(xml): """Opens a wordpress XML file, and yield pelican fields""" - from BeautifulSoup import BeautifulStoneSoup + try: + from BeautifulSoup import BeautifulStoneSoup + except ImportError: + error = 'Missing dependency ' + \ + '"BeautifulSoup" required to import Wordpress files.' + sys.exit(error) xmlfile = open(xml, encoding='utf-8').read() soup = BeautifulStoneSoup(xmlfile) @@ -40,7 +45,13 @@ def wp2fields(xml): def dc2fields(file): """Opens a Dotclear export file, and yield pelican fields""" - from BeautifulSoup import BeautifulStoneSoup + try: + from BeautifulSoup import BeautifulStoneSoup + except ImportError: + error = 'Missing dependency ' + \ + '"BeautifulSoup" required to import Dotclear files.' + sys.exit(error) + in_cat = False in_post = False From 23c05ad7dbd46e61d1cd1cfe193510601d7c2299 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Thu, 12 Apr 2012 19:53:03 -0700 Subject: [PATCH 0191/2344] Issue #311, #312 Document BeautifulSoup & pandoc deps. --- docs/importer.rst | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/docs/importer.rst b/docs/importer.rst index 377820af..96e9e729 100644 --- a/docs/importer.rst +++ b/docs/importer.rst @@ -19,6 +19,23 @@ The conversion from HTML to reStructuredText relies on `pandoc written with Markdown syntax, they will not be converted (as Pelican also supports Markdown). +Dependencies +"""""""""""" + +``pelican-import`` has two additional dependencies not included with pelican +by default: + +- BeautifulSoup +- pandoc + +BeatifulSoup can be installed like any other Python package:: + + $ pip install BeautifulSoup + +For pandoc, install a package for your operating system from the +`pandoc site `_. + + Usage """"" @@ -26,8 +43,8 @@ Usage | [--dir-cat] | input -Optional arguments: -""""""""""""""""""" +Optional arguments +"""""""""""""""""" -h, --help show this help message and exit --wpfile Wordpress XML export From a9f798eae170fd8c6c9d5b9b8fbdc6b5141d0ac7 Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sun, 15 Apr 2012 00:41:38 +0300 Subject: [PATCH 0192/2344] Document less css generator --- docs/index.rst | 1 + docs/settings.rst | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/docs/index.rst b/docs/index.rst index 1389f132..6ad22670 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -23,6 +23,7 @@ Pelican currently supports: * Publication of articles in multiple languages * Atom/RSS feeds * Code syntax highlighting +* Compilation of less css (optional) * Import from WordPress, Dotclear, or RSS feeds * Integration with external tools: Twitter, Google Analytics, etc. (optional) diff --git a/docs/settings.rst b/docs/settings.rst index b7882075..48018a89 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -82,10 +82,15 @@ Setting name (default value) What does it do? generated HTML, using the `Typogrify `_ library +`LESS_GENERATOR` (``FALSE``) Set to True if you want to enable compiling less + files. Requires installtion of `less css`_. +`LESS_COMPILER` (``'/usr/bin/lessc'``) The path to less css compiler (`lessc`) ================================================ ===================================================== .. [#] Default is the system locale. +.. _less css: http://lesscss.org/ + URL settings ------------ From 50f2cd295f8da11218ecbdd4af7abdafdff2725e Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sun, 15 Apr 2012 02:20:20 +0300 Subject: [PATCH 0193/2344] Implement LessCSSGenerator --- pelican/__init__.py | 4 +++- pelican/generators.py | 36 ++++++++++++++++++++++++++++++++++++ pelican/settings.py | 2 ++ 3 files changed, 41 insertions(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index c2766646..bb9819cd 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -6,7 +6,7 @@ import logging import argparse from pelican.generators import (ArticlesGenerator, PagesGenerator, - StaticGenerator, PdfGenerator) + StaticGenerator, PdfGenerator, LessCSSGenerator) from pelican.log import init from pelican.settings import read_settings, _DEFAULT_CONFIG from pelican.utils import clean_output_dir, files_changed @@ -133,6 +133,8 @@ class Pelican(object): generators = [ArticlesGenerator, PagesGenerator, StaticGenerator] if self.settings['PDF_GENERATOR']: generators.append(PdfGenerator) + if self.settings['LESS_GENERATOR']: + generators.append(LessCSSGenerator) return generators def get_writer(self): diff --git a/pelican/generators.py b/pelican/generators.py index d7ebb0b0..5b90ad96 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -4,6 +4,7 @@ import math import random import logging import datetime +import subprocess from collections import defaultdict from functools import partial @@ -414,3 +415,38 @@ class PdfGenerator(Generator): for page in self.context['pages']: self._create_pdf(page, pdf_path) + + +class LessCSSGenerator(Generator): + """Compile less css files. This assumes we have `lessc` in our PATH.""" + + def generate_context(self): + pass + + def _compile(self, less_file, source_dir, dest_dir): + base = os.path.relpath(less_file, source_dir) + target = os.path.splitext( + os.path.join(self.output_path, base))[0] + '.css' + target_dir = os.path.dirname(target) + + if not os.path.exists(target_dir): + try: + os.makedirs(target_dir) + except OSError: + logger.error("Couldn't create the pdf output folder in " + + target_dir) + pass + + cmd = ' '.join([self.settings['LESS_COMPILER'], less_file, target]) + subprocess.call(cmd, shell=True) + logger.info(u' [ok] compiled %s' % base) + + def generate_output(self, writer=None): + logger.info(u' Compiling less css') + + for static_path in self.settings['STATIC_PATHS']: + for f in self.get_files( + os.path.join(self.path, static_path), + extensions=['less']): + + self._compile(f, self.path, self.output_path) diff --git a/pelican/settings.py b/pelican/settings.py index c0e30815..418634a0 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -67,6 +67,8 @@ _DEFAULT_CONFIG = {'PATH': '.', 'DEFAULT_STATUS': 'published', 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, + 'LESS_GENERATOR': False, + 'LESS_COMPILER': '/usr/bin/lessc', } From ddf57ca2957509e4b069a53da20e5842d5ae4dbe Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sun, 15 Apr 2012 02:52:19 +0300 Subject: [PATCH 0194/2344] Also compile less css files in theme static --- pelican/generators.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 5b90ad96..48d29f84 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -426,7 +426,7 @@ class LessCSSGenerator(Generator): def _compile(self, less_file, source_dir, dest_dir): base = os.path.relpath(less_file, source_dir) target = os.path.splitext( - os.path.join(self.output_path, base))[0] + '.css' + os.path.join(dest_dir, base))[0] + '.css' target_dir = os.path.dirname(target) if not os.path.exists(target_dir): @@ -435,7 +435,6 @@ class LessCSSGenerator(Generator): except OSError: logger.error("Couldn't create the pdf output folder in " + target_dir) - pass cmd = ' '.join([self.settings['LESS_COMPILER'], less_file, target]) subprocess.call(cmd, shell=True) @@ -444,9 +443,21 @@ class LessCSSGenerator(Generator): def generate_output(self, writer=None): logger.info(u' Compiling less css') + # walk static paths for static_path in self.settings['STATIC_PATHS']: for f in self.get_files( os.path.join(self.path, static_path), extensions=['less']): self._compile(f, self.path, self.output_path) + + # walk theme static paths + theme_output_path = os.path.join(self.output_path, 'theme') + + for static_path in self.settings['THEME_STATIC_PATHS']: + theme_static_path = os.path.join(self.theme, static_path) + for f in self.get_files( + theme_static_path, + extensions=['less']): + + self._compile(f, theme_static_path, theme_output_path) From ac8f3fc6537d47d806adaa3cfa57dad836f072f3 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sun, 15 Apr 2012 14:31:21 +0100 Subject: [PATCH 0195/2344] Fix misspelling of ftp_target_dir in quickstart --- pelican/tools/pelican_quickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 0365ca62..64288837 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -226,7 +226,7 @@ Please answer the following questions so this script can generate the files need if ask('Do you want to upload your website using FTP ?', answer=bool, default=False): CONF['ftp_host'] = ask('What is the hostname of your FTP server ?', str, CONF['ftp_host']) CONF['ftp_user'] = ask('What is your username on this server ?', str, CONF['ftp_user']) - CONF['ftp_traget_dir'] = ask('Where do you want to put your website on this server ?', str, CONF['ftp_target_dir']) + CONF['ftp_target_dir'] = ask('Where do you want to put your website on this server ?', str, CONF['ftp_target_dir']) if ask('Do you want to upload your website using SSH ?', answer=bool, default=False): CONF['ssh_host'] = ask('What is the hostname of your SSH server ?', str, CONF['ssh_host']) From 4c4c2a96040e99f93b7749057dad37a11b1a13d4 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sun, 15 Apr 2012 14:40:10 +0100 Subject: [PATCH 0196/2344] Add a missing ' --- pelican/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 9afbb6cc..59aef653 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -61,8 +61,8 @@ class Pelican(object): def _handle_deprecation(self): if self.settings.get('CLEAN_URLS', False): - logger.warning('Found deprecated `CLEAN_URLS` in settings. ' - ' Modifying the following settings for the + logger.warning('Found deprecated `CLEAN_URLS` in settings.' + ' Modifying the following settings for the' ' same behaviour.') self.settings['ARTICLE_URL'] = '{slug}/' From 597233c49b797d166553cd42348cc838b4e03f56 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sun, 15 Apr 2012 15:01:03 +0100 Subject: [PATCH 0197/2344] Fix a broken link in the docs --- docs/settings.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index b7882075..7b43f183 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -361,8 +361,7 @@ By default, two themes are available. You can specify them using the `-t` option You can define your own theme too, and specify its placement in the same manner. (Be sure to specify the full absolute path to it.) -Here is `a guide on how to create your theme -`_ +Here is :doc:`a guide on how to create your theme ` You can find a list of themes at http://github.com/ametaireau/pelican-themes. From e694cdc2b36a6fb902f4b105e5315ec4a0a99bfd Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Sun, 15 Apr 2012 15:08:06 +0100 Subject: [PATCH 0198/2344] docs: Fix some sphinx warnings, and correctly format the french FAQ --- docs/fr/faq.rst | 15 ++++++++++----- docs/settings.rst | 8 ++++---- 2 files changed, 14 insertions(+), 9 deletions(-) diff --git a/docs/fr/faq.rst b/docs/fr/faq.rst index 8cbe0881..d945f447 100644 --- a/docs/fr/faq.rst +++ b/docs/fr/faq.rst @@ -1,8 +1,10 @@ -*Foire aux questions (FAQ)* +Foire aux questions (FAQ) +######################### Voici un résumé des questions fréquemment posées pour pelican. -*Est-il obligatoire d'avoir un fichier de configuration ?* +Est-il obligatoire d'avoir un fichier de configuration ? +======================================================== Non. Les fichiers de configuration sont juste un moyen facile de configurer pelican. Pour les opérations de base, il est possible de spécifier des @@ -11,17 +13,20 @@ en invoquant pelican avec la ligne de commande (voir pelican --help pour plus d'informations à ce sujet) -*Je crée mon propre thème, comment utiliser pygments?* +Je crée mon propre thème, comment utiliser pygments? +==================================================== Pygment ajoute quelques classes au contenu généré, de sorte qua colorisation de votre thème se fait grâce à un fichier css. Vous pouvez jeter un oeil à celui proposé par`sur le site du projet `_ -*Comment puis-je créer mon propre thèm* +Comment puis-je créer mon propre thèm +===================================== Vueillez vous référer à :ref:`theming-pelican-fr`. -*Comment puis-je aider?* +Comment puis-je aider? +====================== Vous avez plusieurs options pour aider. Tout d'abord, vous pouvez utiliser le diff --git a/docs/settings.rst b/docs/settings.rst index 7b43f183..427795c2 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -52,10 +52,10 @@ Setting name (default value) What does it do? supported extensions. `OUTPUT_PATH` (``'output/'``) Where to output the generated files. `PATH` (``None``) Path to look at for input files. -`PAGE_DIR' (``'pages'``) Directory to look at for pages. -`PAGE_EXCLUDES' (``()``) A list of directories to exclude when looking for pages. -`ARTICLE_DIR' (``''``) Directory to look at for articles. -`ARTICLE_EXCLUDES': (``('pages',)``) A list of directories to exclude when looking for articles. +`PAGE_DIR` (``'pages'``) Directory to look at for pages. +`PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages. +`ARTICLE_DIR` (``''``) Directory to look at for articles. +`ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles. `PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions of your documents. You will need to install `rst2pdf`. From e29b54e5e079594fb3516b276ce2e1553108bf9d Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 16 Apr 2012 09:10:20 -0700 Subject: [PATCH 0199/2344] Replace omitted slash in feed URL generation This slash was originally present, but I removed it at some point because it was causing double-slashes. I believe the reason is that I had a leading slash in my article URL pattern, which in retrospect should not have been there. Omitting the slash caused problems for other folks; I should have tested this better. This commit puts the slash back where it belongs. --- pelican/writers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/writers.py b/pelican/writers.py index faca46bd..4dd04a2a 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -36,7 +36,7 @@ class Writer(object): feed.add_item( title=item.title, - link='%s%s' % (self.site_url, item.url), + link='%s/%s' % (self.site_url, item.url), unique_id='tag:%s,%s:%s' % (self.site_url.replace('http://', ''), item.date.date(), item.url), description=item.content, From 4793cdfab347835ba3119e97d2fe7e889a87249b Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Mon, 16 Apr 2012 22:55:50 +0300 Subject: [PATCH 0200/2344] Fix typo in less generator docs --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 48018a89..22b4c744 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -83,7 +83,7 @@ Setting name (default value) What does it do? `_ library `LESS_GENERATOR` (``FALSE``) Set to True if you want to enable compiling less - files. Requires installtion of `less css`_. + files. Requires installation of `less css`_. `LESS_COMPILER` (``'/usr/bin/lessc'``) The path to less css compiler (`lessc`) ================================================ ===================================================== From a0d5596605fd62ebfd4c8419f2b1225b90dc6ceb Mon Sep 17 00:00:00 2001 From: Andrew Laski Date: Mon, 16 Apr 2012 20:39:41 -0400 Subject: [PATCH 0201/2344] Modifed question so that it's more clear --- pelican/tools/pelican_quickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 153bc3ec..8459870a 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -209,7 +209,7 @@ Please answer the following questions so this script can generate the files need '''.format(v=__version__)) CONF['basedir'] = os.path.abspath(ask('Where do you want to create your new Web site ?', answer=str, default=args.path)) - CONF['sitename'] = ask('How will you call your Web site ?', answer=str, default=args.title) + CONF['sitename'] = ask('What will be the title of this Web site ?', answer=str, default=args.title) CONF['author'] = ask('Who will be the author of this Web site ?', answer=str, default=args.author) CONF['lang'] = ask('What will be the default language of this Web site ?', str, args.lang or CONF['lang'], 2) From 6577efc8f466acf8f6e639528959e2915a7f9413 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Wed, 18 Apr 2012 00:20:54 -0700 Subject: [PATCH 0202/2344] Wrap paragraphs in

    tags --- pelican/tools/pelican_import.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index a4d64c67..01253960 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -17,7 +17,7 @@ def wp2fields(xml): from BeautifulSoup import BeautifulStoneSoup except ImportError: error = 'Missing dependency ' + \ - '"BeautifulSoup" required to import Wordpress files.' + '"BeautifulSoup" required to import Wordpress XML files.' sys.exit(error) xmlfile = open(xml, encoding='utf-8').read() @@ -226,7 +226,10 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): with open(html_filename, 'w', encoding='utf-8') as fp: # Replace simple newlines with
    +newline so that the HTML file # represents the original post more accurately - content = content.replace("\n", "
    \n") + paragraphs = content.split('\n\n') + paragraphs = ['

    %s

    ' % p for p in paragraphs] + new_content = ''.join(paragraphs) + fp.write(content) cmd = 'pandoc --normalize --reference-links --from=html --to={0} -o "{1}" "{2}"'.format( From 9491bb40d4127b29e2dc68d421d96aca3eb32e98 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Wed, 18 Apr 2012 00:24:52 -0700 Subject: [PATCH 0203/2344] Add --no-wrap option to pandoc, fixing issue with long links names (another fix for issue #314) --- pelican/tools/pelican_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 01253960..9a19f33c 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -232,7 +232,7 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): fp.write(content) - cmd = 'pandoc --normalize --reference-links --from=html --to={0} -o "{1}" "{2}"'.format( + cmd = 'pandoc --normalize --no-wrap --reference-links --from=html --to={0} -o "{1}" "{2}"'.format( out_markup, out_filename, html_filename) try: From 6116236ed9a2bf245df2f34361431fb2515b54ab Mon Sep 17 00:00:00 2001 From: Pavel Puchkin Date: Wed, 18 Apr 2012 18:56:53 +1100 Subject: [PATCH 0204/2344] `*_SAVE_AS` = None fix Ability to disable creating some files when their `_SAVE_AS` setting is set to none-value. Mostly for disabling creating of `authors` stuff (when there only one user, see #320 for details) --- pelican/contents.py | 3 ++- pelican/writers.py | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index 593822a9..8174f05a 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -183,7 +183,8 @@ class URLWrapper(object): def _from_settings(self, key): setting = "%s_%s" % (self.__class__.__name__.upper(), key) - return unicode(self.settings[setting]).format(**self.as_dict()) + value = self.settings[setting] or '' + return unicode(value).format(**self.as_dict()) url = property(functools.partial(_from_settings, key='URL')) save_as = property(functools.partial(_from_settings, key='SAVE_AS')) diff --git a/pelican/writers.py b/pelican/writers.py index faca46bd..058be333 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -99,6 +99,8 @@ class Writer(object): :param **kwargs: additional variables to pass to the templates """ + if not name: return + def _write_file(template, localcontext, output_path, name): """Render the template write the file.""" old_locale = locale.setlocale(locale.LC_ALL) From 55d7cf438b7586b05cd519184f827353c10a3864 Mon Sep 17 00:00:00 2001 From: Pavel Puchkin Date: Wed, 18 Apr 2012 19:04:32 +1100 Subject: [PATCH 0205/2344] Note in docs about previous commit --- docs/settings.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/settings.rst b/docs/settings.rst index 427795c2..af5f94dd 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -142,6 +142,9 @@ Setting name (default value) what does it do? `TAG_SAVE_AS` ('tag/{name}.html') The location to save the tag page. ================================================ ===================================================== +Note: when any of `*_SAVE_AS` setting is set to none-value (including an empty string), files will not be +created. + Timezone -------- From 9dcf612f9dfae01b1a65864660c289a0ac254707 Mon Sep 17 00:00:00 2001 From: Pavel Puchkin Date: Wed, 18 Apr 2012 23:07:57 +1100 Subject: [PATCH 0206/2344] Fixes after review --- docs/settings.rst | 3 +-- pelican/contents.py | 5 ++++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index af5f94dd..9cae8111 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -142,8 +142,7 @@ Setting name (default value) what does it do? `TAG_SAVE_AS` ('tag/{name}.html') The location to save the tag page. ================================================ ===================================================== -Note: when any of `*_SAVE_AS` setting is set to none-value (including an empty string), files will not be -created. +Note: when any of `*_SAVE_AS` is set to False, files will not be created. Timezone -------- diff --git a/pelican/contents.py b/pelican/contents.py index 8174f05a..506c4c02 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -183,7 +183,10 @@ class URLWrapper(object): def _from_settings(self, key): setting = "%s_%s" % (self.__class__.__name__.upper(), key) - value = self.settings[setting] or '' + value = self.settings[setting] + value = value is not False and value or '' # change to '' only False + if value == '': + logger.warning(u'%s is disabled' % setting) return unicode(value).format(**self.as_dict()) url = property(functools.partial(_from_settings, key='URL')) From 602990b80e403ec2cb8021575aadae9c56370439 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 18 Apr 2012 07:16:51 -0700 Subject: [PATCH 0207/2344] Use "endswith" to detect trailing slash on SITEURL --- pelican/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/settings.py b/pelican/settings.py index c0e30815..7a30e56e 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -130,7 +130,7 @@ def configure_settings(settings, default_settings=None, filename=None): if ('SITEURL' in settings): # If SITEURL has a trailing slash, remove it and provide a warning siteurl = settings['SITEURL'] - if (siteurl[len(siteurl) - 1:] == '/'): + if (siteurl.endswith('/')): settings['SITEURL'] = siteurl[:-1] logger.warn("Removed extraneous trailing slash from SITEURL.") # If SITEURL is defined but FEED_DOMAIN isn't, set FEED_DOMAIN = SITEURL From cc30695b72772a5faab8bfccf217e2e1397b4f9f Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Wed, 18 Apr 2012 09:29:47 -0700 Subject: [PATCH 0208/2344] Correct comment; switch to new style string formatting. --- pelican/tools/pelican_import.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 9a19f33c..b45d4fec 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -224,10 +224,10 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): html_filename = os.path.join(output_path, filename+'.html') with open(html_filename, 'w', encoding='utf-8') as fp: - # Replace simple newlines with
    +newline so that the HTML file - # represents the original post more accurately + # Replace newlines with paragraphs wrapped with

    so + # HTML is valid before conversion paragraphs = content.split('\n\n') - paragraphs = ['

    %s

    ' % p for p in paragraphs] + paragraphs = ['

    {}

    '.format(p) for p in paragraphs] new_content = ''.join(paragraphs) fp.write(content) From 36a53442821fbdf379e45c309906fdf0a6f30193 Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Wed, 18 Apr 2012 22:14:53 -0700 Subject: [PATCH 0209/2344] Beautify two-line string concat. --- pelican/tools/pelican_import.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index b45d4fec..fdf28d14 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -16,8 +16,8 @@ def wp2fields(xml): try: from BeautifulSoup import BeautifulStoneSoup except ImportError: - error = 'Missing dependency ' + \ - '"BeautifulSoup" required to import Wordpress XML files.' + error = ('Missing dependency ' + '"BeautifulSoup" required to import Wordpress XML files.') sys.exit(error) xmlfile = open(xml, encoding='utf-8').read() @@ -48,8 +48,8 @@ def dc2fields(file): try: from BeautifulSoup import BeautifulStoneSoup except ImportError: - error = 'Missing dependency ' + \ - '"BeautifulSoup" required to import Dotclear files.' + error = ('Missing dependency ' + '"BeautifulSoup" required to import Dotclear files.') sys.exit(error) From 5cad4c46f06963c58d43dbaf6e2f5addbec663ea Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Wed, 18 Apr 2012 22:17:43 -0700 Subject: [PATCH 0210/2344] Improve wording of docs re: pelican-import deps. --- docs/importer.rst | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/docs/importer.rst b/docs/importer.rst index 96e9e729..0147f900 100644 --- a/docs/importer.rst +++ b/docs/importer.rst @@ -22,8 +22,7 @@ supports Markdown). Dependencies """""""""""" -``pelican-import`` has two additional dependencies not included with pelican -by default: +``pelican-import`` has two dependencies not required by the rest of pelican: - BeautifulSoup - pandoc From 5710dc771d6951519eea5209f388fe17b79b973c Mon Sep 17 00:00:00 2001 From: Aaron Kavlie Date: Wed, 18 Apr 2012 22:28:49 -0700 Subject: [PATCH 0211/2344] Remove --no-wrap; change para formatting to unicode string. --- pelican/tools/pelican_import.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index fdf28d14..050b1010 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -227,12 +227,12 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): # Replace newlines with paragraphs wrapped with

    so # HTML is valid before conversion paragraphs = content.split('\n\n') - paragraphs = ['

    {}

    '.format(p) for p in paragraphs] + paragraphs = [u'

    {}

    '.format(p) for p in paragraphs] new_content = ''.join(paragraphs) fp.write(content) - cmd = 'pandoc --normalize --no-wrap --reference-links --from=html --to={0} -o "{1}" "{2}"'.format( + cmd = 'pandoc --normalize --reference-links --from=html --to={0} -o "{1}" "{2}"'.format( out_markup, out_filename, html_filename) try: From 898ac3808f933e33f458822bb77e3f28d0623fc0 Mon Sep 17 00:00:00 2001 From: Pavel Puchkin Date: Fri, 20 Apr 2012 11:28:00 +1100 Subject: [PATCH 0212/2344] Last fix? --- pelican/contents.py | 9 +++++---- pelican/writers.py | 6 +++++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 506c4c02..ba374ba1 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -184,10 +184,11 @@ class URLWrapper(object): def _from_settings(self, key): setting = "%s_%s" % (self.__class__.__name__.upper(), key) value = self.settings[setting] - value = value is not False and value or '' # change to '' only False - if value == '': - logger.warning(u'%s is disabled' % setting) - return unicode(value).format(**self.as_dict()) + if not isinstance(value, (str, unicode)): + logger.warning(u'%s is set to %s' % (setting, value)) + return value + else: + return unicode(value).format(**self.as_dict()) url = property(functools.partial(_from_settings, key='URL')) save_as = property(functools.partial(_from_settings, key='SAVE_AS')) diff --git a/pelican/writers.py b/pelican/writers.py index 058be333..6eb00d7e 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -99,7 +99,11 @@ class Writer(object): :param **kwargs: additional variables to pass to the templates """ - if not name: return + if name is False: + return + elif not name: + # other stuff, just return for now + return def _write_file(template, localcontext, output_path, name): """Render the template write the file.""" From 1efda9eb74701ca2e56f082327f1970da154ce33 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Mon, 23 Apr 2012 23:29:00 +0200 Subject: [PATCH 0213/2344] test that categories are ordered as expected --- tests/test_generators.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/test_generators.py b/tests/test_generators.py index bc5c8b73..dd27d97f 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -46,3 +46,7 @@ class TestArticlesGenerator(unittest.TestCase): elif relfilepath == "article_without_category.rst": self.assertEquals(article.category.name, 'Default') + categories = [cat.name for cat, _ in generator.categories] + # assert that the categories are ordered as expected + self.assertEquals( + categories, ['Default', 'TestCategory', 'Yeah', 'yeah']) From d4e981f916c445bb13c30d651a3b80c79f79bb06 Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sat, 28 Apr 2012 02:41:48 +0300 Subject: [PATCH 0214/2344] unittest helper: Skip if exectuable not found --- tests/support.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/tests/support.py b/tests/support.py index 4eb07ec4..f2b4a075 100644 --- a/tests/support.py +++ b/tests/support.py @@ -4,6 +4,8 @@ __all__ = [ 'unittest', ] +import os +import subprocess from contextlib import contextmanager from tempfile import mkdtemp from shutil import rmtree @@ -35,3 +37,21 @@ def get_article(title, slug, content, lang, extra_metadata=None): if extra_metadata is not None: metadata.update(extra_metadata) return Article(content, metadata=metadata) + + +def skipIfNoExecutable(executable, valid_exit_code=1): + """Tries to run an executable to make sure it's in the path, Skips the tests + if not found. + """ + + # calling with no params the command should exit with 1 + with open(os.devnull, 'w') as fnull: + try: + res = subprocess.call(executable, stdout=fnull, stderr=fnull) + except OSError: + res = None + + if res != valid_exit_code: + return unittest.skip('{0} compiler not found'.format(executable)) + + return lambda func: func From 1d3e38c5dd4d667ae1d702cfb9dfb32749ab8bf4 Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sat, 28 Apr 2012 03:03:53 +0300 Subject: [PATCH 0215/2344] Test less generator --- tests/test_generators.py | 53 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 51 insertions(+), 2 deletions(-) diff --git a/tests/test_generators.py b/tests/test_generators.py index bc5c8b73..ce1b9e7e 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -2,10 +2,12 @@ from mock import MagicMock import os +import re +import subprocess -from pelican.generators import ArticlesGenerator +from pelican.generators import ArticlesGenerator, LessCSSGenerator from pelican.settings import _DEFAULT_CONFIG -from .support import unittest +from .support import unittest, temporary_folder, skipIfNoExecutable CUR_DIR = os.path.dirname(__file__) @@ -46,3 +48,50 @@ class TestArticlesGenerator(unittest.TestCase): elif relfilepath == "article_without_category.rst": self.assertEquals(article.category.name, 'Default') + +class TestLessCSSGenerator(unittest.TestCase): + + LESS_CONTENT = """ + @color: #4D926F; + + #header { + color: @color; + } + h2 { + color: @color; + } + """ + + @skipIfNoExecutable('lessc') + def test_less_compiler(self): + + settings = _DEFAULT_CONFIG.copy() + settings['STATIC_PATHS'] = ['static'] + settings['LESS_GENERATOR'] = True + settings['LESS_COMPILER'] = 'lessc' + + # we'll nest here for py < 2.7 compat + with temporary_folder() as temp_content: + with temporary_folder() as temp_output: + generator = LessCSSGenerator(None, settings, temp_content, + _DEFAULT_CONFIG['THEME'], temp_output, None) + + # create a dummy less file + less_dir = os.path.join(temp_content, 'static', 'css') + less_filename = os.path.join(less_dir, 'test.less') + + less_output = os.path.join(temp_output, 'static', 'css', + 'test.css') + + os.makedirs(less_dir) + with open(less_filename, 'w') as less_file: + less_file.write(self.LESS_CONTENT) + + generator.generate_output() + + # we have the file ? + self.assertTrue(os.path.exists(less_output)) + + # was it compiled ? + self.assertIsNotNone(re.search(r'^\s+color:\s*#4D926F;$', + open(less_output).read(), re.MULTILINE | re.IGNORECASE)) From 2b93d6d855f392327ea09bdfccd17075f3d8401e Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sat, 28 Apr 2012 03:04:58 +0300 Subject: [PATCH 0216/2344] Remove empty generate_context --- pelican/generators.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 16b4e434..4eecd9dc 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -420,9 +420,6 @@ class PdfGenerator(Generator): class LessCSSGenerator(Generator): """Compile less css files. This assumes we have `lessc` in our PATH.""" - def generate_context(self): - pass - def _compile(self, less_file, source_dir, dest_dir): base = os.path.relpath(less_file, source_dir) target = os.path.splitext( From f558389006e0f013dbc2f410ab6520cc1b2fbc66 Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sat, 28 Apr 2012 03:25:54 +0300 Subject: [PATCH 0217/2344] Remove redundant LESS_COMPILER setting --- docs/settings.rst | 6 +++--- pelican/__init__.py | 2 +- pelican/generators.py | 9 +++++++-- pelican/settings.py | 1 - tests/test_generators.py | 1 - 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 2a1cfe75..a3ac6606 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -82,9 +82,9 @@ Setting name (default value) What does it do? generated HTML, using the `Typogrify `_ library -`LESS_GENERATOR` (``FALSE``) Set to True if you want to enable compiling less - files. Requires installation of `less css`_. -`LESS_COMPILER` (``'/usr/bin/lessc'``) The path to less css compiler (`lessc`) +`LESS_GENERATOR` (``FALSE``) Set to True or complete path to `lessc` (if not + found in system PATH) to enable compiling less + css files. Requires installation of `less css`_. ================================================ ===================================================== .. [#] Default is the system locale. diff --git a/pelican/__init__.py b/pelican/__init__.py index 1161f7e2..6b3d12fb 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -134,7 +134,7 @@ class Pelican(object): generators = [ArticlesGenerator, PagesGenerator, StaticGenerator] if self.settings['PDF_GENERATOR']: generators.append(PdfGenerator) - if self.settings['LESS_GENERATOR']: + if self.settings['LESS_GENERATOR']: # can be True or PATH to lessc generators.append(LessCSSGenerator) return generators diff --git a/pelican/generators.py b/pelican/generators.py index 4eecd9dc..37413ddb 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -418,7 +418,7 @@ class PdfGenerator(Generator): class LessCSSGenerator(Generator): - """Compile less css files. This assumes we have `lessc` in our PATH.""" + """Compile less css files.""" def _compile(self, less_file, source_dir, dest_dir): base = os.path.relpath(less_file, source_dir) @@ -433,13 +433,18 @@ class LessCSSGenerator(Generator): logger.error("Couldn't create the pdf output folder in " + target_dir) - cmd = ' '.join([self.settings['LESS_COMPILER'], less_file, target]) + cmd = ' '.join([self._lessc, less_file, target]) subprocess.call(cmd, shell=True) logger.info(u' [ok] compiled %s' % base) def generate_output(self, writer=None): logger.info(u' Compiling less css') + # store out compiler here, so it won't be evaulted on each run of + # _compile + lg = self.settings['LESS_GENERATOR'] + self._lessc = lg if isinstance(lg, basestring) else 'lessc' + # walk static paths for static_path in self.settings['STATIC_PATHS']: for f in self.get_files( diff --git a/pelican/settings.py b/pelican/settings.py index 8d8a7d75..771c72c6 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -68,7 +68,6 @@ _DEFAULT_CONFIG = {'PATH': '.', 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'LESS_GENERATOR': False, - 'LESS_COMPILER': '/usr/bin/lessc', } diff --git a/tests/test_generators.py b/tests/test_generators.py index ce1b9e7e..ecaacfcd 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -68,7 +68,6 @@ class TestLessCSSGenerator(unittest.TestCase): settings = _DEFAULT_CONFIG.copy() settings['STATIC_PATHS'] = ['static'] settings['LESS_GENERATOR'] = True - settings['LESS_COMPILER'] = 'lessc' # we'll nest here for py < 2.7 compat with temporary_folder() as temp_content: From 0924a9dd736427ec6b5591170f9f306415e9cd4c Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sat, 28 Apr 2012 03:27:30 +0300 Subject: [PATCH 0218/2344] Not pdf, but less folder --- pelican/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 37413ddb..cc18e999 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -430,7 +430,7 @@ class LessCSSGenerator(Generator): try: os.makedirs(target_dir) except OSError: - logger.error("Couldn't create the pdf output folder in " + + logger.error("Couldn't create the less css output folder in " + target_dir) cmd = ' '.join([self._lessc, less_file, target]) From 17626b5474941259dcc4733e3efb1fe1e8b9f017 Mon Sep 17 00:00:00 2001 From: Meir Kriheli Date: Sat, 28 Apr 2012 03:46:43 +0300 Subject: [PATCH 0219/2344] Don't use shell=True --- pelican/generators.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index cc18e999..86e48eb8 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -433,8 +433,7 @@ class LessCSSGenerator(Generator): logger.error("Couldn't create the less css output folder in " + target_dir) - cmd = ' '.join([self._lessc, less_file, target]) - subprocess.call(cmd, shell=True) + subprocess.call([self._lessc, less_file, target]) logger.info(u' [ok] compiled %s' % base) def generate_output(self, writer=None): From cc46ac5d4cade47e84fa304639375f57c4938cda Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Sat, 28 Apr 2012 18:01:19 +0100 Subject: [PATCH 0220/2344] Allow user to customise the save location of direct template pages from settings. --- pelican/generators.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 9f4de79b..43861b23 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -182,7 +182,15 @@ class ArticlesGenerator(Generator): if template in PAGINATED_TEMPLATES: paginated = {'articles': self.articles, 'dates': self.dates} - write('%s.html' % template, self.get_template(template), + save_as = self.settings.get("%s_SAVE_AS" % template.upper(), None) + if save_as is None: + file_name = '%s.html' % template + elif save_as: + file_name = save_as + else: + continue + + write(file_name, self.get_template(template), self.context, blog=True, paginated=paginated, page_name=template) From c7de5e6bff23f98e96b3844cded3391acedc3002 Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Sat, 28 Apr 2012 18:02:10 +0100 Subject: [PATCH 0221/2344] add docs for customised save location for direct template pages and switch to notes directive for notes --- docs/settings.rst | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 9cae8111..7c19b539 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -39,9 +39,9 @@ Setting name (default value) What does it do? `JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. `DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as the generated files. -`LOCALE` (''[#]_) Change the locale. A list of locales can be provided +`LOCALE` (''[#]_) Change the locale. A list of locales can be provided here or a single string representing one locale. - When providing a list, all the locales will be tried + When providing a list, all the locales will be tried until one works. `MARKUP` (``('rst', 'md')``) A list of available markup languages you want to use. For the moment, the only available values @@ -96,14 +96,15 @@ your articles in a location such as '{slug}/index.html' and link to them as '{slug}' for clean URLs. These settings give you the flexibility to place your articles and pages anywhere you want. -Note: If you specify a datetime directive, it will be substituted using the -input files' date metadata attribute. If the date is not specified for a -particular file, Pelican will rely on the file's mtime timestamp. +.. note:: + If you specify a datetime directive, it will be substituted using the + input files' date metadata attribute. If the date is not specified for a + particular file, Pelican will rely on the file's mtime timestamp. Check the Python datetime documentation at http://bit.ly/cNcJUC for more information. -Also, you can use other file metadata attributes as well: +Also, you can use other file metadata attributes as well: * slug * date @@ -111,7 +112,7 @@ Also, you can use other file metadata attributes as well: * author * category -Example usage: +Example usage: * ARTICLE_URL = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/' * ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html' @@ -142,7 +143,14 @@ Setting name (default value) what does it do? `TAG_SAVE_AS` ('tag/{name}.html') The location to save the tag page. ================================================ ===================================================== -Note: when any of `*_SAVE_AS` is set to False, files will not be created. +.. note:: + + When any of `*_SAVE_AS` is set to False, files will not be created. + + You can change the file output location of any pages listed in DIRECT_TEMPLATES + by providing a setting _SAVE_AS, where is the template + name in uppercase; e.g. CATEGORIES. If False it will not be created. + Timezone -------- @@ -332,7 +340,7 @@ Setting name (default value) What does it do? ================================================ ===================================================== `REVERSE_ARCHIVE_ORDER` (``False``) Reverse the archives list order. (True: orders by date in descending order, with newer articles first.) -`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True: lists by reverse +`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True: lists by reverse alphabetical order; default lists alphabetically.) ================================================ ===================================================== From 19cfe00397fca3d0d7dca2a4ce6130efd25c1d84 Mon Sep 17 00:00:00 2001 From: Pavel Puchkin Date: Sun, 29 Apr 2012 14:45:34 +1100 Subject: [PATCH 0222/2344] Checking for basestring isinstance, not (str, unicode) --- pelican/contents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index ba374ba1..f5f3a1dc 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -184,7 +184,7 @@ class URLWrapper(object): def _from_settings(self, key): setting = "%s_%s" % (self.__class__.__name__.upper(), key) value = self.settings[setting] - if not isinstance(value, (str, unicode)): + if not isinstance(value, basestring): logger.warning(u'%s is set to %s' % (setting, value)) return value else: From e4f011a697f3b3ca430c57108c9633f9acad5d02 Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Sun, 29 Apr 2012 10:34:20 +0100 Subject: [PATCH 0223/2344] Refactor generators to aid testing --- pelican/generators.py | 48 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 43861b23..99f4bef8 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -162,20 +162,22 @@ class ArticlesGenerator(Generator): writer.write_feed(items, self.context, self.settings['TRANSLATION_FEED'] % lang) - def generate_pages(self, writer): - """Generate the pages on the disk""" - + def generate_articles(self, writer): + """Generate the articles.""" write = partial(writer.write_file, relative_urls=self.settings.get('RELATIVE_URLS')) - # to minimize the number of relative path stuff modification - # in writer, articles pass first article_template = self.get_template('article') for article in chain(self.translations, self.articles): write(article.save_as, article_template, self.context, article=article, category=article.category) + def generate_direct_templates(self, writer): + """Generate direct templates pages""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + PAGINATED_TEMPLATES = self.settings.get('PAGINATED_DIRECT_TEMPLATES') for template in self.settings.get('DIRECT_TEMPLATES'): paginated = {} @@ -194,7 +196,11 @@ class ArticlesGenerator(Generator): self.context, blog=True, paginated=paginated, page_name=template) - # and subfolders after that + def generate_tags(self, writer): + """Generate Tags pages.""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + tag_template = self.get_template('tag') for tag, articles in self.tags.items(): articles.sort(key=attrgetter('date'), reverse=True) @@ -204,6 +210,11 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'tag/%s' % tag) + def generate_categories(self, writer): + """Generate category pages.""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + category_template = self.get_template('category') for cat, articles in self.categories: dates = [article for article in self.dates if article in articles] @@ -212,6 +223,11 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'category/%s' % cat) + def generate_authors(self, writer): + """Generate Author pages.""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + author_template = self.get_template('author') for aut, articles in self.authors: dates = [article for article in self.dates if article in articles] @@ -220,10 +236,30 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'author/%s' % aut) + def generate_drafts(self, writer): + """Generate drafts pages.""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) + + article_template = self.get_template('article') for article in self.drafts: write('drafts/%s.html' % article.slug, article_template, self.context, article=article, category=article.category) + def generate_pages(self, writer): + """Generate the pages on the disk""" + + # to minimize the number of relative path stuff modification + # in writer, articles pass first + self.generate_articles(writer) + self.generate_direct_templates(writer) + + # and subfolders after that + self.generate_tags(writer) + self.generate_categories(writer) + self.generate_authors(writer) + self.generate_drafts(writer) + def generate_context(self): """change the context""" From 5ab1933be7c9a337d20cdeb3857b3da0feeaef06 Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Sun, 29 Apr 2012 13:45:14 +0100 Subject: [PATCH 0224/2344] added tests for custom save_as for direct templates --- tests/test_generators.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/test_generators.py b/tests/test_generators.py index bc5c8b73..fc35fde4 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -9,6 +9,7 @@ from .support import unittest CUR_DIR = os.path.dirname(__file__) + class TestArticlesGenerator(unittest.TestCase): def test_generate_feeds(self): @@ -46,3 +47,42 @@ class TestArticlesGenerator(unittest.TestCase): elif relfilepath == "article_without_category.rst": self.assertEquals(article.category.name, 'Default') + def test_direct_templates_save_as_default(self): + + settings = _DEFAULT_CONFIG.copy() + settings['DIRECT_TEMPLATES'] = ['archives'] + generator = ArticlesGenerator(settings.copy(), settings, None, + _DEFAULT_CONFIG['THEME'], None, + _DEFAULT_CONFIG['MARKUP']) + + writer = MagicMock() + generator.generate_direct_templates(writer) + writer.write_file.assert_called_with("archives.html", + generator.get_template("archives"), settings, relative_urls=True, + blog=True, paginated={}, page_name='archives') + + def test_direct_templates_save_as_modified(self): + + settings = _DEFAULT_CONFIG.copy() + settings['DIRECT_TEMPLATES'] = ['archives'] + settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' + generator = ArticlesGenerator(settings, settings, None, + _DEFAULT_CONFIG['THEME'], None, + _DEFAULT_CONFIG['MARKUP']) + writer = MagicMock() + generator.generate_direct_templates(writer) + writer.write_file.assert_called_with("archives/index.html", + generator.get_template("archives"), settings, relative_urls=True, + blog=True, paginated={}, page_name='archives') + + def test_direct_templates_save_as_false(self): + + settings = _DEFAULT_CONFIG.copy() + settings['DIRECT_TEMPLATES'] = ['archives'] + settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' + generator = ArticlesGenerator(settings, settings, None, + _DEFAULT_CONFIG['THEME'], None, + _DEFAULT_CONFIG['MARKUP']) + writer = MagicMock() + generator.generate_direct_templates(writer) + writer.write_file.assert_called_count == 0 From feb1dcc773516129177a2f0d6648e8154e23e8c2 Mon Sep 17 00:00:00 2001 From: Pavel Puchkin Date: Mon, 30 Apr 2012 19:43:09 +1100 Subject: [PATCH 0225/2344] Use {slug} instead of {name} for category URL and FILENAME formatting --- pelican/settings.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/settings.py b/pelican/settings.py index 7a30e56e..84d9a0a9 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -43,8 +43,8 @@ _DEFAULT_CONFIG = {'PATH': '.', 'PAGE_SAVE_AS': 'pages/{slug}.html', 'PAGE_LANG_URL': 'pages/{slug}-{lang}.html', 'PAGE_LANG_SAVE_AS': 'pages/{slug}-{lang}.html', - 'CATEGORY_URL': 'category/{name}.html', - 'CATEGORY_SAVE_AS': 'category/{name}.html', + 'CATEGORY_URL': 'category/{slug}.html', + 'CATEGORY_SAVE_AS': 'category/{slug}.html', 'TAG_URL': 'tag/{slug}.html', 'TAG_SAVE_AS': 'tag/{slug}.html', 'AUTHOR_URL': u'author/{slug}.html', From faecba6035a4d15b7d1f8197026cf77bb95386be Mon Sep 17 00:00:00 2001 From: Matt Bowcock Date: Tue, 1 May 2012 22:34:32 -0400 Subject: [PATCH 0226/2344] Changed variable name extension to file_extensions. --- pelican/readers.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index c5d9aa00..868dc965 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -65,7 +65,7 @@ def render_node_to_html(document, node): class RstReader(Reader): enabled = bool(docutils) - extension = ['rst'] + file_extensions = ['rst'] def _parse_metadata(self, document): """Return the dict containing document metadata""" @@ -111,7 +111,7 @@ class RstReader(Reader): class MarkdownReader(Reader): enabled = bool(Markdown) - extension = ['md', 'markdown', 'mkd'] + file_extensions = ['md', 'markdown', 'mkd'] extensions = ['codehilite', 'extra'] def read(self, filename): @@ -128,7 +128,7 @@ class MarkdownReader(Reader): class HtmlReader(Reader): - extension = ['html', 'htm'] + file_extensions = ['html', 'htm'] _re = re.compile('\<\!\-\-\#\s?[A-z0-9_-]*\s?\:s?[A-z0-9\s_-]*\s?\-\-\>') def read(self, filename): @@ -147,7 +147,7 @@ class HtmlReader(Reader): _EXTENSIONS = {} for cls in Reader.__subclasses__(): - for ext in cls.extension: + for ext in cls.file_extensions: _EXTENSIONS[ext] = cls From ec610537be79c90ad6482a8a7372afaa978e539e Mon Sep 17 00:00:00 2001 From: Matt Bowcock Date: Tue, 1 May 2012 23:19:38 -0400 Subject: [PATCH 0227/2344] Added test for markdown files using extension md and mkd. Tests ensure the correct reader is processing file. --- tests/content/article_with_md_extension.md | 7 +++++++ tests/content/article_with_mkd_extension.mkd | 7 +++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/content/article_with_md_extension.md create mode 100644 tests/content/article_with_mkd_extension.mkd diff --git a/tests/content/article_with_md_extension.md b/tests/content/article_with_md_extension.md new file mode 100644 index 00000000..1fb052aa --- /dev/null +++ b/tests/content/article_with_md_extension.md @@ -0,0 +1,7 @@ +Test Markdown File Header +========================= + +Used for pelican test +--------------------- + +The quick brown fox jumped over the lazy dog's back. diff --git a/tests/content/article_with_mkd_extension.mkd b/tests/content/article_with_mkd_extension.mkd new file mode 100644 index 00000000..593f6721 --- /dev/null +++ b/tests/content/article_with_mkd_extension.mkd @@ -0,0 +1,7 @@ +Test Markdown File Header +========================= + +Used for pelican test +--------------------- + +This is another markdown test file. Uses the mkd extension. From 3c987d20b1de7b00f2dad8f5d71c11273c7aa89a Mon Sep 17 00:00:00 2001 From: Matt Bowcock Date: Tue, 1 May 2012 23:30:23 -0400 Subject: [PATCH 0228/2344] Added some metadata to new test files --- tests/content/article_with_md_extension.md | 3 +++ tests/content/article_with_mkd_extension.mkd | 3 +++ tests/test_readers.py | 22 ++++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/tests/content/article_with_md_extension.md b/tests/content/article_with_md_extension.md index 1fb052aa..11aa22a2 100644 --- a/tests/content/article_with_md_extension.md +++ b/tests/content/article_with_md_extension.md @@ -1,3 +1,6 @@ +title: Test md File +category: test + Test Markdown File Header ========================= diff --git a/tests/content/article_with_mkd_extension.mkd b/tests/content/article_with_mkd_extension.mkd index 593f6721..c946cb87 100644 --- a/tests/content/article_with_mkd_extension.mkd +++ b/tests/content/article_with_mkd_extension.mkd @@ -1,3 +1,6 @@ +title: Test mkd File +category: test + Test Markdown File Header ========================= diff --git a/tests/test_readers.py b/tests/test_readers.py index 7b9316b5..de2e9c32 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -61,3 +61,25 @@ class RstReaderTest(unittest.TestCase): self.assertEqual(content, expected) except ImportError: return unittest.skip('need the typogrify distribution') + +class MdReaderTest(unittest.TestCase): + + def test_article_with_md_extention(self): + # test to ensure the md extension is being processed by the correct reader + reader = readers.MarkdownReader({}) + content, metadata = reader.read(_filename('article_with_md_extension.md')) + expected = "

    Test Markdown File Header

    \n"\ + "

    Used for pelican test

    \n"\ + "

    The quick brown fox jumped over the lazy dog's back.

    " + + self.assertEqual(content, expected) + + def test_article_with_mkd_extension(self): + # test to ensure the mkd extension is being processed by the correct reader + reader = readers.MarkdownReader({}) + content, metadata = reader.read(_filename('article_with_mkd_extension.mkd')) + expected = "

    Test Markdown File Header

    \n"\ + "

    Used for pelican test

    \n"\ + "

    This is another markdown test file. Uses the mkd extension.

    " + + self.assertEqual(content, expected) From 06ba9acdb850f8c6f2ba21bb35757a8e5277209d Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Wed, 2 May 2012 09:26:33 +0100 Subject: [PATCH 0229/2344] Pass write function to reduce duplication. Simplify logic. --- pelican/generators.py | 59 ++++++++++++++-------------------------- tests/test_generators.py | 23 ++++++++-------- 2 files changed, 31 insertions(+), 51 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 99f4bef8..86e5db9b 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -162,45 +162,32 @@ class ArticlesGenerator(Generator): writer.write_feed(items, self.context, self.settings['TRANSLATION_FEED'] % lang) - def generate_articles(self, writer): + def generate_articles(self, write): """Generate the articles.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - article_template = self.get_template('article') for article in chain(self.translations, self.articles): write(article.save_as, article_template, self.context, article=article, category=article.category) - def generate_direct_templates(self, writer): + def generate_direct_templates(self, write): """Generate direct templates pages""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - PAGINATED_TEMPLATES = self.settings.get('PAGINATED_DIRECT_TEMPLATES') for template in self.settings.get('DIRECT_TEMPLATES'): paginated = {} if template in PAGINATED_TEMPLATES: paginated = {'articles': self.articles, 'dates': self.dates} + save_as = self.settings.get("%s_SAVE_AS" % template.upper(), + '%s.html' % template) + if not save_as: + continue - save_as = self.settings.get("%s_SAVE_AS" % template.upper(), None) - if save_as is None: - file_name = '%s.html' % template - elif save_as: - file_name = save_as - else: - continue - - write(file_name, self.get_template(template), + write(save_as, self.get_template(template), self.context, blog=True, paginated=paginated, page_name=template) - def generate_tags(self, writer): + def generate_tags(self, write): """Generate Tags pages.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - tag_template = self.get_template('tag') for tag, articles in self.tags.items(): articles.sort(key=attrgetter('date'), reverse=True) @@ -210,11 +197,8 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'tag/%s' % tag) - def generate_categories(self, writer): + def generate_categories(self, write): """Generate category pages.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - category_template = self.get_template('category') for cat, articles in self.categories: dates = [article for article in self.dates if article in articles] @@ -223,11 +207,8 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'category/%s' % cat) - def generate_authors(self, writer): + def generate_authors(self, write): """Generate Author pages.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - author_template = self.get_template('author') for aut, articles in self.authors: dates = [article for article in self.dates if article in articles] @@ -236,11 +217,8 @@ class ArticlesGenerator(Generator): paginated={'articles': articles, 'dates': dates}, page_name=u'author/%s' % aut) - def generate_drafts(self, writer): + def generate_drafts(self, write): """Generate drafts pages.""" - write = partial(writer.write_file, - relative_urls=self.settings.get('RELATIVE_URLS')) - article_template = self.get_template('article') for article in self.drafts: write('drafts/%s.html' % article.slug, article_template, @@ -248,17 +226,20 @@ class ArticlesGenerator(Generator): def generate_pages(self, writer): """Generate the pages on the disk""" + write = partial(writer.write_file, + relative_urls=self.settings.get('RELATIVE_URLS')) # to minimize the number of relative path stuff modification # in writer, articles pass first - self.generate_articles(writer) - self.generate_direct_templates(writer) + self.generate_articles(write) + self.generate_direct_templates(write) + # and subfolders after that - self.generate_tags(writer) - self.generate_categories(writer) - self.generate_authors(writer) - self.generate_drafts(writer) + self.generate_tags(write) + self.generate_categories(write) + self.generate_authors(write) + self.generate_drafts(write) def generate_context(self): """change the context""" diff --git a/tests/test_generators.py b/tests/test_generators.py index fc35fde4..dd2ca9cb 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -54,11 +54,10 @@ class TestArticlesGenerator(unittest.TestCase): generator = ArticlesGenerator(settings.copy(), settings, None, _DEFAULT_CONFIG['THEME'], None, _DEFAULT_CONFIG['MARKUP']) - - writer = MagicMock() - generator.generate_direct_templates(writer) - writer.write_file.assert_called_with("archives.html", - generator.get_template("archives"), settings, relative_urls=True, + write = MagicMock() + generator.generate_direct_templates(write) + write.assert_called_with("archives.html", + generator.get_template("archives"), settings, blog=True, paginated={}, page_name='archives') def test_direct_templates_save_as_modified(self): @@ -69,10 +68,10 @@ class TestArticlesGenerator(unittest.TestCase): generator = ArticlesGenerator(settings, settings, None, _DEFAULT_CONFIG['THEME'], None, _DEFAULT_CONFIG['MARKUP']) - writer = MagicMock() - generator.generate_direct_templates(writer) - writer.write_file.assert_called_with("archives/index.html", - generator.get_template("archives"), settings, relative_urls=True, + write = MagicMock() + generator.generate_direct_templates(write) + write.assert_called_with("archives/index.html", + generator.get_template("archives"), settings, blog=True, paginated={}, page_name='archives') def test_direct_templates_save_as_false(self): @@ -83,6 +82,6 @@ class TestArticlesGenerator(unittest.TestCase): generator = ArticlesGenerator(settings, settings, None, _DEFAULT_CONFIG['THEME'], None, _DEFAULT_CONFIG['MARKUP']) - writer = MagicMock() - generator.generate_direct_templates(writer) - writer.write_file.assert_called_count == 0 + write = MagicMock() + generator.generate_direct_templates(write) + write.assert_called_count == 0 From a60fa59514750ab2cd634c811069f591a7f6326e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albrecht=20M=C3=BChlenschulte?= Date: Sun, 6 May 2012 01:59:19 +0200 Subject: [PATCH 0230/2344] removed duplication --- pelican/tools/pelican_quickstart.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 2f63029b..4725e74d 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -53,14 +53,11 @@ clean: dropbox_upload: $$(OUTPUTDIR)/index.html \tcp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) -rsync_upload: $$(OUTPUTDIR)/index.html -\trsync --delete -rvz -e ssh $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) - ssh_upload: $$(OUTPUTDIR)/index.html \tscp -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) rsync_upload: $$(OUTPUTDIR)/index.html -\trsync -e ssh -P -r $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) +\trsync -e ssh -P -rvz --delete $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) ftp_upload: $$(OUTPUTDIR)/index.html \tlftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" From 8a842c0de7db1196ced0e7e2d7dc5d46548e5c73 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 6 May 2012 02:43:13 +0200 Subject: [PATCH 0231/2344] merge with master --- pelican/generators.py | 6 ++++-- tests/test_generators.py | 8 +++++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 86e48eb8..9647d397 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -303,10 +303,12 @@ class ArticlesGenerator(Generator): # order the categories per name self.categories = list(self.categories.items()) - self.categories.sort(reverse=self.settings['REVERSE_CATEGORY_ORDER']) + self.categories.sort( + key=lambda item: item[0].name, + reverse=self.settings['REVERSE_CATEGORY_ORDER']) self.authors = list(self.authors.items()) - self.authors.sort() + self.authors.sort(key=lambda item: item[0].name) self._update_context(('articles', 'dates', 'tags', 'categories', 'tag_cloud', 'authors')) diff --git a/tests/test_generators.py b/tests/test_generators.py index ecaacfcd..e8ce4e21 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -3,7 +3,6 @@ from mock import MagicMock import os import re -import subprocess from pelican.generators import ArticlesGenerator, LessCSSGenerator from pelican.settings import _DEFAULT_CONFIG @@ -11,6 +10,7 @@ from .support import unittest, temporary_folder, skipIfNoExecutable CUR_DIR = os.path.dirname(__file__) + class TestArticlesGenerator(unittest.TestCase): def test_generate_feeds(self): @@ -48,6 +48,12 @@ class TestArticlesGenerator(unittest.TestCase): elif relfilepath == "article_without_category.rst": self.assertEquals(article.category.name, 'Default') + categories = [cat.name for cat, _ in generator.categories] + # assert that the categories are ordered as expected + self.assertEquals( + categories, ['Default', 'TestCategory', 'Yeah', 'test', + 'yeah']) + class TestLessCSSGenerator(unittest.TestCase): From 7c53cc8955b8f38da7fe60a296335694a3a4ee54 Mon Sep 17 00:00:00 2001 From: m-r-r Date: Sun, 6 May 2012 12:07:13 +0200 Subject: [PATCH 0232/2344] Moved templates in pelican_quistart.py to a directory --- pelican/tools/pelican_quickstart.py | 114 ++++----------------- pelican/tools/templates/Makefile.in | 58 +++++++++++ pelican/tools/templates/pelican.conf.py.in | 25 +++++ 3 files changed, 105 insertions(+), 92 deletions(-) create mode 100644 pelican/tools/templates/Makefile.in create mode 100644 pelican/tools/templates/pelican.conf.py.in diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 00d81148..ca926667 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -7,95 +7,9 @@ import argparse from pelican import __version__ -TEMPLATES = { - 'Makefile' : ''' -PELICAN=$pelican -PELICANOPTS=$pelicanopts +_TEMPLATES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), \ + "templates") -BASEDIR=$$(PWD) -INPUTDIR=$$(BASEDIR)/src -OUTPUTDIR=$$(BASEDIR)/output -CONFFILE=$$(BASEDIR)/pelican.conf.py - -FTP_HOST=$ftp_host -FTP_USER=$ftp_user -FTP_TARGET_DIR=$ftp_target_dir - -SSH_HOST=$ssh_host -SSH_USER=$ssh_user -SSH_TARGET_DIR=$ssh_target_dir - -DROPBOX_DIR=$dropbox_dir - -help: -\t@echo 'Makefile for a pelican Web site ' -\t@echo ' ' -\t@echo 'Usage: ' -\t@echo ' make html (re)generate the web site ' -\t@echo ' make clean remove the generated files ' -\t@echo ' ftp_upload upload the web site using FTP ' -\t@echo ' ssh_upload upload the web site using SSH ' -\t@echo ' dropbox_upload upload the web site using Dropbox ' -\t@echo ' rsync_upload upload the web site using rsync/ssh' -\t@echo ' ' - - -html: clean $$(OUTPUTDIR)/index.html -\t@echo 'Done' - -$$(OUTPUTDIR)/%.html: -\t$$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(CONFFILE) $$(PELICANOPTS) - -clean: -\trm -fr $$(OUTPUTDIR) -\tmkdir $$(OUTPUTDIR) - -dropbox_upload: $$(OUTPUTDIR)/index.html -\tcp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) - -ssh_upload: $$(OUTPUTDIR)/index.html -\tscp -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) - -rsync_upload: $$(OUTPUTDIR)/index.html -\trsync -e ssh -P -rvz --delete $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) - -ftp_upload: $$(OUTPUTDIR)/index.html -\tlftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" - -github: $$(OUTPUTDIR)/index.html -\tghp-import $$(OUTPUTDIR) -\tgit push origin gh-pages - -.PHONY: html help clean ftp_upload ssh_upload rsync_upload dropbox_upload github -''', - - 'pelican.conf.py': '''#!/usr/bin/env python -# -*- coding: utf-8 -*- # - -AUTHOR = u"$author" -SITENAME = u"$sitename" -SITEURL = '/' - -TIMEZONE = 'Europe/Paris' - -DEFAULT_LANG='$lang' - -# Blogroll -LINKS = ( - ('Pelican', 'http://docs.notmyidea.org/alexis/pelican/'), - ('Python.org', 'http://python.org'), - ('Jinja2', 'http://jinja.pocoo.org'), - ('You can modify those links in your config file', '#') - ) - -# Social widget -SOCIAL = ( - ('You can add links in your config file', '#'), - ) - -DEFAULT_PAGINATION = $default_pagination -''' -} CONF = { 'pelican' : 'pelican', @@ -113,6 +27,20 @@ CONF = { } +def get_template(name): + template = os.path.join(_TEMPLATES_DIR, "{0}.in".format(name)) + + if os.path.isfile(template): + raise RuntimeError("Cannot open {0}".format(template)) + + with open(tempalte, 'r') as fd: + line = fd.readline() + while line: + yield line + line = fd.readline() + fd.close() + + def ask(question, answer=str, default=None, l=None): if answer == str: r = '' @@ -247,20 +175,22 @@ Please answer the following questions so this script can generate the files need except OSError, e: print('Error: {0}'.format(e)) - conf = string.Template(TEMPLATES['pelican.conf.py']) try: with open(os.path.join(CONF['basedir'], 'pelican.conf.py'), 'w') as fd: - fd.write(conf.safe_substitute(CONF)) + for line in get_template('pelican.conf.py'): + template = string.Template(line) + fd.write(template.safe_substitute(CONF)) fd.close() except OSError, e: print('Error: {0}'.format(e)) if mkfile: - Makefile = string.Template(TEMPLATES['Makefile']) try: with open(os.path.join(CONF['basedir'], 'Makefile'), 'w') as fd: - fd.write(Makefile.safe_substitute(CONF)) + for line in get_template('Makefile'): + template = string.Template(line) + fd.write(template.safe_substitute(CONF)) fd.close() except OSError, e: print('Error: {0}'.format(e)) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in new file mode 100644 index 00000000..998d8c97 --- /dev/null +++ b/pelican/tools/templates/Makefile.in @@ -0,0 +1,58 @@ +PELICAN=$pelican +PELICANOPTS=$pelicanopts + +BASEDIR=$$(PWD) +INPUTDIR=$$(BASEDIR)/src +OUTPUTDIR=$$(BASEDIR)/output +CONFFILE=$$(BASEDIR)/pelican.conf.py + +FTP_HOST=$ftp_host +FTP_USER=$ftp_user +FTP_TARGET_DIR=$ftp_target_dir + +SSH_HOST=$ssh_host +SSH_USER=$ssh_user +SSH_TARGET_DIR=$ssh_target_dir + +DROPBOX_DIR=$dropbox_dir + +help: + @echo 'Makefile for a pelican Web site ' + @echo ' ' + @echo 'Usage: ' + @echo ' make html (re)generate the web site ' + @echo ' make clean remove the generated files ' + @echo ' ftp_upload upload the web site using FTP ' + @echo ' ssh_upload upload the web site using SSH ' + @echo ' dropbox_upload upload the web site using Dropbox ' + @echo ' rsync_upload upload the web site using rsync/ssh' + @echo ' ' + + +html: clean $$(OUTPUTDIR)/index.html + @echo 'Done' + +$$(OUTPUTDIR)/%.html: + $$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(CONFFILE) $$(PELICANOPTS) + +clean: + rm -fr $$(OUTPUTDIR) + mkdir $$(OUTPUTDIR) + +dropbox_upload: $$(OUTPUTDIR)/index.html + cp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) + +ssh_upload: $$(OUTPUTDIR)/index.html + scp -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) + +rsync_upload: $$(OUTPUTDIR)/index.html + rsync -e ssh -P -rvz --delete $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) + +ftp_upload: $$(OUTPUTDIR)/index.html + lftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" + +github: $$(OUTPUTDIR)/index.html + ghp-import $$(OUTPUTDIR) + git push origin gh-pages + +.PHONY: html help clean ftp_upload ssh_upload rsync_upload dropbox_upload github diff --git a/pelican/tools/templates/pelican.conf.py.in b/pelican/tools/templates/pelican.conf.py.in new file mode 100644 index 00000000..ee56048e --- /dev/null +++ b/pelican/tools/templates/pelican.conf.py.in @@ -0,0 +1,25 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # + +AUTHOR = u"$author" +SITENAME = u"$sitename" +SITEURL = '/' + +TIMEZONE = 'Europe/Paris' + +DEFAULT_LANG='$lang' + +# Blogroll +LINKS = ( + ('Pelican', 'http://docs.notmyidea.org/alexis/pelican/'), + ('Python.org', 'http://python.org'), + ('Jinja2', 'http://jinja.pocoo.org'), + ('You can modify those links in your config file', '#') + ) + +# Social widget +SOCIAL = ( + ('You can add links in your config file', '#'), + ) + +DEFAULT_PAGINATION = $default_pagination From d97fc8f666aaaf55cc9405920bbc75f3c91f7298 Mon Sep 17 00:00:00 2001 From: m-r-r Date: Sun, 6 May 2012 12:32:53 +0200 Subject: [PATCH 0233/2344] Fixed some errors --- pelican/tools/pelican_quickstart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index ca926667..cfd9bb4c 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -30,10 +30,10 @@ CONF = { def get_template(name): template = os.path.join(_TEMPLATES_DIR, "{0}.in".format(name)) - if os.path.isfile(template): + if not os.path.isfile(template): raise RuntimeError("Cannot open {0}".format(template)) - with open(tempalte, 'r') as fd: + with open(template, 'r') as fd: line = fd.readline() while line: yield line From 4a0d4461e18dab5c7da3e9900dfbbc7b3e0a5ca7 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 7 May 2012 12:26:17 +0200 Subject: [PATCH 0234/2344] Apply typogrify on the title. As it is done when reading the file, we need to remove html tags for the permalink and the slug (this is done here for the notmyidea and simple themes). While modifying the themes I also replaced the `pagename` template tag with `article.url` (`pagename` was an empty variable, no more used ?). --- pelican/readers.py | 1 + .../themes/notmyidea/templates/article.html | 56 ++++++++++--------- pelican/themes/simple/templates/article.html | 36 ++++++------ pelican/utils.py | 2 + 4 files changed, 53 insertions(+), 42 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 868dc965..83565918 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -174,5 +174,6 @@ def read_file(filename, fmt=None, settings=None): if settings and settings['TYPOGRIFY']: from typogrify import Typogrify content = Typogrify.typogrify(content) + metadata['title'] = Typogrify.typogrify(metadata['title']) return content, metadata diff --git a/pelican/themes/notmyidea/templates/article.html b/pelican/themes/notmyidea/templates/article.html index 6615b63a..fc7e5893 100644 --- a/pelican/themes/notmyidea/templates/article.html +++ b/pelican/themes/notmyidea/templates/article.html @@ -1,30 +1,34 @@ {% extends "base.html" %} -{% block title %}{{ article.title }}{% endblock %} -{% block content %} -
    -
    -

    {{ article.title - }}

    {% include 'twitter.html' %}
    -
    - {% include 'article_infos.html' %} - {{ article.content }} -
    - {% if DISQUS_SITENAME %} -
    -

    Comments !

    -
    - -
    - {% endif %} +{% block title %}{{ article.title|striptags }}{% endblock %} +{% block content %} +
    + +
    + {% include 'article_infos.html' %} + {{ article.content }} +
    + {% if DISQUS_SITENAME %} +
    +

    Comments !

    +
    + +
    + {% endif %} + +
    {% endblock %} diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index d6c96a13..16c34266 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -1,19 +1,23 @@ {% extends "base.html" %} -{% block content %} -
    -

    {{ article.title }}

    -
    - - {{ article.locale_date }} - - {% if article.author %} -
    - By {{ article.author }} -
    - {% endif %} -
    -
    - {{ article.content }} -
    +{% block content %} +
    +
    +

    + {{ article.title }}

    +
    +
    + + {{ article.locale_date }} + + {% if article.author %} +
    + By {{ article.author }} +
    + {% endif %} +
    +
    + {{ article.content }} +
    {% endblock %} diff --git a/pelican/utils.py b/pelican/utils.py index 18730e6c..d4e34842 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -8,6 +8,7 @@ import logging from codecs import open as _open from datetime import datetime from itertools import groupby +from jinja2 import Markup from operator import attrgetter logger = logging.getLogger(__name__) @@ -44,6 +45,7 @@ def slugify(value): Took from django sources. """ + value = Markup(value).striptags() if type(value) == unicode: import unicodedata value = unicodedata.normalize('NFKD', value).encode('ascii', 'ignore') From e9996b5cc64e4c9dc7c295742e5d1d592ee32511 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 7 May 2012 13:05:33 +0200 Subject: [PATCH 0235/2344] strip tags for feed titles --- pelican/writers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pelican/writers.py b/pelican/writers.py index 593879e2..75971ee9 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -8,8 +8,8 @@ import logging from codecs import open from functools import partial - from feedgenerator import Atom1Feed, Rss201rev2Feed +from jinja2 import Markup from pelican.paginator import Paginator from pelican.utils import get_relative_path, set_date_tzinfo @@ -25,8 +25,9 @@ class Writer(object): def _create_new_feed(self, feed_type, context): feed_class = Rss201rev2Feed if feed_type == 'rss' else Atom1Feed + sitename = Markup(context['SITENAME']).striptags() feed = feed_class( - title=context['SITENAME'], + title=sitename, link=(self.site_url + '/'), feed_url=self.feed_url, description=context.get('SITESUBTITLE', '')) @@ -34,8 +35,9 @@ class Writer(object): def _add_item_to_the_feed(self, feed, item): + title = Markup(item.title).striptags() feed.add_item( - title=item.title, + title=title, link='%s/%s' % (self.site_url, item.url), unique_id='tag:%s,%s:%s' % (self.site_url.replace('http://', ''), item.date.date(), item.url), From a6788f83c2304bd5e551cb9e8dd2daf998e5c48b Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 7 May 2012 17:11:57 +0200 Subject: [PATCH 0236/2344] integrate webassets --- pelican/__init__.py | 5 ++++- pelican/generators.py | 21 +++++++++++++++++---- pelican/settings.py | 9 +++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 6b3d12fb..97e21ccd 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -126,12 +126,15 @@ class Pelican(object): writer = self.get_writer() + generators[1].env.assets_environment = generators[0].assets_env + generators[2].env.assets_environment = generators[0].assets_env + for p in generators: if hasattr(p, 'generate_output'): p.generate_output(writer) def get_generator_classes(self): - generators = [ArticlesGenerator, PagesGenerator, StaticGenerator] + generators = [StaticGenerator, ArticlesGenerator, PagesGenerator] if self.settings['PDF_GENERATOR']: generators.append(PdfGenerator) if self.settings['LESS_GENERATOR']: # can be True or PATH to lessc diff --git a/pelican/generators.py b/pelican/generators.py index 9647d397..00701116 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -42,7 +42,7 @@ class Generator(object): simple_loader = FileSystemLoader(os.path.join(theme_path, "themes", "simple", "templates")) - self._env = Environment( + self.env = Environment( loader=ChoiceLoader([ FileSystemLoader(self._templates_path), simple_loader, # implicit inheritance @@ -51,11 +51,11 @@ class Generator(object): extensions=self.settings.get('JINJA_EXTENSIONS', []), ) - logger.debug('template list: {0}'.format(self._env.list_templates())) + logger.debug('template list: {0}'.format(self.env.list_templates())) # get custom Jinja filters from user settings custom_filters = self.settings.get('JINJA_FILTERS', {}) - self._env.filters.update(custom_filters) + self.env.filters.update(custom_filters) def get_template(self, name): """Return the template by name. @@ -64,7 +64,7 @@ class Generator(object): """ if name not in self._templates: try: - self._templates[name] = self._env.get_template(name + '.html') + self._templates[name] = self.env.get_template(name + '.html') except TemplateNotFound: raise Exception('[templates] unable to load %s.html from %s' \ % (name, self._templates_path)) @@ -364,7 +364,20 @@ class StaticGenerator(Generator): copy(path, source, os.path.join(output_path, destination), final_path, overwrite=True) + def generate_context(self): + + if self.settings['WEBASSETS']: + from webassets import Environment as AssetsEnvironment + + assets_url = self.settings['SITEURL'] + '/theme/' + assets_src = os.path.join(self.output_path, 'theme') + self.assets_env = AssetsEnvironment(assets_src, assets_url) + + if logging.getLevelName(logger.getEffectiveLevel()) == "DEBUG": + self.assets_env.debug = True + def generate_output(self, writer): + self._copy_paths(self.settings['STATIC_PATHS'], self.path, 'static', self.output_path) self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme, diff --git a/pelican/settings.py b/pelican/settings.py index 4da66989..647d3e93 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -68,6 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.', 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'LESS_GENERATOR': False, + 'WEBASSETS': False, } @@ -150,4 +151,12 @@ def configure_settings(settings, default_settings=None, filename=None): "http://docs.notmyidea.org/alexis/pelican/settings.html#timezone " "for more information") + if settings['WEBASSETS']: + try: + from webassets.ext.jinja2 import AssetsExtension + settings['JINJA_EXTENSIONS'].append(AssetsExtension) + except ImportError: + logger.warn("You must install the webassets module to use WEBASSETS.") + settings['WEBASSETS'] = False + return settings From f12a2974668008dbbc3e28c03f11a65159c3b65e Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Mon, 7 May 2012 23:07:44 +0200 Subject: [PATCH 0237/2344] prefix urls with '{{ SITEURL }}/' so that urls won't break when #330 is merged --- pelican/themes/notmyidea/templates/archives.html | 2 +- pelican/themes/notmyidea/templates/categories.html | 2 +- pelican/themes/simple/templates/archives.html | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/themes/notmyidea/templates/archives.html b/pelican/themes/notmyidea/templates/archives.html index f7f1c400..f6784942 100644 --- a/pelican/themes/notmyidea/templates/archives.html +++ b/pelican/themes/notmyidea/templates/archives.html @@ -6,7 +6,7 @@
    {% for article in dates %}
    {{ article.locale_date }}
    -
    {{ article.title }}
    +
    {{ article.title }}
    {% endfor %}
    diff --git a/pelican/themes/notmyidea/templates/categories.html b/pelican/themes/notmyidea/templates/categories.html index e4d9d0a7..e29be0ca 100644 --- a/pelican/themes/notmyidea/templates/categories.html +++ b/pelican/themes/notmyidea/templates/categories.html @@ -2,7 +2,7 @@ {% block content %} {% endblock %} diff --git a/pelican/themes/simple/templates/archives.html b/pelican/themes/simple/templates/archives.html index 6c9db183..050f2686 100644 --- a/pelican/themes/simple/templates/archives.html +++ b/pelican/themes/simple/templates/archives.html @@ -5,7 +5,7 @@
    {% for article in dates %}
    {{ article.locale_date }}
    -
    {{ article.title }}
    +
    {{ article.title }}
    {% endfor %}
    {% endblock %} From df7b2c968e1b026f24546adbcc5511e597d64615 Mon Sep 17 00:00:00 2001 From: Stuart Colville Date: Wed, 9 May 2012 23:24:31 +0100 Subject: [PATCH 0238/2344] Add documentation for DIRECT_TEMPLATES and PAGINATED_DIRECT_TEMPLATES --- docs/settings.rst | 139 +++++++++++++++++++++++----------------------- 1 file changed, 71 insertions(+), 68 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 7c19b539..b5f3c4ad 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -21,68 +21,73 @@ Here is a list of settings for Pelican: Basic settings ============== -================================================ ===================================================== -Setting name (default value) What does it do? -================================================ ===================================================== -`AUTHOR` Default author (put your name) -`DATE_FORMATS` (``{}``) If you do manage multiple languages, you can - set the date formatting here. See "Date format and locales" - section below for details. -`DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on. -`DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use. -`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the - template. Templates may or not honor this - setting. -`FALLBACK_ON_FS_DATE` (``True``) If True, Pelican will use the file system - timestamp information (mtime) if it can't get - date information from the metadata. -`JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. -`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as - the generated files. -`LOCALE` (''[#]_) Change the locale. A list of locales can be provided - here or a single string representing one locale. - When providing a list, all the locales will be tried - until one works. -`MARKUP` (``('rst', 'md')``) A list of available markup languages you want - to use. For the moment, the only available values - are `rst` and `md`. -`MD_EXTENSIONS` (``['codehilite','extra']``) A list of the extensions that the Markdown processor - will use. Refer to the extensions chapter in the - Python-Markdown documentation for a complete list of - supported extensions. -`OUTPUT_PATH` (``'output/'``) Where to output the generated files. -`PATH` (``None``) Path to look at for input files. -`PAGE_DIR` (``'pages'``) Directory to look at for pages. -`PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages. -`ARTICLE_DIR` (``''``) Directory to look at for articles. -`ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles. -`PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions - of your documents. You will need to install - `rst2pdf`. -`RELATIVE_URLS` (``True``) Defines whether Pelican should use relative URLs or - not. -`SITENAME` (``'A Pelican Blog'``) Your site name -`SITEURL` Base URL of your website. Not defined by default, - which means the base URL is assumed to be "/" with a - root-relative URL structure. If `SITEURL` is specified - explicitly, there should be no trailing slash at the end, - and URLs will be generated with an absolute URL structure - (including the domain). If you want to use relative URLs - instead of root-relative or absolute URLs, you should - instead use the `RELATIVE_URL` setting. -`STATIC_PATHS` (``['images']``) The static paths you want to have accessible - on the output path "static". By default, - Pelican will copy the 'images' folder to the - output folder. -`TIMEZONE` The timezone used in the date information, to - generate Atom and RSS feeds. See the "timezone" - section below for more info. -`TYPOGRIFY` (``False``) If set to true, some - additional transformations will be done on the - generated HTML, using the `Typogrify - `_ - library -================================================ ===================================================== +===================================================================== ===================================================================== +Setting name (default value) What does it do? +===================================================================== ===================================================================== +`AUTHOR` Default author (put your name) +`DATE_FORMATS` (``{}``) If you do manage multiple languages, you can + set the date formatting here. See "Date format and locales" + section below for details. +`DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on. +`DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use. +`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the + template. Templates may or not honor this + setting. +`FALLBACK_ON_FS_DATE` (``True``) If True, Pelican will use the file system + timestamp information (mtime) if it can't get + date information from the metadata. +`JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. +`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as + the generated files. +`LOCALE` (''[#]_) Change the locale. A list of locales can be provided + here or a single string representing one locale. + When providing a list, all the locales will be tried + until one works. +`MARKUP` (``('rst', 'md')``) A list of available markup languages you want + to use. For the moment, the only available values + are `rst` and `md`. +`MD_EXTENSIONS` (``['codehilite','extra']``) A list of the extensions that the Markdown processor + will use. Refer to the extensions chapter in the + Python-Markdown documentation for a complete list of + supported extensions. +`OUTPUT_PATH` (``'output/'``) Where to output the generated files. +`PATH` (``None``) Path to look at for input files. +`PAGE_DIR` (``'pages'``) Directory to look at for pages. +`PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages. +`ARTICLE_DIR` (``''``) Directory to look at for articles. +`ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles. +`PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions + of your documents. You will need to install + `rst2pdf`. +`RELATIVE_URLS` (``True``) Defines whether Pelican should use relative URLs or + not. +`SITENAME` (``'A Pelican Blog'``) Your site name +`SITEURL` Base URL of your website. Not defined by default, + which means the base URL is assumed to be "/" with a + root-relative URL structure. If `SITEURL` is specified + explicitly, there should be no trailing slash at the end, + and URLs will be generated with an absolute URL structure + (including the domain). If you want to use relative URLs + instead of root-relative or absolute URLs, you should + instead use the `RELATIVE_URL` setting. +`STATIC_PATHS` (``['images']``) The static paths you want to have accessible + on the output path "static". By default, + Pelican will copy the 'images' folder to the + output folder. +`TIMEZONE` The timezone used in the date information, to + generate Atom and RSS feeds. See the "timezone" + section below for more info. +`TYPOGRIFY` (``False``) If set to true, some + additional transformations will be done on the + generated HTML, using the `Typogrify + `_ + library +`DIRECT_TEMPLATES` (``('index', 'tags', 'categories', 'archives')``) List of templates that are used directly to render + content. Typically direct templates are used to generate + index pages for collections of content e.g. tags and + category index pages. +`PAGINATED_DIRECT_TEMPLATES` (``('index',)``) Provides the direct templates that should be paginated. +===================================================================== ===================================================================== .. [#] Default is the system locale. @@ -96,7 +101,7 @@ your articles in a location such as '{slug}/index.html' and link to them as '{slug}' for clean URLs. These settings give you the flexibility to place your articles and pages anywhere you want. -.. note:: +.. note:: If you specify a datetime directive, it will be substituted using the input files' date metadata attribute. If the date is not specified for a particular file, Pelican will rely on the file's mtime timestamp. @@ -141,17 +146,15 @@ Setting name (default value) what does it do? `CATEGORY_SAVE_AS` ('category/{name}.html') The location to save a category. `TAG_URL` ('tag/{name}.html') The URL to use for a tag. `TAG_SAVE_AS` ('tag/{name}.html') The location to save the tag page. +`_SAVE_AS` The location to save content generated from direct + templates. Where is the + upper case template name. ================================================ ===================================================== .. note:: When any of `*_SAVE_AS` is set to False, files will not be created. - You can change the file output location of any pages listed in DIRECT_TEMPLATES - by providing a setting _SAVE_AS, where is the template - name in uppercase; e.g. CATEGORIES. If False it will not be created. - - Timezone -------- From 252d00834fe81f9954df4ebc78b26edb0dbea2a2 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 7 May 2012 13:05:33 +0200 Subject: [PATCH 0239/2344] strip tags for feed titles --- pelican/writers.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pelican/writers.py b/pelican/writers.py index 593879e2..75971ee9 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -8,8 +8,8 @@ import logging from codecs import open from functools import partial - from feedgenerator import Atom1Feed, Rss201rev2Feed +from jinja2 import Markup from pelican.paginator import Paginator from pelican.utils import get_relative_path, set_date_tzinfo @@ -25,8 +25,9 @@ class Writer(object): def _create_new_feed(self, feed_type, context): feed_class = Rss201rev2Feed if feed_type == 'rss' else Atom1Feed + sitename = Markup(context['SITENAME']).striptags() feed = feed_class( - title=context['SITENAME'], + title=sitename, link=(self.site_url + '/'), feed_url=self.feed_url, description=context.get('SITESUBTITLE', '')) @@ -34,8 +35,9 @@ class Writer(object): def _add_item_to_the_feed(self, feed, item): + title = Markup(item.title).striptags() feed.add_item( - title=item.title, + title=title, link='%s/%s' % (self.site_url, item.url), unique_id='tag:%s,%s:%s' % (self.site_url.replace('http://', ''), item.date.date(), item.url), From ec707930ce247f762d7c1a580e3ef6ac974cb0de Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 7 May 2012 17:11:57 +0200 Subject: [PATCH 0240/2344] integrate webassets --- pelican/__init__.py | 5 ++++- pelican/generators.py | 21 +++++++++++++++++---- pelican/settings.py | 9 +++++++++ 3 files changed, 30 insertions(+), 5 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 6b3d12fb..97e21ccd 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -126,12 +126,15 @@ class Pelican(object): writer = self.get_writer() + generators[1].env.assets_environment = generators[0].assets_env + generators[2].env.assets_environment = generators[0].assets_env + for p in generators: if hasattr(p, 'generate_output'): p.generate_output(writer) def get_generator_classes(self): - generators = [ArticlesGenerator, PagesGenerator, StaticGenerator] + generators = [StaticGenerator, ArticlesGenerator, PagesGenerator] if self.settings['PDF_GENERATOR']: generators.append(PdfGenerator) if self.settings['LESS_GENERATOR']: # can be True or PATH to lessc diff --git a/pelican/generators.py b/pelican/generators.py index 9647d397..00701116 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -42,7 +42,7 @@ class Generator(object): simple_loader = FileSystemLoader(os.path.join(theme_path, "themes", "simple", "templates")) - self._env = Environment( + self.env = Environment( loader=ChoiceLoader([ FileSystemLoader(self._templates_path), simple_loader, # implicit inheritance @@ -51,11 +51,11 @@ class Generator(object): extensions=self.settings.get('JINJA_EXTENSIONS', []), ) - logger.debug('template list: {0}'.format(self._env.list_templates())) + logger.debug('template list: {0}'.format(self.env.list_templates())) # get custom Jinja filters from user settings custom_filters = self.settings.get('JINJA_FILTERS', {}) - self._env.filters.update(custom_filters) + self.env.filters.update(custom_filters) def get_template(self, name): """Return the template by name. @@ -64,7 +64,7 @@ class Generator(object): """ if name not in self._templates: try: - self._templates[name] = self._env.get_template(name + '.html') + self._templates[name] = self.env.get_template(name + '.html') except TemplateNotFound: raise Exception('[templates] unable to load %s.html from %s' \ % (name, self._templates_path)) @@ -364,7 +364,20 @@ class StaticGenerator(Generator): copy(path, source, os.path.join(output_path, destination), final_path, overwrite=True) + def generate_context(self): + + if self.settings['WEBASSETS']: + from webassets import Environment as AssetsEnvironment + + assets_url = self.settings['SITEURL'] + '/theme/' + assets_src = os.path.join(self.output_path, 'theme') + self.assets_env = AssetsEnvironment(assets_src, assets_url) + + if logging.getLevelName(logger.getEffectiveLevel()) == "DEBUG": + self.assets_env.debug = True + def generate_output(self, writer): + self._copy_paths(self.settings['STATIC_PATHS'], self.path, 'static', self.output_path) self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme, diff --git a/pelican/settings.py b/pelican/settings.py index 4da66989..647d3e93 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -68,6 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.', 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'LESS_GENERATOR': False, + 'WEBASSETS': False, } @@ -150,4 +151,12 @@ def configure_settings(settings, default_settings=None, filename=None): "http://docs.notmyidea.org/alexis/pelican/settings.html#timezone " "for more information") + if settings['WEBASSETS']: + try: + from webassets.ext.jinja2 import AssetsExtension + settings['JINJA_EXTENSIONS'].append(AssetsExtension) + except ImportError: + logger.warn("You must install the webassets module to use WEBASSETS.") + settings['WEBASSETS'] = False + return settings From e6448567a0a98d9c005c1ab955c45a657b814428 Mon Sep 17 00:00:00 2001 From: Simon Date: Fri, 11 May 2012 22:19:03 +0200 Subject: [PATCH 0241/2344] add some doc in the code --- pelican/__init__.py | 6 ++++-- pelican/generators.py | 3 +++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 97e21ccd..7e546b29 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -126,8 +126,10 @@ class Pelican(object): writer = self.get_writer() - generators[1].env.assets_environment = generators[0].assets_env - generators[2].env.assets_environment = generators[0].assets_env + # pass the assets environment to the generators + if self.settings['WEBASSETS']: + generators[1].env.assets_environment = generators[0].assets_env + generators[2].env.assets_environment = generators[0].assets_env for p in generators: if hasattr(p, 'generate_output'): diff --git a/pelican/generators.py b/pelican/generators.py index 30a463b4..f15db15d 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -394,6 +394,9 @@ class StaticGenerator(Generator): if self.settings['WEBASSETS']: from webassets import Environment as AssetsEnvironment + # Define the assets environment that will be passed to the + # generators. The StaticGenerator must then be run first to have + # the assets in the output_path before generating the templates. assets_url = self.settings['SITEURL'] + '/theme/' assets_src = os.path.join(self.output_path, 'theme') self.assets_env = AssetsEnvironment(assets_src, assets_url) From b7e6d3d98d0a131e1cd93eb95a586fd1ec3d7da5 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Sat, 12 May 2012 01:07:17 +0200 Subject: [PATCH 0242/2344] update functional tests output --- .../basic/a-markdown-powered-article.html | 27 +++++---- tests/output/basic/archives.html | 16 +++--- tests/output/basic/article-1.html | 27 +++++---- tests/output/basic/article-2.html | 27 +++++---- tests/output/basic/article-3.html | 27 +++++---- tests/output/basic/categories.html | 8 +-- .../output/basic/drafts/a-draft-article.html | 27 +++++---- tests/output/basic/feeds/all-en.atom.xml | 14 ++--- tests/output/basic/feeds/all-fr.atom.xml | 4 +- tests/output/basic/feeds/all.atom.xml | 14 ++--- tests/output/basic/feeds/bar.atom.xml | 2 +- tests/output/basic/feeds/cat1.atom.xml | 6 +- tests/output/basic/feeds/content.atom.xml | 4 +- tests/output/basic/feeds/yeah.atom.xml | 2 +- tests/output/basic/oh-yeah-fr.html | 27 +++++---- tests/output/basic/oh-yeah.html | 27 +++++---- tests/output/basic/second-article-fr.html | 27 +++++---- tests/output/basic/second-article.html | 27 +++++---- tests/output/basic/theme/css/wide.css | 15 +++-- .../basic/theme/images/icons/facebook.png | Bin 0 -> 300 bytes .../output/basic/this-is-a-super-article.html | 27 +++++---- tests/output/basic/unbelievable.html | 27 +++++---- .../custom/a-markdown-powered-article.html | 53 ++++++++++-------- tests/output/custom/archives.html | 16 +++--- tests/output/custom/article-1.html | 53 ++++++++++-------- tests/output/custom/article-2.html | 53 ++++++++++-------- tests/output/custom/article-3.html | 53 ++++++++++-------- tests/output/custom/categories.html | 8 +-- .../output/custom/drafts/a-draft-article.html | 53 ++++++++++-------- tests/output/custom/feeds/all-en.atom.xml | 14 ++--- tests/output/custom/feeds/all-fr.atom.xml | 4 +- tests/output/custom/feeds/all.atom.xml | 14 ++--- tests/output/custom/feeds/all.rss.xml | 14 ++--- tests/output/custom/feeds/bar.atom.xml | 2 +- tests/output/custom/feeds/bar.rss.xml | 2 +- tests/output/custom/feeds/cat1.atom.xml | 6 +- tests/output/custom/feeds/cat1.rss.xml | 6 +- tests/output/custom/feeds/content.atom.xml | 4 +- tests/output/custom/feeds/content.rss.xml | 4 +- tests/output/custom/feeds/yeah.atom.xml | 2 +- tests/output/custom/feeds/yeah.rss.xml | 2 +- tests/output/custom/oh-yeah-fr.html | 53 ++++++++++-------- tests/output/custom/oh-yeah.html | 53 ++++++++++-------- tests/output/custom/second-article-fr.html | 53 ++++++++++-------- tests/output/custom/second-article.html | 53 ++++++++++-------- tests/output/custom/theme/css/wide.css | 15 +++-- .../custom/theme/images/icons/facebook.png | Bin 0 -> 300 bytes .../custom/this-is-a-super-article.html | 53 ++++++++++-------- tests/output/custom/unbelievable.html | 53 ++++++++++-------- 49 files changed, 599 insertions(+), 479 deletions(-) create mode 100644 tests/output/basic/theme/images/icons/facebook.png create mode 100644 tests/output/custom/theme/images/icons/facebook.png diff --git a/tests/output/basic/a-markdown-powered-article.html b/tests/output/basic/a-markdown-powered-article.html index 9cb92c4b..ceadf79a 100644 --- a/tests/output/basic/a-markdown-powered-article.html +++ b/tests/output/basic/a-markdown-powered-article.html @@ -41,13 +41,18 @@ - -
    - +
    diff --git a/tests/output/basic/archives.html b/tests/output/basic/archives.html index 9aedb29d..52d00234 100644 --- a/tests/output/basic/archives.html +++ b/tests/output/basic/archives.html @@ -48,28 +48,28 @@
    Fri 15 October 2010
    -
    Unbelievable !
    +
    Unbelievable !
    Wed 20 October 2010
    -
    Oh yeah !
    +
    Oh yeah !
    Thu 02 December 2010
    -
    This is a super article !
    +
    This is a super article !
    Thu 17 February 2011
    -
    Article 1
    +
    Article 1
    Thu 17 February 2011
    -
    Article 2
    +
    Article 2
    Thu 17 February 2011
    -
    Article 3
    +
    Article 3
    Wed 20 April 2011
    -
    A markdown powered article
    +
    A markdown powered article
    Wed 29 February 2012
    -
    Second article
    +
    Second article
    diff --git a/tests/output/basic/article-1.html b/tests/output/basic/article-1.html index 5f1d7c1d..bd6f9716 100644 --- a/tests/output/basic/article-1.html +++ b/tests/output/basic/article-1.html @@ -41,13 +41,18 @@ - -
    -
    -

    Article 1

    -
    -
    + +
    +
    +
    +

    + Article 1

    + +
    + +
    +
    Thu 17 February 2011 @@ -62,12 +67,12 @@
    -

    Article 1

    +

    Article 1

    -
    - +
    + -
    +
    diff --git a/tests/output/basic/article-2.html b/tests/output/basic/article-2.html index d6dbf74b..7811204a 100644 --- a/tests/output/basic/article-2.html +++ b/tests/output/basic/article-2.html @@ -41,13 +41,18 @@ - -
    -
    -

    Article 2

    -
    -
    + +
    +
    +
    +

    + Article 2

    + +
    + +
    +
    Thu 17 February 2011 @@ -62,12 +67,12 @@
    -

    Article 2

    +

    Article 2

    -
    - +
    + -
    +
    diff --git a/tests/output/basic/article-3.html b/tests/output/basic/article-3.html index 8dc806c1..96acb190 100644 --- a/tests/output/basic/article-3.html +++ b/tests/output/basic/article-3.html @@ -41,13 +41,18 @@ - -
    -
    -

    Article 3

    -
    -
    + +
    +
    +
    +

    + Article 3

    + +
    + +
    +
    Thu 17 February 2011 @@ -62,12 +67,12 @@
    -

    Article 3

    +

    Article 3

    -
    - +
    + -
    +
    diff --git a/tests/output/basic/categories.html b/tests/output/basic/categories.html index 2430cc96..db25ed68 100644 --- a/tests/output/basic/categories.html +++ b/tests/output/basic/categories.html @@ -44,13 +44,13 @@ diff --git a/tests/output/basic/drafts/a-draft-article.html b/tests/output/basic/drafts/a-draft-article.html index 32a11e69..99b90c33 100644 --- a/tests/output/basic/drafts/a-draft-article.html +++ b/tests/output/basic/drafts/a-draft-article.html @@ -41,13 +41,18 @@ - -
    -
    -

    A draft article

    -
    -
    + +
    +
    +
    +

    + A draft article

    + +
    + +
    +
    Fri 02 March 2012 @@ -62,13 +67,13 @@
    -

    This is a draft article, it should live under the /drafts/ folder and not be +

    This is a draft article, it should live under the /drafts/ folder and not be listed anywhere else.

    -
    - +
    + -
    +
    diff --git a/tests/output/basic/feeds/all-en.atom.xml b/tests/output/basic/feeds/all-en.atom.xml index e10386d5..b532e454 100644 --- a/tests/output/basic/feeds/all-en.atom.xml +++ b/tests/output/basic/feeds/all-en.atom.xml @@ -1,9 +1,9 @@ -A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/all-fr.atom.xml b/tests/output/basic/feeds/all-fr.atom.xml index 3243f840..ce245dee 100644 --- a/tests/output/basic/feeds/all-fr.atom.xml +++ b/tests/output/basic/feeds/all-fr.atom.xml @@ -1,4 +1,4 @@ -A Pelican Blog.././2012-03-02T14:01:01ZTrop bien !2012-03-02T14:01:01ZDummy Authortag:../.,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> -Deuxième article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> +A Pelican Blog.././2012-03-02T14:01:01ZTrop bien !2012-03-02T14:01:01ZDummy Authortag:../.,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +Deuxième article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/all.atom.xml b/tests/output/basic/feeds/all.atom.xml index 7cdadf5d..a0fb9144 100644 --- a/tests/output/basic/feeds/all.atom.xml +++ b/tests/output/basic/feeds/all.atom.xml @@ -1,9 +1,9 @@ -A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/bar.atom.xml b/tests/output/basic/feeds/bar.atom.xml index 066ae95f..15708734 100644 --- a/tests/output/basic/feeds/bar.atom.xml +++ b/tests/output/basic/feeds/bar.atom.xml @@ -1,5 +1,5 @@ -A Pelican Blog.././2010-10-20T10:14:00ZOh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> +A Pelican Blog.././2010-10-20T10:14:00ZOh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:../.,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> diff --git a/tests/output/basic/feeds/cat1.atom.xml b/tests/output/basic/feeds/cat1.atom.xml index 05b21f75..383c8ab7 100644 --- a/tests/output/basic/feeds/cat1.atom.xml +++ b/tests/output/basic/feeds/cat1.atom.xml @@ -1,5 +1,5 @@ -A Pelican Blog.././2011-04-20T00:00:00ZA markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> +A Pelican Blog.././2011-04-20T00:00:00ZA markdown powered article2011-04-20T00:00:00ZDummy Authortag:../.,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00ZDummy Authortag:../.,2011-02-17:article-3.html<p>Article 3</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/content.atom.xml b/tests/output/basic/feeds/content.atom.xml index d255cc8a..1fa740b4 100644 --- a/tests/output/basic/feeds/content.atom.xml +++ b/tests/output/basic/feeds/content.atom.xml @@ -1,4 +1,4 @@ -A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> -Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/yeah.atom.xml b/tests/output/basic/feeds/yeah.atom.xml index 5ae933f4..e9bb26d0 100644 --- a/tests/output/basic/feeds/yeah.atom.xml +++ b/tests/output/basic/feeds/yeah.atom.xml @@ -1,5 +1,5 @@ -A Pelican Blog.././2010-12-02T10:14:00ZThis is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> +A Pelican Blog.././2010-12-02T10:14:00ZThis is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:../.,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> diff --git a/tests/output/basic/oh-yeah-fr.html b/tests/output/basic/oh-yeah-fr.html index 186791b5..666a961f 100644 --- a/tests/output/basic/oh-yeah-fr.html +++ b/tests/output/basic/oh-yeah-fr.html @@ -41,13 +41,18 @@ - -
    -
    -

    Trop bien !

    -
    -
    + +
    +
    +
    +

    + Trop bien !

    + +
    + +
    +
    Fri 02 March 2012 @@ -67,12 +72,12 @@ Translations:
    -

    Et voila du contenu en français

    +

    Et voila du contenu en français

    -
    - +
    + -
    +
    diff --git a/tests/output/basic/oh-yeah.html b/tests/output/basic/oh-yeah.html index dfa1d178..c8f1af74 100644 --- a/tests/output/basic/oh-yeah.html +++ b/tests/output/basic/oh-yeah.html @@ -41,13 +41,18 @@ - -
    -
    -

    Oh yeah !

    -
    -
    + +
    +
    +
    +

    + Oh yeah !

    + +
    + +
    +
    Wed 20 October 2010 @@ -67,17 +72,17 @@ Translations:
    -
    +

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    alternate text
    -
    - +
    + -
    +
    diff --git a/tests/output/basic/second-article-fr.html b/tests/output/basic/second-article-fr.html index 9f9838dc..11960efc 100644 --- a/tests/output/basic/second-article-fr.html +++ b/tests/output/basic/second-article-fr.html @@ -41,13 +41,18 @@ - -
    -
    -

    Deuxième article

    -
    -
    + +
    +
    +
    +

    + Deuxième article

    + +
    + +
    +
    Wed 29 February 2012 @@ -67,12 +72,12 @@ Translations:
    -

    Ceci est un article, en français.

    +

    Ceci est un article, en français.

    -
    - +
    + -
    +
    diff --git a/tests/output/basic/second-article.html b/tests/output/basic/second-article.html index 13f56e4c..171717ba 100644 --- a/tests/output/basic/second-article.html +++ b/tests/output/basic/second-article.html @@ -41,13 +41,18 @@ - -
    -
    -

    Second article

    -
    -
    + +
    +
    +
    +

    + Second article

    + +
    + +
    +
    Wed 29 February 2012 @@ -67,12 +72,12 @@ Translations:
    -

    This is some article, in english

    +

    This is some article, in english

    -
    - +
    + -
    +
    diff --git a/tests/output/basic/theme/css/wide.css b/tests/output/basic/theme/css/wide.css index 3376f4c7..88fd59ce 100644 --- a/tests/output/basic/theme/css/wide.css +++ b/tests/output/basic/theme/css/wide.css @@ -4,13 +4,17 @@ body { font:1.3em/1.3 "Hoefler Text","Georgia",Georgia,serif,sans-serif; } -.body, #banner nav, #banner nav ul, #about, #featured, #content{ - width: inherit; +.post-info{ + display: none; } #banner nav { + display: none; -moz-border-radius: 0px; - margin-bottom: 0px; + margin-bottom: 20px; + overflow: hidden; + font-size: 1em; + background: #F5F4EF; } #banner nav ul{ @@ -19,10 +23,11 @@ body { #banner nav li{ float: right; + color: #000; } -#banner nav li:first-child a { - -moz-border-radius: 0px; +#banner nav li a { + color: #000; } #banner h1 { diff --git a/tests/output/basic/theme/images/icons/facebook.png b/tests/output/basic/theme/images/icons/facebook.png new file mode 100644 index 0000000000000000000000000000000000000000..a7914b497369c55feba7defc9a3ea5bec424ecfc GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa2=EDU{r~^Jb>s{nN~l=<`rQ{G z*EMNgZp)TeGt$L@YM4rb{DK+IJaKeh4CFB;dAqwXbg;^L06Clm9+AaB8pQTsa66f8 z2V~fKx;Tb#Tu)ADV02S85J*U9G7veylX_i&!&z12Q~+;~Q|gK~r==k=&T|S@G#cDE zb^5gT;nTtbJUf;eFfcqx6@I vWMyh@WooHyU}$AvU~RtQ2a1N={FKbJO57T}vIJa!8W=oX{an^LB{Ts5Vp3XV literal 0 HcmV?d00001 diff --git a/tests/output/basic/this-is-a-super-article.html b/tests/output/basic/this-is-a-super-article.html index b2cf0392..1e8c160f 100644 --- a/tests/output/basic/this-is-a-super-article.html +++ b/tests/output/basic/this-is-a-super-article.html @@ -41,13 +41,18 @@ - -
    -
    -

    This is a super article !

    -
    -
    + +
    +
    +
    +

    + This is a super article !

    + +
    + +
    +
    Thu 02 December 2010 @@ -62,7 +67,7 @@
    -

    Some content here !

    +

    Some content here !

    This is a simple title

    And here comes the cool stuff.

    @@ -75,10 +80,10 @@

    → And now try with some utf8 hell: ééé

    -
    - +
    + -
    +
    diff --git a/tests/output/basic/unbelievable.html b/tests/output/basic/unbelievable.html index 581e8318..db018d81 100644 --- a/tests/output/basic/unbelievable.html +++ b/tests/output/basic/unbelievable.html @@ -41,13 +41,18 @@ - -
    -
    -

    Unbelievable !

    -
    -
    + +
    +
    +
    +

    + Unbelievable !

    + +
    + +
    +
    Fri 15 October 2010 @@ -62,12 +67,12 @@
    -

    Or completely awesome. Depends the needs.

    +

    Or completely awesome. Depends the needs.

    -
    - +
    + -
    +
    diff --git a/tests/output/custom/a-markdown-powered-article.html b/tests/output/custom/a-markdown-powered-article.html index 74e53913..28486691 100644 --- a/tests/output/custom/a-markdown-powered-article.html +++ b/tests/output/custom/a-markdown-powered-article.html @@ -49,13 +49,18 @@ - -
    -
    -

    A markdown powered article

    -
    -
    + +
    +
    +
    +

    + A markdown powered article

    + +
    + +
    +
    Wed 20 April 2011 @@ -70,24 +75,24 @@
    -

    You're mutually oblivious.

    -
    - -
    -

    Comments !

    -
    - -
    - +

    You're mutually oblivious.

    +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/archives.html b/tests/output/custom/archives.html index 706c7464..083e6ada 100644 --- a/tests/output/custom/archives.html +++ b/tests/output/custom/archives.html @@ -56,28 +56,28 @@
    Fri 15 October 2010
    -
    Unbelievable !
    +
    Unbelievable !
    Wed 20 October 2010
    -
    Oh yeah !
    +
    Oh yeah !
    Thu 02 December 2010
    -
    This is a super article !
    +
    This is a super article !
    Thu 17 February 2011
    -
    Article 1
    +
    Article 1
    Thu 17 February 2011
    -
    Article 2
    +
    Article 2
    Thu 17 February 2011
    -
    Article 3
    +
    Article 3
    Wed 20 April 2011
    -
    A markdown powered article
    +
    A markdown powered article
    Wed 29 February 2012
    -
    Second article
    +
    Second article
    diff --git a/tests/output/custom/article-1.html b/tests/output/custom/article-1.html index 8c73b4ac..b7c0f46f 100644 --- a/tests/output/custom/article-1.html +++ b/tests/output/custom/article-1.html @@ -49,13 +49,18 @@ - -
    -
    -

    Article 1

    -
    -
    + +
    +
    +
    +

    + Article 1

    + +
    + +
    +
    Thu 17 February 2011 @@ -70,25 +75,25 @@
    -

    Article 1

    +

    Article 1

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/article-2.html b/tests/output/custom/article-2.html index e8758391..e60d8077 100644 --- a/tests/output/custom/article-2.html +++ b/tests/output/custom/article-2.html @@ -49,13 +49,18 @@ - -
    -
    -

    Article 2

    -
    -
    + +
    +
    +
    +

    + Article 2

    + +
    + +
    +
    Thu 17 February 2011 @@ -70,25 +75,25 @@
    -

    Article 2

    +

    Article 2

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/article-3.html b/tests/output/custom/article-3.html index ace9dfbf..b79c25f0 100644 --- a/tests/output/custom/article-3.html +++ b/tests/output/custom/article-3.html @@ -49,13 +49,18 @@ - -
    -
    -

    Article 3

    -
    -
    + +
    +
    +
    +

    + Article 3

    + +
    + +
    +
    Thu 17 February 2011 @@ -70,25 +75,25 @@
    -

    Article 3

    +

    Article 3

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/categories.html b/tests/output/custom/categories.html index 92830754..95e8c1f3 100644 --- a/tests/output/custom/categories.html +++ b/tests/output/custom/categories.html @@ -52,13 +52,13 @@ diff --git a/tests/output/custom/drafts/a-draft-article.html b/tests/output/custom/drafts/a-draft-article.html index e12e5bd7..659a61b9 100644 --- a/tests/output/custom/drafts/a-draft-article.html +++ b/tests/output/custom/drafts/a-draft-article.html @@ -49,13 +49,18 @@ - -
    -
    -

    A draft article

    -
    -
    + +
    +
    +
    +

    + A draft article

    + +
    + +
    +
    Fri 02 March 2012 @@ -70,26 +75,26 @@
    -

    This is a draft article, it should live under the /drafts/ folder and not be +

    This is a draft article, it should live under the /drafts/ folder and not be listed anywhere else.

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/feeds/all-en.atom.xml b/tests/output/custom/feeds/all-en.atom.xml index 1b18c1bd..db5fc2de 100644 --- a/tests/output/custom/feeds/all-en.atom.xml +++ b/tests/output/custom/feeds/all-en.atom.xml @@ -1,9 +1,9 @@ -Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/all-fr.atom.xml b/tests/output/custom/feeds/all-fr.atom.xml index 1d42bb6e..5d58742c 100644 --- a/tests/output/custom/feeds/all-fr.atom.xml +++ b/tests/output/custom/feeds/all-fr.atom.xml @@ -1,4 +1,4 @@ -Alexis' loghttp://blog.notmyidea.org/2012-03-02T14:01:01+01:00Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireautag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> -Deuxième article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> +Alexis' loghttp://blog.notmyidea.org/2012-03-02T14:01:01+01:00Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireautag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +Deuxième article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/all.atom.xml b/tests/output/custom/feeds/all.atom.xml index 9090f431..8df5bbdb 100644 --- a/tests/output/custom/feeds/all.atom.xml +++ b/tests/output/custom/feeds/all.atom.xml @@ -1,9 +1,9 @@ -Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/all.rss.xml b/tests/output/custom/feeds/all.rss.xml index b726e2d1..a8be2152 100644 --- a/tests/output/custom/feeds/all.rss.xml +++ b/tests/output/custom/feeds/all.rss.xml @@ -1,9 +1,9 @@ -Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.orgsecond-article.html<p>This is some article, in english</p> -Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazA markdown powered articlehttp://blog.notmyidea.orga-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.orgarticle-1.html<p>Article 1</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-1.htmlArticle 2http://blog.notmyidea.orgarticle-2.html<p>Article 2</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-2.htmlArticle 3http://blog.notmyidea.orgarticle-3.html<p>Article 3</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-3.htmlThis is a super article !http://blog.notmyidea.orgthis-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazA markdown powered articlehttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.org/article-1.html<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-1.htmlArticle 2http://blog.notmyidea.org/article-2.html<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-2.htmlArticle 3http://blog.notmyidea.org/article-3.html<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-3.htmlThis is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> @@ -15,11 +15,11 @@ </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.htmlfoobarfoobarOh yeah !http://blog.notmyidea.orgoh-yeah.html<div class="section" id="why-not"> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.htmlfoobarfoobarOh yeah !http://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> <img alt="alternate text" src="pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:oh-yeah.htmlohbaryeahUnbelievable !http://blog.notmyidea.orgunbelievable.html<p>Or completely awesome. Depends the needs.</p> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:oh-yeah.htmlohbaryeahUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.html \ No newline at end of file diff --git a/tests/output/custom/feeds/bar.atom.xml b/tests/output/custom/feeds/bar.atom.xml index 93961545..9b29f6c9 100644 --- a/tests/output/custom/feeds/bar.atom.xml +++ b/tests/output/custom/feeds/bar.atom.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org/2010-10-20T10:14:00+02:00Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> +Alexis' loghttp://blog.notmyidea.org/2010-10-20T10:14:00+02:00Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> diff --git a/tests/output/custom/feeds/bar.rss.xml b/tests/output/custom/feeds/bar.rss.xml index 0a9d0f9d..c958edbf 100644 --- a/tests/output/custom/feeds/bar.rss.xml +++ b/tests/output/custom/feeds/bar.rss.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org/Wed, 20 Oct 2010 10:14:00 +0200Oh yeah !http://blog.notmyidea.orgoh-yeah.html<div class="section" id="why-not"> +Alexis' loghttp://blog.notmyidea.org/Wed, 20 Oct 2010 10:14:00 +0200Oh yeah !http://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> <h2>Why not ?</h2> <p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !</p> diff --git a/tests/output/custom/feeds/cat1.atom.xml b/tests/output/custom/feeds/cat1.atom.xml index 4fce560d..72703065 100644 --- a/tests/output/custom/feeds/cat1.atom.xml +++ b/tests/output/custom/feeds/cat1.atom.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org/2011-04-20T00:00:00+02:00A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> +Alexis' loghttp://blog.notmyidea.org/2011-04-20T00:00:00+02:00A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/cat1.rss.xml b/tests/output/custom/feeds/cat1.rss.xml index d322572b..f5871487 100644 --- a/tests/output/custom/feeds/cat1.rss.xml +++ b/tests/output/custom/feeds/cat1.rss.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org/Wed, 20 Apr 2011 00:00:00 +0200A markdown powered articlehttp://blog.notmyidea.orga-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.orgarticle-1.html<p>Article 1</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-1.htmlArticle 2http://blog.notmyidea.orgarticle-2.html<p>Article 2</p> -Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-2.htmlArticle 3http://blog.notmyidea.orgarticle-3.html<p>Article 3</p> +Alexis' loghttp://blog.notmyidea.org/Wed, 20 Apr 2011 00:00:00 +0200A markdown powered articlehttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.org/article-1.html<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-1.htmlArticle 2http://blog.notmyidea.org/article-2.html<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-2.htmlArticle 3http://blog.notmyidea.org/article-3.html<p>Article 3</p> Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-3.html \ No newline at end of file diff --git a/tests/output/custom/feeds/content.atom.xml b/tests/output/custom/feeds/content.atom.xml index 6f93c8f4..52bbf194 100644 --- a/tests/output/custom/feeds/content.atom.xml +++ b/tests/output/custom/feeds/content.atom.xml @@ -1,4 +1,4 @@ -Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> -Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/content.rss.xml b/tests/output/custom/feeds/content.rss.xml index 74a322e7..dcacd17f 100644 --- a/tests/output/custom/feeds/content.rss.xml +++ b/tests/output/custom/feeds/content.rss.xml @@ -1,4 +1,4 @@ -Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.orgsecond-article.html<p>This is some article, in english</p> -Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazUnbelievable !http://blog.notmyidea.orgunbelievable.html<p>Or completely awesome. Depends the needs.</p> +Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.html \ No newline at end of file diff --git a/tests/output/custom/feeds/yeah.atom.xml b/tests/output/custom/feeds/yeah.atom.xml index 9a95fa03..802f6329 100644 --- a/tests/output/custom/feeds/yeah.atom.xml +++ b/tests/output/custom/feeds/yeah.atom.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org/2010-12-02T10:14:00+01:00This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/2010-12-02T10:14:00+01:00This is a super article !2010-12-02T10:14:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> diff --git a/tests/output/custom/feeds/yeah.rss.xml b/tests/output/custom/feeds/yeah.rss.xml index 1c5884a2..68e96cf9 100644 --- a/tests/output/custom/feeds/yeah.rss.xml +++ b/tests/output/custom/feeds/yeah.rss.xml @@ -1,5 +1,5 @@ -Alexis' loghttp://blog.notmyidea.org/Thu, 02 Dec 2010 10:14:00 +0100This is a super article !http://blog.notmyidea.orgthis-is-a-super-article.html<p>Some content here !</p> +Alexis' loghttp://blog.notmyidea.org/Thu, 02 Dec 2010 10:14:00 +0100This is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> <h2>This is a simple title</h2> <p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> diff --git a/tests/output/custom/oh-yeah-fr.html b/tests/output/custom/oh-yeah-fr.html index b699b41c..be931a60 100644 --- a/tests/output/custom/oh-yeah-fr.html +++ b/tests/output/custom/oh-yeah-fr.html @@ -49,13 +49,18 @@ - -
    -
    -

    Trop bien !

    -
    -
    + +
    +
    +
    +

    + Trop bien !

    + +
    + +
    +
    Fri 02 March 2012 @@ -75,25 +80,25 @@ Translations:
    -

    Et voila du contenu en français

    +

    Et voila du contenu en français

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/oh-yeah.html b/tests/output/custom/oh-yeah.html index b8263c1b..4f3f1020 100644 --- a/tests/output/custom/oh-yeah.html +++ b/tests/output/custom/oh-yeah.html @@ -49,13 +49,18 @@ - -
    -
    -

    Oh yeah !

    -
    -
    + +
    +
    +
    +

    + Oh yeah !

    + +
    + +
    +
    Wed 20 October 2010 @@ -75,30 +80,30 @@ Translations:
    -
    +

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    alternate text
    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/second-article-fr.html b/tests/output/custom/second-article-fr.html index 9e5b81ad..e386af38 100644 --- a/tests/output/custom/second-article-fr.html +++ b/tests/output/custom/second-article-fr.html @@ -49,13 +49,18 @@ - -
    -
    -

    Deuxième article

    -
    -
    + +
    +
    +
    +

    + Deuxième article

    + +
    + +
    +
    Wed 29 February 2012 @@ -75,25 +80,25 @@ Translations:
    -

    Ceci est un article, en français.

    +

    Ceci est un article, en français.

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/second-article.html b/tests/output/custom/second-article.html index a769cee4..003ebae0 100644 --- a/tests/output/custom/second-article.html +++ b/tests/output/custom/second-article.html @@ -49,13 +49,18 @@ - -
    -
    -

    Second article

    -
    -
    + +
    +
    +
    +

    + Second article

    + +
    + +
    +
    Wed 29 February 2012 @@ -75,25 +80,25 @@ Translations:
    -

    This is some article, in english

    +

    This is some article, in english

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/theme/css/wide.css b/tests/output/custom/theme/css/wide.css index 3376f4c7..88fd59ce 100644 --- a/tests/output/custom/theme/css/wide.css +++ b/tests/output/custom/theme/css/wide.css @@ -4,13 +4,17 @@ body { font:1.3em/1.3 "Hoefler Text","Georgia",Georgia,serif,sans-serif; } -.body, #banner nav, #banner nav ul, #about, #featured, #content{ - width: inherit; +.post-info{ + display: none; } #banner nav { + display: none; -moz-border-radius: 0px; - margin-bottom: 0px; + margin-bottom: 20px; + overflow: hidden; + font-size: 1em; + background: #F5F4EF; } #banner nav ul{ @@ -19,10 +23,11 @@ body { #banner nav li{ float: right; + color: #000; } -#banner nav li:first-child a { - -moz-border-radius: 0px; +#banner nav li a { + color: #000; } #banner h1 { diff --git a/tests/output/custom/theme/images/icons/facebook.png b/tests/output/custom/theme/images/icons/facebook.png new file mode 100644 index 0000000000000000000000000000000000000000..a7914b497369c55feba7defc9a3ea5bec424ecfc GIT binary patch literal 300 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!73?$#)eFPGa2=EDU{r~^Jb>s{nN~l=<`rQ{G z*EMNgZp)TeGt$L@YM4rb{DK+IJaKeh4CFB;dAqwXbg;^L06Clm9+AaB8pQTsa66f8 z2V~fKx;Tb#Tu)ADV02S85J*U9G7veylX_i&!&z12Q~+;~Q|gK~r==k=&T|S@G#cDE zb^5gT;nTtbJUf;eFfcqx6@I vWMyh@WooHyU}$AvU~RtQ2a1N={FKbJO57T}vIJa!8W=oX{an^LB{Ts5Vp3XV literal 0 HcmV?d00001 diff --git a/tests/output/custom/this-is-a-super-article.html b/tests/output/custom/this-is-a-super-article.html index 9ba6bb9b..2b41cdf3 100644 --- a/tests/output/custom/this-is-a-super-article.html +++ b/tests/output/custom/this-is-a-super-article.html @@ -49,13 +49,18 @@ - -
    -
    -

    This is a super article !

    -
    -
    + +
    +
    +
    +

    + This is a super article !

    + +
    + +
    +
    Thu 02 December 2010 @@ -70,7 +75,7 @@
    -

    Some content here !

    +

    Some content here !

    This is a simple title

    And here comes the cool stuff.

    @@ -83,23 +88,23 @@

    → And now try with some utf8 hell: ééé

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    diff --git a/tests/output/custom/unbelievable.html b/tests/output/custom/unbelievable.html index 1b611efe..4d18012a 100644 --- a/tests/output/custom/unbelievable.html +++ b/tests/output/custom/unbelievable.html @@ -49,13 +49,18 @@ - -
    -
    -

    Unbelievable !

    -
    -
    + +
    +
    +
    +

    + Unbelievable !

    + +
    + +
    +
    Fri 15 October 2010 @@ -70,25 +75,25 @@
    -

    Or completely awesome. Depends the needs.

    +

    Or completely awesome. Depends the needs.

    -
    - -
    -

    Comments !

    -
    - -
    - +
    + +
    +

    Comments !

    +
    + +
    + -
    +
    From a8983b420f97379e306c1c5bd93b548b19b042cb Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Sat, 12 May 2012 01:30:09 +0200 Subject: [PATCH 0243/2344] be more verbose when functional tests fail --- tests/test_pelican.py | 48 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) diff --git a/tests/test_pelican.py b/tests/test_pelican.py index 1192dfe1..933c82fa 100644 --- a/tests/test_pelican.py +++ b/tests/test_pelican.py @@ -36,9 +36,27 @@ class TestPelican(unittest.TestCase): pelican = Pelican(path=INPUT_PATH, output_path=temp_path) pelican.run() diff = dircmp(temp_path, os.sep.join((OUTPUT_PATH, "basic"))) - self.assertEqual(diff.left_only, []) - self.assertEqual(diff.right_only, []) - self.assertEqual(diff.diff_files, []) + self.assertEqual(diff.left_only, [], msg="some generated " \ + "files are absent from the expected functional " \ + "tests output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") + self.assertEqual(diff.right_only, [], msg="some files from " \ + "the expected functional tests output are absent " \ + "from the current output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") + self.assertEqual(diff.diff_files, [], msg="some generated " \ + "files differ from the expected functional tests " \ + "output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") def test_custom_generation_works(self): # the same thing with a specified set of settings should work @@ -47,6 +65,24 @@ class TestPelican(unittest.TestCase): settings=read_settings(SAMPLE_CONFIG)) pelican.run() diff = dircmp(temp_path, os.sep.join((OUTPUT_PATH, "custom"))) - self.assertEqual(diff.left_only, []) - self.assertEqual(diff.right_only, []) - self.assertEqual(diff.diff_files, []) + self.assertEqual(diff.left_only, [], msg="some generated " \ + "files are absent from the expected functional " \ + "tests output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") + self.assertEqual(diff.right_only, [], msg="some files from " \ + "the expected functional tests output are absent " \ + "from the current output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") + self.assertEqual(diff.diff_files, [], msg="some generated " \ + "files differ from the expected functional tests " \ + "output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") From e82c6512b4703b19f5c142d0cd85b67a88e0040d Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Sat, 12 May 2012 02:03:18 +0200 Subject: [PATCH 0244/2344] clean up temporary dirs in tearDown to force cleanup even if tests fail --- tests/support.py | 18 --------- tests/test_generators.py | 47 ++++++++++++++---------- tests/test_pelican.py | 79 +++++++++++++++++++++------------------- 3 files changed, 69 insertions(+), 75 deletions(-) diff --git a/tests/support.py b/tests/support.py index f2b4a075..8b8cbab8 100644 --- a/tests/support.py +++ b/tests/support.py @@ -1,14 +1,10 @@ __all__ = [ - 'temporary_folder', 'get_article', 'unittest', ] import os import subprocess -from contextlib import contextmanager -from tempfile import mkdtemp -from shutil import rmtree from pelican.contents import Article @@ -18,20 +14,6 @@ except ImportError: import unittest -@contextmanager -def temporary_folder(): - """creates a temporary folder, return it and delete it afterwards. - - This allows to do something like this in tests: - - >>> with temporary_folder() as d: - # do whatever you want - """ - tempdir = mkdtemp() - yield tempdir - rmtree(tempdir) - - def get_article(title, slug, content, lang, extra_metadata=None): metadata = {'slug': slug, 'title': title, 'lang': lang} if extra_metadata is not None: diff --git a/tests/test_generators.py b/tests/test_generators.py index e62551fa..4e6b0acf 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -3,10 +3,12 @@ from mock import MagicMock import os import re +from tempfile import mkdtemp +from shutil import rmtree from pelican.generators import ArticlesGenerator, LessCSSGenerator from pelican.settings import _DEFAULT_CONFIG -from .support import unittest, temporary_folder, skipIfNoExecutable +from .support import unittest, skipIfNoExecutable CUR_DIR = os.path.dirname(__file__) @@ -107,6 +109,14 @@ class TestLessCSSGenerator(unittest.TestCase): } """ + def setUp(self): + self.temp_content = mkdtemp() + self.temp_output = mkdtemp() + + def tearDown(self): + rmtree(self.temp_content) + rmtree(self.temp_output) + @skipIfNoExecutable('lessc') def test_less_compiler(self): @@ -114,28 +124,25 @@ class TestLessCSSGenerator(unittest.TestCase): settings['STATIC_PATHS'] = ['static'] settings['LESS_GENERATOR'] = True - # we'll nest here for py < 2.7 compat - with temporary_folder() as temp_content: - with temporary_folder() as temp_output: - generator = LessCSSGenerator(None, settings, temp_content, - _DEFAULT_CONFIG['THEME'], temp_output, None) + generator = LessCSSGenerator(None, settings, self.temp_content, + _DEFAULT_CONFIG['THEME'], self.temp_output, None) - # create a dummy less file - less_dir = os.path.join(temp_content, 'static', 'css') - less_filename = os.path.join(less_dir, 'test.less') + # create a dummy less file + less_dir = os.path.join(self.temp_content, 'static', 'css') + less_filename = os.path.join(less_dir, 'test.less') - less_output = os.path.join(temp_output, 'static', 'css', - 'test.css') + less_output = os.path.join(self.temp_output, 'static', 'css', + 'test.css') - os.makedirs(less_dir) - with open(less_filename, 'w') as less_file: - less_file.write(self.LESS_CONTENT) + os.makedirs(less_dir) + with open(less_filename, 'w') as less_file: + less_file.write(self.LESS_CONTENT) - generator.generate_output() + generator.generate_output() - # we have the file ? - self.assertTrue(os.path.exists(less_output)) + # we have the file ? + self.assertTrue(os.path.exists(less_output)) - # was it compiled ? - self.assertIsNotNone(re.search(r'^\s+color:\s*#4D926F;$', - open(less_output).read(), re.MULTILINE | re.IGNORECASE)) + # was it compiled ? + self.assertIsNotNone(re.search(r'^\s+color:\s*#4D926F;$', + open(less_output).read(), re.MULTILINE | re.IGNORECASE)) diff --git a/tests/test_pelican.py b/tests/test_pelican.py index 933c82fa..a331690b 100644 --- a/tests/test_pelican.py +++ b/tests/test_pelican.py @@ -5,11 +5,11 @@ except ImportError: import os from filecmp import dircmp +from tempfile import mkdtemp +from shutil import rmtree from mock import patch -from .support import temporary_folder - from pelican import Pelican from pelican.settings import read_settings @@ -25,46 +25,23 @@ class TestPelican(unittest.TestCase): # general functional testing for pelican. Basically, this test case tries # to run pelican in different situations and see how it behaves + def setUp(self): + self.temp_path = mkdtemp() + + def tearDown(self): + rmtree(self.temp_path) + def test_basic_generation_works(self): # when running pelican without settings, it should pick up the default # ones and generate the output without raising any exception / issuing # any warning. - with temporary_folder() as temp_path: - with patch("pelican.contents.getenv") as mock_getenv: - # force getenv('USER') to always return the same value - mock_getenv.return_value = "Dummy Author" - pelican = Pelican(path=INPUT_PATH, output_path=temp_path) - pelican.run() - diff = dircmp(temp_path, os.sep.join((OUTPUT_PATH, "basic"))) - self.assertEqual(diff.left_only, [], msg="some generated " \ - "files are absent from the expected functional " \ - "tests output.\n" \ - "This is probably because the HTML generated files " \ - "changed. If these changes are normal, please refer " \ - "to docs/contribute.rst to update the expected " \ - "output of the functional tests.") - self.assertEqual(diff.right_only, [], msg="some files from " \ - "the expected functional tests output are absent " \ - "from the current output.\n" \ - "This is probably because the HTML generated files " \ - "changed. If these changes are normal, please refer " \ - "to docs/contribute.rst to update the expected " \ - "output of the functional tests.") - self.assertEqual(diff.diff_files, [], msg="some generated " \ - "files differ from the expected functional tests " \ - "output.\n" \ - "This is probably because the HTML generated files " \ - "changed. If these changes are normal, please refer " \ - "to docs/contribute.rst to update the expected " \ - "output of the functional tests.") - - def test_custom_generation_works(self): - # the same thing with a specified set of settings should work - with temporary_folder() as temp_path: - pelican = Pelican(path=INPUT_PATH, output_path=temp_path, - settings=read_settings(SAMPLE_CONFIG)) + with patch("pelican.contents.getenv") as mock_getenv: + # force getenv('USER') to always return the same value + mock_getenv.return_value = "Dummy Author" + pelican = Pelican(path=INPUT_PATH, output_path=self.temp_path) pelican.run() - diff = dircmp(temp_path, os.sep.join((OUTPUT_PATH, "custom"))) + diff = dircmp( + self.temp_path, os.sep.join((OUTPUT_PATH, "basic"))) self.assertEqual(diff.left_only, [], msg="some generated " \ "files are absent from the expected functional " \ "tests output.\n" \ @@ -86,3 +63,31 @@ class TestPelican(unittest.TestCase): "changed. If these changes are normal, please refer " \ "to docs/contribute.rst to update the expected " \ "output of the functional tests.") + + def test_custom_generation_works(self): + # the same thing with a specified set of settings should work + pelican = Pelican(path=INPUT_PATH, output_path=self.temp_path, + settings=read_settings(SAMPLE_CONFIG)) + pelican.run() + diff = dircmp(self.temp_path, os.sep.join((OUTPUT_PATH, "custom"))) + self.assertEqual(diff.left_only, [], msg="some generated " \ + "files are absent from the expected functional " \ + "tests output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") + self.assertEqual(diff.right_only, [], msg="some files from " \ + "the expected functional tests output are absent " \ + "from the current output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") + self.assertEqual(diff.diff_files, [], msg="some generated " \ + "files differ from the expected functional tests " \ + "output.\n" \ + "This is probably because the HTML generated files " \ + "changed. If these changes are normal, please refer " \ + "to docs/contribute.rst to update the expected " \ + "output of the functional tests.") From 0444513e90ae987cc6b6948742e0225315a20213 Mon Sep 17 00:00:00 2001 From: m-r-r Date: Sat, 12 May 2012 11:49:49 +0200 Subject: [PATCH 0245/2344] Trailing slashes removed to avoid category bug --- pelican/generators.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index ede948a4..24920450 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -245,7 +245,9 @@ class ArticlesGenerator(Generator): def generate_context(self): """change the context""" - article_path = os.path.join(self.path, self.settings['ARTICLE_DIR']) + article_path = os.path.normpath( # we have to remove trailing slashes + os.path.join(self.path, self.settings['ARTICLE_DIR']) + ) all_articles = [] for f in self.get_files( article_path, @@ -259,8 +261,8 @@ class ArticlesGenerator(Generator): # if no category is set, use the name of the path as a category if 'category' not in metadata: - if os.path.dirname(f) == article_path: - category = self.settings['DEFAULT_CATEGORY'] + if os.path.dirname(f) == article_path: # if the article is not in a subdirectory + category = self.settings['DEFAULT_CATEGORY'] else: category = os.path.basename(os.path.dirname(f))\ .decode('utf-8') From fed8e8b331668963d6d5f944211490541274eace Mon Sep 17 00:00:00 2001 From: Simon Date: Sat, 12 May 2012 23:48:57 +0200 Subject: [PATCH 0246/2344] documentation for webassets --- docs/settings.rst | 54 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 53 insertions(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 85e9f0c3..582cd9d4 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -369,6 +369,7 @@ Setting name (default value) What does it do? value is `static`, but if your theme has other static paths, you can put them here. `CSS_FILE` (``'main.css'``) Specify the CSS file you want to load. +`WEBASSETS` (``False``) Asset management with `webassets` (see below) ================================================ ===================================================== By default, two themes are available. You can specify them using the `-t` option: @@ -418,7 +419,58 @@ adding the following to your configuration:: CSS_FILE = "wide.css" -.. _pelican-themes: :doc:`pelican-themes` +Asset management +---------------- + +The `WEBASSETS` setting allows to use the `webassets`_ module to manage assets +(css, js). The module must first be installed:: + + pip install webassets + +`webassets` allows to concatenate your assets and to use almost all of the +hype tools of the moment (see the `documentation`_): + +* css minifier (`cssmin`, `yuicompressor`, ...) +* css compiler (`less`, `sass`, ...) +* js minifier (`uglifyjs`, `yuicompressor`, `closure`, ...) + +Others filters include gzip compression, integration of images in css with +`datauri` and more. Webassets also append a version identifier to your asset +url to convince browsers to download new versions of your assets when you use +far future expires headers. + +When using it with Pelican, `webassets` is configured to process assets in the +``OUTPUT_PATH/theme`` directory. You can use it in your templates with a +template tag, for example: + +.. code-block:: jinja + + {% assets filters="cssmin", output="css/style.min.css", "css/inuit.css", "css/pygment-monokai.css", "css/main.css" %} + + {% endassets %} + +will produce a minified css file with the version identifier: + +.. code-block:: html + + + +Another example for javascript: + +.. code-block:: jinja + + {% assets filters="uglifyjs,gzip", output="js/packed.js", "js/jquery.js", "js/base.js", "js/widgets.js" %} + + {% endassets %} + +will produce a minified and gzipped js file: + +.. code-block:: html + + + +.. _webassets: https://github.com/miracle2k/webassets +.. _documentation: http://webassets.readthedocs.org/en/latest/builtin_filters.html Example settings ================ From ba8ed9fb1806e5f45f30237a13f472034f6b6697 Mon Sep 17 00:00:00 2001 From: sam Date: Sun, 13 May 2012 23:37:33 +0200 Subject: [PATCH 0247/2344] Added strip raw option to wordpress xml importer --- pelican/tools/pelican_import.py | 27 +- tests/content/wordpressexport.xml | 578 ++++++++++++++++++++++++++++++ tests/support.py | 88 ++++- tests/test_importer.py | 43 +++ 4 files changed, 728 insertions(+), 8 deletions(-) create mode 100644 tests/content/wordpressexport.xml create mode 100644 tests/test_importer.py diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 050b1010..f3e9bb48 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -25,8 +25,14 @@ def wp2fields(xml): items = soup.rss.channel.findAll('item') for item in items: + if item.fetch('wp:status')[0].contents[0] == "publish": - title = item.title.contents[0] + + try: + title = item.title.contents[0] + except IndexError: + continue + content = item.fetch('content:encoded')[0].contents[0] filename = item.fetch('wp:post_name')[0].contents[0] @@ -197,7 +203,7 @@ def build_markdown_header(title, date, author, categories, tags): header += '\n' return header -def fields2pelican(fields, out_markup, output_path, dircat=False): +def fields2pelican(fields, out_markup, output_path, dircat=False, strip_raw=False): for title, content, filename, date, author, categories, tags, in_markup in fields: if (in_markup == "markdown") or (out_markup == "markdown") : ext = '.md' @@ -230,10 +236,13 @@ def fields2pelican(fields, out_markup, output_path, dircat=False): paragraphs = [u'

    {}

    '.format(p) for p in paragraphs] new_content = ''.join(paragraphs) - fp.write(content) + fp.write(new_content) - cmd = 'pandoc --normalize --reference-links --from=html --to={0} -o "{1}" "{2}"'.format( - out_markup, out_filename, html_filename) + + parse_raw = '--parse-raw' if not strip_raw else '' + cmd = ('pandoc --normalize --reference-links {0} --from=html' + ' --to={1} -o "{2}" "{3}"').format( + parse_raw, out_markup, out_filename, html_filename) try: rc = subprocess.call(cmd, shell=True) @@ -279,6 +288,10 @@ def main(): help='Output markup format (supports rst & markdown)') parser.add_argument('--dir-cat', action='store_true', dest='dircat', help='Put files in directories with categories name') + parser.add_argument('--strip-raw', action='store_true', dest='strip_raw', + help="Strip raw HTML code that can't be converted to " + "markup such as flash embeds or iframes (wordpress import only)") + args = parser.parse_args() input_type = None @@ -306,4 +319,6 @@ def main(): elif input_type == 'feed': fields = feed2fields(args.input) - fields2pelican(fields, args.markup, args.output, dircat=args.dircat or False) + fields2pelican(fields, args.markup, args.output, + dircat=args.dircat or False, + strip_raw=args.strip_raw or False) diff --git a/tests/content/wordpressexport.xml b/tests/content/wordpressexport.xml new file mode 100644 index 00000000..d3e86cba --- /dev/null +++ b/tests/content/wordpressexport.xml @@ -0,0 +1,578 @@ + + + + + + + + + + + + + + + + + + + + + + + Pelican test channel + http://thisisa.test + Not a real feed, just for test + Sun, 13 May 2012 01:13:52 +0000 + en + 1.1 + http://thisisa.test + http://thisisa.test + + 2Bobbob@thisisa.test + 3Jonhjonh@thisisa.test + + 7categ-1 + 11categ-2 + 1uncategorized + 15categ-3 + 25tag-1 + 122tag2 + 68tag-3 + + http://wordpress.org/?v=3.3.1 + + + Empty post + http://thisisa.test/?attachment_id=24 + Sat, 04 Feb 2012 03:17:33 +0000 + bob + https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Pelican_lakes_entrance02.jpg/240px-Pelican_lakes_entrance02.jpg + + + + 24 + 2012-02-04 03:17:33 + 2012-02-04 03:17:33 + open + open + empty-post + inherit + 0 + 0 + attachment + + 0 + https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Pelican_lakes_entrance02.jpg/240px-Pelican_lakes_entrance02.jpg + + _wp_attachment_metadata + + + + _wp_attached_file + + + + _wp_attachment_image_alt + + + + + + http://thisisa.test/?p=168 + Thu, 01 Jan 1970 00:00:00 +0000 + bob + http://thisisa.test/?p=168 + + + + 168 + 2012-02-15 21:23:57 + 0000-00-00 00:00:00 + open + open + + draft + 0 + 0 + post + + 0 + + + _edit_last + + + + + A normal post + http://thisisa.test/?p=173 + Thu, 01 Jan 1970 00:00:00 +0000 + bob + http://thisisa.test/?p=173 + + +
  • Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non +proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • +
  • Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non +proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  • + + +Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod +tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, +quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo +consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse +cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non +proident, sunt in culpa qui officia deserunt mollit anim id est laborum.]]>
    + + 173 + 2012-02-16 15:52:55 + 0000-00-00 00:00:00 + open + open + + draft + 0 + 0 + post + + 0 + + + _edit_last + + +
    + + Complete draft + http://thisisa.test/?p=176 + Thu, 01 Jan 1970 00:00:00 +0000 + bob + http://thisisa.test/?p=176 + + + + 176 + 2012-02-17 15:11:55 + 0000-00-00 00:00:00 + open + open + + draft + 0 + 0 + post + + 0 + + + _edit_last + + + + + Page + http://thisisa.test/contact/ + Wed, 11 Apr 2012 11:38:08 +0000 + bob + http://thisisa.test/?page_id=334 + + + + 334 + 2012-04-11 06:38:08 + 2012-04-11 11:38:08 + open + open + contact + publish + 0 + 0 + page + + 0 + + sharing_disabled + + + + _wp_page_template + + + + _edit_last + + + + + Empty Page + http://thisisa.test/empty/ + Wed, 11 Apr 2012 11:38:08 +0000 + bob + http://thisisa.test/?page_id=334 + + + + 334 + 2012-04-11 06:38:08 + 2012-04-11 11:38:08 + open + open + empty + publish + 0 + 0 + page + + 0 + + sharing_disabled + + + + _wp_page_template + + + + _edit_last + + + + + Special chars: l'é + http://thisisa.test/?p=471 + Thu, 01 Jan 1970 00:00:00 +0000 + bob + http://thisisa.test/?p=471 + + + + 471 + 2012-04-29 09:44:27 + 0000-00-00 00:00:00 + open + open + + draft + 0 + 0 + post + + 0 + + + _edit_last + + + + + + With excerpt + http://thisisa.test/with-excerpt/ + Sat, 04 Feb 2012 02:03:06 +0000 + bob + http://thisisa.test/?p=8 + + + + 8 + 2012-02-04 02:03:06 + 2012-02-04 02:03:06 + open + open + with-excerpt + publish + 0 + 0 + post + + 0 + + + + + _edit_last + + + + et_bigpost + + + + _thumbnail_id + + + + + With tags + http://thisisa.test/tags/ + Sat, 04 Feb 2012 21:05:25 +0000 + bob + http://thisisa.test/?p=25 + + + + 25 + 2012-02-04 21:05:25 + 2012-02-04 21:05:25 + open + open + with-tags + publish + 0 + 0 + post + + 0 + + + + + + _edit_last + + + + et_bigpost + + + + _thumbnail_id + + + + + With comments + http://thisisa.test/with-comments/ + Wed, 18 Apr 2012 08:36:26 +0000 + john + http://thisisa.test/?p=422 + + + + 422 + 2012-04-18 03:36:26 + 2012-04-18 08:36:26 + open + open + with-comments + publish + 0 + 0 + post + + 0 + + + _edit_last + + + + _thumbnail_id + + + + 116 + + User2@mail.test + + 127.0.0.1 + 2012-05-06 15:46:06 + 2012-05-06 20:46:06 + + 1 + + 0 + 0 + + akismet_result + + + + akismet_history + + + + akismet_as_submitted + + + + + 117 + + bob@thisisa.test + + 127.0.0.1 + 2012-05-06 17:44:06 + 2012-05-06 22:44:06 + + 1 + + 116 + 3 + + akismet_result + + + + akismet_history + + + + akismet_as_submitted + + + + + 156 + + + http://thisisa.test/to-article-you-ping-back/ + 127.0.0.1 + 2012-05-09 19:30:19 + 2012-05-10 00:30:19 + + trash + pingback + 0 + 0 + + akismet_history + + + + _wp_trash_meta_status + + + + _wp_trash_meta_time + + + + + 122 + + bob@thisisa.test + + 127.0.0.1 + 2012-05-07 14:11:34 + 2012-05-07 19:11:34 + + 1 + + 121 + 3 + + akismet_result + + + + akismet_history + + + + akismet_as_submitted + + + + + + Post with raw data + http://thisisa.test/?p=173 + Thu, 01 Jan 1970 00:00:00 +0000 + bob + http://thisisa.test/?p=173 + + Pelicans are scary + +Pelicans are supposed to eat fish, damn it! + + + +Bottom line: don't mess up with birds]]> + + 173 + 2012-02-16 15:52:55 + 0000-00-00 00:00:00 + open + open + post-with-raw-data + publish + 0 + 0 + post + + 0 + + + _edit_last + + + +
    +
    diff --git a/tests/support.py b/tests/support.py index f2b4a075..994cd509 100644 --- a/tests/support.py +++ b/tests/support.py @@ -6,6 +6,11 @@ __all__ = [ import os import subprocess +import re +import sys +import cStringIO + +from functools import wraps from contextlib import contextmanager from tempfile import mkdtemp from shutil import rmtree @@ -28,8 +33,87 @@ def temporary_folder(): # do whatever you want """ tempdir = mkdtemp() - yield tempdir - rmtree(tempdir) + try: + yield tempdir + finally: + rmtree(tempdir) + + +def isplit(s, sep=None): + """ + Behave like str.split but returns a generator instead of a list. + + >>> list(isplit('\tUse the force\n')) == '\tUse the force\n'.split() + True + >>> list(isplit('\tUse the force\n')) == ['Use', 'the', 'force'] + True + >>> list(isplit('\tUse the force\n', "e")) == '\tUse the force\n'.split("e") + True + >>> list(isplit('Use the force', "e")) == 'Use the force'.split("e") + True + >>> list(isplit('Use the force', "e")) == ['Us', ' th', ' forc', ''] + True + + """ + sep, hardsep = r'\s+' if sep is None else re.escape(sep), sep is not None + exp, pos, l = re.compile(sep), 0, len(s) + while True: + m = exp.search(s, pos) + if not m: + if pos < l or hardsep: + # ^ mimic "split()": ''.split() returns [] + yield s[pos:] + break + start = m.start() + if pos < start or hardsep: + # ^ mimic "split()": includes trailing empty string + yield s[pos:start] + pos = m.end() + + +def mute(returns_output=False): + """ + Decorate a function that prints to stdout, intercepting the output. + If "returns_output" is True, the function will return a generator + yielding the printed lines instead of the return values. + + The decorator litterally hijack sys.stdout during each function + execution, so be careful with what you apply it to. + + >>> def numbers(): + print "42" + print "1984" + ... + >>> numbers() + 42 + 1984 + >>> mute()(numbers)() + >>> list(mute(True)(numbers)()) + ['42', '1984'] + + """ + + def decorator(func): + + @wraps(func) + def wrapper(*args, **kwargs): + + saved_stdout = sys.stdout + sys.stdout = cStringIO.StringIO() + + try: + out = func(*args, **kwargs) + if returns_output: + out = isplit(sys.stdout.getvalue().strip()) + finally: + sys.stdout = saved_stdout + + return out + + return wrapper + + return decorator + def get_article(title, slug, content, lang, extra_metadata=None): diff --git a/tests/test_importer.py b/tests/test_importer.py new file mode 100644 index 00000000..c6ee9cfb --- /dev/null +++ b/tests/test_importer.py @@ -0,0 +1,43 @@ +# -*- coding: utf-8 -*- + +import os + +from pelican.tools.pelican_import import wp2fields, fields2pelican +from .support import unittest, temporary_folder, mute + +CUR_DIR = os.path.dirname(__file__) +WORDPRESS_XML_SAMPLE = os.path.join(CUR_DIR, 'content', 'wordpressexport.xml') + + +class TestWordpressXmlImporter(unittest.TestCase): + + + def setUp(self): + self.posts = wp2fields(WORDPRESS_XML_SAMPLE) + + + def test_ignore_empty_posts(self): + + posts = list(self.posts) + self.assertTrue(posts) + for title, content, fname, date, author, categ, tags, format in posts: + self.assertTrue(title.strip()) + + + def test_can_toggle_raw_html_code_parsing(self): + + posts = list(self.posts) + r = lambda f: open(f).read() + silent_f2p = mute(True)(fields2pelican) + + with temporary_folder() as temp: + + rst_files = (r(f) for f in silent_f2p(posts, 'markdown', temp)) + self.assertTrue(any(' Date: Mon, 14 May 2012 18:33:49 +0100 Subject: [PATCH 0248/2344] Fix a broken URL in the simple template --- pelican/themes/simple/templates/base.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/themes/simple/templates/base.html b/pelican/themes/simple/templates/base.html index a1017219..ad2723fd 100644 --- a/pelican/themes/simple/templates/base.html +++ b/pelican/themes/simple/templates/base.html @@ -21,7 +21,7 @@ {% endfor %} {% else %} {% for cat, null in categories %} - {{ cat }} + {{ cat }} {% endfor %} {% endif %} From a16c19545f4ca5f1442c7859d3207121c0be4920 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Mon, 14 May 2012 18:46:27 +0100 Subject: [PATCH 0249/2344] Don't duplicate html across themes --- pelican/themes/notmyidea/templates/categories.html | 8 -------- pelican/themes/notmyidea/templates/tags.html | 0 pelican/themes/simple/templates/index.html | 14 +------------- .../templates/pagination.html | 0 4 files changed, 1 insertion(+), 21 deletions(-) delete mode 100644 pelican/themes/notmyidea/templates/categories.html delete mode 100644 pelican/themes/notmyidea/templates/tags.html rename pelican/themes/{notmyidea => simple}/templates/pagination.html (100%) diff --git a/pelican/themes/notmyidea/templates/categories.html b/pelican/themes/notmyidea/templates/categories.html deleted file mode 100644 index e29be0ca..00000000 --- a/pelican/themes/notmyidea/templates/categories.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} -{% block content %} -
      -{% for category, articles in categories %} -
    • {{ category }}
    • -{% endfor %} -
    -{% endblock %} diff --git a/pelican/themes/notmyidea/templates/tags.html b/pelican/themes/notmyidea/templates/tags.html deleted file mode 100644 index e69de29b..00000000 diff --git a/pelican/themes/simple/templates/index.html b/pelican/themes/simple/templates/index.html index ad2a3b2e..dfdb0b45 100644 --- a/pelican/themes/simple/templates/index.html +++ b/pelican/themes/simple/templates/index.html @@ -17,18 +17,6 @@ {% endfor %} -

    - {% if articles_page.has_previous() %} - {% if articles_page.previous_page_number() == 1 %} - « - {% else %} - « - {% endif %} - {% endif %} - Page {{ articles_page.number }} / {{ articles_paginator.num_pages }} - {% if articles_page.has_next() %} - » - {% endif %} -

    +{% include 'pagination.html' %}
    {% endblock content %} diff --git a/pelican/themes/notmyidea/templates/pagination.html b/pelican/themes/simple/templates/pagination.html similarity index 100% rename from pelican/themes/notmyidea/templates/pagination.html rename to pelican/themes/simple/templates/pagination.html From 40dc019b3092ce0ed92947ace5b96b5b0fdefa8c Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Tue, 15 May 2012 11:58:40 +0300 Subject: [PATCH 0250/2344] Update CHANGELOG --- CHANGELOG | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 46aa68a5..373892cf 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,10 +1,18 @@ -X.X +3.0 - XX/XX/XXXX * Refactored the way URL are handled. * Improved the english documentation * Fixed packaging using setuptools entrypoints * Added typogrify support * Added a way to disable feed generation +* Added support for DIRECT_TEMPLATES +* Allow multiple extensions for content files +* Added less support +* Improved the import script +* Fixed a bunch of bugs :-) +* Added functional tests +* Rsync support in the generated Makefile +* Improved feed support (easily pluggable with feedburner for instance) 2.8 From 849244f61ec3fa3a75448ad134f29f22b40d7350 Mon Sep 17 00:00:00 2001 From: Brandon W Maister Date: Tue, 15 May 2012 17:48:07 -0400 Subject: [PATCH 0251/2344] Add warnings for files skipped due to unknown status --- pelican/generators.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pelican/generators.py b/pelican/generators.py index ede948a4..6483457d 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -284,6 +284,10 @@ class ArticlesGenerator(Generator): all_articles.append(article) elif article.status == "draft": self.drafts.append(article) + else: + logger.warning(u"Unknown status %s for file %s, skipping it." % + (repr(unicode.encode(article.status, 'utf-8')), + repr(f))) self.articles, self.translations = process_translations(all_articles) From ef77847762111d165cba14c65dfe5dfb11425530 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Sat, 19 May 2012 23:44:37 +0200 Subject: [PATCH 0252/2344] force locale to ascii in functional tests --- samples/pelican.conf.py | 2 +- tests/test_pelican.py | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/samples/pelican.conf.py b/samples/pelican.conf.py index bffe57f6..fffbf1a8 100755 --- a/samples/pelican.conf.py +++ b/samples/pelican.conf.py @@ -8,7 +8,7 @@ GITHUB_URL = 'http://github.com/ametaireau/' DISQUS_SITENAME = "blog-notmyidea" PDF_GENERATOR = False REVERSE_CATEGORY_ORDER = True -LOCALE = "" +LOCALE = "C" DEFAULT_PAGINATION = 4 FEED_RSS = 'feeds/all.rss.xml' diff --git a/tests/test_pelican.py b/tests/test_pelican.py index a331690b..0458d58c 100644 --- a/tests/test_pelican.py +++ b/tests/test_pelican.py @@ -7,6 +7,7 @@ import os from filecmp import dircmp from tempfile import mkdtemp from shutil import rmtree +import locale from mock import patch @@ -27,9 +28,12 @@ class TestPelican(unittest.TestCase): def setUp(self): self.temp_path = mkdtemp() + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, 'C') def tearDown(self): rmtree(self.temp_path) + locale.setlocale(locale.LC_ALL, self.old_locale) def test_basic_generation_works(self): # when running pelican without settings, it should pick up the default From 7192f745547e3d5e9b873e31dac001f373449abd Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Mon, 21 May 2012 15:21:16 +0200 Subject: [PATCH 0253/2344] markdown syntax is ':::' not '::' for syntax hl --- docs/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index f5da2753..313b44e1 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -169,7 +169,7 @@ For RestructuredText:: For Markdown, format your code blocks thusly:: - ::identifier + :::identifier your code goes here The specified identifier should be one that appears on the From 46daadc1378d47bc3fd66a2676156c5053a04f36 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 8 Jun 2012 11:21:52 +0200 Subject: [PATCH 0254/2344] add a youtube directive to pelican --- pelican/rstdirectives.py | 56 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index 3d7c2fe7..cb9c6f77 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -36,3 +36,59 @@ class Pygments(Directive): directives.register_directive('code-block', Pygments) directives.register_directive('sourcecode', Pygments) + + +class YouTube(Directive): + """ Embed YouTube video in posts. + + VIDEO_ID is required, with / height are optional integer, + and align could be left / center / right. + + Usage: + .. youtube:: VIDEO_ID + :width: 640 + :height: 480 + :align: center + """ + + def align(argument): + """Conversion function for the "align" option.""" + return directives.choice(argument, ('left', 'center', 'right')) + + required_arguments = 1 + optional_arguments = 2 + option_spec = { + 'width': directives.positive_int, + 'height': directives.positive_int, + 'align': align + } + + final_argument_whitespace = False + has_content = False + + def run(self): + videoID = self.arguments[0].strip() + width = 420 + height = 315 + align = 'left' + + if 'width' in self.options: + width = self.options['width'] + + if 'height' in self.options: + height = self.options['height'] + + if 'align' in self.options: + align = self.options['align'] + + url = 'http://www.youtube.com/embed/%s' % videoID + div_block = '
    ' % align + embed_block = '' % (width, height, url) + + return [ + nodes.raw('', div_block, format='html'), + nodes.raw('', embed_block, format='html'), + nodes.raw('', '
    ', format='html')] + +directives.register_directive('youtube', YouTube) From 3dd63a012e2885fdc3e1de3d63ebe57b0179e568 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Fri, 8 Jun 2012 11:23:18 +0200 Subject: [PATCH 0255/2344] Thanks the author of the youtube directive. --- pelican/rstdirectives.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index cb9c6f77..9c821310 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -41,6 +41,8 @@ directives.register_directive('sourcecode', Pygments) class YouTube(Directive): """ Embed YouTube video in posts. + Courtesy of Brian Hsu: https://gist.github.com/1422773 + VIDEO_ID is required, with / height are optional integer, and align could be left / center / right. From ae1424a8dd488424ea7aade2205cf1cf60e5c90b Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 8 Jun 2012 09:56:55 -0700 Subject: [PATCH 0256/2344] Strip tags from title when within tag attribute The change mentioned in #336 stripped tags properly in some places but seems to have forgotten at least one location in the main index.html --- pelican/themes/notmyidea/templates/index.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index 69dc4622..de607152 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -29,7 +29,8 @@ {% endif %}
  • -

    {{ article.title }}

    +

    {{ article.title }}

    From 219280d20315a9af491ddca77d8d61bae9488fb0 Mon Sep 17 00:00:00 2001 From: Abhishek L Date: Sun, 10 Jun 2012 00:00:49 +0530 Subject: [PATCH 0257/2344] Updated docs, for user and project pages in Github --- docs/tips.rst | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/tips.rst b/docs/tips.rst index 6ddc3d33..14a79a5e 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -10,6 +10,26 @@ GitHub comes with an interesting "pages" feature: you can upload things there and it will be available directly from their servers. As Pelican is a static file generator, we can take advantage of this. +User Pages +---------- +Github allows you to create user pages in the form of ``username.github.com``. +Whatever is created in master branch will be published. For this purposes just +the output generated by pelican needs to pushed at github. + +So given a repository containing your articles, just run pelican over the posts +and deploy the master branch at github:: + + $ pelican -s pelican.conf.py ./path/to/posts -o /path/to/output + +Now add all the files in the output directory generated by pelican:: + + $ git add /path/to/output/* + $ git commit -am "Your Message" + $ git push origin master + +Project Pages +------------- +For creating Project pages, a branch called ``gh-pages`` is used for publishing. The excellent `ghp-import `_ makes this really easy. You will have to install it:: @@ -31,3 +51,4 @@ Put the following into `.git/hooks/post-commit`:: pelican -s pelican.conf.py . && ghp-import output && git push origin gh-pages + From ed8b8bc27e97d22e59c5ab4a84104a368bd0ef62 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 10 Jun 2012 00:24:26 +0200 Subject: [PATCH 0258/2344] Also reload when the settings file changes. Fix for #360 --- pelican/__init__.py | 31 ++++++++++++++++++++++--------- pelican/utils.py | 22 +++++++++++++++++++--- 2 files changed, 41 insertions(+), 12 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 6b3d12fb..23b25730 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -9,7 +9,7 @@ from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, PdfGenerator, LessCSSGenerator) from pelican.log import init from pelican.settings import read_settings, _DEFAULT_CONFIG -from pelican.utils import clean_output_dir, files_changed +from pelican.utils import clean_output_dir, files_changed, file_changed from pelican.writers import Writer __major__ = 3 @@ -134,7 +134,7 @@ class Pelican(object): generators = [ArticlesGenerator, PagesGenerator, StaticGenerator] if self.settings['PDF_GENERATOR']: generators.append(PdfGenerator) - if self.settings['LESS_GENERATOR']: # can be True or PATH to lessc + if self.settings['LESS_GENERATOR']: # can be True or PATH to lessc generators.append(LessCSSGenerator) return generators @@ -192,11 +192,7 @@ def parse_arguments(): return parser.parse_args() -def main(): - args = parse_arguments() - init(args.verbosity) - # Split the markup languages only if some have been given. Otherwise, - # populate the variable with None. +def get_instance(args): markup = [a.strip().lower() for a in args.markup.split(',')]\ if args.markup else None @@ -208,9 +204,18 @@ def main(): module = __import__(module) cls = getattr(module, cls_name) + return cls(settings, args.path, args.theme, args.output, markup, + args.delete_outputdir) + + +def main(): + args = parse_arguments() + init(args.verbosity) + # Split the markup languages only if some have been given. Otherwise, + # populate the variable with None. + pelican = get_instance(args) + try: - pelican = cls(settings, args.path, args.theme, args.output, markup, - args.delete_outputdir) if args.autoreload: while True: try: @@ -222,6 +227,14 @@ def main(): if files_changed(pelican.path, pelican.markup) or \ files_changed(pelican.theme, ['']): pelican.run() + + # reload also if settings.py changed + if file_changed(args.settings): + logger.info('%s changed, re-generating' % + args.settings) + pelican = get_instance(args) + pelican.run() + time.sleep(.5) # sleep to avoid cpu load except KeyboardInterrupt: break diff --git a/pelican/utils.py b/pelican/utils.py index d4e34842..0940bf72 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -4,6 +4,7 @@ import re import pytz import shutil import logging +from collections import defaultdict from codecs import open as _open from datetime import datetime @@ -221,9 +222,9 @@ def files_changed(path, extensions): """Return the last time files have been modified""" for root, dirs, files in os.walk(path): dirs[:] = [x for x in dirs if x[0] != '.'] - for file in files: - if any(file.endswith(ext) for ext in extensions): - yield os.stat(os.path.join(root, file)).st_mtime + for f in files: + if any(f.endswith(ext) for ext in extensions): + yield os.stat(os.path.join(root, f)).st_mtime global LAST_MTIME mtime = max(file_times(path)) @@ -233,6 +234,21 @@ def files_changed(path, extensions): return False +FILENAMES_MTIMES = defaultdict(int) + + +def file_changed(filename): + mtime = os.stat(filename).st_mtime + if FILENAMES_MTIMES[filename] == 0: + FILENAMES_MTIMES[filename] = mtime + return False + else: + if mtime > FILENAMES_MTIMES[filename]: + FILENAMES_MTIMES[filename] = mtime + return True + return False + + def set_date_tzinfo(d, tz_name=None): """ Date without tzinfo shoudbe utc. This function set the right tz to date that aren't utc and don't have From 298c15bdda06e14afeef271cb12bd85749b21d79 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 10 Jun 2012 12:39:51 +0200 Subject: [PATCH 0259/2344] don't test the markdown reader if markdown isn't installed --- dev_requirements.txt | 1 + tests/test_readers.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/dev_requirements.txt b/dev_requirements.txt index e1a15a3f..927a2cab 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -6,3 +6,4 @@ unittest2 pytz mock Markdown +blinker diff --git a/tests/test_readers.py b/tests/test_readers.py index de2e9c32..a921cfc2 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -62,8 +62,10 @@ class RstReaderTest(unittest.TestCase): except ImportError: return unittest.skip('need the typogrify distribution') + class MdReaderTest(unittest.TestCase): + @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_md_extention(self): # test to ensure the md extension is being processed by the correct reader reader = readers.MarkdownReader({}) @@ -74,6 +76,7 @@ class MdReaderTest(unittest.TestCase): self.assertEqual(content, expected) + @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_mkd_extension(self): # test to ensure the mkd extension is being processed by the correct reader reader = readers.MarkdownReader({}) From 68d5ed57e31f51d04d0054f232fa27fe46d70554 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 10 Jun 2012 13:17:52 +0200 Subject: [PATCH 0260/2344] Add beautifulSoup in the dev deps --- dev_requirements.txt | 1 + tox.ini | 1 + 2 files changed, 2 insertions(+) diff --git a/dev_requirements.txt b/dev_requirements.txt index 927a2cab..ef1dbf31 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -7,3 +7,4 @@ pytz mock Markdown blinker +BeautifulSoup diff --git a/tox.ini b/tox.ini index 2cba1472..a7dc9ec6 100644 --- a/tox.ini +++ b/tox.ini @@ -12,3 +12,4 @@ deps = unittest2 mock Markdown + BeautifulSoup From 7c48937ea25acdb492118e85518bcb82d97c59f6 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 10 Jun 2012 13:27:36 +0200 Subject: [PATCH 0261/2344] pandoc is optional --- pelican/tools/pelican_import.py | 21 +++++++++++---------- tests/test_importer.py | 10 +++++----- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index f3e9bb48..dab3c3a8 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -247,14 +247,15 @@ def fields2pelican(fields, out_markup, output_path, dircat=False, strip_raw=Fals try: rc = subprocess.call(cmd, shell=True) if rc < 0: - print("Child was terminated by signal %d" % -rc) - exit() + error = "Child was terminated by signal %d" % -rc + exit(error) + elif rc > 0: - print("Please, check your Pandoc installation.") - exit() + error = "Please, check your Pandoc installation." + exit(error) except OSError, e: - print("Pandoc execution failed: %s" % e) - exit() + error = "Pandoc execution failed: %s" % e + exit(error) os.remove(html_filename) @@ -302,15 +303,15 @@ def main(): elif args.feed: input_type = 'feed' else: - print("You must provide either --wpfile, --dotclear or --feed options") - exit() + error = "You must provide either --wpfile, --dotclear or --feed options" + exit(error) if not os.path.exists(args.output): try: os.mkdir(args.output) except OSError: - print("Unable to create the output folder: " + args.output) - exit() + error = "Unable to create the output folder: " + args.output + exit(error) if input_type == 'wordpress': fields = wp2fields(args.input) diff --git a/tests/test_importer.py b/tests/test_importer.py index c6ee9cfb..1dc6fa78 100644 --- a/tests/test_importer.py +++ b/tests/test_importer.py @@ -11,11 +11,9 @@ WORDPRESS_XML_SAMPLE = os.path.join(CUR_DIR, 'content', 'wordpressexport.xml') class TestWordpressXmlImporter(unittest.TestCase): - def setUp(self): self.posts = wp2fields(WORDPRESS_XML_SAMPLE) - def test_ignore_empty_posts(self): posts = list(self.posts) @@ -23,7 +21,7 @@ class TestWordpressXmlImporter(unittest.TestCase): for title, content, fname, date, author, categ, tags, format in posts: self.assertTrue(title.strip()) - + @unittest.skipUnless(os.system('pandoc --version') == 0, 'pandoc is not installed') def test_can_toggle_raw_html_code_parsing(self): posts = list(self.posts) @@ -34,10 +32,12 @@ class TestWordpressXmlImporter(unittest.TestCase): rst_files = (r(f) for f in silent_f2p(posts, 'markdown', temp)) self.assertTrue(any(' Date: Sun, 10 Jun 2012 13:32:23 +0200 Subject: [PATCH 0262/2344] don't test webassets key if it can be unset --- pelican/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/settings.py b/pelican/settings.py index b9912a47..9dcba369 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -152,7 +152,7 @@ def configure_settings(settings, default_settings=None, filename=None): "http://docs.notmyidea.org/alexis/pelican/settings.html#timezone " "for more information") - if settings['WEBASSETS']: + if 'WEBASSETS' in settings: try: from webassets.ext.jinja2 import AssetsExtension settings['JINJA_EXTENSIONS'].append(AssetsExtension) From 7682f657a436806478c256f4e659065ae93fc6f5 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 10 Jun 2012 21:46:32 +0200 Subject: [PATCH 0263/2344] don't do anything with webassets if the setting is set to false (default) --- pelican/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/settings.py b/pelican/settings.py index 9dcba369..5769f1f4 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -152,7 +152,7 @@ def configure_settings(settings, default_settings=None, filename=None): "http://docs.notmyidea.org/alexis/pelican/settings.html#timezone " "for more information") - if 'WEBASSETS' in settings: + if 'WEBASSETS' in settings and settings['WEBASSETS'] is not False: try: from webassets.ext.jinja2 import AssetsExtension settings['JINJA_EXTENSIONS'].append(AssetsExtension) From 191b1cdb0f12231b24f17b74c828242496b55915 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Sun, 10 Jun 2012 21:56:06 +0200 Subject: [PATCH 0264/2344] skip unless deps are installed in tests --- tests/test_importer.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/test_importer.py b/tests/test_importer.py index 1dc6fa78..5504b12e 100644 --- a/tests/test_importer.py +++ b/tests/test_importer.py @@ -8,12 +8,20 @@ from .support import unittest, temporary_folder, mute CUR_DIR = os.path.dirname(__file__) WORDPRESS_XML_SAMPLE = os.path.join(CUR_DIR, 'content', 'wordpressexport.xml') +PANDOC = os.system('pandoc --version') == 0 +try: + import BeautifulSoup +except ImportError: + BeautifulSoup = False # NOQA + class TestWordpressXmlImporter(unittest.TestCase): def setUp(self): self.posts = wp2fields(WORDPRESS_XML_SAMPLE) + @unittest.skipUnless(PANDOC and BeautifulSoup, + 'Needs Pandoc and BeautifulSoup') def test_ignore_empty_posts(self): posts = list(self.posts) @@ -21,7 +29,8 @@ class TestWordpressXmlImporter(unittest.TestCase): for title, content, fname, date, author, categ, tags, format in posts: self.assertTrue(title.strip()) - @unittest.skipUnless(os.system('pandoc --version') == 0, 'pandoc is not installed') + @unittest.skipUnless(PANDOC and BeautifulSoup, + 'Needs Pandoc and BeautifulSoup') def test_can_toggle_raw_html_code_parsing(self): posts = list(self.posts) From 9fb5969c59ca47911679b1c8f994ddf613cec522 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Sun, 10 Jun 2012 17:58:05 -0400 Subject: [PATCH 0265/2344] Allow settings to specify a summary length, optionally allowing unlimited summary length --- pelican/contents.py | 4 +++- pelican/settings.py | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index f5f3a1dc..b8bb0993 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -139,7 +139,9 @@ class Page(object): if hasattr(self, '_summary'): return self._summary else: - return truncate_html_words(self.content, 50) + if self.settings['SUMMARY_MAX_LENGTH']: + return truncate_html_words(self.content, self.settings['SUMMARY_MAX_LENGTH']) + return self.content def _set_summary(self, summary): """Dummy function""" diff --git a/pelican/settings.py b/pelican/settings.py index 4da66989..a8c8bea4 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -68,6 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.', 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'LESS_GENERATOR': False, + 'SUMARY_MAX_LENGTH': 50, } From 876c7f509392d6c245a81e26fd5fd2a81851281f Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Sun, 10 Jun 2012 18:26:53 -0400 Subject: [PATCH 0266/2344] turn utils.open into actual context manager so as to better handle encoding warnings --- pelican/utils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index d4e34842..db15a343 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import contextlib import os import re import pytz @@ -32,10 +33,10 @@ def get_date(string): pass raise ValueError("'%s' is not a valid date" % string) - +@contextlib.contextmanager def open(filename): """Open a file and return it's content""" - return _open(filename, encoding='utf-8').read() + yield _open(filename, encoding='utf-8').read() def slugify(value): From c6d1de14f3db63705b35fbe3fd5db3701ea962a4 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Sun, 10 Jun 2012 18:27:38 -0400 Subject: [PATCH 0267/2344] better html parser --- pelican/readers.py | 101 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 99 insertions(+), 2 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 83565918..83cb7e3b 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -13,8 +13,11 @@ try: from markdown import Markdown except ImportError: Markdown = False # NOQA +import cgi +from HTMLParser import HTMLParser import re + from pelican.contents import Category, Tag, Author from pelican.utils import get_date, open @@ -126,13 +129,12 @@ class MarkdownReader(Reader): metadata[name] = self.process_metadata(name, value[0]) return content, metadata - +""" class HtmlReader(Reader): file_extensions = ['html', 'htm'] _re = re.compile('\<\!\-\-\#\s?[A-z0-9_-]*\s?\:s?[A-z0-9\s_-]*\s?\-\-\>') def read(self, filename): - """Parse content and metadata of (x)HTML files""" with open(filename) as content: metadata = {'title': 'unnamed'} for i in self._re.findall(content): @@ -142,6 +144,101 @@ class HtmlReader(Reader): metadata[name] = self.process_metadata(name, value) return content, metadata +""" + +class PelicanHTMLParser(HTMLParser): + def __init__(self, settings): + HTMLParser.__init__(self) + self.body = '' + self.metadata = {} + self.settings = settings + + self._data_buffer = '' + + self._in_top_level = True + self._in_head = False + self._in_title = False + self._in_body = False + self._in_tags = False + + def handle_starttag(self, tag, attrs): + if tag == 'head' and self._in_top_level: + self._in_top_level = False + self._in_head = True + elif tag == 'title' and self._in_head: + self._in_title = True + self._data_buffer = '' + elif tag == 'body' and self._in_top_level: + self._in_top_level = False + self._in_body = True + self._data_buffer = '' + elif tag == 'meta' and self._in_head: + self._handle_meta_tag(attrs) + + elif self._in_body: + self._data_buffer += self.build_tag(tag, attrs, False) + + def handle_endtag(self, tag): + if tag == 'head': + if self._in_head: + self._in_head = False + self._in_top_level = True + elif tag == 'title': + self._in_title = False + self.metadata['title'] = self._data_buffer + elif tag == 'body': + self.body = self._data_buffer + self._in_body = False + self._in_top_level = True + elif self._in_body: + self._data_buffer += ''.format(cgi.escape(tag)) + + def handle_startendtag(self, tag, attrs): + if tag == 'meta' and self._in_head: + self._handle_meta_tag(attrs) + if self._in_body: + self._data_buffer += self.build_tag(tag, attrs, True) + + def handle_comment(self, data): + if self._in_body and data.strip() == 'PELICAN_END_SUMMARY': + self.metadata['summary'] = self._data_buffer + + def handle_data(self, data): + self._data_buffer += data + + def build_tag(self, tag, attrs, close_tag): + result = '<{}'.format(cgi.escape(tag)) + result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs)) + if close_tag: + return result + ' />' + return result + '>' + + def _handle_meta_tag(self, attrs): + name = self._attr_value(attrs, 'name') + contents = self._attr_value(attrs, 'contents', '') + if name == 'keywords': + if contents: + self.metadata['tags'] = [Tag(unicode(tag), self.settings) for tag in contents.split(',')] + elif name == 'date': + self.metadata['date'] = get_date(contents) + else: + self.metadata[name] = contents + + @classmethod + def _attr_value(cls, attrs, name, default=None): + return next((x[1] for x in attrs if x[0] == name), default) + +class HTMLReader(Reader): + file_extensions = ['htm', 'html'] + enabled = True + + def read(self, filename): + """Parse content and metadata of markdown files""" + with open(filename) as content: + parser = PelicanHTMLParser(self.settings) + parser.feed(content) + parser.close() + return parser.body, parser.metadata _EXTENSIONS = {} From c6f1d0aadaa5e1dd71ad2a6897169f9da4458c2a Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Mon, 11 Jun 2012 08:39:13 -0400 Subject: [PATCH 0268/2344] fix SUMMARY_MAX_LENGTH, document it, and test it --- docs/settings.rst | 6 ++++++ pelican/settings.py | 2 +- tests/test_contents.py | 38 ++++++++++++++++++++++++++++++-------- 3 files changed, 37 insertions(+), 9 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 85e9f0c3..a26c37dd 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -90,6 +90,12 @@ Setting name (default value) What doe index pages for collections of content e.g. tags and category index pages. `PAGINATED_DIRECT_TEMPLATES` (``('index',)``) Provides the direct templates that should be paginated. +`SUMMARY_MAX_LENGTH` (``50``) When creating a short summary of an article, this will + be the default length in words of the text created. + This only applies if your content does not otherwise + specify a summary. Setting to None will cause the summary + to be a copy of the original content. + ===================================================================== ===================================================================== .. [#] Default is the system locale. diff --git a/pelican/settings.py b/pelican/settings.py index a8c8bea4..d2a39cd9 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -68,7 +68,7 @@ _DEFAULT_CONFIG = {'PATH': '.', 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'LESS_GENERATOR': False, - 'SUMARY_MAX_LENGTH': 50, + 'SUMMARY_MAX_LENGTH': 50, } diff --git a/tests/test_contents.py b/tests/test_contents.py index c6ef29a8..e7c9ad01 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -4,6 +4,7 @@ from .support import unittest from pelican.contents import Page from pelican.settings import _DEFAULT_CONFIG +from pelican.utils import truncate_html_words from jinja2.utils import generate_lorem_ipsum @@ -48,6 +49,20 @@ class TestPage(unittest.TestCase): page = Page(**self.page_kwargs) self.assertEqual(page.summary, TEST_SUMMARY) + def test_summary_max_length(self): + """If a :SUMMARY_MAX_LENGTH: is set, and there is no other summary, generated summary + should not exceed the given length.""" + page_kwargs = self._copy_page_kwargs() + settings = _DEFAULT_CONFIG.copy() + page_kwargs['settings'] = settings + del page_kwargs['metadata']['summary'] + settings['SUMMARY_MAX_LENGTH'] = None + page = Page(**page_kwargs) + self.assertEqual(page.summary, TEST_CONTENT) + settings['SUMMARY_MAX_LENGTH'] = 10 + page = Page(**page_kwargs) + self.assertEqual(page.summary, truncate_html_words(TEST_CONTENT, 10)) + def test_slug(self): """If a title is given, it should be used to generate the slug.""" page = Page(**self.page_kwargs) @@ -83,14 +98,9 @@ class TestPage(unittest.TestCase): from datetime import datetime from sys import platform dt = datetime(2015, 9, 13) - # make a deep copy of page_kawgs - page_kwargs = dict([(key, self.page_kwargs[key]) for key in - self.page_kwargs]) - for key in page_kwargs: - if not isinstance(page_kwargs[key], dict): - break - page_kwargs[key] = dict([(subkey, page_kwargs[key][subkey]) - for subkey in page_kwargs[key]]) + + page_kwargs = self._copy_page_kwargs() + # set its date to dt page_kwargs['metadata']['date'] = dt page = Page(**page_kwargs) @@ -124,3 +134,15 @@ class TestPage(unittest.TestCase): # Until we find some other method to test this functionality, we # will simply skip this test. unittest.skip("There is no locale %s in this system." % locale) + + def _copy_page_kwargs(self): + # make a deep copy of page_kwargs + page_kwargs = dict([(key, self.page_kwargs[key]) for key in + self.page_kwargs]) + for key in page_kwargs: + if not isinstance(page_kwargs[key], dict): + break + page_kwargs[key] = dict([(subkey, page_kwargs[key][subkey]) + for subkey in page_kwargs[key]]) + + return page_kwargs From 1c708a70ba7f806ca2cf373b1f3c47d74c52c086 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Mon, 11 Jun 2012 09:00:36 -0400 Subject: [PATCH 0269/2344] Revert "better html parser" This reverts commit c6d1de14f3db63705b35fbe3fd5db3701ea962a4. --- pelican/readers.py | 101 +-------------------------------------------- 1 file changed, 2 insertions(+), 99 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 83cb7e3b..83565918 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -13,11 +13,8 @@ try: from markdown import Markdown except ImportError: Markdown = False # NOQA -import cgi -from HTMLParser import HTMLParser import re - from pelican.contents import Category, Tag, Author from pelican.utils import get_date, open @@ -129,12 +126,13 @@ class MarkdownReader(Reader): metadata[name] = self.process_metadata(name, value[0]) return content, metadata -""" + class HtmlReader(Reader): file_extensions = ['html', 'htm'] _re = re.compile('\<\!\-\-\#\s?[A-z0-9_-]*\s?\:s?[A-z0-9\s_-]*\s?\-\-\>') def read(self, filename): + """Parse content and metadata of (x)HTML files""" with open(filename) as content: metadata = {'title': 'unnamed'} for i in self._re.findall(content): @@ -144,101 +142,6 @@ class HtmlReader(Reader): metadata[name] = self.process_metadata(name, value) return content, metadata -""" - -class PelicanHTMLParser(HTMLParser): - def __init__(self, settings): - HTMLParser.__init__(self) - self.body = '' - self.metadata = {} - self.settings = settings - - self._data_buffer = '' - - self._in_top_level = True - self._in_head = False - self._in_title = False - self._in_body = False - self._in_tags = False - - def handle_starttag(self, tag, attrs): - if tag == 'head' and self._in_top_level: - self._in_top_level = False - self._in_head = True - elif tag == 'title' and self._in_head: - self._in_title = True - self._data_buffer = '' - elif tag == 'body' and self._in_top_level: - self._in_top_level = False - self._in_body = True - self._data_buffer = '' - elif tag == 'meta' and self._in_head: - self._handle_meta_tag(attrs) - - elif self._in_body: - self._data_buffer += self.build_tag(tag, attrs, False) - - def handle_endtag(self, tag): - if tag == 'head': - if self._in_head: - self._in_head = False - self._in_top_level = True - elif tag == 'title': - self._in_title = False - self.metadata['title'] = self._data_buffer - elif tag == 'body': - self.body = self._data_buffer - self._in_body = False - self._in_top_level = True - elif self._in_body: - self._data_buffer += ''.format(cgi.escape(tag)) - - def handle_startendtag(self, tag, attrs): - if tag == 'meta' and self._in_head: - self._handle_meta_tag(attrs) - if self._in_body: - self._data_buffer += self.build_tag(tag, attrs, True) - - def handle_comment(self, data): - if self._in_body and data.strip() == 'PELICAN_END_SUMMARY': - self.metadata['summary'] = self._data_buffer - - def handle_data(self, data): - self._data_buffer += data - - def build_tag(self, tag, attrs, close_tag): - result = '<{}'.format(cgi.escape(tag)) - result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs)) - if close_tag: - return result + ' />' - return result + '>' - - def _handle_meta_tag(self, attrs): - name = self._attr_value(attrs, 'name') - contents = self._attr_value(attrs, 'contents', '') - if name == 'keywords': - if contents: - self.metadata['tags'] = [Tag(unicode(tag), self.settings) for tag in contents.split(',')] - elif name == 'date': - self.metadata['date'] = get_date(contents) - else: - self.metadata[name] = contents - - @classmethod - def _attr_value(cls, attrs, name, default=None): - return next((x[1] for x in attrs if x[0] == name), default) - -class HTMLReader(Reader): - file_extensions = ['htm', 'html'] - enabled = True - - def read(self, filename): - """Parse content and metadata of markdown files""" - with open(filename) as content: - parser = PelicanHTMLParser(self.settings) - parser.feed(content) - parser.close() - return parser.body, parser.metadata _EXTENSIONS = {} From d9dba3864486dd3949e69976619bc993aaee387a Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Mon, 11 Jun 2012 09:00:57 -0400 Subject: [PATCH 0270/2344] Revert "turn utils.open into actual context manager so as to better handle encoding warnings" This reverts commit 876c7f509392d6c245a81e26fd5fd2a81851281f. --- pelican/utils.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index db15a343..d4e34842 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -import contextlib import os import re import pytz @@ -33,10 +32,10 @@ def get_date(string): pass raise ValueError("'%s' is not a valid date" % string) -@contextlib.contextmanager + def open(filename): """Open a file and return it's content""" - yield _open(filename, encoding='utf-8').read() + return _open(filename, encoding='utf-8').read() def slugify(value): From 336d6fd40740d75638f4064a04fb00e83526f2a8 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 11 Jun 2012 12:27:01 -0700 Subject: [PATCH 0271/2344] Getting Started documentation improvements Expanded installation instructions, added Upgrading section, updated link to Pip installer, and other minor improvements. --- docs/getting_started.rst | 61 +++++++++++++++++++++++++++++++--------- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 313b44e1..8accf658 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -4,17 +4,48 @@ Getting started Installing ========== -You're ready? Let's go! You can install Pelican via several different methods. The simplest is via `pip `_:: +You're ready? Let's go! You can install Pelican via several different methods. +The simplest is via `pip `_:: $ pip install pelican -If you have the project source, you can install Pelican using the distutils -method. I recommend doing so in a virtualenv:: +If you don't have pip installed, an alternative method is easy_install:: - $ virtualenv pelican_venv - $ source bin/activate + $ easy_install pelican + +While the above is the simplest method, the recommended approach is to create +a virtual environment for Pelican via `virtualenv `_ +and `virtualenvwrapper `_ +before installing Pelican:: + + $ pip install virtualenvwrapper + $ mkvirtualenv pelican + +Once the virtual environment has been created and activated, Pelican can be +be installed via pip or easy_install as noted above. Alternatively, if you +have the project source, you can install Pelican using the distutils +method:: + + $ cd path-to-Pelican-source $ python setup.py install +If you have Git installed and prefer to install the latest bleeding-edge +version of Pelican rather than a stable release, use the following command:: + + $ pip install -e git://github.com/ametaireau/pelican#egg=pelican + +Upgrading +--------- + +If you installed a stable Pelican release via pip or easy_install and wish to +upgrade to the latest stable release, you can do so by adding `--upgrade` to +the relevant command. For pip, that would be:: + + $ pip install --upgrade pelican + +If you installed Pelican via distutils or the bleeding-edge method, simply +perform the same step to install the most recent version. + Dependencies ------------ @@ -54,10 +85,9 @@ following syntax (give your file the `.rst` extension):: You can also use Markdown syntax (with a file ending in `.md`). -Markdown generation will not work until you explicitly install the `markdown` -distribution. You can do so on a normal system using `pip install markdown` - -:: +Markdown generation will not work until you explicitly install the `Markdown` +package, which can be done via `pip install Markdown`. Metadata syntax for +Markdown posts should follow this pattern:: Date: 2010-12-03 Title: My super title @@ -94,7 +124,7 @@ Kickstart a blog ---------------- You also can use the `pelican-quickstart` script to start a new blog in -seconds, by just answering few questions. Just run `pelican-quickstart` and +seconds by just answering a few questions. Just run `pelican-quickstart` and you're done! (Added in Pelican 3.0) Pages @@ -175,12 +205,12 @@ For Markdown, format your code blocks thusly:: The specified identifier should be one that appears on the `list of available lexers `_. -Autoreload ----------- +Auto-reload +----------- It's possible to tell Pelican to watch for your modifications, instead of -manually launching it every time you want to see your changes. To enable this, -run the `pelican` command with the `-r` or `--autoreload` options. +manually re-running it every time you want to see your changes. To enable this, +run the `pelican` command with the `-r` or `--autoreload` option. Publishing drafts ----------------- @@ -203,3 +233,6 @@ You can either use your browser to open the files on your disk:: Or run a simple web server using Python:: cd output && python -m SimpleHTTPServer + +(Tip: If using the latter method in conjunction with the auto-reload feature, +ensure that `DELETE_OUTPUT_DIRECTORY` is set to `False` in your settings file.) From 8c375f016f48a67e147334bb72fee3f717b4d4b8 Mon Sep 17 00:00:00 2001 From: Michael Guntsche Date: Wed, 13 Jun 2012 21:54:40 +0200 Subject: [PATCH 0272/2344] Add template files to MANIFEST.in Commit 7c53cc8955b8f38d put the templates in a separate directory. As a result setuptools did not include them any longer. --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index a092ecd0..13ea58a1 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,4 +1,4 @@ include *.rst global-include *.py -recursive-include pelican *.html *.css *png +recursive-include pelican *.html *.css *png *.in include LICENSE From ddb345897e41f7fc11a345381ee6392737839a75 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Thu, 14 Jun 2012 10:29:44 -0400 Subject: [PATCH 0273/2344] Add gitorious icon to default theme. See ametaireau/pelican-themes#38 and ametaireau/pelican-themes#39 for references. --- pelican/themes/notmyidea/static/css/main.css | 1 + .../notmyidea/static/images/icons/gitorious.png | Bin 0 -> 3675 bytes 2 files changed, 1 insertion(+) create mode 100644 pelican/themes/notmyidea/static/images/icons/gitorious.png diff --git a/pelican/themes/notmyidea/static/css/main.css b/pelican/themes/notmyidea/static/css/main.css index 92905076..dce9e247 100644 --- a/pelican/themes/notmyidea/static/css/main.css +++ b/pelican/themes/notmyidea/static/css/main.css @@ -312,6 +312,7 @@ img.left, figure.left {float: right; margin: 0 0 2em 2em;} .social a[type$='atom+xml'], .social a[type$='rss+xml'] {background-image: url('../images/icons/rss.png');} .social a[href*='twitter.com'] {background-image: url('../images/icons/twitter.png');} .social a[href*='linkedin.com'] {background-image: url('../images/icons/linkedin.png');} + .social a[href*='gitorious.org'] {background-image: url('../images/icons/gitorious.org');} /* About diff --git a/pelican/themes/notmyidea/static/images/icons/gitorious.png b/pelican/themes/notmyidea/static/images/icons/gitorious.png new file mode 100644 index 0000000000000000000000000000000000000000..6485f5ecc5f6047a052d9adfb686ee154e7233af GIT binary patch literal 3675 zcmeH}_cs;(AIIM!du1jmd)(}q&As*>mwP2~txFP0S<$suA0ydaQQ0fx>V~qnD`Z|H zDsM1YRfBtf8PhSR$Jg1$Z#Z(m^oWl9R>38%Fr zV-o!|&8oo5l;~FpNdreqVXu59TS#ArPaCJS)~oig4I?ydw2WCs3f4*(#&YPD3tysp zyLy&ZrFA0dh5gU|Zg3a4e&2NdXtJ$6v<*278zrMgbh332;&r zrUQOx5VdKotgD z`hA5QR(*4vZDlM6DVAhkU}Z6+_|xb0_{drY{|m>{Rte_f~M(8MshYu zaDF=@zFp0G=Tzfw8oWz^vUSY}hTV7;tYWO}x%9@qin2NJ zz-^>1h>9&zzl~0rDhSGtx}s}@G(%cU8$HTuwl1u5UTNv!XK>?b2$mG^VXBOK5UJE9S~ooN=pm#z z=Y+30S+kBG1X@TR1#Igi$iJ}=^&f}&} zMOJneveKy1y3%l~Rk>!n6kF1&-|TP{$*kLJB6d^E5S>amk6pK&v7IlaFXb}VR6D4V zuJ9@5Eo#;a`gpf=C#T@UElh!#U+F?f>-wL|;W8)i6W>3j2ZoGD>IOz(Y9b@yqDHq; zfS(4ROfT`LHO#3~2Ud*AL}f31fDf#vM_57*)#U_^`9#`UW=N*s1@ zEq7yYs5%rQ?QS?V7*u1cMJAi8n@ca0;w>^PDhnpjoo{~P`f=q=Ja5*fsfjf>UtBl} z?aGaA>aOYB$!N_8e;@wOi6#wG{0ws?-wnQq`)}`YsM)J6(+pxFMPwjlUngmyn!j8Z{`LttFk$+cV$Sx@r=55a6^FI(C4~Z^-Z1 zE+f|NDDQah#LvALQhXs%;Gl5-Q)eISi}l*5Hp7cdS)awK2uqk{B)V~3NXAVj9Z@~? zrl~lnf`t0Pt@TUm-isBj6%CaI`2`2(A(ghKzNSITPQL=@*hSc5A+kF;lspPbF(MRb z%EUZV3jN3FG23wZT?PpcLnt>+NZ3Es@H zRuSJOKhdDRqLMo!7{y}aV-a!MDgFt_OQUkxN|4l`e}Mv0JK8DJOhW`M1S>s zI9TNoTYuVpH@QjXN+wOePeWSOc?T(a9JJ&c{D$}xgr*+tf$;n|oH(GGRatOtczdW} zfS9K8{KpIOHd_bV(ob7dVMnDLWeueY=wK#j~DvftZIEe3rW#u*^ zyC$MlG}PQD@>csmRC^k8}B#pF?a6S+w#gTy!(jfnCHgV1*rl@=B$eBui4CZnPz6+GA-J_-9GrGPn5|X z7AH1G<6!t#A2r^!c$D@NhSjyS)ZyLH9p12(Uy9!+h>k6!6RrLa zL^}#Q^9j!hk0axw29kD7V#UT`){(DMwS{lMb}!`^iFJrNNaR*b0PHDka(5lxuS+ch{+zj-+Oi=YCHqIJMsjZi4BjC{ypbHe2EKN zcOxv`X7T&+o;7f3OrM;*uHK?fxVif-aJQbg#*TQ0$g5Rz_T3EJ)Hux;x9n|x-kev1 zzv+YD32ki*^CWHX7N`*B_gh1La*-z|3RE@cTlYf!NZq7^MXvdXdtxVq!RDDDv7PD` z%NFN-oo(G2*nIqiw&UsC^pCm6x7&gW_eSRoNz}2?Bd6&HsVuPbsky0xaZGVr1=qDy zRhPBzoopPJ!baRjL<_i2U!D%uaC6B-98PRa5k_-Hi?VmKGd}u0Dn8k4+v2Gu_H^`I z`OqJ%Aa`ru{%E^BXfBBF$E!sa%hgBxkHyJezv~WcKb0P3@ML6=sVH;yj@=Zbh-ZD1 z-_6Lz9Dq;}05H)2{3f6I1^^Fa0oZf_KrIIVZoj9_-39ZfDh7YjeuipAOblqHnRd;pX1guKpVP^?KjrDZl!Lxy>?erb8ta^(jygszj+vLaYB8AoV>@2=0&gbI Date: Thu, 14 Jun 2012 23:04:23 +0200 Subject: [PATCH 0274/2344] added GoSquared support GoSquared(analytics) support added in default themes and documentation (in French and English) --- README.rst | 2 +- docs/fr/configuration.rst | 3 +++ docs/settings.rst | 1 + pelican/themes/notmyidea/templates/gosquared.html | 14 ++++++++++++++ pelican/themes/simple/templates/gosquared.html | 14 ++++++++++++++ 5 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 pelican/themes/notmyidea/templates/gosquared.html create mode 100644 pelican/themes/simple/templates/gosquared.html diff --git a/README.rst b/README.rst index 5012bb9c..4f4edb61 100644 --- a/README.rst +++ b/README.rst @@ -26,7 +26,7 @@ Pelican currently supports: * Atom/RSS feeds * Code syntax highlighting * Import from WordPress, Dotclear, or RSS feeds -* Integration with external tools: Twitter, Google Analytics, etc. (optional) +* Integration with external tools: Twitter, Google Analytics, GoSquared, etc. (optional) Have a look at `the documentation `_ for more information. diff --git a/docs/fr/configuration.rst b/docs/fr/configuration.rst index 695a0b0e..fadaf258 100644 --- a/docs/fr/configuration.rst +++ b/docs/fr/configuration.rst @@ -98,6 +98,9 @@ GITHUB_URL : GOOGLE_ANALYTICS : 'UA-XXXX-YYYY' pour activer Google analytics ; + +GOSQUARED_SITENAME : + 'XXX-YYYYYY-X' pour activer GoSquared ; JINJA_EXTENSIONS : Liste d'extension Jinja2 que vous souhaitez utiliser ; diff --git a/docs/settings.rst b/docs/settings.rst index b36c9953..416c22d4 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -398,6 +398,7 @@ Setting name What does it do ? `GITHUB_URL` Your GitHub URL (if you have one). It will then use this information to create a GitHub ribbon. `GOOGLE_ANALYTICS` 'UA-XXXX-YYYY' to activate Google Analytics. +`GOSQUARED_SITENAME` 'XXX-YYYYYY-X' to activate GoSquared. `MENUITEMS` A list of tuples (Title, URL) for additional menu items to appear at the beginning of the main menu. `PIWIK_URL` URL to your Piwik server - without 'http://' at the diff --git a/pelican/themes/notmyidea/templates/gosquared.html b/pelican/themes/notmyidea/templates/gosquared.html new file mode 100644 index 00000000..f47efcf4 --- /dev/null +++ b/pelican/themes/notmyidea/templates/gosquared.html @@ -0,0 +1,14 @@ +{% if GOSQUARED_SITENAME %} + +{% endif %} diff --git a/pelican/themes/simple/templates/gosquared.html b/pelican/themes/simple/templates/gosquared.html new file mode 100644 index 00000000..f47efcf4 --- /dev/null +++ b/pelican/themes/simple/templates/gosquared.html @@ -0,0 +1,14 @@ +{% if GOSQUARED_SITENAME %} + +{% endif %} From d1dfcdafc229b788bf48f08964836ff17eace4f0 Mon Sep 17 00:00:00 2001 From: asselinpaul Date: Thu, 14 Jun 2012 23:32:23 +0200 Subject: [PATCH 0275/2344] updated remove GoSqaured from README and template file from the notmyidea theme. --- README.rst | 2 +- pelican/themes/notmyidea/templates/.DS_Store | Bin 0 -> 6148 bytes .../themes/notmyidea/templates/gosquared.html | 14 -------------- 3 files changed, 1 insertion(+), 15 deletions(-) create mode 100644 pelican/themes/notmyidea/templates/.DS_Store delete mode 100644 pelican/themes/notmyidea/templates/gosquared.html diff --git a/README.rst b/README.rst index 4f4edb61..5012bb9c 100644 --- a/README.rst +++ b/README.rst @@ -26,7 +26,7 @@ Pelican currently supports: * Atom/RSS feeds * Code syntax highlighting * Import from WordPress, Dotclear, or RSS feeds -* Integration with external tools: Twitter, Google Analytics, GoSquared, etc. (optional) +* Integration with external tools: Twitter, Google Analytics, etc. (optional) Have a look at `the documentation `_ for more information. diff --git a/pelican/themes/notmyidea/templates/.DS_Store b/pelican/themes/notmyidea/templates/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 - var GoSquared={}; - GoSquared.acct = "{{ GOSQUARED_SITENAME }}"; - (function(w){ - function gs(){ - w._gstc_lt=+(new Date); var d=document; - var g = d.createElement("script"); g.type = "text/javascript"; g.async = true; g.src = "//d1l6p2sc9645hc.cloudfront.net/tracker.js"; - var s = d.getElementsByTagName("script")[0]; s.parentNode.insertBefore(g, s); - } - w.addEventListener?w.addEventListener("load",gs,false):w.attachEvent("onload",gs); - })(window); - -{% endif %} From cc1988fbda5f191768b9d20ef0f942b572d0bb39 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 14 Jun 2012 23:08:34 -0400 Subject: [PATCH 0276/2344] new HTMLReader --- pelican/readers.py | 186 ++++++++---------- tests/content/article_with_keywords.html | 6 + tests/content/article_with_metadata.html | 15 ++ .../article_with_uppercase_metadata.html | 6 + tests/test_readers.py | 38 ++++ 5 files changed, 150 insertions(+), 101 deletions(-) create mode 100644 tests/content/article_with_keywords.html create mode 100644 tests/content/article_with_metadata.html create mode 100644 tests/content/article_with_uppercase_metadata.html diff --git a/pelican/readers.py b/pelican/readers.py index 83cb7e3b..9ce3e3c0 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -129,117 +129,101 @@ class MarkdownReader(Reader): metadata[name] = self.process_metadata(name, value[0]) return content, metadata -""" -class HtmlReader(Reader): - file_extensions = ['html', 'htm'] - _re = re.compile('\<\!\-\-\#\s?[A-z0-9_-]*\s?\:s?[A-z0-9\s_-]*\s?\-\-\>') - - def read(self, filename): - with open(filename) as content: - metadata = {'title': 'unnamed'} - for i in self._re.findall(content): - key = i.split(':')[0][5:].strip() - value = i.split(':')[-1][:-3].strip() - name = key.lower() - metadata[name] = self.process_metadata(name, value) - - return content, metadata -""" - -class PelicanHTMLParser(HTMLParser): - def __init__(self, settings): - HTMLParser.__init__(self) - self.body = '' - self.metadata = {} - self.settings = settings - - self._data_buffer = '' - - self._in_top_level = True - self._in_head = False - self._in_title = False - self._in_body = False - self._in_tags = False - - def handle_starttag(self, tag, attrs): - if tag == 'head' and self._in_top_level: - self._in_top_level = False - self._in_head = True - elif tag == 'title' and self._in_head: - self._in_title = True - self._data_buffer = '' - elif tag == 'body' and self._in_top_level: - self._in_top_level = False - self._in_body = True - self._data_buffer = '' - elif tag == 'meta' and self._in_head: - self._handle_meta_tag(attrs) - - elif self._in_body: - self._data_buffer += self.build_tag(tag, attrs, False) - - def handle_endtag(self, tag): - if tag == 'head': - if self._in_head: - self._in_head = False - self._in_top_level = True - elif tag == 'title': - self._in_title = False - self.metadata['title'] = self._data_buffer - elif tag == 'body': - self.body = self._data_buffer - self._in_body = False - self._in_top_level = True - elif self._in_body: - self._data_buffer += ''.format(cgi.escape(tag)) - - def handle_startendtag(self, tag, attrs): - if tag == 'meta' and self._in_head: - self._handle_meta_tag(attrs) - if self._in_body: - self._data_buffer += self.build_tag(tag, attrs, True) - - def handle_comment(self, data): - if self._in_body and data.strip() == 'PELICAN_END_SUMMARY': - self.metadata['summary'] = self._data_buffer - - def handle_data(self, data): - self._data_buffer += data - - def build_tag(self, tag, attrs, close_tag): - result = '<{}'.format(cgi.escape(tag)) - result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs)) - if close_tag: - return result + ' />' - return result + '>' - - def _handle_meta_tag(self, attrs): - name = self._attr_value(attrs, 'name') - contents = self._attr_value(attrs, 'contents', '') - if name == 'keywords': - if contents: - self.metadata['tags'] = [Tag(unicode(tag), self.settings) for tag in contents.split(',')] - elif name == 'date': - self.metadata['date'] = get_date(contents) - else: - self.metadata[name] = contents - - @classmethod - def _attr_value(cls, attrs, name, default=None): - return next((x[1] for x in attrs if x[0] == name), default) - class HTMLReader(Reader): + """Parses HTML files as input, looking for meta, title, and body tags""" file_extensions = ['htm', 'html'] enabled = True + class _HTMLParser(HTMLParser): + def __init__(self, settings): + HTMLParser.__init__(self) + self.body = '' + self.metadata = {} + self.settings = settings + + self._data_buffer = '' + + self._in_top_level = True + self._in_head = False + self._in_title = False + self._in_body = False + self._in_tags = False + + def handle_starttag(self, tag, attrs): + if tag == 'head' and self._in_top_level: + self._in_top_level = False + self._in_head = True + elif tag == 'title' and self._in_head: + self._in_title = True + self._data_buffer = '' + elif tag == 'body' and self._in_top_level: + self._in_top_level = False + self._in_body = True + self._data_buffer = '' + elif tag == 'meta' and self._in_head: + self._handle_meta_tag(attrs) + + elif self._in_body: + self._data_buffer += self.build_tag(tag, attrs, False) + + def handle_endtag(self, tag): + if tag == 'head': + if self._in_head: + self._in_head = False + self._in_top_level = True + elif tag == 'title': + self._in_title = False + self.metadata['title'] = self._data_buffer + elif tag == 'body': + self.body = self._data_buffer + self._in_body = False + self._in_top_level = True + elif self._in_body: + self._data_buffer += ''.format(cgi.escape(tag)) + + def handle_startendtag(self, tag, attrs): + if tag == 'meta' and self._in_head: + self._handle_meta_tag(attrs) + if self._in_body: + self._data_buffer += self.build_tag(tag, attrs, True) + + def handle_comment(self, data): + if self._in_body and data.strip() == 'PELICAN_END_SUMMARY': + self.metadata['summary'] = self._data_buffer + + def handle_data(self, data): + self._data_buffer += data + + def build_tag(self, tag, attrs, close_tag): + result = '<{}'.format(cgi.escape(tag)) + result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs)) + if close_tag: + return result + ' />' + return result + '>' + + def _handle_meta_tag(self, attrs): + name = self._attr_value(attrs, 'name').lower() + contents = self._attr_value(attrs, 'contents', '') + + if name == 'keywords': + name = 'tags' + self.metadata[name] = contents + + @classmethod + def _attr_value(cls, attrs, name, default=None): + return next((x[1] for x in attrs if x[0] == name), default) + def read(self, filename): """Parse content and metadata of markdown files""" with open(filename) as content: - parser = PelicanHTMLParser(self.settings) + parser = self._HTMLParser(self.settings) parser.feed(content) parser.close() - return parser.body, parser.metadata + metadata = {} + for k in parser.metadata: + metadata[k] = self.process_metadata(k, parser.metadata[k]) + return parser.body, metadata _EXTENSIONS = {} diff --git a/tests/content/article_with_keywords.html b/tests/content/article_with_keywords.html new file mode 100644 index 00000000..c869f514 --- /dev/null +++ b/tests/content/article_with_keywords.html @@ -0,0 +1,6 @@ + + + This is a super article ! + + + diff --git a/tests/content/article_with_metadata.html b/tests/content/article_with_metadata.html new file mode 100644 index 00000000..2bd77241 --- /dev/null +++ b/tests/content/article_with_metadata.html @@ -0,0 +1,15 @@ + + + This is a super article ! + + + + + + + + Multi-line metadata should be supported + as well as inline markup. + + + diff --git a/tests/content/article_with_uppercase_metadata.html b/tests/content/article_with_uppercase_metadata.html new file mode 100644 index 00000000..4fe5a9ee --- /dev/null +++ b/tests/content/article_with_uppercase_metadata.html @@ -0,0 +1,6 @@ + + + This is a super article ! + + + diff --git a/tests/test_readers.py b/tests/test_readers.py index a921cfc2..52887068 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -86,3 +86,41 @@ class MdReaderTest(unittest.TestCase): "

    This is another markdown test file. Uses the mkd extension.

    " self.assertEqual(content, expected) + +class HTMLReaderTest(unittest.TestCase): + + def test_article_with_metadata(self): + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_metadata.html')) + expected = { + 'category': 'yeah', + 'author': u'Alexis Métaireau', + 'title': 'This is a super article !', + 'summary': u''' + Multi-line metadata should be supported + as well as inline markup. + ''', + 'date': datetime.datetime(2010, 12, 2, 10, 14), + 'tags': ['foo', 'bar', 'foobar'], + 'custom_field': 'http://notmyidea.org', + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + def test_article_with_keywords(self): + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_keywords.html')) + expected = { + 'tags': ['foo', 'bar', 'foobar'], + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + def test_article_metadata_key_lowercase(self): + """Keys of metadata should be lowercase.""" + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_uppercase_metadata.html')) + self.assertIn('category', metadata, "Key should be lowercase.") + self.assertEquals('Yeah', metadata.get('category'), "Value keeps cases.") From 0373c15e430e168928b645be3b9513f093b97403 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 14 Jun 2012 23:16:27 -0400 Subject: [PATCH 0277/2344] include html comments properly in reader --- pelican/readers.py | 2 ++ tests/content/article_with_comments.html | 7 +++++ tests/test_readers.py | 36 ++++++++++++++++++------ 3 files changed, 36 insertions(+), 9 deletions(-) create mode 100644 tests/content/article_with_comments.html diff --git a/pelican/readers.py b/pelican/readers.py index 9ce3e3c0..e3d0e0dd 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -190,6 +190,8 @@ class HTMLReader(Reader): def handle_comment(self, data): if self._in_body and data.strip() == 'PELICAN_END_SUMMARY': self.metadata['summary'] = self._data_buffer + else: + self._data_buffer += ''.format(data) def handle_data(self, data): self._data_buffer += data diff --git a/tests/content/article_with_comments.html b/tests/content/article_with_comments.html new file mode 100644 index 00000000..f222682d --- /dev/null +++ b/tests/content/article_with_comments.html @@ -0,0 +1,7 @@ + + + Summary comment is not included. + + + + diff --git a/tests/test_readers.py b/tests/test_readers.py index 52887068..b3e30bfc 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -88,6 +88,33 @@ class MdReaderTest(unittest.TestCase): self.assertEqual(content, expected) class HTMLReaderTest(unittest.TestCase): + def test_article_with_comments(self): + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_comments.html')) + expected = { + 'summary': ''' + Summary comment is not included. + ''', + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + self.assertEquals(''' + Summary comment is not included. + + + ''', content) + + def test_article_with_keywords(self): + reader = readers.HTMLReader({}) + content, metadata = reader.read(_filename('article_with_keywords.html')) + expected = { + 'tags': ['foo', 'bar', 'foobar'], + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) def test_article_with_metadata(self): reader = readers.HTMLReader({}) @@ -108,15 +135,6 @@ class HTMLReaderTest(unittest.TestCase): for key, value in expected.items(): self.assertEquals(value, metadata[key], key) - def test_article_with_keywords(self): - reader = readers.HTMLReader({}) - content, metadata = reader.read(_filename('article_with_keywords.html')) - expected = { - 'tags': ['foo', 'bar', 'foobar'], - } - - for key, value in expected.items(): - self.assertEquals(value, metadata[key], key) def test_article_metadata_key_lowercase(self): """Keys of metadata should be lowercase.""" From c461c6435df87bb0407d3459719e3278ffb5d55c Mon Sep 17 00:00:00 2001 From: Michael Guntsche Date: Sat, 16 Jun 2012 19:53:53 +0200 Subject: [PATCH 0278/2344] Fix HTML5 conformance of the notmyidea template The W3C validator complained that the pagination

    was inside an

      . So just move it out of there. --- pelican/themes/notmyidea/templates/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index de607152..8752a6b6 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -41,12 +41,12 @@
  • {% endif %} - {% if loop.last and (articles_page.has_previous() - or not articles_page.has_previous() and loop.length > 1) %} - {% include 'pagination.html' %} - {% endif %} {% if loop.last %} + {% if loop.last and (articles_page.has_previous() + or not articles_page.has_previous() and loop.length > 1) %} + {% include 'pagination.html' %} + {% endif %}
    {% endif %} {% endfor %} From 083f302b194eaeedd76d65b96120f42f54112c22 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 16 Jun 2012 11:23:55 -0700 Subject: [PATCH 0279/2344] Remove errant .DS_Store and add to .gitignore --- .gitignore | 1 + pelican/themes/notmyidea/templates/.DS_Store | Bin 6148 -> 0 bytes 2 files changed, 1 insertion(+) delete mode 100644 pelican/themes/notmyidea/templates/.DS_Store diff --git a/.gitignore b/.gitignore index 4029b327..9274ba2d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,7 @@ .*.swp .*.swo *.pyc +.DS_Store docs/_build docs/fr/_build build diff --git a/pelican/themes/notmyidea/templates/.DS_Store b/pelican/themes/notmyidea/templates/.DS_Store deleted file mode 100644 index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 Date: Wed, 20 Jun 2012 19:52:17 -0400 Subject: [PATCH 0280/2344] re-import htmlparser --- pelican/readers.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pelican/readers.py b/pelican/readers.py index 870c11c8..1916fa1e 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -15,6 +15,8 @@ except ImportError: Markdown = False # NOQA import re +from htmlparser import HTMLParser + from pelican.contents import Category, Tag, Author from pelican.utils import get_date, open From caa4442abb145d419a3120c7339ad7ecf91ac56c Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Wed, 20 Jun 2012 19:59:32 -0400 Subject: [PATCH 0281/2344] re-import cgi. properly turn utils.open into a context manager --- pelican/readers.py | 3 ++- pelican/utils.py | 9 +++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 1916fa1e..d05ab40f 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -15,7 +15,8 @@ except ImportError: Markdown = False # NOQA import re -from htmlparser import HTMLParser +import cgi +from HTMLParser import HTMLParser from pelican.contents import Category, Tag, Author from pelican.utils import get_date, open diff --git a/pelican/utils.py b/pelican/utils.py index 0940bf72..088a8faa 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -34,10 +34,15 @@ def get_date(string): raise ValueError("'%s' is not a valid date" % string) -def open(filename): +class open(object): """Open a file and return it's content""" - return _open(filename, encoding='utf-8').read() + def __init__(self, filename): + self.filename = filename + def __enter__(self): + return _open(self.filename, encoding='utf-8').read() + def __exit__(self, exc_type, exc_value, traceback): + pass def slugify(value): """ From 56800a1d43ff9e07659d0f5ad570a9004d44cd74 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Wed, 20 Jun 2012 20:02:41 -0400 Subject: [PATCH 0282/2344] fix failing test with new open context manager --- pelican/readers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index d05ab40f..1d06bd6d 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -119,9 +119,9 @@ class MarkdownReader(Reader): def read(self, filename): """Parse content and metadata of markdown files""" - text = open(filename) - md = Markdown(extensions=set(self.extensions + ['meta'])) - content = md.convert(text) + with open(filename) as text: + md = Markdown(extensions=set(self.extensions + ['meta'])) + content = md.convert(text) metadata = {} for name, value in md.Meta.items(): From c0578eb9ab77c7be4a045f58a7844222ccbe6b95 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Wed, 20 Jun 2012 23:19:06 -0400 Subject: [PATCH 0283/2344] handle escaped chars in html properly --- pelican/readers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pelican/readers.py b/pelican/readers.py index 1d06bd6d..08ef4cf8 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -196,6 +196,12 @@ class HTMLReader(Reader): def handle_data(self, data): self._data_buffer += data + def handle_entityref(self, data): + self._data_buffer += '&{};'.format(data) + + def handle_charref(self, data): + self._data_buffer += '&{};'.format(data) + def build_tag(self, tag, attrs, close_tag): result = '<{}'.format(cgi.escape(tag)) result += ''.join((' {}="{}"'.format(cgi.escape(k), cgi.escape(v)) for k,v in attrs)) From 036728a194695d463123c714954c25a3d6a826d5 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 21 Jun 2012 09:05:27 -0400 Subject: [PATCH 0284/2344] properly write out charref's --- pelican/readers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/readers.py b/pelican/readers.py index 08ef4cf8..93549d96 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -200,7 +200,7 @@ class HTMLReader(Reader): self._data_buffer += '&{};'.format(data) def handle_charref(self, data): - self._data_buffer += '&{};'.format(data) + self._data_buffer += '&#{};'.format(data) def build_tag(self, tag, attrs, close_tag): result = '<{}'.format(cgi.escape(tag)) From 847a6fe3cee7f05e36679d6b12fafaf58cfc1045 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Thu, 21 Jun 2012 09:12:38 -0400 Subject: [PATCH 0285/2344] change 'markdown' to HTML in the comments --- pelican/readers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/readers.py b/pelican/readers.py index 93549d96..9d200599 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -222,7 +222,7 @@ class HTMLReader(Reader): return next((x[1] for x in attrs if x[0] == name), default) def read(self, filename): - """Parse content and metadata of markdown files""" + """Parse content and metadata of HTML files""" with open(filename) as content: parser = self._HTMLParser(self.settings) parser.feed(content) From 387e5c1ab987feaecfad6e6383e94130d6a085f8 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Mon, 25 Jun 2012 08:57:09 -0400 Subject: [PATCH 0286/2344] Add upgrade ability to pelican-themes. Fix typos. I disliked having to do: $ pelican-theme -r -i So I modified install() to handle an upgrade of an existing theme. While doing so, I noticed that in install() and symlink() the script would error with 'no a directory' instead of 'not a directory'. So I fixed that for you as well. --- pelican/tools/pelican_themes.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index 3d35bb5d..a7e0470f 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -48,9 +48,11 @@ def main(): parser.add_argument('-i', '--install', dest='to_install', nargs='+', metavar="theme path", - help='The themes to install ') + help='The themes to install') parser.add_argument('-r', '--remove', dest='to_remove', nargs='+', metavar="theme name", help='The themes to remove') + parser.add_argument('-U', '--upgrade', dest='to_upgrade', nargs='+', + metavar="theme path", help='The themes to upgrade') parser.add_argument('-s', '--symlink', dest='to_symlink', nargs='+', metavar="theme path", help="Same as `--install', but create a symbolic link instead of copying the theme. Useful for theme development") parser.add_argument('-c', '--clean', dest='clean', action="store_true", @@ -85,6 +87,13 @@ def main(): for i in args.to_install: install(i, v=args.verbose) + if args.to_upgrade: + if args.verbose: + print('Upgrading themes...') + + for i in args.to_upgrade: + install(i, v=args.verbose, u=True) + if args.to_symlink: if args.verbose: print('Linking themes...') @@ -149,17 +158,21 @@ def remove(theme_name, v=False): err(target + ' : no such file or directory') -def install(path, v=False): +def install(path, v=False, u=False): """Installs a theme""" if not os.path.exists(path): err(path + ' : no such file or directory') elif not os.path.isdir(path): - err(path + ' : no a directory') + err(path + ' : not a directory') else: theme_name = os.path.basename(os.path.normpath(path)) theme_path = os.path.join(_THEMES_PATH, theme_name) - if os.path.exists(theme_path): + exists = os.path.exists(theme_path) + if exists and not u: err(path + ' : already exists') + elif exists and u: + remove(theme_name, v) + install(path, v) else: if v: print("Copying `{p}' to `{t}' ...".format(p=path, t=theme_path)) @@ -174,7 +187,7 @@ def symlink(path, v=False): if not os.path.exists(path): err(path + ' : no such file or directory') elif not os.path.isdir(path): - err(path + ' : no a directory') + err(path + ' : not a directory') else: theme_name = os.path.basename(os.path.normpath(path)) theme_path = os.path.join(_THEMES_PATH, theme_name) From 707536725da13df8ed7b167447039c738068b1c8 Mon Sep 17 00:00:00 2001 From: Ian Cordasco Date: Mon, 25 Jun 2012 11:43:12 -0400 Subject: [PATCH 0287/2344] Failed to commit some important changes. --- pelican/tools/pelican_themes.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index a7e0470f..6a021ecc 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -64,6 +64,9 @@ def main(): args = parser.parse_args() + + to_install = args.to_install or args.to_upgrade + to_sym = args.to_symlink or args.clean if args.action: @@ -71,8 +74,7 @@ def main(): list_themes(args.verbose) elif args.action is 'path': print(_THEMES_PATH) - elif args.to_install or args.to_remove or args.to_symlink or args.clean: - + elif to_install or args.to_remove or to_sym: if args.to_remove: if args.verbose: print('Removing themes...') From b2ff07d58cc0949cba20da5b4ceffe8979a6c479 Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Tue, 26 Jun 2012 16:28:00 +0200 Subject: [PATCH 0288/2344] we need jinja >= 2.4 --- dev_requirements.txt | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index ef1dbf31..ec3245d1 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,4 +1,4 @@ -Jinja2 +Jinja2>=2.4 Pygments docutils feedgenerator diff --git a/setup.py b/setup.py index a8a8fbd9..1603746e 100755 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ #!/usr/bin/env python from setuptools import setup -requires = ['feedgenerator', 'jinja2', 'pygments', 'docutils', 'pytz', 'blinker'] +requires = ['feedgenerator', 'jinja2 >= 2.4', 'pygments', 'docutils', 'pytz', 'blinker'] try: import argparse From a0e46c91066bd8338d0e067875d6e040fec88477 Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Tue, 26 Jun 2012 19:26:43 -0700 Subject: [PATCH 0289/2344] Add support for `status: hidden` in pages Resolves #380 If the status metadata is set to 'hidden' on a page it is translated and rendered but not linked anywhere in the site. --- docs/getting_started.rst | 4 ++++ pelican/generators.py | 17 +++++++++++++++-- samples/content/pages/hidden_page.rst | 9 +++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) create mode 100644 samples/content/pages/hidden_page.rst diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 8accf658..580c43a1 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -136,6 +136,10 @@ generate static pages. Then, use the `DISPLAY_PAGES_ON_MENU` setting, which will add all the pages to the menu. +If you want to exclude any pages from being linked to or listed in the menu +then add a ``status: hidden`` attribute to it's metadata. This is useful for +things like making error pages that fit the generated theme of your site. + Importing an existing blog -------------------------- diff --git a/pelican/generators.py b/pelican/generators.py index 1ddc13c2..6790fcd6 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -357,10 +357,13 @@ class PagesGenerator(Generator): def __init__(self, *args, **kwargs): self.pages = [] + self.hidden_pages = [] + self.hidden_translations = [] super(PagesGenerator, self).__init__(*args, **kwargs) def generate_context(self): all_pages = [] + hidden_pages = [] for f in self.get_files( os.path.join(self.path, self.settings['PAGE_DIR']), exclude=self.settings['PAGE_EXCLUDES']): @@ -373,15 +376,25 @@ class PagesGenerator(Generator): filename=f) if not is_valid_content(page, f): continue - all_pages.append(page) + if page.status == "published": + all_pages.append(page) + elif page.status == "hidden": + hidden_pages.append(page) + else: + logger.warning(u"Unknown status %s for file %s, skipping it." % + (repr(unicode.encode(article.status, 'utf-8')), + repr(f))) + self.pages, self.translations = process_translations(all_pages) + self.hidden_pages, self.hidden_translations = process_translations(hidden_pages) self._update_context(('pages', )) self.context['PAGES'] = self.pages def generate_output(self, writer): - for page in chain(self.translations, self.pages): + for page in chain(self.translations, self.pages, + self.hidden_translations, self.hidden_pages): writer.write_file(page.save_as, self.get_template('page'), self.context, page=page, relative_urls=self.settings.get('RELATIVE_URLS')) diff --git a/samples/content/pages/hidden_page.rst b/samples/content/pages/hidden_page.rst new file mode 100644 index 00000000..ab8704ed --- /dev/null +++ b/samples/content/pages/hidden_page.rst @@ -0,0 +1,9 @@ +This is a test hidden page +########################## + +:category: test +:status: hidden + +This is great for things like error(404) pages +Anyone can see this page but it's not linked to anywhere! + From de251bc9998b1245238e69707c21a0dd5143756b Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Tue, 26 Jun 2012 19:51:48 -0700 Subject: [PATCH 0290/2344] Fixes typo in error message for bad status Bugfix #380 We want the bad status of page, not article. --- pelican/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 6790fcd6..4e9312cc 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -382,7 +382,7 @@ class PagesGenerator(Generator): hidden_pages.append(page) else: logger.warning(u"Unknown status %s for file %s, skipping it." % - (repr(unicode.encode(article.status, 'utf-8')), + (repr(unicode.encode(page.status, 'utf-8')), repr(f))) From c2993c4d4e19b1eceb3c367c38005dd89d04b53c Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 27 Jun 2012 07:02:25 -0700 Subject: [PATCH 0291/2344] Documentation typo --- docs/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 580c43a1..96038c2a 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -137,7 +137,7 @@ Then, use the `DISPLAY_PAGES_ON_MENU` setting, which will add all the pages to the menu. If you want to exclude any pages from being linked to or listed in the menu -then add a ``status: hidden`` attribute to it's metadata. This is useful for +then add a ``status: hidden`` attribute to its metadata. This is useful for things like making error pages that fit the generated theme of your site. Importing an existing blog From 9ad93d36a0cff5e684bff5f4ca9f6b7080ea42d7 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 1 Jul 2012 10:52:39 -0700 Subject: [PATCH 0292/2344] Convert code in docs to inline literals Most of the references to code and settings in the docs were wrapped in single tickmarks (`), while reStructuredText syntax actually calls for double tickmarks for inline literals, which are normally rendered as monospaced text with spaces preserved. Converted the relevant instances to inline literals, along with some other minor fixes. --- docs/faq.rst | 6 +-- docs/getting_started.rst | 36 +++++++-------- docs/internals.rst | 40 ++++++++-------- docs/plugins.rst | 26 +++++------ docs/report.rst | 99 ++++++++++++++++++++-------------------- docs/themes.rst | 9 ++-- docs/tips.rst | 26 +++++------ 7 files changed, 119 insertions(+), 123 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index b3dbca87..a3829d65 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -8,14 +8,14 @@ Is it mandatory to have a configuration file? No, it's not. Configuration files are just an easy way to configure Pelican. For basic operations, it's possible to specify options while invoking Pelican -via the command line. See `pelican --help` for more information. +via the command line. See ``pelican --help`` for more information. I'm creating my own theme. How do I use Pygments for syntax highlighting? ========================================================================= Pygments adds some classes to the generated content. These classes are used by themes to style code syntax highlighting via CSS. Specifically, you can -customize the appearance of your syntax highlighting via the `.codehilite pre` +customize the appearance of your syntax highlighting via the ``.codehilite pre`` class in your theme's CSS file. To see how various styles can be used to render Django code, for example, you can use the demo `on the project website `_. @@ -30,7 +30,7 @@ How can I help? There are several ways to help out. First, you can use Pelican and report any suggestions or problems you might have on `the bugtracker -`_. +`_. If you want to contribute, please fork `the git repository `_, make your changes, and issue diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 8accf658..cd186a1c 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -38,7 +38,7 @@ Upgrading --------- If you installed a stable Pelican release via pip or easy_install and wish to -upgrade to the latest stable release, you can do so by adding `--upgrade` to +upgrade to the latest stable release, you can do so by adding ``--upgrade`` to the relevant command. For pip, that would be:: $ pip install --upgrade pelican @@ -55,7 +55,7 @@ At this time, Pelican is dependent on the following Python packages: * jinja2, for templating support * docutils, for supporting reStructuredText as an input format -If you're not using Python 2.7, you will also need `argparse`. +If you're not using Python 2.7, you will also need the ``argparse`` package. Optionally: @@ -73,7 +73,7 @@ file system (for instance, about the category of your articles), but some information you need to provide in the form of metadata inside your files. You can provide this metadata in reStructuredText text files via the -following syntax (give your file the `.rst` extension):: +following syntax (give your file the ``.rst`` extension):: My super title ############## @@ -84,9 +84,9 @@ following syntax (give your file the `.rst` extension):: :author: Alexis Metaireau -You can also use Markdown syntax (with a file ending in `.md`). -Markdown generation will not work until you explicitly install the `Markdown` -package, which can be done via `pip install Markdown`. Metadata syntax for +You can also use Markdown syntax (with a file ending in ``.md``). +Markdown generation will not work until you explicitly install the ``Markdown`` +package, which can be done via ``pip install Markdown``. Metadata syntax for Markdown posts should follow this pattern:: Date: 2010-12-03 @@ -99,17 +99,17 @@ Markdown posts should follow this pattern:: Note that, aside from the title, none of this metadata is mandatory: if the date is not specified, Pelican will rely on the file's "mtime" timestamp, and the category can be determined by the directory in which the file resides. For -example, a file located at `python/foobar/myfoobar.rst` will have a category of -`foobar`. +example, a file located at ``python/foobar/myfoobar.rst`` will have a category of +``foobar``. Generate your blog ------------------ -To launch Pelican, just use the `pelican` command:: +To launch Pelican, just use the ``pelican`` command:: $ pelican /path/to/your/content/ [-s path/to/your/settings.py] -And… that's all! Your weblog will be generated and saved in the `content/` +And… that's all! Your weblog will be generated and saved in the ``content/`` folder. The above command will use the default theme to produce a simple site. It's not @@ -123,17 +123,17 @@ the options you can use:: Kickstart a blog ---------------- -You also can use the `pelican-quickstart` script to start a new blog in -seconds by just answering a few questions. Just run `pelican-quickstart` and +You also can use the ``pelican-quickstart`` script to start a new blog in +seconds by just answering a few questions. Just run ``pelican-quickstart`` and you're done! (Added in Pelican 3.0) Pages ----- -If you create a folder named `pages`, all the files in it will be used to +If you create a folder named ``pages``, all the files in it will be used to generate static pages. -Then, use the `DISPLAY_PAGES_ON_MENU` setting, which will add all the pages to +Then, use the ``DISPLAY_PAGES_ON_MENU`` setting, which will add all the pages to the menu. Importing an existing blog @@ -145,8 +145,8 @@ a simple script. See :ref:`import`. Translations ------------ -It is possible to translate articles. To do so, you need to add a `lang` meta -attribute to your articles/pages and set a `DEFAULT_LANG` setting (which is +It is possible to translate articles. To do so, you need to add a ``lang`` meta +attribute to your articles/pages and set a ``DEFAULT_LANG`` setting (which is English [en] by default). With those settings in place, only articles with the default language will be listed, and each article will be accompanied by a list of available translations for that article. @@ -210,7 +210,7 @@ Auto-reload It's possible to tell Pelican to watch for your modifications, instead of manually re-running it every time you want to see your changes. To enable this, -run the `pelican` command with the `-r` or `--autoreload` option. +run the ``pelican`` command with the ``-r`` or ``--autoreload`` option. Publishing drafts ----------------- @@ -235,4 +235,4 @@ Or run a simple web server using Python:: cd output && python -m SimpleHTTPServer (Tip: If using the latter method in conjunction with the auto-reload feature, -ensure that `DELETE_OUTPUT_DIRECTORY` is set to `False` in your settings file.) +ensure that ``DELETE_OUTPUT_DIRECTORY`` is set to ``False`` in your settings file.) diff --git a/docs/internals.rst b/docs/internals.rst index f0934825..6b6f991f 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -12,34 +12,34 @@ original author wrote with some software design information. Overall structure ================= -What `pelican` does is take a list of files and process them into some +What Pelican does is take a list of files and process them into some sort of output. Usually, the input files are reStructuredText and Markdown files, and the output is a blog, but both input and output can be anything you want. The logic is separated into different classes and concepts: -* `writers` are responsible for writing files: .html files, RSS feeds, and so +* **Writers** are responsible for writing files: .html files, RSS feeds, and so on. Since those operations are commonly used, the object is created once and then passed to the generators. -* `readers` are used to read from various formats (Markdown and +* **Readers** are used to read from various formats (Markdown and reStructuredText for now, but the system is extensible). Given a file, they return metadata (author, tags, category, etc.) and content (HTML-formatted). -* `generators` generate the different outputs. For instance, Pelican comes with - `ArticlesGenerator` and `PageGenerator`. Given a configuration, they can do +* **Generators** generate the different outputs. For instance, Pelican comes with + ``ArticlesGenerator`` and ``PageGenerator``. Given a configuration, they can do whatever they want. Most of the time, it's generating files from inputs. -* `pelican` also uses `templates`, so it's easy to write your own theme. The - syntax is `jinja2`, and, trust me, really easy to learn, so don't hesitate - to jump in and build your own theme. +* Pelican also uses templates, so it's easy to write your own theme. The + syntax is `Jinja2 `_ and is very easy to learn, so + don't hesitate to jump in and build your own theme. How to implement a new reader? ============================== Is there an awesome markup language you want to add to Pelican? -Well, the only thing you have to do is to create a class with a `read` +Well, the only thing you have to do is to create a class with a ``read`` method that returns HTML content and some metadata. Take a look at the Markdown reader:: @@ -65,8 +65,8 @@ Take a look at the Markdown reader:: Simple, isn't it? If your new reader requires additional Python dependencies, then you should wrap -their `import` statements in a `try...except` block. Then inside the reader's -class, set the `enabled` class attribute to mark import success or failure. +their ``import`` statements in a ``try...except`` block. Then inside the reader's +class, set the ``enabled`` class attribute to mark import success or failure. This makes it possible for users to continue using their favourite markup method without needing to install modules for formats they don't use. @@ -76,17 +76,17 @@ How to implement a new generator? Generators have two important methods. You're not forced to create both; only the existing ones will be called. -* `generate_context`, that is called first, for all the generators. +* ``generate_context``, that is called first, for all the generators. Do whatever you have to do, and update the global context if needed. This context is shared between all generators, and will be passed to the - templates. For instance, the `PageGenerator` `generate_context` method finds - all the pages, transforms them into objects, and populates the context with - them. Be careful *not* to output anything using this context at this stage, - as it is likely to change by the effect of other generators. + templates. For instance, the ``PageGenerator`` ``generate_context`` method + finds all the pages, transforms them into objects, and populates the context + with them. Be careful *not* to output anything using this context at this + stage, as it is likely to change by the effect of other generators. -* `generate_output` is then called. And guess what is it made for? Oh, +* ``generate_output`` is then called. And guess what is it made for? Oh, generating the output. :) It's here that you may want to look at the context - and call the methods of the `writer` object that is passed as the first - argument of this function. In the `PageGenerator` example, this method will + and call the methods of the ``writer`` object that is passed as the first + argument of this function. In the ``PageGenerator`` example, this method will look at all the pages recorded in the global context and output a file on - the disk (using the writer method `write_file`) for each page encountered. + the disk (using the writer method ``write_file``) for each page encountered. diff --git a/docs/plugins.rst b/docs/plugins.rst index db5a4bfc..3e009e33 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -3,14 +3,14 @@ Plugins ####### -Since version 3.0, pelican manages plugins. Plugins are a way to add features -to pelican without having to directly hack pelican code. +Since version 3.0, Pelican manages plugins. Plugins are a way to add features +to Pelican without having to directly hack Pelican code. Pelican is shipped with a set of core plugins, but you can easily implement your own (and this page describes how). -How to use plugins? -==================== +How to use plugins +================== To load plugins, you have to specify them in your settings file. You have two ways to do so. @@ -23,21 +23,21 @@ Or by importing them and adding them to the list:: from pelican.plugins import gravatar PLUGINS = [gravatar, ] -If your plugins are not in an importable path, you can specify a `PLUGIN_PATH` +If your plugins are not in an importable path, you can specify a ``PLUGIN_PATH`` in the settings:: PLUGIN_PATH = "plugins" PLUGINS = ["list", "of", "plugins"] -How to create plugins? -====================== +How to create plugins +===================== -Plugins are based on the concept of signals. Pelican sends signals and plugins +Plugins are based on the concept of signals. Pelican sends signals, and plugins subscribe to those signals. The list of signals are defined in a following section. -The only rule to follow for plugins is to define a `register` callable, in -which you map the signals to your plugin logic. Let's take a simple exemple:: +The only rule to follow for plugins is to define a ``register`` callable, in +which you map the signals to your plugin logic. Let's take a simple example:: from pelican import signals @@ -68,7 +68,7 @@ List of plugins =============== Not all the list are described here, but a few of them have been extracted from -pelican core and provided in pelican.plugins. They are described here: +the Pelican core and provided in ``pelican.plugins``. They are described here: Tag cloud --------- @@ -82,7 +82,7 @@ Github Activity This plugin makes use of the ``feedparser`` library that you'll need to install. -Set the GITHUB_ACTIVITY_FEED parameter to your github activity feed. +Set the ``GITHUB_ACTIVITY_FEED`` parameter to your Github activity feed. For example, my setting would look like:: GITHUB_ACTIVITY_FEED = 'https://github.com/kpanic.atom' @@ -105,4 +105,4 @@ variable, as in the example:: ``github_activity`` is a list of lists. The first element is the title -and the second element is the raw html from github. +and the second element is the raw HTML from Github. diff --git a/docs/report.rst b/docs/report.rst index 7e0432e2..f12f3048 100644 --- a/docs/report.rst +++ b/docs/report.rst @@ -1,40 +1,40 @@ -Some history about pelican +Some history about Pelican ########################## .. warning:: This page comes from a report the original author (Alexis Métaireau) wrote - right after writing pelican, in december 2010. The information may not be - up to date. + right after writing Pelican, in December 2010. The information may not be + up-to-date. Pelican is a simple static blog generator. It parses markup files -(markdown or restructured text for now), and generate a HTML folder +(Markdown or reStructuredText for now) and generates an HTML folder with all the files in it. -I've chosen to use python to implement pelican because it seemed to +I've chosen to use Python to implement Pelican because it seemed to be simple and to fit to my needs. I did not wanted to define a class for each thing, but still wanted to keep my things loosely coupled. It turns out that it was exactly what I wanted. From time to time, thanks to the feedback of some users, it took me a very few time to -provide fixes on it. So far, I've re-factored the pelican code by two -times, each time took less than 30 minutes. +provide fixes on it. So far, I've re-factored the Pelican code by two +times; each time took less than 30 minutes. Use case ======== -I was previously using wordpress, a solution you can host on a web +I was previously using WordPress, a solution you can host on a web server to manage your blog. Most of the time, I prefer using markup -languages such as Markdown or RestructuredText to type my articles. +languages such as Markdown or reStructuredText to type my articles. To do so, I use vim. I think it is important to let the people choose the tool they want to write the articles. In my opinion, a blog manager should just allow you to take any kind of input and transform it to a -weblog. That's what pelican does. +weblog. That's what Pelican does. You can write your articles using the tool you want, and the markup -language you want, and then generate a static HTML weblog +language you want, and then generate a static HTML weblog. .. image:: _static/overall.png -To be flexible enough, pelican have a template support, so you can -easily write you own themes if you want to. +To be flexible enough, Pelican has template support, so you can easily write +your own themes if you want to. Design process ============== @@ -42,19 +42,18 @@ Design process Pelican came from a need I have. I started by creating a single file application, and I have make it grow to support what it does by now. To start, I wrote a piece of documentation about what I wanted to do. -Then, I have created the content I wanted to parse (the restructured -text files), and started experimenting with the code. -Pelican was 200 lines long, and contained almost ten functions and one -class when it was first usable. +Then, I created the content I wanted to parse (the reStructuredText files) +and started experimenting with the code. Pelican was 200 lines long and +contained almost ten functions and one class when it was first usable. -I have been facing different problems all over the time, and wanted to -add features to pelican while using it. The first change I have done was +I have been facing different problems all over the time and wanted to +add features to Pelican while using it. The first change I have done was to add the support of a settings file. It is possible to pass the options to the command line, but can be tedious if there is a lot of them. In the same way, I have added the support of different things over -time: atom feeds, multiple themes, multiple markup support, etc. -At some point, it appears that the “only one file” mantra was not good -enough for pelican, so I decided to rework a bit all that, and split this in +time: Atom feeds, multiple themes, multiple markup support, etc. +At some point, it appears that the "only one file" mantra was not good +enough for Pelican, so I decided to rework a bit all that, and split this in multiple different files. I’ve separated the logic in different classes and concepts: @@ -64,59 +63,59 @@ I’ve separated the logic in different classes and concepts: Since those operations are commonly used, the object is created once, and then passed to the generators. -* *readers* are used to read from various formats (Markdown, and - Restructured Text for now, but the system is extensible). Given a - file, they return metadata (author, tags, category etc) and - content (HTML formated). +* *readers* are used to read from various formats (Markdown and + reStructuredText for now, but the system is extensible). Given a + file, they return metadata (author, tags, category, etc) and + content (HTML formatted). -* *generators* generate the different outputs. For instance, pelican +* *generators* generate the different outputs. For instance, Pelican comes with an ArticlesGenerator and PagesGenerator, into others. Given a configuration, they can do whatever you want - them to do. Most of the time it’s generating files from inputs + them to do. Most of the time it's generating files from inputs (user inputs and files). -I also deal with contents objects. They can be `Articles`, `Pages`, `Quotes`, -or whatever you want. They are defined in the contents.py module, -and represent some content to be used by the program. +I also deal with contents objects. They can be ``Articles``, ``Pages``, +``Quotes``, or whatever you want. They are defined in the ``contents.py`` +module and represent some content to be used by the program. -In more details -=============== +In more detail +============== -Here is an overview of the classes involved in pelican. +Here is an overview of the classes involved in Pelican. .. image:: _static/uml.jpg -The interface do not really exists, and I have added it only to clarify the -whole picture. I do use duck typing, and not interfaces. +The interface does not really exist, and I have added it only to clarify the +whole picture. I do use duck typing and not interfaces. Internally, the following process is followed: * First of all, the command line is parsed, and some content from - the user are used to initialize the different generator objects. + the user is used to initialize the different generator objects. -* A `context` is created. It contains the settings from the command +* A ``context`` is created. It contains the settings from the command line and a settings file if provided. -* The `generate_context` method of each generator is called, updating +* The ``generate_context`` method of each generator is called, updating the context. -* The writer is created, and given to the `generate_output` method of +* The writer is created and given to the ``generate_output`` method of each generator. I make two calls because it is important that when the output is generated by the generators, the context will not change. In other -words, the first method `generate_context` should modify the context, -whereas the second `generate_output` method should not. +words, the first method ``generate_context`` should modify the context, +whereas the second ``generate_output`` method should not. Then, it is up to the generators to do what the want, in the -`generate_context` and `generate_content` method. -Taking the `ArticlesGenerator` class will help to understand some others -concepts. Here is what happens when calling the `generate_context` +``generate_context`` and ``generate_content`` method. +Taking the ``ArticlesGenerator`` class will help to understand some others +concepts. Here is what happens when calling the ``generate_context`` method: * Read the folder “path”, looking for restructured text files, load - each of them, and construct a content object (`Article`) with it. To do so, - use `Reader` objects. -* Update the `context` with all those articles. + each of them, and construct a content object (``Article``) with it. To do so, + use ``Reader`` objects. +* Update the ``context`` with all those articles. -Then, the `generate_content` method uses the `context` and the `writer` to -generate the wanted output +Then, the ``generate_content`` method uses the ``context`` and the ``writer`` to +generate the wanted output. diff --git a/docs/themes.rst b/docs/themes.rst index e0583882..8e432a95 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -3,11 +3,10 @@ How to create themes for Pelican ################################ -Pelican uses the great `jinja2 `_ templating engine to -generate its HTML output. The jinja2 syntax is really simple. If you want to -create your own theme, feel free to take inspiration from the "simple" theme, -which is available `here -`_ +Pelican uses the great `Jinja2 `_ templating engine to +generate its HTML output. Jinja2 syntax is really simple. If you want to +create your own theme, feel free to take inspiration from the `"simple" theme +`_. Structure ========= diff --git a/docs/tips.rst b/docs/tips.rst index 14a79a5e..8905103b 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -12,16 +12,16 @@ file generator, we can take advantage of this. User Pages ---------- -Github allows you to create user pages in the form of ``username.github.com``. -Whatever is created in master branch will be published. For this purposes just -the output generated by pelican needs to pushed at github. +GitHub allows you to create user pages in the form of ``username.github.com``. +Whatever is created in the master branch will be published. For this purpose, +just the output generated by Pelican needs to pushed to GitHub. -So given a repository containing your articles, just run pelican over the posts -and deploy the master branch at github:: +So given a repository containing your articles, just run Pelican over the posts +and deploy the master branch to GitHub:: $ pelican -s pelican.conf.py ./path/to/posts -o /path/to/output -Now add all the files in the output directory generated by pelican:: +Now add all the files in the output directory generated by Pelican:: $ git add /path/to/output/* $ git commit -am "Your Message" @@ -31,12 +31,12 @@ Project Pages ------------- For creating Project pages, a branch called ``gh-pages`` is used for publishing. The excellent `ghp-import `_ makes this -really easy. You will have to install it:: +really easy, which can be installed via:: $ pip install ghp-import -Then, given a repository containing your articles, you would simply have -to run Pelican and upload the output to GitHub:: +Then, given a repository containing your articles, you would simply run +Pelican and upload the output to GitHub:: $ pelican -s pelican.conf.py . $ ghp-import output @@ -45,10 +45,8 @@ to run Pelican and upload the output to GitHub:: And that's it. If you want, you can put that directly into a post-commit hook, so each time you -commit, your blog is up to date on GitHub! +commit, your blog is up-to-date on GitHub! -Put the following into `.git/hooks/post-commit`:: - - pelican -s pelican.conf.py . && ghp-import output && git push origin - gh-pages +Put the following into ``.git/hooks/post-commit``:: + pelican -s pelican.conf.py . && ghp-import output && git push origin gh-pages From 8a53ee1ad36e88604f976ab176ab309fb852eb79 Mon Sep 17 00:00:00 2001 From: Alexandre RODIERE Date: Tue, 3 Jul 2012 15:19:38 +0200 Subject: [PATCH 0293/2344] Fix typo on debug logger calls. --- pelican/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 6dc7dd36..d42526a3 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -68,10 +68,10 @@ class Pelican(object): for plugin in self.plugins: # if it's a string, then import it if isinstance(plugin, basestring): - log.debug("Loading plugin `{0}' ...".format(plugin)) + logger.debug("Loading plugin `{0}' ...".format(plugin)) plugin = __import__(plugin, globals(), locals(), 'module') - log.debug("Registering plugin `{0}' ...".format(plugin.__name__)) + logger.debug("Registering plugin `{0}' ...".format(plugin.__name__)) plugin.register() def _handle_deprecation(self): From cf696939f8c49d54c8b6f5e6fa13422e3278734e Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 4 Jul 2012 10:06:53 -0700 Subject: [PATCH 0294/2344] Added tests for page generation. Currently tests rst & markdown generation, ignoring pages w/ bad status, and status hidden vs published --- tests/TestPages/bad_page.rst | 8 +++++ tests/TestPages/hidden_page.rst | 8 +++++ tests/TestPages/hidden_page_markdown.md | 12 +++++++ tests/TestPages/page.rst | 4 +++ tests/TestPages/page_markdown.md | 9 +++++ tests/test_generators.py | 44 ++++++++++++++++++++++++- 6 files changed, 84 insertions(+), 1 deletion(-) create mode 100644 tests/TestPages/bad_page.rst create mode 100644 tests/TestPages/hidden_page.rst create mode 100644 tests/TestPages/hidden_page_markdown.md create mode 100644 tests/TestPages/page.rst create mode 100644 tests/TestPages/page_markdown.md diff --git a/tests/TestPages/bad_page.rst b/tests/TestPages/bad_page.rst new file mode 100644 index 00000000..bc62948b --- /dev/null +++ b/tests/TestPages/bad_page.rst @@ -0,0 +1,8 @@ +This is a test bad page +####################### + +:status: invalid + +The quick brown fox jumped over the lazy dog's back. + +The status here is invalid, the page should not render. diff --git a/tests/TestPages/hidden_page.rst b/tests/TestPages/hidden_page.rst new file mode 100644 index 00000000..57ca329c --- /dev/null +++ b/tests/TestPages/hidden_page.rst @@ -0,0 +1,8 @@ +This is a test hidden page +########################## + +:status: hidden + +The quick brown fox jumped over the lazy dog's back. + +This page is hidden diff --git a/tests/TestPages/hidden_page_markdown.md b/tests/TestPages/hidden_page_markdown.md new file mode 100644 index 00000000..1e532fe7 --- /dev/null +++ b/tests/TestPages/hidden_page_markdown.md @@ -0,0 +1,12 @@ +title: This is a markdown test hidden page +status: hidden + +Test Markdown File Header +========================= + +Used for pelican test +--------------------- + +The quick brown fox jumped over the lazy dog's back. + +This page is hidden diff --git a/tests/TestPages/page.rst b/tests/TestPages/page.rst new file mode 100644 index 00000000..2d13976d --- /dev/null +++ b/tests/TestPages/page.rst @@ -0,0 +1,4 @@ +This is a test page +################### + +The quick brown fox jumped over the lazy dog's back. diff --git a/tests/TestPages/page_markdown.md b/tests/TestPages/page_markdown.md new file mode 100644 index 00000000..d5416a6f --- /dev/null +++ b/tests/TestPages/page_markdown.md @@ -0,0 +1,9 @@ +title: This is a markdown test page + +Test Markdown File Header +========================= + +Used for pelican test +--------------------- + +The quick brown fox jumped over the lazy dog's back. diff --git a/tests/test_generators.py b/tests/test_generators.py index e62551fa..cc84c80f 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -4,7 +4,7 @@ from mock import MagicMock import os import re -from pelican.generators import ArticlesGenerator, LessCSSGenerator +from pelican.generators import ArticlesGenerator, LessCSSGenerator, PagesGenerator from pelican.settings import _DEFAULT_CONFIG from .support import unittest, temporary_folder, skipIfNoExecutable @@ -94,6 +94,48 @@ class TestArticlesGenerator(unittest.TestCase): write.assert_called_count == 0 +class TestPageGenerator(unittest.TestCase): + """ + Every time you want to test for a new field; + Make sure the test pages in "TestPages" have all the fields + Add it to distilled in distill_pages_for_test + Then update the assertItemsEqual in test_generate_context to match expected + """ + + def distill_pages_for_test(self, pages): + distilled = [] + for page in pages: + distilled.append([ + page.title, + page.status + ] + ) + return distilled + + def test_generate_context(self): + settings = _DEFAULT_CONFIG.copy() + + settings['PAGE_DIR'] = 'TestPages' + generator = PagesGenerator(settings.copy(), settings, CUR_DIR, + _DEFAULT_CONFIG['THEME'], None, + _DEFAULT_CONFIG['MARKUP']) + generator.generate_context() + pages = self.distill_pages_for_test(generator.pages) + hidden_pages = self.distill_pages_for_test(generator.hidden_pages) + + pages_expected = [ + [u'This is a test page', 'published'], + [u'This is a markdown test page', 'published'] + ] + hidden_pages_expected = [ + [u'This is a test hidden page', 'hidden'], + [u'This is a markdown test hidden page', 'hidden'] + ] + + self.assertItemsEqual(pages_expected,pages) + self.assertItemsEqual(hidden_pages_expected,hidden_pages) + + class TestLessCSSGenerator(unittest.TestCase): LESS_CONTENT = """ From d589450200c1ce9e14eefad63dc099767af64ada Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 4 Jul 2012 12:32:20 -0700 Subject: [PATCH 0295/2344] Change behavior of DELETE_OUTPUT_DIRECTORY to purge contents of the directory, not the directory itself. Added Debug level logging for each deletion Added error level logging when a delete has an exception Built a test case for clean_output_directory in tests.utils.py Updated `settings` in documentation to reflect new behavior Removed the tip from the bottom of getting started since this setting should no longer break web servers pointing to the output directory. --- docs/getting_started.rst | 2 -- docs/settings.rst | 4 ++-- pelican/utils.py | 20 ++++++++++++++++---- tests/test_utils.py | 11 +++++++++++ 4 files changed, 29 insertions(+), 8 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index cd186a1c..a0975bd5 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -234,5 +234,3 @@ Or run a simple web server using Python:: cd output && python -m SimpleHTTPServer -(Tip: If using the latter method in conjunction with the auto-reload feature, -ensure that ``DELETE_OUTPUT_DIRECTORY`` is set to ``False`` in your settings file.) diff --git a/docs/settings.rst b/docs/settings.rst index 65561d5d..c5aa7f4e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -37,8 +37,8 @@ Setting name (default value) What doe timestamp information (mtime) if it can't get date information from the metadata. `JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. -`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as - the generated files. +`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the contents of the output directory before + generating new files. `LOCALE` (''[#]_) Change the locale. A list of locales can be provided here or a single string representing one locale. When providing a list, all the locales will be tried diff --git a/pelican/utils.py b/pelican/utils.py index 0940bf72..a1c40077 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -92,10 +92,22 @@ def clean_output_dir(path): """Remove all the files from the output directory""" # remove all the existing content from the output folder - try: - shutil.rmtree(path) - except Exception: - pass + for filename in os.listdir(path): + file = os.path.join(path, filename) + if os.path.isdir(file): + logger.debug("Deleting directory %s" % file) + try: + shutil.rmtree(file) + except Exception, e: + logger.error("Unable to delete directory %s; %e" % file, e) + elif os.path.isfile(file) or os.path.islink(file): + logger.debug("Deleting file/link %s" % file) + try: + os.remove(file) + except Exception, e: + logger.error("Unable to delete file %s; %e" % file, e) + else: + logger.error("Unable to delete %s, file type unknown" % file) def get_relative_path(filename): diff --git a/tests/test_utils.py b/tests/test_utils.py index e738e295..d2f44131 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -1,4 +1,5 @@ # -*- coding: utf-8 -*- +import shutil import os import datetime import time @@ -86,3 +87,13 @@ class TestUtils(unittest.TestCase): changed = utils.files_changed(path, 'rst') self.assertEquals(changed, True) self.assertAlmostEqual(utils.LAST_MTIME, t, delta=1) + + def test_clean_output_dir(self): + test_directory = os.path.join(os.path.dirname(__file__), 'clean_output') + content = os.path.join(os.path.dirname(__file__), 'content') + shutil.copytree(content, test_directory) + utils.clean_output_dir(test_directory) + self.assertTrue(os.path.isdir(test_directory)) + self.assertListEqual([], os.listdir(test_directory)) + shutil.rmtree(test_directory) + From 2b062ce384c5e75e4af0d137351d97aea8c5ed39 Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 4 Jul 2012 14:55:39 -0700 Subject: [PATCH 0296/2344] Documentation typo --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index c5aa7f4e..78ede790 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -37,7 +37,7 @@ Setting name (default value) What doe timestamp information (mtime) if it can't get date information from the metadata. `JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. -`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the contents of the output directory before +`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the content of the output directory before generating new files. `LOCALE` (''[#]_) Change the locale. A list of locales can be provided here or a single string representing one locale. From c07821e8a210c70eef91067223cebe388481ad71 Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 4 Jul 2012 14:56:52 -0700 Subject: [PATCH 0297/2344] Too many empty lines at end of file --- tests/test_utils.py | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/test_utils.py b/tests/test_utils.py index d2f44131..2e3f714b 100644 --- a/tests/test_utils.py +++ b/tests/test_utils.py @@ -96,4 +96,3 @@ class TestUtils(unittest.TestCase): self.assertTrue(os.path.isdir(test_directory)) self.assertListEqual([], os.listdir(test_directory)) shutil.rmtree(test_directory) - From b44ea53741f7baab89371718c9a7eba07010bb91 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Thu, 5 Jul 2012 00:04:32 +0200 Subject: [PATCH 0298/2344] update command to generate functional tests output we need to force LC_ALL="C" to avoid generating articles/pages in other languages --- docs/contribute.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index 3960b3f9..0090dd07 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -43,9 +43,9 @@ If you have made changes that affect the output of a pelican generated weblog, then you should update the output used by functional tests. To do so, you can use the 2 following commands:: - $ pelican -o tests/output/custom/ -s samples/pelican.conf.py \ + $ LC_ALL="C" pelican -o tests/output/custom/ -s samples/pelican.conf.py \ samples/content/ - $ USER="Dummy Author" pelican -o tests/output/basic/ samples/content/ + $ LC_ALL="C" USER="Dummy Author" pelican -o tests/output/basic/ samples/content/ Coding standards ================ From 36be150f200c009d334d525a9fbeba59c3aa2d11 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Thu, 5 Jul 2012 00:07:01 +0200 Subject: [PATCH 0299/2344] replace FALLBACK_ON_FS_DATE by DEFAULT_DATE DEFAULT_DATE allows to specify any default date as a tuple in addition to the fallback on filesystem mtime check --- pelican/generators.py | 8 ++++++-- pelican/settings.py | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index ede948a4..dd5eb89e 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -268,9 +268,13 @@ class ArticlesGenerator(Generator): if category != '': metadata['category'] = Category(category, self.settings) - if 'date' not in metadata and self.settings['FALLBACK_ON_FS_DATE']: + if 'date' not in metadata and self.settings['DEFAULT_DATE']: + if self.settings['DEFAULT_DATE'] == 'fs': metadata['date'] = datetime.datetime.fromtimestamp( - os.stat(f).st_ctime) + os.stat(f).st_ctime) + else: + metadata['date'] = datetime.datetime( + *self.settings['DEFAULT_DATE']) article = Article(content, metadata, settings=self.settings, filename=f) diff --git a/pelican/settings.py b/pelican/settings.py index 4da66989..08b01133 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -29,7 +29,7 @@ _DEFAULT_CONFIG = {'PATH': '.', 'DISPLAY_PAGES_ON_MENU': True, 'PDF_GENERATOR': False, 'DEFAULT_CATEGORY': 'misc', - 'FALLBACK_ON_FS_DATE': True, + 'DEFAULT_DATE': 'fs', 'WITH_FUTURE_DATES': True, 'CSS_FILE': 'main.css', 'REVERSE_ARCHIVE_ORDER': False, From 775b236c934afab3df47b16c51806d1061c91a54 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Thu, 5 Jul 2012 00:08:54 +0200 Subject: [PATCH 0300/2344] update doc for replacing FALLBACK_ON_FS_DATE by DEFAULT_DATE --- docs/fr/configuration.rst | 8 ++++++-- docs/settings.rst | 6 +++++- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/docs/fr/configuration.rst b/docs/fr/configuration.rst index 695a0b0e..7dffd8ab 100644 --- a/docs/fr/configuration.rst +++ b/docs/fr/configuration.rst @@ -130,8 +130,12 @@ Pelican est fournit avec :doc:`pelican-themes`, un script permettant de gérer l Paramètres divers ================= -FALLBACK_ON_FS_DATE : - Si *True*, Pelican se basera sur le *mtime* du fichier s'il n'y a pas de date spécifiée dans le fichier de l'article ; +DEFAULT_DATE: + Date par défaut à utiliser si l'information de date n'est pas spécifiée + dans les metadonnées de l'article. + Si 'fs', Pelican se basera sur le *mtime* du fichier. + Si c'est un tuple, il sera passé au constructeur datetime.datetime pour + générer l'objet datetime utilisé par défaut. KEEP_OUTPUT DIRECTORY : Ne génère que les fichiers modifiés et n'efface pas le repertoire de sortie ; diff --git a/docs/settings.rst b/docs/settings.rst index 85e9f0c3..199faefe 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -33,9 +33,13 @@ Setting name (default value) What doe `DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the template. Templates may or not honor this setting. -`FALLBACK_ON_FS_DATE` (``True``) If True, Pelican will use the file system +`DEFAULT_DATE` (``fs``) The default date you want to use. + If 'fs', Pelican will use the file system timestamp information (mtime) if it can't get date information from the metadata. + If tuple object, it will instead generate the + default datetime object by passing the tuple to + the datetime.datetime constructor. `JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. `DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory as well as the generated files. From 3a2df479da5890716e3730716565eeb54a34df02 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Thu, 5 Jul 2012 00:10:08 +0200 Subject: [PATCH 0301/2344] fix test_custom_generation_works functional test --- samples/pelican.conf.py | 1 + 1 file changed, 1 insertion(+) diff --git a/samples/pelican.conf.py b/samples/pelican.conf.py index fffbf1a8..e55e0c0b 100755 --- a/samples/pelican.conf.py +++ b/samples/pelican.conf.py @@ -10,6 +10,7 @@ PDF_GENERATOR = False REVERSE_CATEGORY_ORDER = True LOCALE = "C" DEFAULT_PAGINATION = 4 +DEFAULT_DATE = (2012, 03, 02, 14, 01, 01) FEED_RSS = 'feeds/all.rss.xml' CATEGORY_FEED_RSS = 'feeds/%s.rss.xml' From 7abb2a7a7ce519b4d7e9865aa9e130ad287073f0 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Thu, 5 Jul 2012 00:11:06 +0200 Subject: [PATCH 0302/2344] temporary skip failing test_basic_generation_works functional test --- tests/test_pelican.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_pelican.py b/tests/test_pelican.py index 0458d58c..15088ed0 100644 --- a/tests/test_pelican.py +++ b/tests/test_pelican.py @@ -35,6 +35,7 @@ class TestPelican(unittest.TestCase): rmtree(self.temp_path) locale.setlocale(locale.LC_ALL, self.old_locale) + @unittest.skip("Test failing") def test_basic_generation_works(self): # when running pelican without settings, it should pick up the default # ones and generate the output without raising any exception / issuing From 4427424db39c95890a30d2a6293d129002e2dc04 Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 4 Jul 2012 15:20:15 -0700 Subject: [PATCH 0303/2344] Changed debugging reporting to post file deletion instead of pre file deletion per request. --- pelican/utils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index a1c40077..f0f742db 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -95,15 +95,15 @@ def clean_output_dir(path): for filename in os.listdir(path): file = os.path.join(path, filename) if os.path.isdir(file): - logger.debug("Deleting directory %s" % file) try: shutil.rmtree(file) + logger.debug("Deleted directory %s" % file) except Exception, e: logger.error("Unable to delete directory %s; %e" % file, e) elif os.path.isfile(file) or os.path.islink(file): - logger.debug("Deleting file/link %s" % file) try: os.remove(file) + logger.debug("Deleted file/link %s" % file) except Exception, e: logger.error("Unable to delete file %s; %e" % file, e) else: From 2b47429c4a6c1a6cc42421b27a237dbf1dd07cd8 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Thu, 5 Jul 2012 01:51:58 +0200 Subject: [PATCH 0304/2344] update generated output for 'custom' functional test LC_ALL="C" pelican -o tests/output/custom/ -s samples/pelican.conf.py samples/content/ --- .../custom/a-markdown-powered-article.html | 2 +- tests/output/custom/archives.html | 2 +- tests/output/custom/article-1.html | 2 +- tests/output/custom/article-2.html | 2 +- tests/output/custom/article-3.html | 2 +- .../custom/author/alexis-metaireau.html | 20 +-- .../custom/author/alexis-metaireau2.html | 27 ++-- tests/output/custom/categories.html | 4 +- tests/output/custom/category/bar.html | 4 +- tests/output/custom/category/cat1.html | 20 +-- .../category/{content.html => misc.html} | 18 +-- tests/output/custom/category/yeah.html | 4 +- .../output/custom/drafts/a-draft-article.html | 4 +- .../feeds/{content.atom.xml => misc.atom.xml} | 2 +- .../feeds/{content.rss.xml => misc.rss.xml} | 2 +- tests/output/custom/index.html | 22 +-- tests/output/custom/index2.html | 25 ++-- tests/output/custom/oh-yeah-fr.html | 4 +- tests/output/custom/oh-yeah.html | 2 +- .../pages/this-is-a-test-hidden-page.html | 125 ++++++++++++++++++ .../custom/pages/this-is-a-test-page.html | 2 +- tests/output/custom/second-article-fr.html | 4 +- tests/output/custom/second-article.html | 4 +- tests/output/custom/tag/bar.html | 24 ++-- tests/output/custom/tag/baz.html | 16 +-- tests/output/custom/tag/foo.html | 20 +-- tests/output/custom/tag/foobar.html | 4 +- tests/output/custom/tag/oh.html | 4 +- tests/output/custom/tag/yeah.html | 4 +- tests/output/custom/theme/css/main.css | 1 + .../custom/theme/images/icons/gitorious.png | Bin 0 -> 3675 bytes .../custom/this-is-a-super-article.html | 2 +- tests/output/custom/unbelievable.html | 4 +- 33 files changed, 255 insertions(+), 127 deletions(-) rename tests/output/custom/category/{content.html => misc.html} (94%) rename tests/output/custom/feeds/{content.atom.xml => misc.atom.xml} (56%) rename tests/output/custom/feeds/{content.rss.xml => misc.rss.xml} (76%) create mode 100644 tests/output/custom/pages/this-is-a-test-hidden-page.html create mode 100644 tests/output/custom/theme/images/icons/gitorious.png diff --git a/tests/output/custom/a-markdown-powered-article.html b/tests/output/custom/a-markdown-powered-article.html index 28486691..d3d0f53c 100644 --- a/tests/output/custom/a-markdown-powered-article.html +++ b/tests/output/custom/a-markdown-powered-article.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/archives.html b/tests/output/custom/archives.html index 083e6ada..3be563df 100644 --- a/tests/output/custom/archives.html +++ b/tests/output/custom/archives.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/article-1.html b/tests/output/custom/article-1.html index b7c0f46f..4402d227 100644 --- a/tests/output/custom/article-1.html +++ b/tests/output/custom/article-1.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/article-2.html b/tests/output/custom/article-2.html index e60d8077..ec6a86c8 100644 --- a/tests/output/custom/article-2.html +++ b/tests/output/custom/article-2.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/article-3.html b/tests/output/custom/article-3.html index b79c25f0..0d39654c 100644 --- a/tests/output/custom/article-3.html +++ b/tests/output/custom/article-3.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/author/alexis-metaireau.html b/tests/output/custom/author/alexis-metaireau.html index 85f550b4..b60a01ef 100644 --- a/tests/output/custom/author/alexis-metaireau.html +++ b/tests/output/custom/author/alexis-metaireau.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -85,7 +85,6 @@ - @@ -93,7 +92,8 @@
  • - @@ -128,7 +127,8 @@
  • - @@ -163,7 +162,8 @@
  • + +

    Page 1 / 2 @@ -199,9 +201,7 @@

    - - - +
    diff --git a/tests/output/custom/author/alexis-metaireau2.html b/tests/output/custom/author/alexis-metaireau2.html index 53fec2e5..cbf4387b 100644 --- a/tests/output/custom/author/alexis-metaireau2.html +++ b/tests/output/custom/author/alexis-metaireau2.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -61,7 +61,8 @@
  • - @@ -106,7 +106,8 @@ YEAH !

  • - @@ -146,7 +146,8 @@ Translations:
  • - @@ -182,7 +182,8 @@ as well as inline markup.

  • + +

    @@ -220,9 +223,7 @@ as well as inline markup.

    - - - +
    diff --git a/tests/output/custom/categories.html b/tests/output/custom/categories.html index 95e8c1f3..74f1c16b 100644 --- a/tests/output/custom/categories.html +++ b/tests/output/custom/categories.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -54,7 +54,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/category/bar.html b/tests/output/custom/category/bar.html index 53af38da..7860bd15 100644 --- a/tests/output/custom/category/bar.html +++ b/tests/output/custom/category/bar.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -99,8 +99,8 @@ YEAH !

    - +
    diff --git a/tests/output/custom/category/cat1.html b/tests/output/custom/category/cat1.html index 94bb74a7..b01c1ad6 100644 --- a/tests/output/custom/category/cat1.html +++ b/tests/output/custom/category/cat1.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -85,7 +85,6 @@ - @@ -93,7 +92,8 @@
  • - @@ -128,7 +127,8 @@
  • - @@ -163,7 +162,8 @@
  • + +

    Page 1 / 1

    - - - +
    diff --git a/tests/output/custom/category/content.html b/tests/output/custom/category/misc.html similarity index 94% rename from tests/output/custom/category/content.html rename to tests/output/custom/category/misc.html index 7645d430..0161b441 100644 --- a/tests/output/custom/category/content.html +++ b/tests/output/custom/category/misc.html @@ -1,7 +1,7 @@ - Alexis' log - content + Alexis' log - misc @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -68,7 +68,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    tags: foobarbaz

    @@ -91,7 +91,6 @@ Translations: - @@ -99,7 +98,8 @@ Translations:
  • + +

    Page 1 / 1

    - - - +
    diff --git a/tests/output/custom/category/yeah.html b/tests/output/custom/category/yeah.html index dc20affb..27e929c4 100644 --- a/tests/output/custom/category/yeah.html +++ b/tests/output/custom/category/yeah.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -100,8 +100,8 @@ - +
    diff --git a/tests/output/custom/drafts/a-draft-article.html b/tests/output/custom/drafts/a-draft-article.html index 659a61b9..35264ed6 100644 --- a/tests/output/custom/drafts/a-draft-article.html +++ b/tests/output/custom/drafts/a-draft-article.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -70,7 +70,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    diff --git a/tests/output/custom/feeds/content.atom.xml b/tests/output/custom/feeds/misc.atom.xml similarity index 56% rename from tests/output/custom/feeds/content.atom.xml rename to tests/output/custom/feeds/misc.atom.xml index 52bbf194..cce84da9 100644 --- a/tests/output/custom/feeds/content.atom.xml +++ b/tests/output/custom/feeds/misc.atom.xml @@ -1,4 +1,4 @@ -Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> \ No newline at end of file diff --git a/tests/output/custom/feeds/content.rss.xml b/tests/output/custom/feeds/misc.rss.xml similarity index 76% rename from tests/output/custom/feeds/content.rss.xml rename to tests/output/custom/feeds/misc.rss.xml index dcacd17f..938bce29 100644 --- a/tests/output/custom/feeds/content.rss.xml +++ b/tests/output/custom/feeds/misc.rss.xml @@ -1,4 +1,4 @@ -Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.html \ No newline at end of file diff --git a/tests/output/custom/index.html b/tests/output/custom/index.html index ae77c625..79882019 100644 --- a/tests/output/custom/index.html +++ b/tests/output/custom/index.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -68,7 +68,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    tags: foobarbaz

    @@ -91,7 +91,6 @@ Translations: - @@ -99,7 +98,8 @@ Translations:
  • - @@ -133,7 +132,8 @@ Translations:
  • - @@ -168,7 +167,8 @@ Translations:
  • + +

    Page 1 / 2 @@ -204,9 +206,7 @@ Translations:

    - - - +
    diff --git a/tests/output/custom/index2.html b/tests/output/custom/index2.html index 797217ad..d6079fd9 100644 --- a/tests/output/custom/index2.html +++ b/tests/output/custom/index2.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -61,7 +61,8 @@
  • - @@ -96,7 +96,8 @@
  • - @@ -132,7 +132,8 @@ as well as inline markup.

  • - @@ -177,7 +177,8 @@ YEAH !

  • + +

    @@ -215,9 +218,7 @@ YEAH !

    - - - +
    diff --git a/tests/output/custom/oh-yeah-fr.html b/tests/output/custom/oh-yeah-fr.html index be931a60..25f67032 100644 --- a/tests/output/custom/oh-yeah-fr.html +++ b/tests/output/custom/oh-yeah-fr.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -70,7 +70,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    diff --git a/tests/output/custom/oh-yeah.html b/tests/output/custom/oh-yeah.html index 4f3f1020..fc635dc7 100644 --- a/tests/output/custom/oh-yeah.html +++ b/tests/output/custom/oh-yeah.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/pages/this-is-a-test-hidden-page.html b/tests/output/custom/pages/this-is-a-test-hidden-page.html new file mode 100644 index 00000000..b5eca671 --- /dev/null +++ b/tests/output/custom/pages/this-is-a-test-hidden-page.html @@ -0,0 +1,125 @@ + + + + This is a test hidden page + + + + + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + +
    +

    This is a test hidden page

    + +

    This is great for things like error(404) pages +Anyone can see this page but it's not linked to anywhere!

    + +
    + +
    + +
    +

    blogroll

    + +
    + + + + +
    + + + + + + + + + + \ No newline at end of file diff --git a/tests/output/custom/pages/this-is-a-test-page.html b/tests/output/custom/pages/this-is-a-test-page.html index f176e761..85161430 100644 --- a/tests/output/custom/pages/this-is-a-test-page.html +++ b/tests/output/custom/pages/this-is-a-test-page.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/second-article-fr.html b/tests/output/custom/second-article-fr.html index e386af38..9ed39cec 100644 --- a/tests/output/custom/second-article-fr.html +++ b/tests/output/custom/second-article-fr.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -70,7 +70,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    tags: foobarbaz

    diff --git a/tests/output/custom/second-article.html b/tests/output/custom/second-article.html index 003ebae0..93e421fb 100644 --- a/tests/output/custom/second-article.html +++ b/tests/output/custom/second-article.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -70,7 +70,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    tags: foobarbaz

    diff --git a/tests/output/custom/tag/bar.html b/tests/output/custom/tag/bar.html index 5d6237cd..74cdb11d 100644 --- a/tests/output/custom/tag/bar.html +++ b/tests/output/custom/tag/bar.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -68,7 +68,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    tags: foobarbaz

    @@ -91,7 +91,6 @@ Translations: - @@ -99,7 +98,8 @@ Translations:
  • - @@ -139,7 +138,8 @@ Translations:
  • - @@ -175,7 +174,8 @@ as well as inline markup.

  • + +

    Page 1 / 1

    - - - +
    diff --git a/tests/output/custom/tag/baz.html b/tests/output/custom/tag/baz.html index e1be3d77..ee0a0728 100644 --- a/tests/output/custom/tag/baz.html +++ b/tests/output/custom/tag/baz.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -68,7 +68,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    tags: foobarbaz

    @@ -91,7 +91,6 @@ Translations: - @@ -99,7 +98,8 @@ Translations:
  • + +

    Page 1 / 1

    - - - +
    diff --git a/tests/output/custom/tag/foo.html b/tests/output/custom/tag/foo.html index 3beabbb1..dfbcb68b 100644 --- a/tests/output/custom/tag/foo.html +++ b/tests/output/custom/tag/foo.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -68,7 +68,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    tags: foobarbaz

    @@ -91,7 +91,6 @@ Translations: - @@ -99,7 +98,8 @@ Translations:
  • - @@ -139,7 +138,8 @@ Translations:
  • + +

    Page 1 / 1

    - - - +
    diff --git a/tests/output/custom/tag/foobar.html b/tests/output/custom/tag/foobar.html index 2da611ed..d14a9c71 100644 --- a/tests/output/custom/tag/foobar.html +++ b/tests/output/custom/tag/foobar.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -100,8 +100,8 @@ - +
    diff --git a/tests/output/custom/tag/oh.html b/tests/output/custom/tag/oh.html index 73db4505..abc98868 100644 --- a/tests/output/custom/tag/oh.html +++ b/tests/output/custom/tag/oh.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -99,8 +99,8 @@ YEAH !

    - +
    diff --git a/tests/output/custom/tag/yeah.html b/tests/output/custom/tag/yeah.html index f72400a6..199adbe0 100644 --- a/tests/output/custom/tag/yeah.html +++ b/tests/output/custom/tag/yeah.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -99,8 +99,8 @@ YEAH !

    - +
    diff --git a/tests/output/custom/theme/css/main.css b/tests/output/custom/theme/css/main.css index 92905076..dce9e247 100644 --- a/tests/output/custom/theme/css/main.css +++ b/tests/output/custom/theme/css/main.css @@ -312,6 +312,7 @@ img.left, figure.left {float: right; margin: 0 0 2em 2em;} .social a[type$='atom+xml'], .social a[type$='rss+xml'] {background-image: url('../images/icons/rss.png');} .social a[href*='twitter.com'] {background-image: url('../images/icons/twitter.png');} .social a[href*='linkedin.com'] {background-image: url('../images/icons/linkedin.png');} + .social a[href*='gitorious.org'] {background-image: url('../images/icons/gitorious.org');} /* About diff --git a/tests/output/custom/theme/images/icons/gitorious.png b/tests/output/custom/theme/images/icons/gitorious.png new file mode 100644 index 0000000000000000000000000000000000000000..6485f5ecc5f6047a052d9adfb686ee154e7233af GIT binary patch literal 3675 zcmeH}_cs;(AIIM!du1jmd)(}q&As*>mwP2~txFP0S<$suA0ydaQQ0fx>V~qnD`Z|H zDsM1YRfBtf8PhSR$Jg1$Z#Z(m^oWl9R>38%Fr zV-o!|&8oo5l;~FpNdreqVXu59TS#ArPa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S+w#gTy!(jfnCHgV1*rl@=B$eBui4CZnPz6+GA-J_-9GrGPn5|X z7AH1G<6!t#A2r^!c$D@NhSjyS)ZyLH9p12(Uy9!+h>k6!6RrLa zL^}#Q^9j!hk0axw29kD7V#UT`){(DMwS{lMb}!`^iFJrNNaR*b0PHDka(5lxuS+ch{+zj-+Oi=YCHqIJMsjZi4BjC{ypbHe2EKN zcOxv`X7T&+o;7f3OrM;*uHK?fxVif-aJQbg#*TQ0$g5Rz_T3EJ)Hux;x9n|x-kev1 zzv+YD32ki*^CWHX7N`*B_gh1La*-z|3RE@cTlYf!NZq7^MXvdXdtxVq!RDDDv7PD` z%NFN-oo(G2*nIqiw&UsC^pCm6x7&gW_eSRoNz}2?Bd6&HsVuPbsky0xaZGVr1=qDy zRhPBzoopPJ!baRjL<_i2U!D%uaC6B-98PRa5k_-Hi?VmKGd}u0Dn8k4+v2Gu_H^`I z`OqJ%Aa`ru{%E^BXfBBF$E!sa%hgBxkHyJezv~WcKb0P3@ML6=sVH;yj@=Zbh-ZD1 z-_6Lz9Dq;}05H)2{3f6I1^^Fa0oZf_KrIIVZoj9_-39ZfDh7YjeuipAOblqHnRd;pX1guKpVP^?KjrDZl!Lxy>?erb8ta^(jygszj+vLaYB8AoV>@2=0&gbIyeah -
  • content
  • +
  • misc
  • cat1
  • diff --git a/tests/output/custom/unbelievable.html b/tests/output/custom/unbelievable.html index 4d18012a..83eed167 100644 --- a/tests/output/custom/unbelievable.html +++ b/tests/output/custom/unbelievable.html @@ -41,7 +41,7 @@
  • yeah
  • -
  • content
  • +
  • misc
  • cat1
  • @@ -70,7 +70,7 @@ By Alexis Métaireau -

    In content.

    +

    In misc.

    From 886a1d94b957ac4f79b2a40a0438f69b1bf1ce5c Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Wed, 4 Jul 2012 17:09:42 -0700 Subject: [PATCH 0305/2344] Changed name of the page helper method to prevent nose from running it as a test --- tests/test_generators.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/test_generators.py b/tests/test_generators.py index cc84c80f..61f31696 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -98,11 +98,11 @@ class TestPageGenerator(unittest.TestCase): """ Every time you want to test for a new field; Make sure the test pages in "TestPages" have all the fields - Add it to distilled in distill_pages_for_test + Add it to distilled in distill_pages Then update the assertItemsEqual in test_generate_context to match expected """ - def distill_pages_for_test(self, pages): + def distill_pages(self, pages): distilled = [] for page in pages: distilled.append([ @@ -120,8 +120,8 @@ class TestPageGenerator(unittest.TestCase): _DEFAULT_CONFIG['THEME'], None, _DEFAULT_CONFIG['MARKUP']) generator.generate_context() - pages = self.distill_pages_for_test(generator.pages) - hidden_pages = self.distill_pages_for_test(generator.hidden_pages) + pages = self.distill_pages(generator.pages) + hidden_pages = self.distill_pages(generator.hidden_pages) pages_expected = [ [u'This is a test page', 'published'], From 72421d443844e8bf7e79d76baa8766d0a7a59c8a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 5 Jul 2012 11:34:45 -0700 Subject: [PATCH 0306/2344] Support arbitrary SSH ports in pelican-quickstart Some folks choose non-standard SSH ports for security reasons, so it makes sense to try to support that in the pelican-quickstart script. --- pelican/tools/pelican_quickstart.py | 2 ++ pelican/tools/templates/Makefile.in | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index cfd9bb4c..b5da8926 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -19,6 +19,7 @@ CONF = { 'ftp_user': 'anonymous', 'ftp_target_dir': '/', 'ssh_host': 'locahost', + 'ssh_port': 22, 'ssh_user': 'root', 'ssh_target_dir': '/var/www', 'dropbox_dir' : '~/Dropbox/Public/', @@ -159,6 +160,7 @@ Please answer the following questions so this script can generate the files need if ask('Do you want to upload your website using SSH ?', answer=bool, default=False): CONF['ssh_host'] = ask('What is the hostname of your SSH server ?', str, CONF['ssh_host']) + CONF['ssh_port'] = ask('What is the port of your SSH server?', int, CONF['ssh_port']) CONF['ssh_user'] = ask('What is your username on this server ?', str, CONF['ssh_user']) CONF['ssh_target_dir'] = ask('Where do you want to put your website on this server ?', str, CONF['ssh_target_dir']) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index 998d8c97..392336d7 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -11,6 +11,7 @@ FTP_USER=$ftp_user FTP_TARGET_DIR=$ftp_target_dir SSH_HOST=$ssh_host +SSH_PORT=$ssh_port SSH_USER=$ssh_user SSH_TARGET_DIR=$ssh_target_dir @@ -43,10 +44,10 @@ dropbox_upload: $$(OUTPUTDIR)/index.html cp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) ssh_upload: $$(OUTPUTDIR)/index.html - scp -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) + scp -P $$(SSH_PORT) -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) rsync_upload: $$(OUTPUTDIR)/index.html - rsync -e ssh -P -rvz --delete $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) + rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) ftp_upload: $$(OUTPUTDIR)/index.html lftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" From d8b85580dc8eb32a718a1e7331b47c4c26061bf0 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 5 Jul 2012 12:15:55 -0700 Subject: [PATCH 0307/2344] Minor syntactical improvements to quickstart --- pelican/tools/pelican_quickstart.py | 30 ++++++++++------------ pelican/tools/templates/pelican.conf.py.in | 2 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index b5da8926..0e713fe8 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -18,7 +18,7 @@ CONF = { 'ftp_host': 'localhost', 'ftp_user': 'anonymous', 'ftp_target_dir': '/', - 'ssh_host': 'locahost', + 'ssh_host': 'localhost', 'ssh_port': 22, 'ssh_user': 'root', 'ssh_target_dir': '/var/www', @@ -89,7 +89,7 @@ def ask(question, answer=str, default=None, l=None): r = default break else: - print("You must answer `yes' or `no'") + print("You must answer 'yes' or 'no'") return r elif answer == int: r = None @@ -112,12 +112,12 @@ def ask(question, answer=str, default=None, l=None): print('You must enter an integer') return r else: - raise NotImplemented('Arguent `answer` must be str, bool or integer') + raise NotImplemented('Argument `answer` must be str, bool, or integer') def main(): parser = argparse.ArgumentParser( - description="A kickstarter for pelican", + description="A kickstarter for Pelican", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('-p', '--path', default=".", help="The path to generate the blog into") @@ -126,7 +126,7 @@ def main(): parser.add_argument('-a', '--author', metavar="author", help='Set the author name of the website') parser.add_argument('-l', '--lang', metavar="lang", - help='Set the default lang of the website') + help='Set the default web site language') args = parser.parse_args() @@ -138,15 +138,15 @@ Please answer the following questions so this script can generate the files need '''.format(v=__version__)) - CONF['basedir'] = os.path.abspath(ask('Where do you want to create your new Web site ?', answer=str, default=args.path)) - CONF['sitename'] = ask('What will be the title of this Web site ?', answer=str, default=args.title) - CONF['author'] = ask('Who will be the author of this Web site ?', answer=str, default=args.author) - CONF['lang'] = ask('What will be the default language of this Web site ?', str, args.lang or CONF['lang'], 2) + CONF['basedir'] = os.path.abspath(ask('Where do you want to create your new web site?', answer=str, default=args.path)) + CONF['sitename'] = ask('What will be the title of this web site?', answer=str, default=args.title) + CONF['author'] = ask('Who will be the author of this web site?', answer=str, default=args.author) + CONF['lang'] = ask('What will be the default language of this web site ?', str, args.lang or CONF['lang'], 2) CONF['with_pagination'] = ask('Do you want to enable article pagination ?', bool, bool(CONF['default_pagination'])) if CONF['with_pagination']: - CONF['default_pagination'] = ask('So how many articles per page do you want ?', int, CONF['default_pagination']) + CONF['default_pagination'] = ask('How many articles per page do you want?', int, CONF['default_pagination']) else: CONF['default_pagination'] = False @@ -155,15 +155,13 @@ Please answer the following questions so this script can generate the files need if mkfile: if ask('Do you want to upload your website using FTP ?', answer=bool, default=False): CONF['ftp_host'] = ask('What is the hostname of your FTP server ?', str, CONF['ftp_host']) - CONF['ftp_user'] = ask('What is your username on this server ?', str, CONF['ftp_user']) - CONF['ftp_target_dir'] = ask('Where do you want to put your website on this server ?', str, CONF['ftp_target_dir']) - + CONF['ftp_user'] = ask('What is your username on that server?', str, CONF['ftp_user']) + CONF['ftp_target_dir'] = ask('Where do you want to put your web site on that server?', str, CONF['ftp_target_dir']) if ask('Do you want to upload your website using SSH ?', answer=bool, default=False): CONF['ssh_host'] = ask('What is the hostname of your SSH server ?', str, CONF['ssh_host']) CONF['ssh_port'] = ask('What is the port of your SSH server?', int, CONF['ssh_port']) - CONF['ssh_user'] = ask('What is your username on this server ?', str, CONF['ssh_user']) - CONF['ssh_target_dir'] = ask('Where do you want to put your website on this server ?', str, CONF['ssh_target_dir']) - + CONF['ssh_user'] = ask('What is your username on that server?', str, CONF['ssh_user']) + CONF['ssh_target_dir'] = ask('Where do you want to put your web site on that server?', str, CONF['ssh_target_dir']) if ask('Do you want to upload your website using Dropbox ?', answer=bool, default=False): CONF['dropbox_dir'] = ask('Where is your Dropbox directory ?', str, CONF['dropbox_dir']) diff --git a/pelican/tools/templates/pelican.conf.py.in b/pelican/tools/templates/pelican.conf.py.in index ee56048e..095a7e7d 100644 --- a/pelican/tools/templates/pelican.conf.py.in +++ b/pelican/tools/templates/pelican.conf.py.in @@ -3,7 +3,7 @@ AUTHOR = u"$author" SITENAME = u"$sitename" -SITEURL = '/' +SITEURL = '' TIMEZONE = 'Europe/Paris' From 764a2cfa5100d1cd70699e33d328c1203e201a00 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 7 Jul 2012 07:41:12 -0700 Subject: [PATCH 0308/2344] Add dual dev/publish modes to quickstart script Certain configuration options are more useful in production than they are in development. Some examples might be absolute URLs, external analytics service identifiers, Disqus comments, etc. This version of the quickstart script creates two configuration files: one for development and the other for use when publishing. In addition, the related docs have been expanded considerably. Last but not least, the quickstart script will now detect whether there is a project folder associated with the currently active virtualenv (if any) and use it by default. --- docs/getting_started.rst | 109 +++++++++++++----- docs/settings.rst | 25 ++-- pelican/tools/pelican_quickstart.py | 45 +++++--- pelican/tools/templates/Makefile.in | 38 +++--- .../{pelican.conf.py.in => pelicanconf.py.in} | 0 pelican/tools/templates/publishconf.py.in | 17 +++ 6 files changed, 170 insertions(+), 64 deletions(-) rename pelican/tools/templates/{pelican.conf.py.in => pelicanconf.py.in} (100%) create mode 100644 pelican/tools/templates/publishconf.py.in diff --git a/docs/getting_started.rst b/docs/getting_started.rst index aa04dd03..954dac3d 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -1,15 +1,70 @@ Getting started ############### -Installing -========== +Kickstart a blog +================ -You're ready? Let's go! You can install Pelican via several different methods. +You're ready? Let's go! Following is a brief tutorial for those who want to get +started right away. Subsequent sections below will cover individual topics in +greater detail. To get started, here are some recommended install steps for +Pelican:: + + $ sudo pip install --upgrade virtualenv virtualenvwrapper + $ mkvirtualenv pelican + $ pip install pelican Markdown + $ mkdir ~/code/yoursitename # (where you want your new site code to be saved) + $ cd ~/code/yoursitename + $ setvirtualenvproject + $ pelican-quickstart + +Once you've run that last ``pelican-quickstart`` command, you'll be asked some +questions about your site. Once you finish answering all the questions, you can +begin adding content to the *content* folder that has been created for you. +(See *Writing articles using Pelican* section below for more information +about how to format your content.) Once you have some content to generate, you +can convert it to HTML via the following command:: + + $ make html + +If you'd prefer to have Pelican automatically regenerate your site every time a +change is detected (handy when testing locally), use the following command +instead:: + + $ make regenerate + +To preview the site in your browser, open a new terminal tab and enter:: + + $ workon yoursitename + $ make serve + +Visit http://localhost:8000 in your browser to see your site. + +When you're ready to publish your site, you can upload it via the method(s) you +chose during the ``pelican-quickstart`` questionnaire. For this example, we'll +use rsync over ssh:: + + $ make rsync_upload + +That's it! Your site should now be live. + +Closing the current terminal session will also close the virtual environment in +which we installed Pelican. In the future, when you want to work on your site, +you can activate its virtual environment via:: + + $ workon yoursitename + +Not only will that command activate your new site's virtual environment, but it +will also automatically change your working directory to your site project. + +Installing Pelican +================== + +You can install Pelican via several different methods. The simplest is via `pip `_:: $ pip install pelican -If you don't have pip installed, an alternative method is easy_install:: +If you don't have ``pip`` installed, an alternative method is ``easy_install``:: $ easy_install pelican @@ -18,12 +73,12 @@ a virtual environment for Pelican via `virtualenv `_ and `virtualenvwrapper `_ before installing Pelican:: - $ pip install virtualenvwrapper + $ sudo pip install --upgrade virtualenv virtualenvwrapper $ mkvirtualenv pelican Once the virtual environment has been created and activated, Pelican can be -be installed via pip or easy_install as noted above. Alternatively, if you -have the project source, you can install Pelican using the distutils +be installed via ``pip`` or ``easy_install`` as noted above. Alternatively, if +you have the project source, you can install Pelican using the distutils method:: $ cd path-to-Pelican-source @@ -34,6 +89,11 @@ version of Pelican rather than a stable release, use the following command:: $ pip install -e git://github.com/ametaireau/pelican#egg=pelican +If you plan on using Markdown as a markup format, you'll need to install the +Markdown library as well:: + + $ pip install Markdown + Upgrading --------- @@ -83,7 +143,6 @@ following syntax (give your file the ``.rst`` extension):: :category: yeah :author: Alexis Metaireau - You can also use Markdown syntax (with a file ending in ``.md``). Markdown generation will not work until you explicitly install the ``Markdown`` package, which can be done via ``pip install Markdown``. Metadata syntax for @@ -105,27 +164,28 @@ example, a file located at ``python/foobar/myfoobar.rst`` will have a category o Generate your blog ------------------ -To launch Pelican, just use the ``pelican`` command:: +The ``make`` shortcut commands mentioned in the ``Kickstart a blog`` section +are mostly wrappers around the ``pelican`` command that generates the HTML from +the content. The ``pelican`` command can also be run directly:: $ pelican /path/to/your/content/ [-s path/to/your/settings.py] -And… that's all! Your weblog will be generated and saved in the ``content/`` -folder. +The above command will generate your weblog and save it in the ``content/`` +folder, using the default theme to produce a simple site. It's not +very sexy, as it's just simple HTML output (without any style). You can create +your own style if you want. -The above command will use the default theme to produce a simple site. It's not -very sexy, as it's just simple HTML output (without any style). - -You can create your own style if you want. Have a look at the help to see all -the options you can use:: +Pelican has other command-line switches available. Have a look at the help to +see all the options you can use:: $ pelican --help -Kickstart a blog ----------------- +Auto-reload +----------- -You also can use the ``pelican-quickstart`` script to start a new blog in -seconds by just answering a few questions. Just run ``pelican-quickstart`` and -you're done! (Added in Pelican 3.0) +It's possible to tell Pelican to watch for your modifications, instead of +manually re-running it every time you want to see your changes. To enable this, +run the ``pelican`` command with the ``-r`` or ``--autoreload`` option. Pages ----- @@ -209,13 +269,6 @@ For Markdown, format your code blocks thusly:: The specified identifier should be one that appears on the `list of available lexers `_. -Auto-reload ------------ - -It's possible to tell Pelican to watch for your modifications, instead of -manually re-running it every time you want to see your changes. To enable this, -run the ``pelican`` command with the ``-r`` or ``--autoreload`` option. - Publishing drafts ----------------- diff --git a/docs/settings.rst b/docs/settings.rst index 78ede790..3c557e87 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -59,18 +59,16 @@ Setting name (default value) What doe `PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions of your documents. You will need to install `rst2pdf`. -`RELATIVE_URLS` (``True``) Defines whether Pelican should use relative URLs or - not. +`RELATIVE_URLS` (``True``) Defines whether Pelican should use document-relative URLs or + not. If set to ``False``, Pelican will use the SITEURL + setting to construct absolute URLs. `PLUGINS` (``[]``) The list of plugins to load. See :ref:`plugins`. `SITENAME` (``'A Pelican Blog'``) Your site name `SITEURL` Base URL of your website. Not defined by default, - which means the base URL is assumed to be "/" with a - root-relative URL structure. If `SITEURL` is specified - explicitly, there should be no trailing slash at the end, - and URLs will be generated with an absolute URL structure - (including the domain). If you want to use relative URLs - instead of root-relative or absolute URLs, you should - instead use the `RELATIVE_URL` setting. + so it is best to specify your SITEURL; if you do not, feeds + will not be generated with properly-formed URLs. You should + include ``http://`` and your domain, with no trailing + slash at the end. Example: ``SITEURL = 'http://mydomain.com'`` `STATIC_PATHS` (``['images']``) The static paths you want to have accessible on the output path "static". By default, Pelican will copy the 'images' folder to the @@ -107,6 +105,15 @@ Setting name (default value) What doe URL settings ------------ +The first thing to understand is that there are currently two supported methods +for URL formation: *relative* and *absolute*. Document-relative URLs are useful +when testing locally, and absolute URLs are reliable and most useful when +publishing. One method of supporting both is to have one Pelican configuration +file for local development and another for publishing. To see an example of this +type of setup, use the ``pelican-quickstart`` script as described at the top of +the :doc:`Getting Started` page, which will produce two separate +configuration files for local development and publishing, respectively. + You can customize the URLs and locations where files will be saved. The URLs and SAVE_AS variables use Python's format strings. These variables allow you to place your articles in a location such as '{slug}/index.html' and link to them as diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 0e713fe8..f747d048 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -24,6 +24,7 @@ CONF = { 'ssh_target_dir': '/var/www', 'dropbox_dir' : '~/Dropbox/Public/', 'default_pagination' : 10, + 'siteurl': '', 'lang': 'en' } @@ -138,35 +139,44 @@ Please answer the following questions so this script can generate the files need '''.format(v=__version__)) - CONF['basedir'] = os.path.abspath(ask('Where do you want to create your new web site?', answer=str, default=args.path)) + project = os.path.join(os.environ['VIRTUAL_ENV'], '.project') + if os.path.isfile(project): + CONF['basedir'] = open(project, 'r').read().rstrip("\n") + print('Using project associated with current virtual environment. Will save to:\n%s\n' % CONF['basedir']) + else: + CONF['basedir'] = os.path.abspath(ask('Where do you want to create your new web site?', answer=str, default=args.path)) + CONF['sitename'] = ask('What will be the title of this web site?', answer=str, default=args.title) CONF['author'] = ask('Who will be the author of this web site?', answer=str, default=args.author) - CONF['lang'] = ask('What will be the default language of this web site ?', str, args.lang or CONF['lang'], 2) + CONF['lang'] = ask('What will be the default language of this web site?', str, args.lang or CONF['lang'], 2) - CONF['with_pagination'] = ask('Do you want to enable article pagination ?', bool, bool(CONF['default_pagination'])) + if ask('Do you want to specify a URL prefix? e.g., http://example.com ', answer=bool, default=True): + CONF['siteurl'] = ask('What is your URL prefix? (see above example; no trailing slash)', str, CONF['siteurl']) + + CONF['with_pagination'] = ask('Do you want to enable article pagination?', bool, bool(CONF['default_pagination'])) if CONF['with_pagination']: CONF['default_pagination'] = ask('How many articles per page do you want?', int, CONF['default_pagination']) else: CONF['default_pagination'] = False - mkfile = ask('Do you want to generate a Makefile to easily manage your website ?', bool, True) + mkfile = ask('Do you want to generate a Makefile to easily manage your website?', bool, True) if mkfile: - if ask('Do you want to upload your website using FTP ?', answer=bool, default=False): - CONF['ftp_host'] = ask('What is the hostname of your FTP server ?', str, CONF['ftp_host']) + if ask('Do you want to upload your website using FTP?', answer=bool, default=False): + CONF['ftp_host'] = ask('What is the hostname of your FTP server?', str, CONF['ftp_host']) CONF['ftp_user'] = ask('What is your username on that server?', str, CONF['ftp_user']) CONF['ftp_target_dir'] = ask('Where do you want to put your web site on that server?', str, CONF['ftp_target_dir']) - if ask('Do you want to upload your website using SSH ?', answer=bool, default=False): - CONF['ssh_host'] = ask('What is the hostname of your SSH server ?', str, CONF['ssh_host']) + if ask('Do you want to upload your website using SSH?', answer=bool, default=False): + CONF['ssh_host'] = ask('What is the hostname of your SSH server?', str, CONF['ssh_host']) CONF['ssh_port'] = ask('What is the port of your SSH server?', int, CONF['ssh_port']) CONF['ssh_user'] = ask('What is your username on that server?', str, CONF['ssh_user']) CONF['ssh_target_dir'] = ask('Where do you want to put your web site on that server?', str, CONF['ssh_target_dir']) - if ask('Do you want to upload your website using Dropbox ?', answer=bool, default=False): - CONF['dropbox_dir'] = ask('Where is your Dropbox directory ?', str, CONF['dropbox_dir']) + if ask('Do you want to upload your website using Dropbox?', answer=bool, default=False): + CONF['dropbox_dir'] = ask('Where is your Dropbox directory?', str, CONF['dropbox_dir']) try: - os.makedirs(os.path.join(CONF['basedir'], 'src')) + os.makedirs(os.path.join(CONF['basedir'], 'content')) except OSError, e: print('Error: {0}'.format(e)) @@ -176,8 +186,17 @@ Please answer the following questions so this script can generate the files need print('Error: {0}'.format(e)) try: - with open(os.path.join(CONF['basedir'], 'pelican.conf.py'), 'w') as fd: - for line in get_template('pelican.conf.py'): + with open(os.path.join(CONF['basedir'], 'pelicanconf.py'), 'w') as fd: + for line in get_template('pelicanconf.py'): + template = string.Template(line) + fd.write(template.safe_substitute(CONF)) + fd.close() + except OSError, e: + print('Error: {0}'.format(e)) + + try: + with open(os.path.join(CONF['basedir'], 'publishconf.py'), 'w') as fd: + for line in get_template('publishconf.py'): template = string.Template(line) fd.write(template.safe_substitute(CONF)) fd.close() diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index 392336d7..3a3fe74c 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -2,9 +2,10 @@ PELICAN=$pelican PELICANOPTS=$pelicanopts BASEDIR=$$(PWD) -INPUTDIR=$$(BASEDIR)/src +INPUTDIR=$$(BASEDIR)/content OUTPUTDIR=$$(BASEDIR)/output -CONFFILE=$$(BASEDIR)/pelican.conf.py +CONFFILE=$$(BASEDIR)/pelicanconf.py +PUBLISHCONF=$$(BASEDIR)/publishconf.py FTP_HOST=$ftp_host FTP_USER=$ftp_user @@ -23,10 +24,11 @@ help: @echo 'Usage: ' @echo ' make html (re)generate the web site ' @echo ' make clean remove the generated files ' - @echo ' ftp_upload upload the web site using FTP ' - @echo ' ssh_upload upload the web site using SSH ' - @echo ' dropbox_upload upload the web site using Dropbox ' - @echo ' rsync_upload upload the web site using rsync/ssh' + @echo ' make publish generate using production settings ' + @echo ' ftp_upload upload the web site via FTP ' + @echo ' ssh_upload upload the web site via SSH ' + @echo ' dropbox_upload upload the web site via Dropbox ' + @echo ' rsync_upload upload the web site via rsync/ssh ' @echo ' ' @@ -37,23 +39,31 @@ $$(OUTPUTDIR)/%.html: $$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(CONFFILE) $$(PELICANOPTS) clean: - rm -fr $$(OUTPUTDIR) - mkdir $$(OUTPUTDIR) + find $$(OUTPUTDIR) -mindepth 1 -delete -dropbox_upload: $$(OUTPUTDIR)/index.html +regenerate: clean + $$(PELICAN) -r $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(CONFFILE) $$(PELICANOPTS) + +serve: + cd $$(OUTPUTDIR) && python -m SimpleHTTPServer + +publish: + $$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(PUBLISHCONF) $$(PELICANOPTS) + +dropbox_upload: publish cp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) -ssh_upload: $$(OUTPUTDIR)/index.html +ssh_upload: publish scp -P $$(SSH_PORT) -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) -rsync_upload: $$(OUTPUTDIR)/index.html +rsync_upload: publish rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR)/* $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) -ftp_upload: $$(OUTPUTDIR)/index.html +ftp_upload: publish lftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" -github: $$(OUTPUTDIR)/index.html +github: publish ghp-import $$(OUTPUTDIR) git push origin gh-pages -.PHONY: html help clean ftp_upload ssh_upload rsync_upload dropbox_upload github +.PHONY: html help clean regenerate serve publish ftp_upload ssh_upload rsync_upload dropbox_upload github diff --git a/pelican/tools/templates/pelican.conf.py.in b/pelican/tools/templates/pelicanconf.py.in similarity index 100% rename from pelican/tools/templates/pelican.conf.py.in rename to pelican/tools/templates/pelicanconf.py.in diff --git a/pelican/tools/templates/publishconf.py.in b/pelican/tools/templates/publishconf.py.in new file mode 100644 index 00000000..391eb9fa --- /dev/null +++ b/pelican/tools/templates/publishconf.py.in @@ -0,0 +1,17 @@ +#!/usr/bin/env python +# -*- coding: utf-8 -*- # + +from pelicanconf import * + +SITEURL = '$siteurl' + +DELETE_OUTPUT_DIRECTORY = True + +# Following items are often useful when publishing + +# Uncomment following line for absolute URLs in production: +#RELATIVE_URLS = False + +#DISQUS_SITENAME = "" +#GOOGLE_ANALYTICS = "" + From 18b4d65c4eefcc020e7094b1886a105d8fc107e0 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 7 Jul 2012 08:45:50 -0700 Subject: [PATCH 0309/2344] Clarify quickstart docs and remove spurious line --- docs/getting_started.rst | 117 +++++++++++----------- pelican/tools/templates/publishconf.py.in | 1 - 2 files changed, 58 insertions(+), 60 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 954dac3d..93d578a0 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -1,65 +1,10 @@ Getting started ############### -Kickstart a blog -================ - -You're ready? Let's go! Following is a brief tutorial for those who want to get -started right away. Subsequent sections below will cover individual topics in -greater detail. To get started, here are some recommended install steps for -Pelican:: - - $ sudo pip install --upgrade virtualenv virtualenvwrapper - $ mkvirtualenv pelican - $ pip install pelican Markdown - $ mkdir ~/code/yoursitename # (where you want your new site code to be saved) - $ cd ~/code/yoursitename - $ setvirtualenvproject - $ pelican-quickstart - -Once you've run that last ``pelican-quickstart`` command, you'll be asked some -questions about your site. Once you finish answering all the questions, you can -begin adding content to the *content* folder that has been created for you. -(See *Writing articles using Pelican* section below for more information -about how to format your content.) Once you have some content to generate, you -can convert it to HTML via the following command:: - - $ make html - -If you'd prefer to have Pelican automatically regenerate your site every time a -change is detected (handy when testing locally), use the following command -instead:: - - $ make regenerate - -To preview the site in your browser, open a new terminal tab and enter:: - - $ workon yoursitename - $ make serve - -Visit http://localhost:8000 in your browser to see your site. - -When you're ready to publish your site, you can upload it via the method(s) you -chose during the ``pelican-quickstart`` questionnaire. For this example, we'll -use rsync over ssh:: - - $ make rsync_upload - -That's it! Your site should now be live. - -Closing the current terminal session will also close the virtual environment in -which we installed Pelican. In the future, when you want to work on your site, -you can activate its virtual environment via:: - - $ workon yoursitename - -Not only will that command activate your new site's virtual environment, but it -will also automatically change your working directory to your site project. - Installing Pelican ================== -You can install Pelican via several different methods. +You're ready? Let's go! You can install Pelican via several different methods. The simplest is via `pip `_:: $ pip install pelican @@ -75,6 +20,7 @@ before installing Pelican:: $ sudo pip install --upgrade virtualenv virtualenvwrapper $ mkvirtualenv pelican + $ pip install pelican Once the virtual environment has been created and activated, Pelican can be be installed via ``pip`` or ``easy_install`` as noted above. Alternatively, if @@ -122,6 +68,59 @@ Optionally: * pygments, for syntax highlighting * Markdown, for supporting Markdown as an input format +Kickstart a blog +================ + +Following is a brief tutorial for those who want to get started right away. +We're going to assume Pelican was installed in a virtual environment via the +following steps (if you're not using a virtual environment for Pelican, you can +skip to the ``pelican-quickstart`` command):: + + $ sudo pip install --upgrade virtualenv virtualenvwrapper + $ mkvirtualenv pelican + $ pip install pelican Markdown + +Next we'll create a directory to house our site content and configuration files, +which can be located any place you prefer, and associate this new project with +the currently-active virtual environment:: + + $ mkdir ~/code/yoursitename + $ cd ~/code/yoursitename + $ setvirtualenvproject + +Now we can run the ``pelican-quickstart`` command, which will ask some questions +about your site:: + + $ pelican-quickstart + +Once you finish answering all the questions, you can begin adding content to the +*content* folder that has been created for you. (See *Writing articles using +Pelican* section below for more information about how to format your content.) +Once you have some content to generate, you can convert it to HTML via the +following command:: + + $ make html + +If you'd prefer to have Pelican automatically regenerate your site every time a +change is detected (handy when testing locally), use the following command +instead:: + + $ make regenerate + +To serve the site so it can be previewed in your browser:: + + $ make serve + +Visit http://localhost:8000 in your browser to see your site. + +When you're ready to publish your site, you can upload it via the method(s) you +chose during the ``pelican-quickstart`` questionnaire. For this example, we'll +use rsync over ssh:: + + $ make rsync_upload + +That's it! Your site should now be live. + Writing articles using Pelican ============================== @@ -171,9 +170,9 @@ the content. The ``pelican`` command can also be run directly:: $ pelican /path/to/your/content/ [-s path/to/your/settings.py] The above command will generate your weblog and save it in the ``content/`` -folder, using the default theme to produce a simple site. It's not -very sexy, as it's just simple HTML output (without any style). You can create -your own style if you want. +folder, using the default theme to produce a simple site. The default theme is +simple HTML without styling and is provided so folks may use it as a basis for +creating their own themes. Pelican has other command-line switches available. Have a look at the help to see all the options you can use:: diff --git a/pelican/tools/templates/publishconf.py.in b/pelican/tools/templates/publishconf.py.in index 391eb9fa..113a7318 100644 --- a/pelican/tools/templates/publishconf.py.in +++ b/pelican/tools/templates/publishconf.py.in @@ -14,4 +14,3 @@ DELETE_OUTPUT_DIRECTORY = True #DISQUS_SITENAME = "" #GOOGLE_ANALYTICS = "" - From dc21efbe10dc6552f882bdf69e4a210da100977a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 7 Jul 2012 10:33:47 -0700 Subject: [PATCH 0310/2344] Improved quickstart config formatting. Fixes #401. --- pelican/tools/templates/pelicanconf.py.in | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/pelican/tools/templates/pelicanconf.py.in b/pelican/tools/templates/pelicanconf.py.in index 095a7e7d..07e286cd 100644 --- a/pelican/tools/templates/pelicanconf.py.in +++ b/pelican/tools/templates/pelicanconf.py.in @@ -7,19 +7,16 @@ SITEURL = '' TIMEZONE = 'Europe/Paris' -DEFAULT_LANG='$lang' +DEFAULT_LANG = '$lang' # Blogroll -LINKS = ( - ('Pelican', 'http://docs.notmyidea.org/alexis/pelican/'), - ('Python.org', 'http://python.org'), - ('Jinja2', 'http://jinja.pocoo.org'), - ('You can modify those links in your config file', '#') - ) +LINKS = (('Pelican', 'http://docs.notmyidea.org/alexis/pelican/'), + ('Python.org', 'http://python.org'), + ('Jinja2', 'http://jinja.pocoo.org'), + ('You can modify those links in your config file', '#'),) # Social widget -SOCIAL = ( - ('You can add links in your config file', '#'), - ) +SOCIAL = (('You can add links in your config file', '#'), + ('Another social link', '#'),) DEFAULT_PAGINATION = $default_pagination From dff5b3589bf4d437cc6c250423066049f3ec1adc Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Sat, 7 Jul 2012 12:15:35 -0700 Subject: [PATCH 0311/2344] Add per page templates. Closes #376 Also set up helper classes in test_generators.py for cleaner tests --- docs/faq.rst | 11 ++++ pelican/contents.py | 11 ++++ pelican/generators.py | 15 +++--- tests/TestPages/hidden_page_with_template.rst | 11 ++++ tests/TestPages/page_with_template.rst | 8 +++ tests/content/article_with_template.rst | 8 +++ tests/test_contents.py | 25 ++++++++- tests/test_generators.py | 54 +++++++++++++++++-- 8 files changed, 128 insertions(+), 15 deletions(-) create mode 100644 tests/TestPages/hidden_page_with_template.rst create mode 100644 tests/TestPages/page_with_template.rst create mode 100644 tests/content/article_with_template.rst diff --git a/docs/faq.rst b/docs/faq.rst index a3829d65..3eec6e84 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -49,3 +49,14 @@ install it. You can do so by typing:: In case you don't have pip installed, consider installing it via:: $ (sudo) easy_install pip + +How do I assign custom templates on a per page basis? +===================================================== + +It's as simple as adding an extra line of metadata to any pages or articles you +want to have it's own template. + + :template: template_name + +Then just make sure to have the template installed in to your theme as +``template_name.html``. \ No newline at end of file diff --git a/pelican/contents.py b/pelican/contents.py index b8bb0993..a5e3be8f 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -21,6 +21,7 @@ class Page(object): :param content: the string to parse, containing the original content. """ mandatory_properties = ('title',) + default_template = 'page' def __init__(self, content, metadata=None, settings=None, filename=None): @@ -44,6 +45,9 @@ class Page(object): # also keep track of the metadata attributes available self.metadata = local_metadata + #default template if it's not defined in page + self.template = self._get_template() + # default author to the one in settings if not defined if not hasattr(self, 'author'): if 'AUTHOR' in settings: @@ -153,9 +157,16 @@ class Page(object): url = property(functools.partial(get_url_setting, key='url')) save_as = property(functools.partial(get_url_setting, key='save_as')) + def _get_template(self): + if hasattr(self, 'template') and self.template is not None: + return self.template + else: + return self.default_template + class Article(Page): mandatory_properties = ('title', 'date', 'category') + default_template = 'article' class Quote(Page): diff --git a/pelican/generators.py b/pelican/generators.py index 4e9312cc..8526a56d 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -167,11 +167,9 @@ class ArticlesGenerator(Generator): def generate_articles(self, write): """Generate the articles.""" - article_template = self.get_template('article') for article in chain(self.translations, self.articles): - write(article.save_as, - article_template, self.context, article=article, - category=article.category) + write(article.save_as, self.get_template(article.template), + self.context, article=article, category=article.category) def generate_direct_templates(self, write): """Generate direct templates pages""" @@ -222,10 +220,10 @@ class ArticlesGenerator(Generator): def generate_drafts(self, write): """Generate drafts pages.""" - article_template = self.get_template('article') for article in self.drafts: - write('drafts/%s.html' % article.slug, article_template, - self.context, article=article, category=article.category) + write('drafts/%s.html' % article.slug, + self.get_template(article.template), self.context, + article=article, category=article.category) def generate_pages(self, writer): """Generate the pages on the disk""" @@ -385,7 +383,6 @@ class PagesGenerator(Generator): (repr(unicode.encode(page.status, 'utf-8')), repr(f))) - self.pages, self.translations = process_translations(all_pages) self.hidden_pages, self.hidden_translations = process_translations(hidden_pages) @@ -395,7 +392,7 @@ class PagesGenerator(Generator): def generate_output(self, writer): for page in chain(self.translations, self.pages, self.hidden_translations, self.hidden_pages): - writer.write_file(page.save_as, self.get_template('page'), + writer.write_file(page.save_as, self.get_template(page.template), self.context, page=page, relative_urls=self.settings.get('RELATIVE_URLS')) diff --git a/tests/TestPages/hidden_page_with_template.rst b/tests/TestPages/hidden_page_with_template.rst new file mode 100644 index 00000000..36104a09 --- /dev/null +++ b/tests/TestPages/hidden_page_with_template.rst @@ -0,0 +1,11 @@ +This is a test hidden page with a custom template +################################################# + +:status: hidden +:template: custom + +The quick brown fox jumped over the lazy dog's back. + +This page is hidden + +This page has a custom template to be called when rendered diff --git a/tests/TestPages/page_with_template.rst b/tests/TestPages/page_with_template.rst new file mode 100644 index 00000000..9388dc2f --- /dev/null +++ b/tests/TestPages/page_with_template.rst @@ -0,0 +1,8 @@ +This is a test page with a preset template +########################################## + +:template: custom + +The quick brown fox jumped over the lazy dog's back. + +This article has a custom template to be called when rendered diff --git a/tests/content/article_with_template.rst b/tests/content/article_with_template.rst new file mode 100644 index 00000000..eb55738c --- /dev/null +++ b/tests/content/article_with_template.rst @@ -0,0 +1,8 @@ +Article with template +##################### + +:template: custom + +This article has a custom template to be called when rendered + +This is some content. With some stuff to "typogrify". diff --git a/tests/test_contents.py b/tests/test_contents.py index e7c9ad01..bc028ea8 100644 --- a/tests/test_contents.py +++ b/tests/test_contents.py @@ -2,7 +2,7 @@ from .support import unittest -from pelican.contents import Page +from pelican.contents import Page, Article from pelican.settings import _DEFAULT_CONFIG from pelican.utils import truncate_html_words @@ -135,6 +135,17 @@ class TestPage(unittest.TestCase): # will simply skip this test. unittest.skip("There is no locale %s in this system." % locale) + def test_template(self): + """ + Pages default to page, metadata overwrites + """ + default_page = Page(**self.page_kwargs) + self.assertEqual('page', default_page.template) + page_kwargs = self._copy_page_kwargs() + page_kwargs['metadata']['template'] = 'custom' + custom_page = Page(**page_kwargs) + self.assertEqual('custom', custom_page.template) + def _copy_page_kwargs(self): # make a deep copy of page_kwargs page_kwargs = dict([(key, self.page_kwargs[key]) for key in @@ -146,3 +157,15 @@ class TestPage(unittest.TestCase): for subkey in page_kwargs[key]]) return page_kwargs + +class TestArticle(TestPage): + def test_template(self): + """ + Articles default to article, metadata overwrites + """ + default_article = Article(**self.page_kwargs) + self.assertEqual('article', default_article.template) + article_kwargs = self._copy_page_kwargs() + article_kwargs['metadata']['template'] = 'custom' + custom_article = Article(**article_kwargs) + self.assertEqual('custom', custom_article.template) diff --git a/tests/test_generators.py b/tests/test_generators.py index 61f31696..3b0a4b46 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -13,6 +13,37 @@ CUR_DIR = os.path.dirname(__file__) class TestArticlesGenerator(unittest.TestCase): + def setUp(self): + super(TestArticlesGenerator, self).setUp() + self.generator = None + + def get_populated_generator(self): + """ + We only need to pull all the test articles once, but read from it + for each test. + """ + if self.generator is None: + settings = _DEFAULT_CONFIG.copy() + settings['ARTICLE_DIR'] = 'content' + settings['DEFAULT_CATEGORY'] = 'Default' + self.generator = ArticlesGenerator(settings.copy(), settings, + CUR_DIR, _DEFAULT_CONFIG['THEME'], None, + _DEFAULT_CONFIG['MARKUP']) + self.generator.generate_context() + return self.generator + + def distill_articles(self, articles): + distilled = [] + for page in articles: + distilled.append([ + page.title, + page.status, + page.category.name, + page.template + ] + ) + return distilled + def test_generate_feeds(self): generator = ArticlesGenerator(None, {'FEED': _DEFAULT_CONFIG['FEED']}, @@ -93,6 +124,16 @@ class TestArticlesGenerator(unittest.TestCase): generator.generate_direct_templates(write) write.assert_called_count == 0 + def test_per_article_template(self): + """ + Custom template articles get the field but standard/unset are None + """ + generator = self.get_populated_generator() + articles = self.distill_articles(generator.articles) + custom_template = ['Article with template', 'published', 'Default', 'custom'] + standard_template = ['This is a super article !', 'published', 'Yeah', 'article'] + self.assertIn(custom_template, articles) + self.assertIn(standard_template, articles) class TestPageGenerator(unittest.TestCase): """ @@ -107,7 +148,8 @@ class TestPageGenerator(unittest.TestCase): for page in pages: distilled.append([ page.title, - page.status + page.status, + page.template ] ) return distilled @@ -124,12 +166,14 @@ class TestPageGenerator(unittest.TestCase): hidden_pages = self.distill_pages(generator.hidden_pages) pages_expected = [ - [u'This is a test page', 'published'], - [u'This is a markdown test page', 'published'] + [u'This is a test page', 'published', 'page'], + [u'This is a markdown test page', 'published', 'page'], + [u'This is a test page with a preset template', 'published', 'custom'] ] hidden_pages_expected = [ - [u'This is a test hidden page', 'hidden'], - [u'This is a markdown test hidden page', 'hidden'] + [u'This is a test hidden page', 'hidden', 'page'], + [u'This is a markdown test hidden page', 'hidden', 'page'], + [u'This is a test hidden page with a custom template', 'hidden', 'custom'] ] self.assertItemsEqual(pages_expected,pages) From a1f27d9189461da533a8cc4334e7701e33ab8ff3 Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Sat, 7 Jul 2012 16:59:58 -0700 Subject: [PATCH 0312/2344] Small change to fix #406 --- pelican/tools/templates/publishconf.py.in | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pelican/tools/templates/publishconf.py.in b/pelican/tools/templates/publishconf.py.in index 113a7318..a4516332 100644 --- a/pelican/tools/templates/publishconf.py.in +++ b/pelican/tools/templates/publishconf.py.in @@ -1,6 +1,8 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # +import sys +sys.path.append('.') from pelicanconf import * SITEURL = '$siteurl' From 38ffcfd4c40b5d054cfc99772d84a05cf8bd3e2e Mon Sep 17 00:00:00 2001 From: tBunnyMan Date: Sun, 8 Jul 2012 17:50:18 -0700 Subject: [PATCH 0313/2344] Added the delevop_server script This script and the small changes to quick start's makefile make for easily launching and killing of pelican --debug --autoreload and SimpleHTTPServer. This is extra useful for working on templates. --- pelican/tools/pelican_quickstart.py | 11 ++- pelican/tools/templates/Makefile.in | 3 +- pelican/tools/templates/develop_server.sh.in | 83 ++++++++++++++++++++ 3 files changed, 95 insertions(+), 2 deletions(-) create mode 100755 pelican/tools/templates/develop_server.sh.in diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index f747d048..577a435d 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -160,7 +160,7 @@ Please answer the following questions so this script can generate the files need else: CONF['default_pagination'] = False - mkfile = ask('Do you want to generate a Makefile to easily manage your website?', bool, True) + mkfile = ask('Do you want to generate a Makefile and develop server script to easily manage your website?', bool, True) if mkfile: if ask('Do you want to upload your website using FTP?', answer=bool, default=False): @@ -214,4 +214,13 @@ Please answer the following questions so this script can generate the files need except OSError, e: print('Error: {0}'.format(e)) + try: + with open(os.path.join(CONF['basedir'], 'develop_server.sh'), 'w') as fd: + for line in get_template('develop_server.sh'): + template = string.Template(line) + fd.write(template.safe_substitute(CONF)) + fd.close() + except OSError, e: + print('Error: {0}'.format(e)) + print('Done. Your new project is available at %s' % CONF['basedir']) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index 3a3fe74c..df00ffbf 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -25,6 +25,7 @@ help: @echo ' make html (re)generate the web site ' @echo ' make clean remove the generated files ' @echo ' make publish generate using production settings ' + @echo ' make serve run develop_server.sh restart ' @echo ' ftp_upload upload the web site via FTP ' @echo ' ssh_upload upload the web site via SSH ' @echo ' dropbox_upload upload the web site via Dropbox ' @@ -45,7 +46,7 @@ regenerate: clean $$(PELICAN) -r $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(CONFFILE) $$(PELICANOPTS) serve: - cd $$(OUTPUTDIR) && python -m SimpleHTTPServer + $$(BASEDIR)/develop_server.sh restart publish: $$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(PUBLISHCONF) $$(PELICANOPTS) diff --git a/pelican/tools/templates/develop_server.sh.in b/pelican/tools/templates/develop_server.sh.in new file mode 100755 index 00000000..2f8c07dd --- /dev/null +++ b/pelican/tools/templates/develop_server.sh.in @@ -0,0 +1,83 @@ +#!/bin/bash +## +# This section should match your Makefile +## +PELICAN=$pelican +PELICANOPTS=$pelicanopts + +BASEDIR=$$(PWD) +INPUTDIR=$$BASEDIR/content +OUTPUTDIR=$$BASEDIR/output +CONFFILE=$$BASEDIR/pelicanconf.py + +### +# Don't change stuff below here unless you are sure +### + +SRV_PID=$$BASEDIR/srv.pid +PELICAN_PID=$$BASEDIR/pelican.pid + +function usage(){ + echo "usage: $$0 (stop) (start) (restart)" + echo "This starts pelican in debug and reload mode and then launches" + echo "A SimpleHTTP server to help site development. It doesn't read" + echo "your pelican options so you edit any paths in your Makefile" + echo "you will need to edit it as well" + exit 3 +} + +function shut_down(){ + if [[ -f $$SRV_PID ]]; then + PID=$$(cat $$SRV_PID) + PROCESS=$$(ps -p $$PID | tail -n 1 | awk '{print $$4}') + if [[ $$PROCESS == python ]]; then + echo "Killing SimpleHTTPServer" + kill $$PID + else + echo "Stale PID, deleting" + fi + rm $$SRV_PID + else + echo "SimpleHTTPServer PIDFile not found" + fi + + if [[ -f $$PELICAN_PID ]]; then + PID=$$(cat $$PELICAN_PID) + PROCESS=$$(ps -p $$PID | tail -n 1 | awk '{print $$4}') + if [[ $$PROCESS != "" ]]; then + echo "Killing Pelican" + kill $$PID + else + echo "Stale PID, deleting" + fi + rm $$PELICAN_PID + else + echo "Pelican PIDFile not found" + fi +} + +function start_up(){ + echo "Starting up Pelican and SimpleHTTPServer" + shift + $$PELICAN --debug --autoreload -r $$INPUTDIR -o $$OUTPUTDIR -s $$CONFFILE $$PELICANOPTS & + echo $$! > $$PELICAN_PID + cd $$OUTPUTDIR + python -m SimpleHTTPServer & + echo $$! > $$SRV_PID + cd $$BASEDIR +} + +### +# MAIN +### +[[ $$# -ne 1 ]] && usage +if [[ $$1 == "stop" ]]; then + shut_down +elif [[ $$1 == "restart" ]]; then + shut_down + start_up +elif [[ $$1 == "start" ]]; then + start_up +else + usage +fi From 10e668a87cd0e1fba125d04bcf93465600c81ba6 Mon Sep 17 00:00:00 2001 From: solsTiCe d'Hiver Date: Mon, 9 Jul 2012 15:25:13 +0200 Subject: [PATCH 0314/2344] Fix issue #175 Force world-readable permission on files and directory of the themes installed by pelican-themes. Only on posix system i.e. mostly non Windows Rationale: If the theme's files have only -rw------- permissions, once installed system wide and owned by root, they will not be accessible to any user but only root. --- pelican/tools/pelican_themes.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index 6a021ecc..0083dd50 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -180,8 +180,19 @@ def install(path, v=False, u=False): print("Copying `{p}' to `{t}' ...".format(p=path, t=theme_path)) try: shutil.copytree(path, theme_path) - except Exception, e: + + if os.name == 'posix': + for root, dirs, files in os.walk(theme_path): + for d in dirs: + dname = os.path.join(root, d) + os.chmod(dname, 0755) + for f in files: + fname = os.path.join(root, f) + os.chmod(fname, 0644) + except shutil.Error, e: err("Cannot copy `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e))) + except OSError, e: + err("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)), die=False) def symlink(path, v=False): From 4acbbb8d0fa157fbb0cb10e2b0c6abc428f8ffab Mon Sep 17 00:00:00 2001 From: solsTiCe d'Hiver Date: Mon, 9 Jul 2012 19:48:53 +0200 Subject: [PATCH 0315/2344] Use logging module instead of err function --- pelican/tools/pelican_themes.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index 0083dd50..2fe4f459 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -192,7 +192,9 @@ def install(path, v=False, u=False): except shutil.Error, e: err("Cannot copy `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e))) except OSError, e: - err("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)), die=False) + import logging + logger = logging.getLogger(__name__) + logger.warning("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e))) def symlink(path, v=False): From 842817f110481c280b7a121e96a9a818c8354f6a Mon Sep 17 00:00:00 2001 From: solsTiCe d'Hiver Date: Mon, 9 Jul 2012 20:05:21 +0200 Subject: [PATCH 0316/2344] Revert "Use logging module instead of err function" This reverts commit 4acbbb8d0fa157fbb0cb10e2b0c6abc428f8ffab. I don't know how to use logging/logger This throws: No handlers could be found for logger "pelican.tools.pelican_themes" --- pelican/tools/pelican_themes.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index 2fe4f459..0083dd50 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -192,9 +192,7 @@ def install(path, v=False, u=False): except shutil.Error, e: err("Cannot copy `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e))) except OSError, e: - import logging - logger = logging.getLogger(__name__) - logger.warning("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e))) + err("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)), die=False) def symlink(path, v=False): From a0d2d3446649066e7f03560953b5962d9fdcadf5 Mon Sep 17 00:00:00 2001 From: solsTiCe d'Hiver Date: Mon, 9 Jul 2012 20:07:31 +0200 Subject: [PATCH 0317/2344] shutil.copytree seems to throw OSError exception too So revert to previous Exception handling --- pelican/tools/pelican_themes.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index 0083dd50..d13e60e9 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -181,18 +181,19 @@ def install(path, v=False, u=False): try: shutil.copytree(path, theme_path) - if os.name == 'posix': - for root, dirs, files in os.walk(theme_path): - for d in dirs: - dname = os.path.join(root, d) - os.chmod(dname, 0755) - for f in files: - fname = os.path.join(root, f) - os.chmod(fname, 0644) - except shutil.Error, e: + try: + if os.name == 'posix': + for root, dirs, files in os.walk(theme_path): + for d in dirs: + dname = os.path.join(root, d) + os.chmod(dname, 0755) + for f in files: + fname = os.path.join(root, f) + os.chmod(fname, 0644) + except OSError, e: + err("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)), die=False) + except Exception, e: err("Cannot copy `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e))) - except OSError, e: - err("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)), die=False) def symlink(path, v=False): From a86d5fda71a2d2ce7295cb385641331b139bf361 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Mon, 9 Jul 2012 22:43:51 -0400 Subject: [PATCH 0318/2344] add documentation for html reader --- docs/getting_started.rst | 30 ++++++++++++++++++++++++++++++ docs/internals.rst | 2 +- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 93d578a0..d60cce83 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -154,6 +154,36 @@ Markdown posts should follow this pattern:: This is the content of my super blog post. +Lastly, you can use Vanilla HTML (files ending in ``.htm`` and ``.html``). Pelican +interprets the HTML in a very straightforward manner, reading meta data out +of ``meta`` tags, the title out of the ``title`` tag, and the body out of the +``body`` tag:: + + + + My super title + + + + + + + This is the content of my super blog post. + + Content continues down here. + + + +With HTML, there are two simple exceptions to the standard metadata. First, +``tags`` can be specified either with the ``tags`` metadata, as is standard in +Pelican, or with the ``keywords`` metadata, as is standard in HTML. The two can +be used interchangeably. The second note is that summaries are done differently +in HTML posts. Either a ``summary`` metadata tag can be supplied, or, as seen +above, you can place an HTML comment, ````, that +Pelican will recognize. Everything before the comment will be treated as a +summary. The content of the post will contain everything in the body tag, with +the special comment stripped out. + Note that, aside from the title, none of this metadata is mandatory: if the date is not specified, Pelican will rely on the file's "mtime" timestamp, and the category can be determined by the directory in which the file resides. For diff --git a/docs/internals.rst b/docs/internals.rst index 6b6f991f..a94d1c56 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -23,7 +23,7 @@ The logic is separated into different classes and concepts: on. Since those operations are commonly used, the object is created once and then passed to the generators. -* **Readers** are used to read from various formats (Markdown and +* **Readers** are used to read from various formats (HTML, Markdown and reStructuredText for now, but the system is extensible). Given a file, they return metadata (author, tags, category, etc.) and content (HTML-formatted). From 4ec6cefe1db92c0bc6cea9a95c810e3f5b455865 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Mon, 9 Jul 2012 22:45:34 -0400 Subject: [PATCH 0319/2344] fix grammar --- docs/getting_started.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index d60cce83..5e553815 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -154,7 +154,7 @@ Markdown posts should follow this pattern:: This is the content of my super blog post. -Lastly, you can use Vanilla HTML (files ending in ``.htm`` and ``.html``). Pelican +Lastly, you can use vanilla HTML (files ending in ``.htm`` and ``.html``). Pelican interprets the HTML in a very straightforward manner, reading meta data out of ``meta`` tags, the title out of the ``title`` tag, and the body out of the ``body`` tag:: From ddc0aa0e8260f5ab61eb16369632a18c1ee21648 Mon Sep 17 00:00:00 2001 From: Samrat Man Singh Date: Tue, 10 Jul 2012 11:06:07 +0545 Subject: [PATCH 0320/2344] Related posts is now working, but needs some actual logic. --- pelican/generators.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 4e9312cc..a7180e98 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -116,6 +116,7 @@ class ArticlesGenerator(Generator): self.dates = {} self.tags = defaultdict(list) self.categories = defaultdict(list) + self.related_posts = [] self.authors = defaultdict(list) super(ArticlesGenerator, self).__init__(*args, **kwargs) self.drafts = [] @@ -344,8 +345,14 @@ class ArticlesGenerator(Generator): self.authors = list(self.authors.items()) self.authors.sort(key=lambda item: item[0].name) + for article in self.articles: + article.related_posts = [] + print article + potential_related = all_articles.remove(article) + article.related_posts = potential_related[:5] + self._update_context(('articles', 'dates', 'tags', 'categories', - 'tag_cloud', 'authors')) + 'tag_cloud', 'authors', 'related_posts')) def generate_output(self, writer): self.generate_feeds(writer) From 4d23ffc1121b553f9b2da6bb9f035fe63437456a Mon Sep 17 00:00:00 2001 From: Alexis Metaireau Date: Tue, 10 Jul 2012 13:40:38 +0200 Subject: [PATCH 0321/2344] Updated the functional tests to match latest changes. --- .../basic/a-markdown-powered-article.html | 2 +- tests/output/basic/archives.html | 2 +- tests/output/basic/article-1.html | 2 +- tests/output/basic/article-2.html | 2 +- tests/output/basic/article-3.html | 2 +- .../output/basic/author/alexis-metaireau.html | 12 +- tests/output/basic/author/dummy-author.html | 32 ++-- tests/output/basic/categories.html | 4 +- tests/output/basic/category/bar.html | 4 +- tests/output/basic/category/cat1.html | 20 +-- tests/output/basic/category/misc.html | 147 ++++++++++++++++++ tests/output/basic/category/yeah.html | 4 +- .../output/basic/drafts/a-draft-article.html | 8 +- tests/output/basic/feeds/all-fr.atom.xml | 2 +- tests/output/basic/feeds/misc.atom.xml | 4 + tests/output/basic/index.html | 40 ++--- tests/output/basic/oh-yeah-fr.html | 8 +- tests/output/basic/oh-yeah.html | 2 +- .../pages/this-is-a-test-hidden-page.html | 70 +++++++++ .../basic/pages/this-is-a-test-page.html | 2 +- tests/output/basic/second-article-fr.html | 4 +- tests/output/basic/second-article.html | 4 +- tests/output/basic/tag/bar.html | 36 ++--- tests/output/basic/tag/baz.html | 28 ++-- tests/output/basic/tag/foo.html | 32 ++-- tests/output/basic/tag/foobar.html | 4 +- tests/output/basic/tag/oh.html | 4 +- tests/output/basic/tag/yeah.html | 4 +- tests/output/basic/theme/css/main.css | 1 + .../basic/theme/images/icons/gitorious.png | Bin 0 -> 3675 bytes .../output/basic/this-is-a-super-article.html | 2 +- tests/output/basic/unbelievable.html | 4 +- tests/output/custom/tag/bar.html | 20 +-- tests/output/custom/tag/baz.html | 20 +-- tests/output/custom/tag/foo.html | 20 +-- 35 files changed, 387 insertions(+), 165 deletions(-) create mode 100644 tests/output/basic/category/misc.html create mode 100644 tests/output/basic/feeds/misc.atom.xml create mode 100644 tests/output/basic/pages/this-is-a-test-hidden-page.html create mode 100644 tests/output/basic/theme/images/icons/gitorious.png diff --git a/tests/output/basic/a-markdown-powered-article.html b/tests/output/basic/a-markdown-powered-article.html index ceadf79a..bfa09fdf 100644 --- a/tests/output/basic/a-markdown-powered-article.html +++ b/tests/output/basic/a-markdown-powered-article.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • diff --git a/tests/output/basic/archives.html b/tests/output/basic/archives.html index 52d00234..dac96a47 100644 --- a/tests/output/basic/archives.html +++ b/tests/output/basic/archives.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • diff --git a/tests/output/basic/article-1.html b/tests/output/basic/article-1.html index bd6f9716..ab1d71d7 100644 --- a/tests/output/basic/article-1.html +++ b/tests/output/basic/article-1.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • diff --git a/tests/output/basic/article-2.html b/tests/output/basic/article-2.html index 7811204a..52cfff0d 100644 --- a/tests/output/basic/article-2.html +++ b/tests/output/basic/article-2.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • diff --git a/tests/output/basic/article-3.html b/tests/output/basic/article-3.html index 96acb190..ef97a56d 100644 --- a/tests/output/basic/article-3.html +++ b/tests/output/basic/article-3.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • diff --git a/tests/output/basic/author/alexis-metaireau.html b/tests/output/basic/author/alexis-metaireau.html index 6bf631eb..ad7b8bee 100644 --- a/tests/output/basic/author/alexis-metaireau.html +++ b/tests/output/basic/author/alexis-metaireau.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -88,7 +88,6 @@ YEAH !

    - @@ -96,7 +95,8 @@ YEAH !

  • - - - + + +
    diff --git a/tests/output/basic/author/dummy-author.html b/tests/output/basic/author/dummy-author.html index cf23f899..54c81100 100644 --- a/tests/output/basic/author/dummy-author.html +++ b/tests/output/basic/author/dummy-author.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -77,7 +77,6 @@ - @@ -85,7 +84,8 @@
  • - @@ -120,7 +119,8 @@
  • - @@ -155,7 +154,8 @@
  • - @@ -190,7 +189,8 @@
  • - @@ -230,7 +229,8 @@ Translations:
  • - - - + + +
    diff --git a/tests/output/basic/categories.html b/tests/output/basic/categories.html index db25ed68..d13d0b92 100644 --- a/tests/output/basic/categories.html +++ b/tests/output/basic/categories.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -48,7 +48,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • diff --git a/tests/output/basic/category/bar.html b/tests/output/basic/category/bar.html index 77d0187b..a80656a5 100644 --- a/tests/output/basic/category/bar.html +++ b/tests/output/basic/category/bar.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -85,8 +85,8 @@ YEAH !

    - +
    diff --git a/tests/output/basic/category/cat1.html b/tests/output/basic/category/cat1.html index 1d8d67e8..3d062ac7 100644 --- a/tests/output/basic/category/cat1.html +++ b/tests/output/basic/category/cat1.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -77,7 +77,6 @@ - @@ -85,7 +84,8 @@
  • - @@ -120,7 +119,8 @@
  • - @@ -155,7 +154,8 @@
  • - - - + + +
    diff --git a/tests/output/basic/category/misc.html b/tests/output/basic/category/misc.html new file mode 100644 index 00000000..ff344111 --- /dev/null +++ b/tests/output/basic/category/misc.html @@ -0,0 +1,147 @@ + + + + A Pelican Blog - misc + + + + + + + + + + + + + + + + + + + + + + + + +
    +

    Other articles

    +
    +
      + + + + + + + + + +
    1. + + +
    + + + +
    + + + + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/category/yeah.html b/tests/output/basic/category/yeah.html index 747cad37..1d4d7f04 100644 --- a/tests/output/basic/category/yeah.html +++ b/tests/output/basic/category/yeah.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -86,8 +86,8 @@ - +
    diff --git a/tests/output/basic/drafts/a-draft-article.html b/tests/output/basic/drafts/a-draft-article.html index 99b90c33..af0f2476 100644 --- a/tests/output/basic/drafts/a-draft-article.html +++ b/tests/output/basic/drafts/a-draft-article.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -53,8 +53,8 @@
    - - Fri 02 March 2012 + + Sat 19 May 2012 @@ -62,7 +62,7 @@ By Dummy Author -

    In content.

    +

    In misc.

    diff --git a/tests/output/basic/feeds/all-fr.atom.xml b/tests/output/basic/feeds/all-fr.atom.xml index ce245dee..274bd548 100644 --- a/tests/output/basic/feeds/all-fr.atom.xml +++ b/tests/output/basic/feeds/all-fr.atom.xml @@ -1,4 +1,4 @@ -A Pelican Blog.././2012-03-02T14:01:01ZTrop bien !2012-03-02T14:01:01ZDummy Authortag:../.,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +A Pelican Blog.././2012-05-19T23:55:50ZTrop bien !2012-05-19T23:55:50ZDummy Authortag:../.,2012-05-19:oh-yeah-fr.html<p>Et voila du contenu en français</p> Deuxième article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/misc.atom.xml b/tests/output/basic/feeds/misc.atom.xml new file mode 100644 index 00000000..db33d39b --- /dev/null +++ b/tests/output/basic/feeds/misc.atom.xml @@ -0,0 +1,4 @@ + +A Pelican Blog.././2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00ZDummy Authortag:../.,2012-02-29:second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00ZDummy Authortag:../.,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> + \ No newline at end of file diff --git a/tests/output/basic/index.html b/tests/output/basic/index.html index 1f247443..fe6c2279 100644 --- a/tests/output/basic/index.html +++ b/tests/output/basic/index.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -60,7 +60,7 @@ By Dummy Author -

    In content.

    +

    In misc.

    tags: foobarbaz

    @@ -83,7 +83,6 @@ Translations: - @@ -91,7 +90,8 @@ Translations:
  • - @@ -125,7 +124,8 @@ Translations:
  • - @@ -160,7 +159,8 @@ Translations:
  • - @@ -195,7 +194,8 @@ Translations:
  • - @@ -230,7 +229,8 @@ Translations:
  • - @@ -266,7 +265,8 @@ as well as inline markup.

  • - @@ -311,7 +310,8 @@ YEAH !

  • - - - + + + diff --git a/tests/output/basic/oh-yeah-fr.html b/tests/output/basic/oh-yeah-fr.html index 666a961f..4856347f 100644 --- a/tests/output/basic/oh-yeah-fr.html +++ b/tests/output/basic/oh-yeah-fr.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -53,8 +53,8 @@
    - - Fri 02 March 2012 + + Sat 19 May 2012 @@ -62,7 +62,7 @@ By Dummy Author -

    In content.

    +

    In misc.

    diff --git a/tests/output/basic/oh-yeah.html b/tests/output/basic/oh-yeah.html index c8f1af74..bd0c75ee 100644 --- a/tests/output/basic/oh-yeah.html +++ b/tests/output/basic/oh-yeah.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • diff --git a/tests/output/basic/pages/this-is-a-test-hidden-page.html b/tests/output/basic/pages/this-is-a-test-hidden-page.html new file mode 100644 index 00000000..4412d600 --- /dev/null +++ b/tests/output/basic/pages/this-is-a-test-hidden-page.html @@ -0,0 +1,70 @@ + + + + This is a test hidden page + + + + + + + + + + + + + + + + + +
    +

    This is a test hidden page

    + +

    This is great for things like error(404) pages +Anyone can see this page but it's not linked to anywhere!

    + +
    + +
    + + +
    + + + + + + + + \ No newline at end of file diff --git a/tests/output/basic/pages/this-is-a-test-page.html b/tests/output/basic/pages/this-is-a-test-page.html index cc282243..14a78a29 100644 --- a/tests/output/basic/pages/this-is-a-test-page.html +++ b/tests/output/basic/pages/this-is-a-test-page.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • diff --git a/tests/output/basic/second-article-fr.html b/tests/output/basic/second-article-fr.html index 11960efc..a3701245 100644 --- a/tests/output/basic/second-article-fr.html +++ b/tests/output/basic/second-article-fr.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -62,7 +62,7 @@ By Dummy Author -

    In content.

    +

    In misc.

    tags: foobarbaz

    diff --git a/tests/output/basic/second-article.html b/tests/output/basic/second-article.html index 171717ba..cbae942b 100644 --- a/tests/output/basic/second-article.html +++ b/tests/output/basic/second-article.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -62,7 +62,7 @@ By Dummy Author -

    In content.

    +

    In misc.

    tags: foobarbaz

    diff --git a/tests/output/basic/tag/bar.html b/tests/output/basic/tag/bar.html index 8ffd84d8..47a427cb 100644 --- a/tests/output/basic/tag/bar.html +++ b/tests/output/basic/tag/bar.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -49,7 +49,7 @@

    This is some article, in english

    @@ -83,7 +83,6 @@ Translations: - @@ -91,7 +90,8 @@ Translations:
  • -

    This is some article, in english

    +

    Ceci est un article, en français.

    - read more + read more
    - @@ -131,7 +130,8 @@ Translations:
  • - @@ -167,7 +166,8 @@ as well as inline markup.

  • - - - + + + diff --git a/tests/output/basic/tag/baz.html b/tests/output/basic/tag/baz.html index ea01a199..d5c2904f 100644 --- a/tests/output/basic/tag/baz.html +++ b/tests/output/basic/tag/baz.html @@ -35,7 +35,7 @@
  • cat1
  • -
  • content
  • +
  • misc
  • yeah
  • @@ -49,7 +49,7 @@

    Other articles

    diff --git a/tests/output/basic/category/misc.html b/tests/output/basic/category/misc.html index 6a088793..86cf5470 100644 --- a/tests/output/basic/category/misc.html +++ b/tests/output/basic/category/misc.html @@ -69,8 +69,8 @@

    In misc.

    Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    read more diff --git a/tests/output/basic/feeds/all-en.atom.xml b/tests/output/basic/feeds/all-en.atom.xml index bc5418a7..fc05c4b3 100644 --- a/tests/output/basic/feeds/all-en.atom.xml +++ b/tests/output/basic/feeds/all-en.atom.xml @@ -1,8 +1,8 @@ A Pelican Blog/2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> A markdown powered article2011-04-20T00:00:00Ztag:,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> -<p><a href="unbelievable.html">a root-relative link to unbelievable</a> -<a href="unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00Ztag:,2011-02-17:article-1.html<p>Article 1</p> +<p><a href="/unbelievable.html">a root-relative link to unbelievable</a> +<a href="/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00Ztag:,2011-02-17:article-1.html<p>Article 1</p> Article 22011-02-17T00:00:00Ztag:,2011-02-17:article-2.html<p>Article 2</p> Article 32011-02-17T00:00:00Ztag:,2011-02-17:article-3.html<p>Article 3</p> This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> @@ -24,6 +24,6 @@ YEAH !</p> <img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> Unbelievable !2010-10-15T20:30:00Ztag:,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> -<p><a class="reference external" href="a-markdown-powered-article.html">a root-relative link to markdown-article</a> -<a class="reference external" href="a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> +<a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> \ No newline at end of file diff --git a/tests/output/basic/feeds/all.atom.xml b/tests/output/basic/feeds/all.atom.xml index 645c5890..f3a1a6f4 100644 --- a/tests/output/basic/feeds/all.atom.xml +++ b/tests/output/basic/feeds/all.atom.xml @@ -2,8 +2,8 @@ A Pelican Blog/2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> Deuxième article2012-02-29T00:00:00Ztag:,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> A markdown powered article2011-04-20T00:00:00Ztag:,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> -<p><a href="unbelievable.html">a root-relative link to unbelievable</a> -<a href="unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00Ztag:,2011-02-17:article-1.html<p>Article 1</p> +<p><a href="/unbelievable.html">a root-relative link to unbelievable</a> +<a href="/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00Ztag:,2011-02-17:article-1.html<p>Article 1</p> Article 22011-02-17T00:00:00Ztag:,2011-02-17:article-2.html<p>Article 2</p> Article 32011-02-17T00:00:00Ztag:,2011-02-17:article-3.html<p>Article 3</p> This is a super article !2010-12-02T10:14:00ZAlexis Métaireautag:,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> @@ -25,6 +25,6 @@ YEAH !</p> <img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> Unbelievable !2010-10-15T20:30:00Ztag:,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> -<p><a class="reference external" href="a-markdown-powered-article.html">a root-relative link to markdown-article</a> -<a class="reference external" href="a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> +<a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> \ No newline at end of file diff --git a/tests/output/basic/feeds/cat1.atom.xml b/tests/output/basic/feeds/cat1.atom.xml index 3d8100fd..2fa534aa 100644 --- a/tests/output/basic/feeds/cat1.atom.xml +++ b/tests/output/basic/feeds/cat1.atom.xml @@ -1,7 +1,7 @@ A Pelican Blog/2011-04-20T00:00:00ZA markdown powered article2011-04-20T00:00:00Ztag:,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> -<p><a href="unbelievable.html">a root-relative link to unbelievable</a> -<a href="unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00Ztag:,2011-02-17:article-1.html<p>Article 1</p> +<p><a href="/unbelievable.html">a root-relative link to unbelievable</a> +<a href="/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00Ztag:,2011-02-17:article-1.html<p>Article 1</p> Article 22011-02-17T00:00:00Ztag:,2011-02-17:article-2.html<p>Article 2</p> Article 32011-02-17T00:00:00Ztag:,2011-02-17:article-3.html<p>Article 3</p> \ No newline at end of file diff --git a/tests/output/basic/feeds/misc.atom.xml b/tests/output/basic/feeds/misc.atom.xml index 8e5477ba..40ad44c5 100644 --- a/tests/output/basic/feeds/misc.atom.xml +++ b/tests/output/basic/feeds/misc.atom.xml @@ -1,6 +1,6 @@ A Pelican Blog/2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> Unbelievable !2010-10-15T20:30:00Ztag:,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> -<p><a class="reference external" href="a-markdown-powered-article.html">a root-relative link to markdown-article</a> -<a class="reference external" href="a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> +<a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> \ No newline at end of file diff --git a/tests/output/basic/index.html b/tests/output/basic/index.html index 9c00402e..97bb5256 100644 --- a/tests/output/basic/index.html +++ b/tests/output/basic/index.html @@ -69,8 +69,8 @@

    In cat1.

    You're mutually oblivious.

    -

    a root-relative link to unbelievable -a file-relative link to unbelievable

    +

    a root-relative link to unbelievable +a file-relative link to unbelievable

    read more @@ -214,8 +214,8 @@ YEAH !

    In misc.

    Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    read more diff --git a/tests/output/basic/unbelievable.html b/tests/output/basic/unbelievable.html index 95bc7b85..36a1703c 100644 --- a/tests/output/basic/unbelievable.html +++ b/tests/output/basic/unbelievable.html @@ -46,8 +46,8 @@

    In misc.

    Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    diff --git a/tests/output/custom/a-markdown-powered-article.html b/tests/output/custom/a-markdown-powered-article.html index 52d0e5f9..49c0d422 100644 --- a/tests/output/custom/a-markdown-powered-article.html +++ b/tests/output/custom/a-markdown-powered-article.html @@ -53,8 +53,8 @@

    In cat1.

    You're mutually oblivious.

    -

    a root-relative link to unbelievable -a file-relative link to unbelievable

    +

    a root-relative link to unbelievable +a file-relative link to unbelievable

    Comments !

    diff --git a/tests/output/custom/author/alexis-metaireau.html b/tests/output/custom/author/alexis-metaireau.html index 5a36c27e..eb39ae57 100644 --- a/tests/output/custom/author/alexis-metaireau.html +++ b/tests/output/custom/author/alexis-metaireau.html @@ -50,8 +50,8 @@

    In cat1.

    You're mutually oblivious.

    -

    a root-relative link to unbelievable -a file-relative link to unbelievable

    There are comments.

    +

    a root-relative link to unbelievable +a file-relative link to unbelievable

    There are comments.

    Other articles

    diff --git a/tests/output/custom/author/alexis-metaireau2.html b/tests/output/custom/author/alexis-metaireau2.html index e456805b..a87c85af 100644 --- a/tests/output/custom/author/alexis-metaireau2.html +++ b/tests/output/custom/author/alexis-metaireau2.html @@ -62,7 +62,7 @@

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text
    read more @@ -142,8 +142,8 @@ as well as inline markup.

    In misc.

    Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    read more

    There are comments.

    diff --git a/tests/output/custom/category/bar.html b/tests/output/custom/category/bar.html index d291b9df..253d64ea 100644 --- a/tests/output/custom/category/bar.html +++ b/tests/output/custom/category/bar.html @@ -55,7 +55,7 @@

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text

    There are comments.

    diff --git a/tests/output/custom/category/cat1.html b/tests/output/custom/category/cat1.html index 9316faf0..8c265d41 100644 --- a/tests/output/custom/category/cat1.html +++ b/tests/output/custom/category/cat1.html @@ -50,8 +50,8 @@

    In cat1.

    You're mutually oblivious.

    -

    a root-relative link to unbelievable -a file-relative link to unbelievable

    There are comments.

    +

    a root-relative link to unbelievable +a file-relative link to unbelievable

    There are comments.

    Other articles

    diff --git a/tests/output/custom/category/misc.html b/tests/output/custom/category/misc.html index 6609ce25..24a53791 100644 --- a/tests/output/custom/category/misc.html +++ b/tests/output/custom/category/misc.html @@ -79,8 +79,8 @@

    In misc.

    Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    read more

    There are comments.

    diff --git a/tests/output/custom/category/yeah.html b/tests/output/custom/category/yeah.html index 587e2f97..c39e1a86 100644 --- a/tests/output/custom/category/yeah.html +++ b/tests/output/custom/category/yeah.html @@ -53,8 +53,8 @@

    This is a simple title

    And here comes the cool stuff.

    -alternate text -alternate text +alternate text +alternate text
     >>> from ipdb import set_trace
     >>> set_trace()
    diff --git a/tests/output/custom/index.html b/tests/output/custom/index.html
    index 7b7cb84b..eab96fa1 100644
    --- a/tests/output/custom/index.html
    +++ b/tests/output/custom/index.html
    @@ -79,8 +79,8 @@
             

    In cat1.

    You're mutually oblivious.

    -

    a root-relative link to unbelievable -a file-relative link to unbelievable

    +

    a root-relative link to unbelievable +a file-relative link to unbelievable

    read more

    There are comments.

    diff --git a/tests/output/custom/index2.html b/tests/output/custom/index2.html index 8e308821..5269ed70 100644 --- a/tests/output/custom/index2.html +++ b/tests/output/custom/index2.html @@ -113,7 +113,7 @@ as well as inline markup.

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text read more @@ -140,8 +140,8 @@ YEAH !

    In misc.

    Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    read more

    There are comments.

    diff --git a/tests/output/custom/oh-yeah.html b/tests/output/custom/oh-yeah.html index aafcc69d..cb30a7d6 100644 --- a/tests/output/custom/oh-yeah.html +++ b/tests/output/custom/oh-yeah.html @@ -58,7 +58,7 @@

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text diff --git a/tests/output/custom/pages/this-is-a-test-page.html b/tests/output/custom/pages/this-is-a-test-page.html index 6cb1c582..5df98726 100644 --- a/tests/output/custom/pages/this-is-a-test-page.html +++ b/tests/output/custom/pages/this-is-a-test-page.html @@ -38,7 +38,7 @@

    This is a test page

    Just an image.

    -alternate text +alternate text
    diff --git a/tests/output/custom/tag/bar.html b/tests/output/custom/tag/bar.html index 319f9595..85bc5a07 100644 --- a/tests/output/custom/tag/bar.html +++ b/tests/output/custom/tag/bar.html @@ -137,7 +137,7 @@ as well as inline markup.

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text read more diff --git a/tests/output/custom/tag/foobar.html b/tests/output/custom/tag/foobar.html index c8653686..b7a257e4 100644 --- a/tests/output/custom/tag/foobar.html +++ b/tests/output/custom/tag/foobar.html @@ -53,8 +53,8 @@

    This is a simple title

    And here comes the cool stuff.

    -alternate text -alternate text +alternate text +alternate text
     >>> from ipdb import set_trace
     >>> set_trace()
    diff --git a/tests/output/custom/tag/oh.html b/tests/output/custom/tag/oh.html
    index ddec0f41..451b1031 100644
    --- a/tests/output/custom/tag/oh.html
    +++ b/tests/output/custom/tag/oh.html
    @@ -55,7 +55,7 @@
     

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text

    There are comments.

    diff --git a/tests/output/custom/tag/yeah.html b/tests/output/custom/tag/yeah.html index a000affd..151eb64c 100644 --- a/tests/output/custom/tag/yeah.html +++ b/tests/output/custom/tag/yeah.html @@ -55,7 +55,7 @@

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! YEAH !

    -alternate text +alternate text

    There are comments.

    diff --git a/tests/output/custom/this-is-a-super-article.html b/tests/output/custom/this-is-a-super-article.html index 0f1e198b..98d22351 100644 --- a/tests/output/custom/this-is-a-super-article.html +++ b/tests/output/custom/this-is-a-super-article.html @@ -56,8 +56,8 @@

    This is a simple title

    And here comes the cool stuff.

    -alternate text -alternate text +alternate text +alternate text
     >>> from ipdb import set_trace
     >>> set_trace()
    diff --git a/tests/output/custom/unbelievable.html b/tests/output/custom/unbelievable.html
    index f22a05a2..691f28f6 100644
    --- a/tests/output/custom/unbelievable.html
    +++ b/tests/output/custom/unbelievable.html
    @@ -53,8 +53,8 @@
             

    In misc.

    Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    From 81cb774a8e807453a82921aa31f2f1325b6a3d23 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Sat, 1 Dec 2012 21:35:15 +0100 Subject: [PATCH 0581/2344] add docs for cross-site linking --- docs/getting_started.rst | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 467363de..bc3d2bbe 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -226,6 +226,50 @@ If you want to exclude any pages from being linked to or listed in the menu then add a ``status: hidden`` attribute to its metadata. This is useful for things like making error pages that fit the generated theme of your site. +Linking to internal content +--------------------------- + +Since Pelican 3.1, you now have the ability to do cross-site linking. + +To link to an internal content, you will have to use the following syntax: +``|filename|path/to/file``. + +For example, you may want to add links between "article1" and "article2" given +the structure:: + + website/ + ├── content + │   ├── article1.rst + │   └── cat/ + │      └── article2.md + └── pelican.conf.py + +In this example, ``article1.rst`` could look like:: + + Title: The first article + Date: 2012-12-01 + + See below cross-site links examples in restructured text. + + `a root-relative link <|filename|/cat/article2.md>`_ + `a file-relative link <|filename|cat/article2.md>`_ + +and ``article2.md``:: + + Title: The second article + Date: 2012-12-01 + + See below cross-site links examples in markdown. + + [a root-relative link](|filename|/article1.rst) + [a file-relative link](|filename|../article1.rst) + +.. note:: + + You can use the same syntax to link to internal pages or even static + content (like images) which would be available in a directory listed in + ``settings["STATIC_PATHS"]``. + Importing an existing blog -------------------------- From 891a66ad8bd0913c064f176db3dba405f83b7aaa Mon Sep 17 00:00:00 2001 From: Michael Reneer Date: Sun, 2 Dec 2012 13:11:47 -0500 Subject: [PATCH 0582/2344] Updated documentation to reflect addition of new markdown types. --- docs/getting_started.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index bc3d2bbe..7b44034c 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -162,10 +162,10 @@ Pelican implements an extension of reStructuredText to enable support for the This will be turned into :abbr:`HTML (HyperText Markup Language)`. -You can also use Markdown syntax (with a file ending in ``.md``). -Markdown generation will not work until you explicitly install the ``Markdown`` -package, which can be done via ``pip install Markdown``. Metadata syntax for -Markdown posts should follow this pattern:: +You can also use Markdown syntax (with a file ending in ``.md``, ``.markdown``, +or ``.mkd``). Markdown generation will not work until you explicitly install the +``Markdown`` package, which can be done via ``pip install Markdown``. Metadata +syntax for Markdown posts should follow this pattern:: Title: My super title Date: 2010-12-03 10:20 From 49f481e399af45bf12f53afd129bd6a873dc2f27 Mon Sep 17 00:00:00 2001 From: "Brian C. Lane" Date: Sun, 28 Oct 2012 07:37:53 -0700 Subject: [PATCH 0583/2344] Add asciidoc reader support http://www.methods.co.nz/asciidoc/index.html Processes files ending in .asc with asciidoc. Extra arguments can be passed by using the ASCIIDOC_OPTIONS config setting --- docs/changelog.rst | 1 + docs/getting_started.rst | 4 ++ docs/index.rst | 3 +- docs/internals.rst | 10 ++--- docs/settings.rst | 2 + pelican/readers.py | 36 ++++++++++++++++ tests/content/article_with_asc_extension.asc | 12 ++++++ tests/content/article_with_asc_options.asc | 9 ++++ tests/test_readers.py | 43 ++++++++++++++++++++ 9 files changed, 114 insertions(+), 6 deletions(-) create mode 100644 tests/content/article_with_asc_extension.asc create mode 100644 tests/content/article_with_asc_options.asc diff --git a/docs/changelog.rst b/docs/changelog.rst index f60c6e47..f25ee3d9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -24,6 +24,7 @@ Release history * Add the gzip_cache plugin which compresses common text files into a ``.gz`` file within the same directory as the original file to prevent the server (e.g. Nginx) from compressing files during an HTTP call. +* Add AsciiDoc support 3.0 (2012-08-08) ================== diff --git a/docs/getting_started.rst b/docs/getting_started.rst index bc3d2bbe..8959f536 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -42,6 +42,10 @@ Markdown library as well:: $ pip install Markdown +If you want to use AsciiDoc you need to install it from `source +`_ or use your operating +system's package manager. + Upgrading --------- diff --git a/docs/index.rst b/docs/index.rst index fd99b449..8206727c 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,7 @@ Pelican Pelican is a static site generator, written in Python_. * Write your weblog entries directly with your editor of choice (vim!) - in reStructuredText_ or Markdown_ + in reStructuredText_, Markdown_ or AsciiDoc_ * Includes a simple CLI tool to (re)generate the weblog * Easy to interface with DVCSes and web hooks * Completely static output is easy to host anywhere @@ -74,6 +74,7 @@ A French version of the documentation is available at :doc:`fr/index`. .. _Python: http://www.python.org/ .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Markdown: http://daringfireball.net/projects/markdown/ +.. _AsciiDoc: http://www.methods.co.nz/asciidoc/index.html .. _Jinja2: http://jinja.pocoo.org/ .. _`Pelican documentation`: http://docs.getpelican.com/latest/ .. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html diff --git a/docs/internals.rst b/docs/internals.rst index a6264476..280e14d7 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -12,8 +12,8 @@ original author wrote with some software design information. Overall structure ================= -What Pelican does is take a list of files and process them into some -sort of output. Usually, the input files are reStructuredText and Markdown +What Pelican does is take a list of files and process them into some sort of +output. Usually, the input files are reStructuredText, Markdown and AsciiDoc files, and the output is a blog, but both input and output can be anything you want. @@ -23,9 +23,9 @@ The logic is separated into different classes and concepts: on. Since those operations are commonly used, the object is created once and then passed to the generators. -* **Readers** are used to read from various formats (Markdown and - reStructuredText for now, but the system is extensible). Given a file, they return - metadata (author, tags, category, etc.) and content (HTML-formatted). +* **Readers** are used to read from various formats (AsciiDoc, Markdown and + reStructuredText for now, but the system is extensible). Given a file, they + return metadata (author, tags, category, etc.) and content (HTML-formatted). * **Generators** generate the different outputs. For instance, Pelican comes with ``ArticlesGenerator`` and ``PageGenerator``. Given a configuration, they can do diff --git a/docs/settings.rst b/docs/settings.rst index a7cf107b..7d73afe0 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -121,6 +121,8 @@ Setting name (default value) What doe This templates need to use ``DIRECT_TEMPLATES`` setting `MARKDOWN_EXTENSIONS` (``['toc',]``) A list of any Markdown extensions you want to use. +`ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to asciidoc, see the `manpage + `_ ===================================================================== ===================================================================== .. [#] Default is the system locale. diff --git a/pelican/readers.py b/pelican/readers.py index 42995688..f04b4a03 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -13,6 +13,11 @@ try: from markdown import Markdown except ImportError: Markdown = False # NOQA +try: + from asciidocapi import AsciiDocAPI + asciidoc = True +except ImportError: + asciidoc = False import re from pelican.contents import Category, Tag, Author @@ -162,6 +167,37 @@ class HtmlReader(Reader): return content, metadata +class AsciiDocReader(Reader): + enabled = bool(asciidoc) + file_extensions = ['asc'] + default_options = ["--no-header-footer", "-a newline=\\n"] + + def read(self, filename): + """Parse content and metadata of asciidoc files""" + from cStringIO import StringIO + text = StringIO(pelican_open(filename)) + content = StringIO() + ad = AsciiDocAPI() + + options = self.settings.get('ASCIIDOC_OPTIONS', []) + if isinstance(options, (str, unicode)): + options = [m.strip() for m in options.split(',')] + options = self.default_options + options + for o in options: + ad.options(*o.split()) + + ad.execute(text, content, backend="html4") + content = content.getvalue() + + metadata = {} + for name, value in ad.asciidoc.document.attributes.items(): + name = name.lower() + metadata[name] = self.process_metadata(name, value) + if 'doctitle' in metadata: + metadata['title'] = metadata['doctitle'] + return content, metadata + + _EXTENSIONS = {} for cls in Reader.__subclasses__(): diff --git a/tests/content/article_with_asc_extension.asc b/tests/content/article_with_asc_extension.asc new file mode 100644 index 00000000..9ce2166c --- /dev/null +++ b/tests/content/article_with_asc_extension.asc @@ -0,0 +1,12 @@ +Test AsciiDoc File Header +========================= +:Author: Author O. Article +:Email: +:Date: 2011-09-15 09:05 +:Category: Blog +:Tags: Linux, Python, Pelican + +Used for pelican test +--------------------- + +The quick brown fox jumped over the lazy dog's back. diff --git a/tests/content/article_with_asc_options.asc b/tests/content/article_with_asc_options.asc new file mode 100644 index 00000000..bafb3a4a --- /dev/null +++ b/tests/content/article_with_asc_options.asc @@ -0,0 +1,9 @@ +Test AsciiDoc File Header +========================= + +Used for pelican test +--------------------- + +version {revision} + +The quick brown fox jumped over the lazy dog's back. diff --git a/tests/test_readers.py b/tests/test_readers.py index 406027c1..c9d22c18 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -109,3 +109,46 @@ class MdReaderTest(unittest.TestCase): '

    Level2

    ' self.assertEqual(content, expected) + +class AdReaderTest(unittest.TestCase): + + @unittest.skipUnless(readers.asciidoc, "asciidoc isn't installed") + def test_article_with_asc_extension(self): + # test to ensure the asc extension is being processed by the correct reader + reader = readers.AsciiDocReader({}) + content, metadata = reader.read(_filename('article_with_asc_extension.asc')) + expected = '
    \n

    Used for pelican test

    \n'\ + '

    The quick brown fox jumped over the lazy dog’s back.

    \n' + self.assertEqual(content, expected) + expected = { + 'category': 'Blog', + 'author': 'Author O. Article', + 'title': 'Test AsciiDoc File Header', + 'date': datetime.datetime(2011, 9, 15, 9, 5), + 'tags': ['Linux', 'Python', 'Pelican'], + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + + expected = { + 'category': 'Blog', + 'author': 'Author O. Article', + 'title': 'Test AsciiDoc File Header', + 'date': datetime.datetime(2011, 9, 15, 9, 5), + 'tags': ['Linux', 'Python', 'Pelican'], + } + + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + @unittest.skipUnless(readers.asciidoc, "asciidoc isn't installed") + def test_article_with_asc_options(self): + # test to ensure the ASCIIDOC_OPTIONS is being used + reader = readers.AsciiDocReader(dict(ASCIIDOC_OPTIONS=["-a revision=1.0.42"])) + content, metadata = reader.read(_filename('article_with_asc_options.asc')) + expected = '
    \n

    Used for pelican test

    \n'\ + '

    version 1.0.42

    \n'\ + '

    The quick brown fox jumped over the lazy dog’s back.

    \n' + self.assertEqual(content, expected) From a0049f9fcddf967d036a88fcf17169982f3fc993 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 2 Dec 2012 16:10:11 -0800 Subject: [PATCH 0584/2344] Strip tags from title in simple index. Fixes #612 This fix was applied previously to the relevant places in both the "simple" and "notmyidea" themes, but the simple theme's index.html file was apparently neglected. --- pelican/themes/simple/templates/index.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/themes/simple/templates/index.html b/pelican/themes/simple/templates/index.html index dfdb0b45..5bb94dfc 100644 --- a/pelican/themes/simple/templates/index.html +++ b/pelican/themes/simple/templates/index.html @@ -1,14 +1,14 @@ {% extends "base.html" %} -{% block content %} +{% block content %}
    {% block content_title %}

    All articles

    {% endblock %}
      -{% for article in articles_page.object_list %} -
    1. -

      {{ article.title }}

      +{% for article in articles_page.object_list %} +
    2. +

      {{ article.title }}

      {{ article.locale_date }} {% if article.author %}
      By {{ article.author }}
      {% endif %} From debd6fb3b4a472c80a8fc7924eddf6e79856e725 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Wed, 28 Nov 2012 00:29:30 +0100 Subject: [PATCH 0585/2344] add FILENAME_METADATA setting to extract metadata from filename FILENAME_METADATA default to '(?P\d{4}-\d{2}-\d{2}).*' which will allow to extract date metadata from the filename. --- pelican/readers.py | 14 +++++++++++++- pelican/settings.py | 12 +++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index f04b4a03..ad2b0f74 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -1,4 +1,6 @@ # -*- coding: utf-8 -*- +import os +import re try: import docutils import docutils.core @@ -207,8 +209,9 @@ for cls in Reader.__subclasses__(): def read_file(filename, fmt=None, settings=None): """Return a reader object using the given format.""" + base, ext = os.path.splitext(os.path.basename(filename)) if not fmt: - fmt = filename.split('.')[-1] + fmt = ext[1:] if fmt not in _EXTENSIONS: raise TypeError('Pelican does not know how to parse %s' % filename) @@ -230,4 +233,13 @@ def read_file(filename, fmt=None, settings=None): content = typogrify(content) metadata['title'] = typogrify(metadata['title']) + filename_metadata = settings and settings.get('FILENAME_METADATA') + if filename_metadata: + match = re.match(filename_metadata, base) + if match: + for k, v in match.groupdict().iteritems(): + if k not in metadata: + k = k.lower() # metadata must be lowercase + metadata[k] = reader.process_metadata(k, v) + return content, metadata diff --git a/pelican/settings.py b/pelican/settings.py index d2c0cef5..a98f3538 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -5,6 +5,7 @@ import inspect import os import locale import logging +import re from os.path import isabs @@ -60,7 +61,7 @@ _DEFAULT_CONFIG = {'PATH': '.', 'TAG_CLOUD_STEPS': 4, 'TAG_CLOUD_MAX_ITEMS': 100, 'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'archives'), - 'EXTRA_TEMPLATES_PATHS' : [], + 'EXTRA_TEMPLATES_PATHS': [], 'PAGINATED_DIRECT_TEMPLATES': ('index', ), 'PELICAN_CLASS': 'pelican.Pelican', 'DEFAULT_DATE_FORMAT': '%a %d %B %Y', @@ -70,6 +71,7 @@ _DEFAULT_CONFIG = {'PATH': '.', 'DEFAULT_PAGINATION': False, 'DEFAULT_ORPHANS': 0, 'DEFAULT_METADATA': (), + 'FILENAME_METADATA': '(?P\d{4}-\d{2}-\d{2}).*', 'FILES_TO_COPY': (), 'DEFAULT_STATUS': 'published', 'ARTICLE_PERMALINK_STRUCTURE': '', @@ -205,4 +207,12 @@ def configure_settings(settings): " falling back to the default extension " + _DEFAULT_CONFIG['OUTPUT_SOURCES_EXTENSION']) + filename_metadata = settings.get('FILENAME_METADATA') + if filename_metadata and not isinstance(filename_metadata, basestring): + logger.error("Detected misconfiguration with FILENAME_METADATA" + " setting (must be string or compiled pattern), falling" + "back to the default") + settings['FILENAME_METADATA'] = \ + _DEFAULT_CONFIG['FILENAME_METADATA'] + return settings From 3a25f82c4fc95c4654a7d85eb0fdd85e39cfb904 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Wed, 28 Nov 2012 01:01:15 +0100 Subject: [PATCH 0586/2344] update docs/settings.rst for both DEFAULT_METADATA and FILENAME_METADATA --- docs/settings.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/docs/settings.rst b/docs/settings.rst index 7d73afe0..2ce44dfb 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -50,6 +50,16 @@ Setting name (default value) What doe If tuple object, it will instead generate the default datetime object by passing the tuple to the datetime.datetime constructor. +`DEFAULT_METADATA` (``()``) The default metadata you want to use for all articles + and pages. +`FILENAME_METADATA` (``'(?P\d{4}-\d{2}-\d{2}).*'``) The regexp that will be used to extract any metadata + from the filename. All named groups that are matched + will be set in the metadata object. + The default value will only extract the date from + the filename. + For example, if you would like to extract both the + date and the slug, you could set something like: + ``'(?P\d{4}-\d{2}-\d{2})_(?.*)'``. `DELETE_OUTPUT_DIRECTORY` (``False``) Delete the content of the output directory before generating new files. `FILES_TO_COPY` (``()``) A list of files (or directories) to copy from the source (inside the From dfab8ed5b96a03ac35394acc3123ca0b79eb552e Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 30 Nov 2012 01:12:59 +0100 Subject: [PATCH 0587/2344] test the "metadata from filename" feature --- pelican/readers.py | 2 +- ...2012-11-29_rst_w_filename_meta#foo-bar.rst | 6 ++ .../2012-11-30_md_w_filename_meta#foo-bar.md | 6 ++ tests/test_readers.py | 93 +++++++++++++++++++ 4 files changed, 106 insertions(+), 1 deletion(-) create mode 100644 tests/content/2012-11-29_rst_w_filename_meta#foo-bar.rst create mode 100644 tests/content/2012-11-30_md_w_filename_meta#foo-bar.md diff --git a/pelican/readers.py b/pelican/readers.py index ad2b0f74..74cec02f 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -228,7 +228,7 @@ def read_file(filename, fmt=None, settings=None): content, metadata = reader.read(filename) # eventually filter the content with typogrify if asked so - if settings and settings['TYPOGRIFY']: + if settings and settings.get('TYPOGRIFY'): from typogrify.filters import typogrify content = typogrify(content) metadata['title'] = typogrify(metadata['title']) diff --git a/tests/content/2012-11-29_rst_w_filename_meta#foo-bar.rst b/tests/content/2012-11-29_rst_w_filename_meta#foo-bar.rst new file mode 100644 index 00000000..43f05a15 --- /dev/null +++ b/tests/content/2012-11-29_rst_w_filename_meta#foo-bar.rst @@ -0,0 +1,6 @@ + +Rst with filename metadata +########################## + +:category: yeah +:author: Alexis Métaireau diff --git a/tests/content/2012-11-30_md_w_filename_meta#foo-bar.md b/tests/content/2012-11-30_md_w_filename_meta#foo-bar.md new file mode 100644 index 00000000..cdccfc8a --- /dev/null +++ b/tests/content/2012-11-30_md_w_filename_meta#foo-bar.md @@ -0,0 +1,6 @@ +category: yeah +author: Alexis Métaireau + +Markdown with filename metadata +=============================== + diff --git a/tests/test_readers.py b/tests/test_readers.py index c9d22c18..dcfee809 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -34,6 +34,50 @@ class RstReaderTest(unittest.TestCase): for key, value in expected.items(): self.assertEquals(value, metadata[key], key) + def test_article_with_filename_metadata(self): + content, metadata = readers.read_file( + _filename('2012-11-29_rst_w_filename_meta#foo-bar.rst'), + settings={}) + expected = { + 'category': 'yeah', + 'author': u'Alexis Métaireau', + 'title': 'Rst with filename metadata', + } + for key, value in metadata.items(): + self.assertEquals(value, expected[key], key) + + content, metadata = readers.read_file( + _filename('2012-11-29_rst_w_filename_meta#foo-bar.rst'), + settings={ + 'FILENAME_METADATA': '(?P\d{4}-\d{2}-\d{2}).*' + }) + expected = { + 'category': 'yeah', + 'author': u'Alexis Métaireau', + 'title': 'Rst with filename metadata', + 'date': datetime.datetime(2012, 11, 29), + } + for key, value in metadata.items(): + self.assertEquals(value, expected[key], key) + + content, metadata = readers.read_file( + _filename('2012-11-29_rst_w_filename_meta#foo-bar.rst'), + settings={ + 'FILENAME_METADATA': '(?P\d{4}-\d{2}-\d{2})_' \ + '_(?P.*)' \ + '#(?P.*)-(?P.*)' + }) + expected = { + 'category': 'yeah', + 'author': u'Alexis Métaireau', + 'title': 'Rst with filename metadata', + 'date': datetime.datetime(2012, 11, 29), + 'slug': 'article_with_filename_metadata', + 'mymeta': 'foo', + } + for key, value in metadata.items(): + self.assertEquals(value, expected[key], key) + def test_article_metadata_key_lowercase(self): """Keys of metadata should be lowercase.""" reader = readers.RstReader({}) @@ -80,6 +124,13 @@ class MdReaderTest(unittest.TestCase): self.assertEqual(content, expected) + expected = { + 'category': 'test', + 'title': 'Test md File', + } + for key, value in metadata.items(): + self.assertEquals(value, expected[key], key) + @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_mkd_extension(self): # test to ensure the mkd extension is being processed by the correct reader @@ -110,6 +161,48 @@ class MdReaderTest(unittest.TestCase): self.assertEqual(content, expected) + @unittest.skipUnless(readers.Markdown, "markdown isn't installed") + def test_article_with_filename_metadata(self): + content, metadata = readers.read_file( + _filename('2012-11-30_md_w_filename_meta#foo-bar.md'), + settings={}) + expected = { + 'category': 'yeah', + 'author': u'Alexis Métaireau', + } + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + content, metadata = readers.read_file( + _filename('2012-11-30_md_w_filename_meta#foo-bar.md'), + settings={ + 'FILENAME_METADATA': '(?P\d{4}-\d{2}-\d{2}).*' + }) + expected = { + 'category': 'yeah', + 'author': u'Alexis Métaireau', + 'date': datetime.datetime(2012, 11, 30), + } + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + + content, metadata = readers.read_file( + _filename('2012-11-30_md_w_filename_meta#foo-bar.md'), + settings={ + 'FILENAME_METADATA': '(?P\d{4}-\d{2}-\d{2})' + '_(?P.*)' + '#(?P.*)-(?P.*)' + }) + expected = { + 'category': 'yeah', + 'author': u'Alexis Métaireau', + 'date': datetime.datetime(2012, 11, 30), + 'slug': 'md_w_filename_meta', + 'mymeta': 'foo', + } + for key, value in expected.items(): + self.assertEquals(value, metadata[key], key) + class AdReaderTest(unittest.TestCase): @unittest.skipUnless(readers.asciidoc, "asciidoc isn't installed") From 92b9ccb08a077675984986c4f36fedf73c0e803b Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 30 Nov 2012 01:29:11 +0100 Subject: [PATCH 0588/2344] fix failing TestArticlesGenerator.test_generate_context test new file have been added to the content directory so articles_expected needs to be updated --- tests/test_generators.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/test_generators.py b/tests/test_generators.py index 7abaf687..90b19227 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -73,6 +73,7 @@ class TestArticlesGenerator(unittest.TestCase): [u'Article title', 'published', 'Default', 'article'], [u'Article with template', 'published', 'Default', 'custom'], [u'Test md File', 'published', 'test', 'article'], + [u'Rst with filename metadata', 'published', u'yeah', 'article'], [u'Test Markdown extensions', 'published', u'Default', 'article'], [u'This is a super article !', 'published', 'Yeah', 'article'], [u'This is an article with category !', 'published', 'yeah', 'article'], From fc13ae8e7605db6cac1f3e7dfac5aa9777d088b0 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 30 Nov 2012 01:48:28 +0100 Subject: [PATCH 0589/2344] add new file to functional test content to showcase FILENAME_METADATA and update functional tests output --- .../content/2012-11-30_filename-metadata.rst | 4 + tests/output/basic/archives.html | 2 + tests/output/basic/category/misc.html | 40 ++++-- tests/output/basic/feeds/all-en.atom.xml | 3 +- tests/output/basic/feeds/all.atom.xml | 3 +- tests/output/basic/feeds/misc.atom.xml | 3 +- .../basic/filename_metadata-example.html | 66 ++++++++++ tests/output/basic/index.html | 40 ++++-- tests/output/custom/archives.html | 2 + .../custom/author/alexis-metaireau.html | 2 +- .../custom/author/alexis-metaireau2.html | 55 ++++----- .../custom/author/alexis-metaireau3.html | 115 +++++++++++++++++ tests/output/custom/category/misc.html | 43 +++++-- tests/output/custom/feeds/all-en.atom.xml | 3 +- tests/output/custom/feeds/all.atom.xml | 3 +- tests/output/custom/feeds/all.rss.xml | 3 +- tests/output/custom/feeds/misc.atom.xml | 3 +- tests/output/custom/feeds/misc.rss.xml | 3 +- .../custom/filename_metadata-example.html | 116 ++++++++++++++++++ tests/output/custom/index.html | 70 +++++------ tests/output/custom/index2.html | 55 ++++----- tests/output/custom/index3.html | 115 +++++++++++++++++ 22 files changed, 622 insertions(+), 127 deletions(-) create mode 100644 samples/content/2012-11-30_filename-metadata.rst create mode 100644 tests/output/basic/filename_metadata-example.html create mode 100644 tests/output/custom/author/alexis-metaireau3.html create mode 100644 tests/output/custom/filename_metadata-example.html create mode 100644 tests/output/custom/index3.html diff --git a/samples/content/2012-11-30_filename-metadata.rst b/samples/content/2012-11-30_filename-metadata.rst new file mode 100644 index 00000000..b048103d --- /dev/null +++ b/samples/content/2012-11-30_filename-metadata.rst @@ -0,0 +1,4 @@ +FILENAME_METADATA example +######################### + +Some cool stuff! diff --git a/tests/output/basic/archives.html b/tests/output/basic/archives.html index 0bccff9b..cb06dfa1 100644 --- a/tests/output/basic/archives.html +++ b/tests/output/basic/archives.html @@ -33,6 +33,8 @@

      Archives for A Pelican Blog

      +
      Fri 30 November 2012
      +
      FILENAME_METADATA example
      Wed 29 February 2012
      Second article
      Wed 20 April 2011
      diff --git a/tests/output/basic/category/misc.html b/tests/output/basic/category/misc.html index 86cf5470..2d62b852 100644 --- a/tests/output/basic/category/misc.html +++ b/tests/output/basic/category/misc.html @@ -34,8 +34,32 @@ +
      +

      Other articles

      +
      +
        + + + +
      1. +
        +

        Second article

        +
        + +
        +
        Wed 29 February 2012 @@ -44,14 +68,12 @@

        tags: foobarbaz

        Translations: fr -

        This is some article, in english

        -
        - -
        -

        Other articles

        -
        -
          - +

      This is some article, in english

      + + read more +
    + +
  • diff --git a/tests/output/basic/feeds/all-en.atom.xml b/tests/output/basic/feeds/all-en.atom.xml index fc05c4b3..54c87905 100644 --- a/tests/output/basic/feeds/all-en.atom.xml +++ b/tests/output/basic/feeds/all-en.atom.xml @@ -1,5 +1,6 @@ -A Pelican Blog/2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> +A Pelican Blog/2012-11-30T00:00:00ZFILENAME_METADATA example2012-11-30T00:00:00Ztag:,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> A markdown powered article2011-04-20T00:00:00Ztag:,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> <p><a href="/unbelievable.html">a root-relative link to unbelievable</a> <a href="/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00Ztag:,2011-02-17:article-1.html<p>Article 1</p> diff --git a/tests/output/basic/feeds/all.atom.xml b/tests/output/basic/feeds/all.atom.xml index f3a1a6f4..3081adc6 100644 --- a/tests/output/basic/feeds/all.atom.xml +++ b/tests/output/basic/feeds/all.atom.xml @@ -1,5 +1,6 @@ -A Pelican Blog/2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> +A Pelican Blog/2012-11-30T00:00:00ZFILENAME_METADATA example2012-11-30T00:00:00Ztag:,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> Deuxième article2012-02-29T00:00:00Ztag:,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> A markdown powered article2011-04-20T00:00:00Ztag:,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> <p><a href="/unbelievable.html">a root-relative link to unbelievable</a> diff --git a/tests/output/basic/feeds/misc.atom.xml b/tests/output/basic/feeds/misc.atom.xml index 40ad44c5..e71bd151 100644 --- a/tests/output/basic/feeds/misc.atom.xml +++ b/tests/output/basic/feeds/misc.atom.xml @@ -1,5 +1,6 @@ -A Pelican Blog/2012-02-29T00:00:00ZSecond article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> +A Pelican Blog/2012-11-30T00:00:00ZFILENAME_METADATA example2012-11-30T00:00:00Ztag:,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00Ztag:,2012-02-29:second-article.html<p>This is some article, in english</p> Unbelievable !2010-10-15T20:30:00Ztag:,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> diff --git a/tests/output/basic/filename_metadata-example.html b/tests/output/basic/filename_metadata-example.html new file mode 100644 index 00000000..b7ae95a7 --- /dev/null +++ b/tests/output/basic/filename_metadata-example.html @@ -0,0 +1,66 @@ + + + + FILENAME_METADATA example + + + + + + + + + + + + + + +
    + +
    +
    +
    + + + + + \ No newline at end of file diff --git a/tests/output/basic/index.html b/tests/output/basic/index.html index 97bb5256..488d1b08 100644 --- a/tests/output/basic/index.html +++ b/tests/output/basic/index.html @@ -34,8 +34,32 @@ +
    +

    Other articles

    +
    +
      + + + +
    1. +
      +

      Second article

      +
      + +
      +
      Wed 29 February 2012 @@ -44,14 +68,12 @@

      tags: foobarbaz

      Translations: fr -

      This is some article, in english

      -
      - -
      -

      Other articles

      -
      -
        - +

        This is some article, in english

        + + read more + +
  • +
  • diff --git a/tests/output/custom/archives.html b/tests/output/custom/archives.html index 44bc876e..632387a4 100644 --- a/tests/output/custom/archives.html +++ b/tests/output/custom/archives.html @@ -37,6 +37,8 @@

    Archives for Alexis' log

    +
    Fri 30 November 2012
    +
    FILENAME_METADATA example
    Wed 29 February 2012
    Second article
    Wed 20 April 2011
    diff --git a/tests/output/custom/author/alexis-metaireau.html b/tests/output/custom/author/alexis-metaireau.html index eb39ae57..8bb0dd1c 100644 --- a/tests/output/custom/author/alexis-metaireau.html +++ b/tests/output/custom/author/alexis-metaireau.html @@ -134,7 +134,7 @@
  • - Page 1 / 2 + Page 1 / 3 »

    diff --git a/tests/output/custom/author/alexis-metaireau2.html b/tests/output/custom/author/alexis-metaireau2.html index a87c85af..59926d8c 100644 --- a/tests/output/custom/author/alexis-metaireau2.html +++ b/tests/output/custom/author/alexis-metaireau2.html @@ -39,6 +39,31 @@
      +
    1. + + +
    2. - - - -

    « - Page 2 / 2 + Page 2 / 3 + »

    diff --git a/tests/output/custom/author/alexis-metaireau3.html b/tests/output/custom/author/alexis-metaireau3.html new file mode 100644 index 00000000..5f2ecbb1 --- /dev/null +++ b/tests/output/custom/author/alexis-metaireau3.html @@ -0,0 +1,115 @@ + + + + Alexis' log - Alexis Métaireau + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + +
    +
      +
    1. +
    +

    + « + Page 3 / 3 +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/tests/output/custom/category/misc.html b/tests/output/custom/category/misc.html index 24a53791..33acbd70 100644 --- a/tests/output/custom/category/misc.html +++ b/tests/output/custom/category/misc.html @@ -38,8 +38,35 @@ +
    +

    Other articles

    +
    +
      + + + +
    1. - -
      -

      Other articles

      -
      -
        - +

        This is some article, in english

        + + read more +

        There are comments.

        + +
      1. diff --git a/tests/output/custom/feeds/all-en.atom.xml b/tests/output/custom/feeds/all-en.atom.xml index f8eb3219..5c8f9241 100644 --- a/tests/output/custom/feeds/all-en.atom.xml +++ b/tests/output/custom/feeds/all-en.atom.xml @@ -1,5 +1,6 @@ -Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +Alexis' loghttp://blog.notmyidea.org/2012-11-30T00:00:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> <p><a href="http://blog.notmyidea.org/unbelievable.html">a root-relative link to unbelievable</a> <a href="http://blog.notmyidea.org/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> diff --git a/tests/output/custom/feeds/all.atom.xml b/tests/output/custom/feeds/all.atom.xml index b009d135..ae5fe30c 100644 --- a/tests/output/custom/feeds/all.atom.xml +++ b/tests/output/custom/feeds/all.atom.xml @@ -1,5 +1,6 @@ -Alexis' loghttp://blog.notmyidea.org/2012-03-02T14:01:01+01:00Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireautag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +Alexis' loghttp://blog.notmyidea.org/2012-11-30T00:00:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> +Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireautag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> Deuxième article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> diff --git a/tests/output/custom/feeds/all.rss.xml b/tests/output/custom/feeds/all.rss.xml index 786cb097..0ce2c837 100644 --- a/tests/output/custom/feeds/all.rss.xml +++ b/tests/output/custom/feeds/all.rss.xml @@ -1,5 +1,6 @@ -Alexis' loghttp://blog.notmyidea.org/Fri, 02 Mar 2012 14:01:01 +0100Trop bien !http://blog.notmyidea.org/oh-yeah-fr.html<p>Et voila du contenu en français</p> +Alexis' loghttp://blog.notmyidea.org/Fri, 30 Nov 2012 00:00:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/filename_metadata-example.html<p>Some cool stuff!</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:filename_metadata-example.htmlTrop bien !http://blog.notmyidea.org/oh-yeah-fr.html<p>Et voila du contenu en français</p> Alexis MétaireauFri, 02 Mar 2012 14:01:01 +0100tag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.htmlSecond articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazDeuxième articlehttp://blog.notmyidea.org/second-article-fr.html<p>Ceci est un article, en français.</p> Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article-fr.htmlfoobarbazA markdown powered articlehttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p> diff --git a/tests/output/custom/feeds/misc.atom.xml b/tests/output/custom/feeds/misc.atom.xml index dbf8bbfd..45c996f3 100644 --- a/tests/output/custom/feeds/misc.atom.xml +++ b/tests/output/custom/feeds/misc.atom.xml @@ -1,5 +1,6 @@ -Alexis' loghttp://blog.notmyidea.org/2012-02-29T00:00:00+01:00Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +Alexis' loghttp://blog.notmyidea.org/2012-11-30T00:00:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> diff --git a/tests/output/custom/feeds/misc.rss.xml b/tests/output/custom/feeds/misc.rss.xml index bbc5a48e..a0fa290d 100644 --- a/tests/output/custom/feeds/misc.rss.xml +++ b/tests/output/custom/feeds/misc.rss.xml @@ -1,5 +1,6 @@ -Alexis' loghttp://blog.notmyidea.org/Wed, 29 Feb 2012 00:00:00 +0100Second articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +Alexis' loghttp://blog.notmyidea.org/Fri, 30 Nov 2012 00:00:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/filename_metadata-example.html<p>Some cool stuff!</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:filename_metadata-example.htmlSecond articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> diff --git a/tests/output/custom/filename_metadata-example.html b/tests/output/custom/filename_metadata-example.html new file mode 100644 index 00000000..8f6353cb --- /dev/null +++ b/tests/output/custom/filename_metadata-example.html @@ -0,0 +1,116 @@ + + + + FILENAME_METADATA example + + + + + + + + + + + + + + + +Fork me on GitHub + + +
        +
        +
        +

        + FILENAME_METADATA example

        +
        + +
        +

        Some cool stuff!

        + +
        +
        +

        Comments !

        +
        + +
        + +
        +
        +
        +
        +

        blogroll

        + +
        + +
        + + + + + + \ No newline at end of file diff --git a/tests/output/custom/index.html b/tests/output/custom/index.html index eab96fa1..cc905735 100644 --- a/tests/output/custom/index.html +++ b/tests/output/custom/index.html @@ -38,8 +38,35 @@ +
        +

        Other articles

        +
        +
          + + + +
        1. - -
          -

          Other articles

          -
          -
            - +

            This is some article, in english

            + + read more +

            There are comments.

            +
      2. +
      3. - - - -

      - Page 1 / 2 + Page 1 / 3 »

      diff --git a/tests/output/custom/index2.html b/tests/output/custom/index2.html index 5269ed70..f0d2f948 100644 --- a/tests/output/custom/index2.html +++ b/tests/output/custom/index2.html @@ -39,6 +39,31 @@
        +
      1. + + +
      2. - - - -

      « - Page 2 / 2 + Page 2 / 3 + »

      diff --git a/tests/output/custom/index3.html b/tests/output/custom/index3.html new file mode 100644 index 00000000..60f8633d --- /dev/null +++ b/tests/output/custom/index3.html @@ -0,0 +1,115 @@ + + + + Alexis' log + + + + + + + + + + + + + + + +Fork me on GitHub + + + + + + +
      +
        +
      1. +
      +

      + « + Page 3 / 3 +

      +
      +
      +
      +

      blogroll

      + +
      + +
      + + + + + + \ No newline at end of file From 070fa1ff9dcb7603e0c555168f27bb057694a6b2 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 30 Nov 2012 02:19:38 +0100 Subject: [PATCH 0590/2344] add more docs about FILENAME_METADATA --- docs/changelog.rst | 2 ++ docs/getting_started.rst | 29 ++++++++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index f25ee3d9..ab3a4233 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -25,6 +25,8 @@ Release history file within the same directory as the original file to prevent the server (e.g. Nginx) from compressing files during an HTTP call. * Add AsciiDoc support +* Add ``FILENAME_METADATA`` new setting which adds support for metadata + extraction from the filename. 3.0 (2012-08-08) ================== diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 73378fc4..6be7fbb2 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -181,15 +181,26 @@ syntax for Markdown posts should follow this pattern:: This is the content of my super blog post. -Note that, aside from the title, none of this metadata is mandatory: if the date -is not specified, Pelican will rely on the file's "mtime" timestamp, and the -category can be determined by the directory in which the file resides. For -example, a file located at ``python/foobar/myfoobar.rst`` will have a category of -``foobar``. If you would like to organize your files in other ways where the -name of the subfolder would not be a good category name, you can set the -setting ``USE_FOLDER_AS_CATEGORY`` to ``False``. If summary isn't given, setting -``SUMMARY_MAX_LENGTH`` determines how many words from the beginning of an article -are used as the summary. +Note that, aside from the title, none of this metadata is mandatory: if the +date is not specified, Pelican can rely on the file's "mtime" timestamp through +the ``DEFAULT_DATE`` setting, and the category can be determined by the +directory in which the file resides. For example, a file located at +``python/foobar/myfoobar.rst`` will have a category of ``foobar``. If you would +like to organize your files in other ways where the name of the subfolder would +not be a good category name, you can set the setting ``USE_FOLDER_AS_CATEGORY`` +to ``False``. If summary isn't given, setting ``SUMMARY_MAX_LENGTH`` determines +how many words from the beginning of an article are used as the summary. + +You can also extract any metadata from the filename through a regexp to be set +in the ``FILENAME_METADATA`` setting. +All named groups that are matched will be set in the metadata object. The +default value for the ``FILENAME_METADATA`` setting will only extract the date +from the filename. For example, if you would like to extract both the date and +the slug, you could set something like: +``'(?P\d{4}-\d{2}-\d{2})_(?.*)'``. + +Please note that the metadata available inside your files takes precedence over +the metadata extracted from the filename. Generate your blog ------------------ From f86e1128f0b535efc8e20f1da2d1c045991051b7 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 30 Nov 2012 09:48:30 +0100 Subject: [PATCH 0591/2344] docfix: fix example of FILENAME_METADATA regexp --- docs/getting_started.rst | 2 +- docs/settings.rst | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 6be7fbb2..b0b5bf92 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -197,7 +197,7 @@ All named groups that are matched will be set in the metadata object. The default value for the ``FILENAME_METADATA`` setting will only extract the date from the filename. For example, if you would like to extract both the date and the slug, you could set something like: -``'(?P\d{4}-\d{2}-\d{2})_(?.*)'``. +``'(?P\d{4}-\d{2}-\d{2})_(?P.*)'``. Please note that the metadata available inside your files takes precedence over the metadata extracted from the filename. diff --git a/docs/settings.rst b/docs/settings.rst index 2ce44dfb..fc019757 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -59,7 +59,7 @@ Setting name (default value) What doe the filename. For example, if you would like to extract both the date and the slug, you could set something like: - ``'(?P\d{4}-\d{2}-\d{2})_(?.*)'``. + ``'(?P\d{4}-\d{2}-\d{2})_(?P.*)'``. `DELETE_OUTPUT_DIRECTORY` (``False``) Delete the content of the output directory before generating new files. `FILES_TO_COPY` (``()``) A list of files (or directories) to copy from the source (inside the From 6236e8f66ba262731563599ecfdc5be0a2d7addf Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 3 Dec 2012 12:59:31 -0800 Subject: [PATCH 0592/2344] Updated changelog to include recent changes --- docs/changelog.rst | 35 +++++++++++++++++++---------------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index ab3a4233..a68ed53d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -5,28 +5,31 @@ Release history ================ * Improve handling of links to intra-site resources -* Ensure WordPress import adds paragraphs in for all types of line endings - in post content. +* Ensure WordPress import adds paragraphs for all types of line endings + in post content * Decode HTML entities within WordPress post titles on import -* Improved appearance of LinkedIn icon in default theme +* Improve appearance of LinkedIn icon in default theme * Add GitHub and Google+ social icons support in default theme * Optimize social icons * Add ``FEED_ALL_ATOM`` and ``FEED_ALL_RSS`` to generate feeds containing all posts regardless of their language * Split ``TRANSLATION_FEED`` into ``TRANSLATION_FEED_ATOM`` and ``TRANSLATION_FEED_RSS`` -* The different feeds can now be enabled/disabled individually +* Different feeds can now be enabled/disabled individually * Allow for blank author: if ``AUTHOR`` setting is not set, author won't - default to ``${USER}`` anymore and a post won't contain any author - information if the post author is empty. -* LESS and Webassets support removed from Pelican core in favor of a Webassets - plugin. -* The ``DEFAULT_DATE`` setting now defaults to None, which means that articles - won't be generated anymore unless a date metadata is specified. -* Add the gzip_cache plugin which compresses common text files into a ``.gz`` - file within the same directory as the original file to prevent the server - (e.g. Nginx) from compressing files during an HTTP call. -* Add AsciiDoc support -* Add ``FILENAME_METADATA`` new setting which adds support for metadata - extraction from the filename. + default to ``${USER}`` anymore, and a post won't contain any author + information if the post author is empty +* Move LESS and Webassets support from Pelican core to plugin +* The ``DEFAULT_DATE`` setting now defaults to ``None``, which means that + articles won't be generated unless date metadata is specified +* Add ``FILENAME_METADATA`` setting to support metadata extraction from filename +* Add ``gzip_cache`` plugin to compress common text files into a ``.gz`` + file within the same directory as the original file, preventing the server + (e.g. Nginx) from having to compress files during an HTTP call +* Add support for AsciiDoc-formatted content +* Add ``USE_FOLDER_AS_CATEGORY`` setting so that feature can be toggled on/off +* Support arbitrary Jinja template files +* Restore basic functional tests +* New signals: ``generator_init``, ``get_generators``, and + ``article_generate_preread`` 3.0 (2012-08-08) ================== From 8bb86d3e5d5e7fa6b95e6143c35a37c559c460f8 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Mon, 3 Dec 2012 22:35:08 +0100 Subject: [PATCH 0593/2344] revert #523 we don't need a new MARKDOWN_EXTENSIONS setting because the equivalent setting MD_EXTENSIONS already exists. --- docs/fr/configuration.rst | 3 --- docs/settings.rst | 2 -- pelican/readers.py | 7 +------ pelican/settings.py | 1 - tests/test_readers.py | 6 +++--- 5 files changed, 4 insertions(+), 15 deletions(-) diff --git a/docs/fr/configuration.rst b/docs/fr/configuration.rst index e3fb8542..5388dae3 100644 --- a/docs/fr/configuration.rst +++ b/docs/fr/configuration.rst @@ -163,6 +163,3 @@ SITEURL : STATIC_PATHS : Les chemins statiques que vous voulez avoir accès sur le chemin de sortie "statique" ; - -MARKDOWN_EXTENSIONS : - Liste des extentions Markdown que vous souhaitez utiliser ; diff --git a/docs/settings.rst b/docs/settings.rst index fc019757..f629a4d6 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -129,8 +129,6 @@ Setting name (default value) What doe Can be used to separate templates from the theme. Example: projects, resume, profile ... This templates need to use ``DIRECT_TEMPLATES`` setting - -`MARKDOWN_EXTENSIONS` (``['toc',]``) A list of any Markdown extensions you want to use. `ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to asciidoc, see the `manpage `_ ===================================================================== ===================================================================== diff --git a/pelican/readers.py b/pelican/readers.py index 74cec02f..4dc041ae 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -136,13 +136,8 @@ class MarkdownReader(Reader): def read(self, filename): """Parse content and metadata of markdown files""" - markdown_extensions = self.settings.get('MARKDOWN_EXTENSIONS', []) - if isinstance(markdown_extensions, (str, unicode)): - markdown_extensions = [m.strip() for m in - markdown_extensions.split(',')] text = pelican_open(filename) - md = Markdown(extensions=set( - self.extensions + markdown_extensions + ['meta'])) + md = Markdown(extensions=set(self.extensions + ['meta'])) content = md.convert(text) metadata = {} diff --git a/pelican/settings.py b/pelican/settings.py index a98f3538..692fc983 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -78,7 +78,6 @@ _DEFAULT_CONFIG = {'PATH': '.', 'TYPOGRIFY': False, 'SUMMARY_MAX_LENGTH': 50, 'PLUGINS': [], - 'MARKDOWN_EXTENSIONS': ['toc', ], 'TEMPLATE_PAGES': {} } diff --git a/tests/test_readers.py b/tests/test_readers.py index dcfee809..937a98e3 100644 --- a/tests/test_readers.py +++ b/tests/test_readers.py @@ -145,9 +145,9 @@ class MdReaderTest(unittest.TestCase): @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_markdown_markup_extension(self): # test to ensure the markdown markup extension is being processed as expected - reader = readers.MarkdownReader({}) - reader.settings.update(dict(MARKDOWN_EXTENSIONS=['toc', ])) - content, metadata = reader.read(_filename('article_with_markdown_markup_extensions.md')) + content, metadata = readers.read_file( + _filename('article_with_markdown_markup_extensions.md'), + settings={'MD_EXTENSIONS': ['toc', 'codehilite', 'extra']}) expected = '
      \n'\ '
        \n'\ '
      • Level1
          \n'\ From f604cc4df88e0c3e1e1ddb91aa1df2b0b6f21af5 Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Mon, 3 Dec 2012 22:56:05 +0100 Subject: [PATCH 0594/2344] update functional tests to test TEMPLATE_PAGES feature closes #614: cannot reproduce this issue. --- samples/content/pages/jinja2_template.html | 6 ++ samples/pelican.conf.py | 3 + tests/output/custom/jinja2_template.html | 82 ++++++++++++++++++++++ 3 files changed, 91 insertions(+) create mode 100644 samples/content/pages/jinja2_template.html create mode 100644 tests/output/custom/jinja2_template.html diff --git a/samples/content/pages/jinja2_template.html b/samples/content/pages/jinja2_template.html new file mode 100644 index 00000000..1b0dc4e4 --- /dev/null +++ b/samples/content/pages/jinja2_template.html @@ -0,0 +1,6 @@ +{% extends "base.html" %} +{% block content %} + +Some text + +{% endblock %} diff --git a/samples/pelican.conf.py b/samples/pelican.conf.py index ce51c0fd..0ac4cd2c 100755 --- a/samples/pelican.conf.py +++ b/samples/pelican.conf.py @@ -35,6 +35,9 @@ STATIC_PATHS = ["pictures", ] # A list of files to copy from the source to the destination FILES_TO_COPY = (('extra/robots.txt', 'robots.txt'),) +# custom page generated with a jinja2 template +TEMPLATE_PAGES = {'pages/jinja2_template.html': 'jinja2_template.html'} + # foobar will not be used, because it's not in caps. All configuration keys # have to be in caps foobar = "barbaz" diff --git a/tests/output/custom/jinja2_template.html b/tests/output/custom/jinja2_template.html new file mode 100644 index 00000000..2def2d4e --- /dev/null +++ b/tests/output/custom/jinja2_template.html @@ -0,0 +1,82 @@ + + + + Alexis' log + + + + + + + + + + + + + + + +Fork me on GitHub + + + +Some text + +
          +
          +

          blogroll

          + +
          + +
          + + + + + + \ No newline at end of file From 21e808782268cdfafe4f05a3d10152b86778d4eb Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Tue, 4 Dec 2012 00:48:29 +0100 Subject: [PATCH 0595/2344] fix weird implementation for extension removal this leads to raising exception when slug was not used to generate the url --- pelican/contents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index 522892ba..d675a2ad 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -277,7 +277,7 @@ class URLWrapper(object): return value else: if get_page_name: - return unicode(value[:value.find('{slug}') + len('{slug}')]).format(**self.as_dict()) + return unicode(os.path.splitext(value)[0]).format(**self.as_dict()) else: return unicode(value).format(**self.as_dict()) From 89fd11d5829de860f78a836ff57e9104093115f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 4 Dec 2012 01:21:57 +0100 Subject: [PATCH 0596/2344] tagging 3.1 --- docs/changelog.rst | 4 ++-- setup.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index a68ed53d..7c0675f9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,7 +1,7 @@ Release history ############### -3.1 (XXXX-XX-XX) +3.1 (2012-12-04) ================ * Improve handling of links to intra-site resources @@ -32,7 +32,7 @@ Release history ``article_generate_preread`` 3.0 (2012-08-08) -================== +================ * Refactored the way URLs are handled * Improved the English documentation diff --git a/setup.py b/setup.py index 97c8ca64..26121423 100755 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ setup( version="3.1", url='http://getpelican.com/', author='Alexis Metaireau', - author_email='alexis@notmyidea.org', + author_email='authors@getpelican.com', description="A tool to generate a static blog from reStructuredText or "\ "Markdown input files.", long_description=open('README.rst').read(), From be2a3f4030e9f5f1f4b2f6d657c9f18347d6af9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 4 Dec 2012 01:27:16 +0100 Subject: [PATCH 0597/2344] bump version number --- docs/changelog.rst | 5 +++++ pelican/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 7c0675f9..05454e17 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Release history ############### +3.2 (XXXX-XX-XX) +================ + +* ??? + 3.1 (2012-12-04) ================ diff --git a/pelican/__init__.py b/pelican/__init__.py index a175e2a8..6a7ee708 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -17,7 +17,7 @@ from pelican.utils import (clean_output_dir, files_changed, file_changed, from pelican.writers import Writer __major__ = 3 -__minor__ = 0 +__minor__ = 2 __version__ = "{0}.{1}".format(__major__, __minor__) diff --git a/setup.py b/setup.py index 26121423..326a3195 100755 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ entry_points = { setup( name="pelican", - version="3.1", + version="3.2", url='http://getpelican.com/', author='Alexis Metaireau', author_email='authors@getpelican.com', From a07b56c02bfa5ddac8de359e215d9571ee2ba96c Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 3 Dec 2012 16:31:55 -0800 Subject: [PATCH 0598/2344] Doc fixes and improvements --- docs/faq.rst | 36 ++++++++-------- docs/getting_started.rst | 50 ++++++++++++----------- docs/index.rst | 2 +- docs/plugins.rst | 88 ++++++++++++++++++++-------------------- docs/settings.rst | 75 ++++++++++++++++------------------ 5 files changed, 127 insertions(+), 124 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 735fe9d0..a8617b30 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -1,7 +1,7 @@ Frequently Asked Questions (FAQ) ################################ -Here is a summary of the frequently asked questions for Pelican. +Here are some frequently asked questions about Pelican. What's the best way to communicate a problem, question, or suggestion? ====================================================================== @@ -21,7 +21,8 @@ How can I help? ================ There are several ways to help out. First, you can use Pelican and report any -suggestions or problems you might have via IRC or the `issue tracker `_. +suggestions or problems you might have via IRC or the `issue tracker +`_. If you want to contribute, please fork `the git repository `_, create a new feature branch, make @@ -57,13 +58,14 @@ I want to use Markdown, but I got an error. =========================================== Markdown is not a hard dependency for Pelican, so you will need to explicitly -install it. You can do so by typing:: +install it. You can do so by typing the following, including ``sudo`` if +required:: - $ (sudo) pip install markdown + (sudo) pip install markdown -In case you don't have pip installed, consider installing it via:: +If you don't have pip installed, consider installing the pip installer via:: - $ (sudo) easy_install pip + (sudo) easy_install pip Can I use arbitrary meta-data in my templates? ============================================== @@ -87,15 +89,15 @@ want to have its own template. :template: template_name -Then just make sure to have the template installed in to your theme as -``template_name.html``. +Then just make sure your theme contains the relevant template file (e.g. +``template_name.html``). What if I want to disable feed generation? ========================================== To disable all feed generation, all feed settings should be set to ``None``. -Since other feed settings already defaults to ``None``, you only need to set -the following settings:: +All but two feed settings already default to ``None``, so if you want to disable +all feed generation, you only need to specify the following settings:: FEED_ALL_ATOM = None CATEGORY_FEED_ATOM = None @@ -129,13 +131,13 @@ setting names). Here is an exact list of the renamed setting names:: CATEGORY_FEED -> CATEGORY_FEED_ATOM Starting in 3.1, the new feed ``FEED_ALL_ATOM`` has been introduced: this -feed will aggregate all posts regardless of their language. It is generated to -``'feeds/all.atom.xml'`` by default and ``FEED_ATOM`` now defaults to ``None``. -The following FEED setting has also been renamed:: +feed will aggregate all posts regardless of their language. This setting +generates ``'feeds/all.atom.xml'`` by default and ``FEED_ATOM`` now defaults to +``None``. The following feed setting has also been renamed:: TRANSLATION_FEED -> TRANSLATION_FEED_ATOM -Older 2.x themes that referenced the old setting names may not link properly. -In order to rectify this, please update your theme for compatibility with 3.0+ -by changing the relevant values in your template files. For an example of -complete feed headers and usage please check out the ``simple`` theme. +Older themes that referenced the old setting names may not link properly. +In order to rectify this, please update your theme for compatibility by changing +the relevant values in your template files. For an example of complete feed +headers and usage please check out the ``simple`` theme. diff --git a/docs/getting_started.rst b/docs/getting_started.rst index b0b5bf92..3e527611 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -161,7 +161,7 @@ following syntax (give your file the ``.rst`` extension):: :author: Alexis Metaireau :summary: Short version for index and feeds -Pelican implements an extension of reStructuredText to enable support for the +Pelican implements an extension to reStructuredText to enable support for the ``abbr`` HTML tag. To use it, write something like this in your post:: This will be turned into :abbr:`HTML (HyperText Markup Language)`. @@ -188,16 +188,17 @@ directory in which the file resides. For example, a file located at ``python/foobar/myfoobar.rst`` will have a category of ``foobar``. If you would like to organize your files in other ways where the name of the subfolder would not be a good category name, you can set the setting ``USE_FOLDER_AS_CATEGORY`` -to ``False``. If summary isn't given, setting ``SUMMARY_MAX_LENGTH`` determines -how many words from the beginning of an article are used as the summary. +to ``False``. If there is no summary metadata for a given post, the +``SUMMARY_MAX_LENGTH`` setting can be used to specify how many words from the +beginning of an article are used as the summary. -You can also extract any metadata from the filename through a regexp to be set -in the ``FILENAME_METADATA`` setting. +You can also extract any metadata from the filename through a regular +expression to be set in the ``FILENAME_METADATA`` setting. All named groups that are matched will be set in the metadata object. The default value for the ``FILENAME_METADATA`` setting will only extract the date from the filename. For example, if you would like to extract both the date and the slug, you could set something like: -``'(?P\d{4}-\d{2}-\d{2})_(?P.*)'``. +``'(?P\d{4}-\d{2}-\d{2})_(?P.*)'`` Please note that the metadata available inside your files takes precedence over the metadata extracted from the filename. @@ -205,7 +206,7 @@ the metadata extracted from the filename. Generate your blog ------------------ -The ``make`` shortcut commands mentioned in the ``Kickstart a blog`` section +The ``make`` shortcut commands mentioned in the *Kickstart a blog* section are mostly wrappers around the ``pelican`` command that generates the HTML from the content. The ``pelican`` command can also be run directly:: @@ -231,11 +232,11 @@ run the ``pelican`` command with the ``-r`` or ``--autoreload`` option. Pages ----- -If you create a folder named ``pages``, itself in the content folder, all the +If you create a folder named ``pages`` inside the content folder, all the files in it will be used to generate static pages. -Then, use the ``DISPLAY_PAGES_ON_MENU`` setting, which will add all the pages to -the menu. +Then, use the ``DISPLAY_PAGES_ON_MENU`` setting to add all those pages to +the primary navigation menu. If you want to exclude any pages from being linked to or listed in the menu then add a ``status: hidden`` attribute to its metadata. This is useful for @@ -244,9 +245,13 @@ things like making error pages that fit the generated theme of your site. Linking to internal content --------------------------- -Since Pelican 3.1, you now have the ability to do cross-site linking. +From Pelican 3.1 onwards, it is now possible to specify intra-site links to +files in the *source content* hierarchy instead of files in the *generated* +hierarchy. This makes it easier to link from the current post to other posts +and images that may be sitting alongside the current post (instead of having +to determine where those resources will be placed after site generation). -To link to an internal content, you will have to use the following syntax: +To link to internal content, use the following syntax: ``|filename|path/to/file``. For example, you may want to add links between "article1" and "article2" given @@ -264,20 +269,20 @@ In this example, ``article1.rst`` could look like:: Title: The first article Date: 2012-12-01 - See below cross-site links examples in restructured text. + See below intra-site link examples in reStructuredText format. - `a root-relative link <|filename|/cat/article2.md>`_ - `a file-relative link <|filename|cat/article2.md>`_ + `a link relative to content root <|filename|/cat/article2.md>`_ + `a link relative to current file <|filename|cat/article2.md>`_ and ``article2.md``:: Title: The second article Date: 2012-12-01 - See below cross-site links examples in markdown. + See below intra-site link examples in Markdown format. - [a root-relative link](|filename|/article1.rst) - [a file-relative link](|filename|../article1.rst) + [a link relative to content root](|filename|/article1.rst) + [a link relative to current file](|filename|../article1.rst) .. note:: @@ -334,13 +339,12 @@ then instead ensure that the translated article titles are identical, since the slug will be auto-generated from the article title. Syntax highlighting ---------------------- +------------------- Pelican is able to provide colorized syntax highlighting for your code blocks. -To do so, you have to use the following conventions (you need to put this in -your content files). +To do so, you have to use the following conventions inside your content files. -For RestructuredText, use the code-block directive:: +For reStructuredText, use the code-block directive:: .. code-block:: identifier @@ -373,7 +377,7 @@ anything special to see what's happening with the generated files. You can either use your browser to open the files on your disk:: - $ firefox output/index.html + firefox output/index.html Or run a simple web server using Python:: diff --git a/docs/index.rst b/docs/index.rst index 8206727c..ebe1ace6 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -4,7 +4,7 @@ Pelican Pelican is a static site generator, written in Python_. * Write your weblog entries directly with your editor of choice (vim!) - in reStructuredText_, Markdown_ or AsciiDoc_ + in reStructuredText_, Markdown_, or AsciiDoc_ * Includes a simple CLI tool to (re)generate the weblog * Easy to interface with DVCSes and web hooks * Completely static output is easy to host anywhere diff --git a/docs/plugins.rst b/docs/plugins.rst index c6b18200..6555e647 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -3,25 +3,25 @@ Plugins ####### -Since version 3.0, Pelican manages plugins. Plugins are a way to add features -to Pelican without having to directly hack Pelican code. +Beginning with version 3.0, Pelican supports plugins. Plugins are a way to add +features to Pelican without having to directly modify the Pelican core. -Pelican is shipped with a set of core plugins, but you can easily implement -your own (and this page describes how). +Pelican is shipped with a set of bundled plugins, but you can easily implement +your own. This page describes how to use and create plugins. How to use plugins ================== -To load plugins, you have to specify them in your settings file. You have two -ways to do so. -Either by specifying strings with the path to the callables:: +To load plugins, you have to specify them in your settings file. There are two +ways to do so. The first method is to specify strings with the path to the +callables:: PLUGINS = ['pelican.plugins.gravatar',] -Or by importing them and adding them to the list:: +Alternatively, another method is to import them and add them to the list:: from pelican.plugins import gravatar - PLUGINS = [gravatar, ] + PLUGINS = [gravatar,] If your plugins are not in an importable path, you can specify a ``PLUGIN_PATH`` in the settings:: @@ -33,7 +33,7 @@ How to create plugins ===================== Plugins are based on the concept of signals. Pelican sends signals, and plugins -subscribe to those signals. The list of signals are defined in a following +subscribe to those signals. The list of signals are defined in a subsequent section. The only rule to follow for plugins is to define a ``register`` callable, in @@ -75,13 +75,13 @@ pages_generate_context pages_generator, metadata pages_generator_init pages_generator invoked in the PagesGenerator.__init__ ============================= ============================ =========================================================================== -The list is currently small, don't hesitate to add signals and make a pull +The list is currently small, so don't hesitate to add signals and make a pull request if you need them! .. note:: - The signal ``content_object_init`` can send different type of object as - argument. If you want to register only one type of object then you will + The signal ``content_object_init`` can send a different type of object as + the argument. If you want to register only one type of object then you will need to specify the sender when you are connecting to the signal. :: @@ -122,30 +122,30 @@ Plugin descriptions Asset management ---------------- -This plugin allows you to use the `webassets`_ module to manage assets such as +This plugin allows you to use the `Webassets`_ module to manage assets such as CSS and JS files. The module must first be installed:: pip install webassets -The `webassets` module allows you to perform a number of useful asset management +The Webassets module allows you to perform a number of useful asset management functions, including: -* CSS minifier (`cssmin`, `yuicompressor`, ...) -* CSS compiler (`less`, `sass`, ...) -* JS minifier (`uglifyjs`, `yuicompressor`, `closure`, ...) +* CSS minifier (``cssmin``, ``yuicompressor``, ...) +* CSS compiler (``less``, ``sass``, ...) +* JS minifier (``uglifyjs``, ``yuicompressor``, ``closure``, ...) Others filters include gzip compression, integration of images in CSS via data -URIs, and more. `webassets` can also append a version identifier to your asset +URIs, and more. Webassets can also append a version identifier to your asset URL to convince browsers to download new versions of your assets when you use -far-future expires headers. Please refer to the `webassets documentation`_ for +far-future expires headers. Please refer to the `Webassets documentation`_ for more information. -When using with Pelican, `webassets` is configured to process assets in the -``OUTPUT_PATH/theme`` directory. You can use `webassets` in your templates by -including one or more template tags. The jinja variable ``{{ ASSET_URL }}`` to -use in the templates is configured to be relative to the ``theme/`` url. -Hence, it must be used with the ``{{ SITEURL }}`` variable which allows to -have relative urls. For example... +When used with Pelican, Webassets is configured to process assets in the +``OUTPUT_PATH/theme`` directory. You can use Webassets in your templates by +including one or more template tags. The Jinja variable ``{{ ASSET_URL }}`` can +be used in templates and is relative to the ``theme/`` url. The +``{{ ASSET_URL }}`` variable should be used in conjunction with the +``{{ SITEURL }}`` variable in order to generate URLs properly. For example: .. code-block:: jinja @@ -153,7 +153,7 @@ have relative urls. For example... {% endassets %} -... will produce a minified css file with a version identifier: +... will produce a minified css file with a version identifier that looks like: .. code-block:: html @@ -182,29 +182,29 @@ The above will produce a minified and gzipped JS file: -Pelican's debug mode is propagated to `webassets` to disable asset packaging +Pelican's debug mode is propagated to Webassets to disable asset packaging and instead work with the uncompressed assets. However, this also means that the LESS and SASS files are not compiled. This should be fixed in a future -version of `webassets` (cf. the related `bug report +version of Webassets (cf. the related `bug report `_). -.. _webassets: https://github.com/miracle2k/webassets -.. _webassets documentation: http://webassets.readthedocs.org/en/latest/builtin_filters.html +.. _Webassets: https://github.com/miracle2k/webassets +.. _Webassets documentation: http://webassets.readthedocs.org/en/latest/builtin_filters.html GitHub activity --------------- -This plugin makes use of the ``feedparser`` library that you'll need to +This plugin makes use of the `feedparser`_ library that you'll need to install. Set the ``GITHUB_ACTIVITY_FEED`` parameter to your GitHub activity feed. -For example, my setting would look like:: +For example, to track Pelican project activity, the setting would be:: - GITHUB_ACTIVITY_FEED = 'https://github.com/kpanic.atom' + GITHUB_ACTIVITY_FEED = 'https://github.com/getpelican.atom' -On the templates side, you just have to iterate over the ``github_activity`` -variable, as in the example:: +On the template side, you just have to iterate over the ``github_activity`` +variable, as in this example:: {% if GITHUB_ACTIVITY_FEED %} {% endif %} - - -``github_activity`` is a list of lists. The first element is the title +``github_activity`` is a list of lists. The first element is the title, and the second element is the raw HTML from GitHub. +.. _feedparser: https://crate.io/packages/feedparser/ + Global license -------------- -This plugin allows you to define a LICENSE setting and adds the contents of that +This plugin allows you to define a ``LICENSE`` setting and adds the contents of that license variable to the article's context, making that variable available to use from within your theme's templates. @@ -235,7 +235,7 @@ Gravatar This plugin assigns the ``author_gravatar`` variable to the Gravatar URL and makes the variable available within the article's context. You can add -AUTHOR_EMAIL to your settings file to define the default author's email +``AUTHOR_EMAIL`` to your settings file to define the default author's email address. Obviously, that email address must be associated with a Gravatar account. @@ -249,7 +249,7 @@ the ``author_gravatar`` variable is added to the article's context. Gzip cache ---------- -Certain web servers (e.g., Nginx) can use a static cache of gzip compressed +Certain web servers (e.g., Nginx) can use a static cache of gzip-compressed files to prevent the server from compressing files during an HTTP call. Since compression occurs at another time, these compressed files can be compressed at a higher compression level for increased optimization. @@ -303,7 +303,7 @@ The sitemap plugin generates plain-text or XML sitemaps. You can use the ``SITEMAP`` variable in your settings file to configure the behavior of the plugin. -The ``SITEMAP`` variable must be a Python dictionary, it can contain three keys: +The ``SITEMAP`` variable must be a Python dictionary and can contain three keys: - ``format``, which sets the output format of the plugin (``xml`` or ``txt``) @@ -336,7 +336,7 @@ default value. The sitemap is saved in ``/sitemap.``. .. note:: - ``priorities`` and ``changefreqs`` are informations for search engines. + ``priorities`` and ``changefreqs`` are information for search engines. They are only used in the XML sitemaps. For more information: diff --git a/docs/settings.rst b/docs/settings.rst index f629a4d6..baf9f60c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -16,8 +16,8 @@ False, None, etc.), dictionaries, or tuples should *not* be enclosed in quotation marks. All other values (i.e., strings) *must* be enclosed in quotation marks. -Unless otherwise specified, settings that refer to paths can be either absolute or relative to the -configuration file. +Unless otherwise specified, settings that refer to paths can be either absolute +or relative to the configuration file. The settings you define in the configuration file will be passed to the templates, which allows you to use your settings to add site-wide content. @@ -31,12 +31,11 @@ Basic settings Setting name (default value) What does it do? ===================================================================== ===================================================================== `AUTHOR` Default author (put your name) -`DATE_FORMATS` (``{}``) If you do manage multiple languages, you can - set the date formatting here. See "Date format and locales" - section below for details. -`USE_FOLDER_AS_CATEGORY` (``True``) When you don't specify a category in your post metadata and set this - setting to ``True`` and organize your articles in subfolders, the - subfolder will become the category of your post. If set to ``False`` +`DATE_FORMATS` (``{}``) If you manage multiple languages, you can set the date formatting + here. See the "Date format and locales" section below for details. +`USE_FOLDER_AS_CATEGORY` (``True``) When you don't specify a category in your post metadata, set this + setting to ``True``, and organize your articles in subfolders, the + subfolder will become the category of your post. If set to ``False``, ``DEFAULT_CATEGORY`` will be used as a fallback. `DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on. `DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use. @@ -44,12 +43,12 @@ Setting name (default value) What doe template. Templates may or not honor this setting. `DEFAULT_DATE` (``None``) The default date you want to use. - If 'fs', Pelican will use the file system + If ``fs``, Pelican will use the file system timestamp information (mtime) if it can't get date information from the metadata. - If tuple object, it will instead generate the - default datetime object by passing the tuple to - the datetime.datetime constructor. + If set to a tuple object, the default datetime object will instead + be generated by passing the tuple to the + ``datetime.datetime`` constructor. `DEFAULT_METADATA` (``()``) The default metadata you want to use for all articles and pages. `FILENAME_METADATA` (``'(?P\d{4}-\d{2}-\d{2}).*'``) The regexp that will be used to extract any metadata @@ -83,11 +82,10 @@ Setting name (default value) What doe `PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages. `ARTICLE_DIR` (``''``) Directory to look at for articles, relative to `PATH`. `ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles. -`PDF_GENERATOR` (``False``) Set to True if you want to have PDF versions - of your documents. You will need to install - `rst2pdf`. +`PDF_GENERATOR` (``False``) Set to ``True`` if you want PDF versions of your documents to be. + generated. You will need to install ``rst2pdf``. `OUTPUT_SOURCES` (``False``) Set to True if you want to copy the articles and pages in their - original format (e.g. Markdown or ReStructeredText) to the + original format (e.g. Markdown or reStructuredText) to the specified OUTPUT_PATH. `OUTPUT_SOURCES_EXTENSION` (``.text``) Controls the extension that will be used by the SourcesGenerator. Defaults to ``.text``. If not a valid string the default value @@ -106,10 +104,10 @@ Setting name (default value) What doe the blog entries. See :ref:`template_pages`. `STATIC_PATHS` (``['images']``) The static paths you want to have accessible on the output path "static". By default, - Pelican will copy the 'images' folder to the + Pelican will copy the "images" folder to the output folder. `TIMEZONE` The timezone used in the date information, to - generate Atom and RSS feeds. See the "timezone" + generate Atom and RSS feeds. See the *Timezone* section below for more info. `TYPOGRIFY` (``False``) If set to True, several typographical improvements will be incorporated into the generated HTML via the `Typogrify @@ -117,19 +115,19 @@ Setting name (default value) What doe library, which can be installed via: ``pip install typogrify`` `DIRECT_TEMPLATES` (``('index', 'tags', 'categories', 'archives')``) List of templates that are used directly to render content. Typically direct templates are used to generate - index pages for collections of content e.g. tags and - category index pages. + index pages for collections of content (e.g. tags and + category index pages). `PAGINATED_DIRECT_TEMPLATES` (``('index',)``) Provides the direct templates that should be paginated. `SUMMARY_MAX_LENGTH` (``50``) When creating a short summary of an article, this will be the default length in words of the text created. This only applies if your content does not otherwise - specify a summary. Setting to None will cause the summary + specify a summary. Setting to ``None`` will cause the summary to be a copy of the original content. -`EXTRA_TEMPLATES_PATHS` (``[]``) A list of paths you want Jinja2 to look for the templates. +`EXTRA_TEMPLATES_PATHS` (``[]``) A list of paths you want Jinja2 to search for templates. Can be used to separate templates from the theme. Example: projects, resume, profile ... - This templates need to use ``DIRECT_TEMPLATES`` setting -`ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to asciidoc, see the `manpage + These templates need to use ``DIRECT_TEMPLATES`` setting. +`ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to AsciiDoc. See the `manpage `_ ===================================================================== ===================================================================== @@ -145,13 +143,13 @@ when testing locally, and absolute URLs are reliable and most useful when publishing. One method of supporting both is to have one Pelican configuration file for local development and another for publishing. To see an example of this type of setup, use the ``pelican-quickstart`` script as described at the top of -the :doc:`Getting Started` page, which will produce two separate +the :doc:`Getting Started ` page, which will produce two separate configuration files for local development and publishing, respectively. You can customize the URLs and locations where files will be saved. The URLs and SAVE_AS variables use Python's format strings. These variables allow you to place -your articles in a location such as '{slug}/index.html' and link to them as -'{slug}' for clean URLs. These settings give you the flexibility to place your +your articles in a location such as ``{slug}/index.html`` and link to them as +``{slug}`` for clean URLs. These settings give you the flexibility to place your articles and pages anywhere you want. .. note:: @@ -175,8 +173,8 @@ Example usage: * ARTICLE_URL = ``'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/'`` * ARTICLE_SAVE_AS = ``'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html'`` -This would save your articles in something like '/posts/2011/Aug/07/sample-post/index.html', -and the URL to this would be '/posts/2011/Aug/07/sample-post/'. +This would save your articles in something like ``/posts/2011/Aug/07/sample-post/index.html``, +and the URL to this would be ``/posts/2011/Aug/07/sample-post/``. ==================================================== ===================================================== Setting name (default value) What does it do? @@ -206,7 +204,7 @@ Setting name (default value) What does it do? .. note:: - When any of `*_SAVE_AS` is set to False, files will not be created. + When any of the `*_SAVE_AS` settings is set to False, files will not be created. Timezone -------- @@ -283,12 +281,12 @@ If you want to generate custom pages besides your blog entries, you can point any Jinja2 template file with a path pointing to the file and the destination path for the generated file. -For instance, if you have a blog with three static pages, for a list of books, -your resume and a contact page, you could have:: +For instance, if you have a blog with three static pages — a list of books, +your resume, and a contact page — you could have:: TEMPLATE_PAGES = {'src/books.html': 'dest/books.html', - 'src/resume.html': 'dest/resume.html', - 'src/contact.html': 'dest/contact.html'} + 'src/resume.html': 'dest/resume.html', + 'src/contact.html': 'dest/contact.html'} Feed settings ============= @@ -326,8 +324,7 @@ Setting name (default value) What does it do? quantity is unrestricted by default. ================================================ ===================================================== -If you don't want to generate some or any of these feeds, set ``None`` to the -variables above. +If you don't want to generate some or any of these feeds, set the above variables to ``None``. .. [2] %s is the name of the category. @@ -399,7 +396,7 @@ N matches `TAG_CLOUD_STEPS` -1). Translations ============ -Pelican offers a way to translate articles. See the Getting Started section for +Pelican offers a way to translate articles. See the :doc:`Getting Started ` section for more information. ===================================================== ===================================================== @@ -467,7 +464,7 @@ Following are example ways to specify your preferred theme:: # Specify a customized theme, via absolute path THEME = "~/projects/mysite/themes/mycustomtheme" -The built-in `notmyidea` theme can make good use of the following settings. Feel +The built-in ``notmyidea`` theme can make good use of the following settings. Feel free to use them in your themes as well. ======================= ======================================================= @@ -496,7 +493,7 @@ Setting name What does it do ? if you want this button to appear. ======================= ======================================================= -In addition, you can use the "wide" version of the `notmyidea` theme by +In addition, you can use the "wide" version of the ``notmyidea`` theme by adding the following to your configuration:: CSS_FILE = "wide.css" From f92c0cb69dad13491f93872af79d3a14ec6a1e54 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 4 Dec 2012 01:43:19 +0100 Subject: [PATCH 0599/2344] update the version scheme to support micro versions --- pelican/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 6a7ee708..e2ea7f76 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -18,7 +18,8 @@ from pelican.writers import Writer __major__ = 3 __minor__ = 2 -__version__ = "{0}.{1}".format(__major__, __minor__) +__micro__ = 0 +__version__ = "{0}.{1}.{2}".format(__major__, __minor__, __micro__) logger = logging.getLogger(__name__) From 625afa0621866d1bbc29ade89551b096d4362838 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 4 Dec 2012 01:53:52 +0100 Subject: [PATCH 0600/2344] add the changelog to the text on PyPI --- MANIFEST.in | 2 +- setup.py | 9 +++++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index bec6d1a3..2f2ea824 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,6 +1,6 @@ include *.rst global-include *.py recursive-include pelican *.html *.css *png *.in -include LICENSE THANKS +include LICENSE THANKS docs/changelog.rst recursive-include tests * recursive-exclude tests *.pyc diff --git a/setup.py b/setup.py index 326a3195..15ddebd6 100755 --- a/setup.py +++ b/setup.py @@ -18,15 +18,20 @@ entry_points = { ] } + +README = open('README.rst').read() +CHANGELOG = open('docs/changelog.rst').read() + + setup( name="pelican", version="3.2", url='http://getpelican.com/', author='Alexis Metaireau', author_email='authors@getpelican.com', - description="A tool to generate a static blog from reStructuredText or "\ + description="A tool to generate a static blog from reStructuredText or " "Markdown input files.", - long_description=open('README.rst').read(), + long_description=README + '\n' + CHANGELOG, packages=['pelican', 'pelican.tools', 'pelican.plugins'], include_package_data=True, install_requires=requires, From 9f66333d7726513138b9d839b853ba54e8fc308b Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Tue, 4 Dec 2012 02:08:13 +0100 Subject: [PATCH 0601/2344] fix rst issue --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 05454e17..ea476ca8 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,7 +4,7 @@ Release history 3.2 (XXXX-XX-XX) ================ -* ??? +* [...] 3.1 (2012-12-04) ================ From 694f318614ef6f8ccccf273ecf9ff5cb33ac99c3 Mon Sep 17 00:00:00 2001 From: Roman Skvazh Date: Thu, 6 Dec 2012 21:15:25 +0400 Subject: [PATCH 0602/2344] Update docs/plugins.rst Change yuicompressor to yui_js and yui_css --- docs/plugins.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 6555e647..d9964287 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -130,9 +130,9 @@ CSS and JS files. The module must first be installed:: The Webassets module allows you to perform a number of useful asset management functions, including: -* CSS minifier (``cssmin``, ``yuicompressor``, ...) +* CSS minifier (``cssmin``, ``yui_css``, ...) * CSS compiler (``less``, ``sass``, ...) -* JS minifier (``uglifyjs``, ``yuicompressor``, ``closure``, ...) +* JS minifier (``uglifyjs``, ``yui_js``, ``closure``, ...) Others filters include gzip compression, integration of images in CSS via data URIs, and more. Webassets can also append a version identifier to your asset From a5772bf3d6e0563b109dc1f2cb19743cf6a19aef Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 7 Dec 2012 00:10:30 +0100 Subject: [PATCH 0603/2344] allow override page url and save_as values directly from the metadata this is similar to the template override implemented in #404 --- pelican/contents.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pelican/contents.py b/pelican/contents.py index d675a2ad..77ee70f8 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -44,6 +44,8 @@ class Page(object): # set metadata as attributes for key, value in local_metadata.items(): + if key in ('save_as', 'url'): + key = 'override_' + key setattr(self, key.lower(), value) # also keep track of the metadata attributes available @@ -128,6 +130,8 @@ class Page(object): return self.settings[fq_key].format(**self.url_format) def get_url_setting(self, key): + if hasattr(self, 'override_' + key): + return getattr(self, 'override_' + key) key = key if self.in_default_lang else 'lang_%s' % key return self._expand_settings(key) From 00c7451200fd75056ebecb7cd681bda08b55d70a Mon Sep 17 00:00:00 2001 From: Bruno Binet Date: Fri, 7 Dec 2012 00:14:00 +0100 Subject: [PATCH 0604/2344] add functional test for save_as/url override and update functional tests output --- samples/content/pages/override_url_saveas.rst | 9 ++ .../basic/a-markdown-powered-article.html | 3 +- tests/output/basic/archives.html | 3 +- tests/output/basic/article-1.html | 3 +- tests/output/basic/article-2.html | 3 +- tests/output/basic/article-3.html | 3 +- .../output/basic/author/alexis-metaireau.html | 3 +- tests/output/basic/categories.html | 3 +- tests/output/basic/category/bar.html | 3 +- tests/output/basic/category/cat1.html | 3 +- tests/output/basic/category/misc.html | 3 +- tests/output/basic/category/yeah.html | 3 +- .../basic/filename_metadata-example.html | 3 +- tests/output/basic/index.html | 3 +- tests/output/basic/oh-yeah.html | 3 +- tests/output/basic/override/index.html | 53 +++++++++++ .../pages/this-is-a-test-hidden-page.html | 3 +- .../basic/pages/this-is-a-test-page.html | 3 +- tests/output/basic/second-article-fr.html | 3 +- tests/output/basic/second-article.html | 3 +- tests/output/basic/tag/bar.html | 3 +- tests/output/basic/tag/baz.html | 3 +- tests/output/basic/tag/foo.html | 3 +- tests/output/basic/tag/foobar.html | 3 +- tests/output/basic/tag/oh.html | 3 +- tests/output/basic/tag/yeah.html | 3 +- .../output/basic/this-is-a-super-article.html | 3 +- tests/output/basic/unbelievable.html | 3 +- .../custom/a-markdown-powered-article.html | 3 +- tests/output/custom/archives.html | 3 +- tests/output/custom/article-1.html | 3 +- tests/output/custom/article-2.html | 3 +- tests/output/custom/article-3.html | 3 +- .../custom/author/alexis-metaireau.html | 3 +- .../custom/author/alexis-metaireau2.html | 3 +- .../custom/author/alexis-metaireau3.html | 3 +- tests/output/custom/categories.html | 3 +- tests/output/custom/category/bar.html | 3 +- tests/output/custom/category/cat1.html | 3 +- tests/output/custom/category/misc.html | 3 +- tests/output/custom/category/yeah.html | 3 +- .../output/custom/drafts/a-draft-article.html | 3 +- .../custom/filename_metadata-example.html | 3 +- tests/output/custom/index.html | 3 +- tests/output/custom/index2.html | 3 +- tests/output/custom/index3.html | 3 +- tests/output/custom/jinja2_template.html | 3 +- tests/output/custom/oh-yeah-fr.html | 3 +- tests/output/custom/oh-yeah.html | 3 +- tests/output/custom/override/index.html | 88 +++++++++++++++++++ .../pages/this-is-a-test-hidden-page.html | 3 +- .../custom/pages/this-is-a-test-page.html | 3 +- tests/output/custom/second-article-fr.html | 3 +- tests/output/custom/second-article.html | 3 +- tests/output/custom/tag/bar.html | 3 +- tests/output/custom/tag/baz.html | 3 +- tests/output/custom/tag/foo.html | 3 +- tests/output/custom/tag/foobar.html | 3 +- tests/output/custom/tag/oh.html | 3 +- tests/output/custom/tag/yeah.html | 3 +- .../custom/this-is-a-super-article.html | 3 +- tests/output/custom/unbelievable.html | 3 +- 62 files changed, 268 insertions(+), 59 deletions(-) create mode 100644 samples/content/pages/override_url_saveas.rst create mode 100644 tests/output/basic/override/index.html create mode 100644 tests/output/custom/override/index.html diff --git a/samples/content/pages/override_url_saveas.rst b/samples/content/pages/override_url_saveas.rst new file mode 100644 index 00000000..8a515f60 --- /dev/null +++ b/samples/content/pages/override_url_saveas.rst @@ -0,0 +1,9 @@ +Override url/save_as +#################### + +:date: 2012-12-07 +:url: override/ +:save_as: override/index.html + +Test page which overrides save_as and url so that this page will be generated +at a custom location. diff --git a/tests/output/basic/a-markdown-powered-article.html b/tests/output/basic/a-markdown-powered-article.html index 80a12212..9b9da171 100644 --- a/tests/output/basic/a-markdown-powered-article.html +++ b/tests/output/basic/a-markdown-powered-article.html @@ -22,7 +22,8 @@
      -
      + +
    diff --git a/tests/output/basic/archives.html b/tests/output/basic/archives.html index cb06dfa1..07a62bcc 100644 --- a/tests/output/basic/archives.html +++ b/tests/output/basic/archives.html @@ -54,7 +54,14 @@
    -
    + +
    diff --git a/tests/output/basic/article-1.html b/tests/output/basic/article-1.html index b372d6ca..de3717fa 100644 --- a/tests/output/basic/article-1.html +++ b/tests/output/basic/article-1.html @@ -52,7 +52,14 @@
    -
    + +
    diff --git a/tests/output/basic/article-2.html b/tests/output/basic/article-2.html index 1a18cb47..ebe9b8a7 100644 --- a/tests/output/basic/article-2.html +++ b/tests/output/basic/article-2.html @@ -52,7 +52,14 @@
    -
    + +
    diff --git a/tests/output/basic/article-3.html b/tests/output/basic/article-3.html index 6b83b062..42762c26 100644 --- a/tests/output/basic/article-3.html +++ b/tests/output/basic/article-3.html @@ -52,7 +52,14 @@
    -
    + +
    diff --git a/tests/output/basic/author/alexis-metaireau.html b/tests/output/basic/author/alexis-metaireau.html index e6f65a11..c6e75b8b 100644 --- a/tests/output/basic/author/alexis-metaireau.html +++ b/tests/output/basic/author/alexis-metaireau.html @@ -86,7 +86,14 @@ as well as inline markup.

    -
    + +
    diff --git a/tests/output/basic/categories.html b/tests/output/basic/categories.html index f945d04a..8dd4c810 100644 --- a/tests/output/basic/categories.html +++ b/tests/output/basic/categories.html @@ -36,7 +36,14 @@
  • yeah
  • -
    + +
    diff --git a/tests/output/basic/category/bar.html b/tests/output/basic/category/bar.html index 896d9222..d9fcd2a5 100644 --- a/tests/output/basic/category/bar.html +++ b/tests/output/basic/category/bar.html @@ -56,7 +56,14 @@ YEAH !

    -
    + +
    diff --git a/tests/output/basic/category/cat1.html b/tests/output/basic/category/cat1.html index b8ae397e..ad18cd9a 100644 --- a/tests/output/basic/category/cat1.html +++ b/tests/output/basic/category/cat1.html @@ -119,7 +119,14 @@
    -
    + +
    diff --git a/tests/output/basic/category/misc.html b/tests/output/basic/category/misc.html index 2d62b852..7e8307a0 100644 --- a/tests/output/basic/category/misc.html +++ b/tests/output/basic/category/misc.html @@ -100,7 +100,14 @@
    -
    + +
    diff --git a/tests/output/basic/category/yeah.html b/tests/output/basic/category/yeah.html index 37dfde63..7c6cb721 100644 --- a/tests/output/basic/category/yeah.html +++ b/tests/output/basic/category/yeah.html @@ -62,7 +62,14 @@
    -
    + +
    diff --git a/tests/output/basic/filename_metadata-example.html b/tests/output/basic/filename_metadata-example.html index b7ae95a7..730e9c41 100644 --- a/tests/output/basic/filename_metadata-example.html +++ b/tests/output/basic/filename_metadata-example.html @@ -52,7 +52,14 @@
    -
    + +
    diff --git a/tests/output/basic/index.html b/tests/output/basic/index.html index 488d1b08..f44ffbc9 100644 --- a/tests/output/basic/index.html +++ b/tests/output/basic/index.html @@ -245,7 +245,14 @@ YEAH !

    -
    + +
    diff --git a/tests/output/basic/oh-yeah.html b/tests/output/basic/oh-yeah.html index ab090b58..1900e76c 100644 --- a/tests/output/basic/oh-yeah.html +++ b/tests/output/basic/oh-yeah.html @@ -60,7 +60,14 @@ YEAH !

    -
    + +
    diff --git a/tests/output/basic/pages/this-is-a-test-hidden-page.html b/tests/output/basic/pages/this-is-a-test-hidden-page.html index 655ae272..3447b3a5 100644 --- a/tests/output/basic/pages/this-is-a-test-hidden-page.html +++ b/tests/output/basic/pages/this-is-a-test-hidden-page.html @@ -38,7 +38,14 @@ Anyone can see this page but it's not linked to anywhere!

    -
    + +
    diff --git a/tests/output/basic/pages/this-is-a-test-page.html b/tests/output/basic/pages/this-is-a-test-page.html index 43e2c2d4..c9192c94 100644 --- a/tests/output/basic/pages/this-is-a-test-page.html +++ b/tests/output/basic/pages/this-is-a-test-page.html @@ -38,7 +38,14 @@
    -
    + +
    diff --git a/tests/output/basic/second-article-fr.html b/tests/output/basic/second-article-fr.html index aa30292e..a5abce27 100644 --- a/tests/output/basic/second-article-fr.html +++ b/tests/output/basic/second-article-fr.html @@ -54,7 +54,14 @@
    -
    + +
    diff --git a/tests/output/basic/second-article.html b/tests/output/basic/second-article.html index 7319c87f..f6b42fec 100644 --- a/tests/output/basic/second-article.html +++ b/tests/output/basic/second-article.html @@ -54,7 +54,14 @@
    -
    + +
    diff --git a/tests/output/basic/tag/bar.html b/tests/output/basic/tag/bar.html index 06b012cb..891f5c35 100644 --- a/tests/output/basic/tag/bar.html +++ b/tests/output/basic/tag/bar.html @@ -134,7 +134,14 @@ YEAH !

    -
    + +
    diff --git a/tests/output/basic/tag/baz.html b/tests/output/basic/tag/baz.html index f6c56d4b..ce7c1c62 100644 --- a/tests/output/basic/tag/baz.html +++ b/tests/output/basic/tag/baz.html @@ -78,7 +78,14 @@
    -
    + +
    diff --git a/tests/output/basic/tag/foo.html b/tests/output/basic/tag/foo.html index 4ee92b7d..dffd1768 100644 --- a/tests/output/basic/tag/foo.html +++ b/tests/output/basic/tag/foo.html @@ -104,7 +104,14 @@ as well as inline markup.

    -
    + +
    diff --git a/tests/output/basic/tag/foobar.html b/tests/output/basic/tag/foobar.html index 11f21b6d..108353c2 100644 --- a/tests/output/basic/tag/foobar.html +++ b/tests/output/basic/tag/foobar.html @@ -62,7 +62,14 @@
    -
    + +
    diff --git a/tests/output/basic/tag/oh.html b/tests/output/basic/tag/oh.html index d88192a0..6e1a31ad 100644 --- a/tests/output/basic/tag/oh.html +++ b/tests/output/basic/tag/oh.html @@ -56,7 +56,14 @@ YEAH !

    -
    + +
    diff --git a/tests/output/basic/tag/yeah.html b/tests/output/basic/tag/yeah.html index 8533dbdc..c201b5c0 100644 --- a/tests/output/basic/tag/yeah.html +++ b/tests/output/basic/tag/yeah.html @@ -56,7 +56,14 @@ YEAH !

    -
    + +
    diff --git a/tests/output/basic/this-is-a-super-article.html b/tests/output/basic/this-is-a-super-article.html index 0188c07e..e098e2cf 100644 --- a/tests/output/basic/this-is-a-super-article.html +++ b/tests/output/basic/this-is-a-super-article.html @@ -66,7 +66,14 @@
    -
    + +
    diff --git a/tests/output/basic/unbelievable.html b/tests/output/basic/unbelievable.html index 36a1703c..a56096d9 100644 --- a/tests/output/basic/unbelievable.html +++ b/tests/output/basic/unbelievable.html @@ -54,7 +54,14 @@
    -
    + +
    From a7a71da6df64de5b1ce7f92d133a68f14d6ba8f8 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 21 Feb 2013 15:57:25 +0100 Subject: [PATCH 0686/2344] Fix a test in the asciidoc reader, and add asciidoc to travis so that the related tests will not be skipped. --- .travis.yml | 3 ++- pelican/readers.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b292101..569ea7b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,9 @@ python: - "3.2" before_install: - sudo apt-get update -qq - - sudo apt-get install -qq ruby-sass + - sudo apt-get install -qq --no-install-recommends asciidoc ruby-sass install: + - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi - pip install nose mock --use-mirrors - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install --use-mirrors unittest2; else pip install --use-mirrors unittest2py3k; fi - pip install . --use-mirrors diff --git a/pelican/readers.py b/pelican/readers.py index 99dc6e54..1623fb7f 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -285,7 +285,8 @@ class AsciiDocReader(Reader): def read(self, source_path): """Parse content and metadata of asciidoc files""" from cStringIO import StringIO - text = StringIO(pelican_open(source_path)) + with pelican_open(source_path) as source: + text = StringIO(source) content = StringIO() ad = AsciiDocAPI() From 824edb88238f7a7799ac1219c2994d0ac763094f Mon Sep 17 00:00:00 2001 From: Richard Duivenvoorde Date: Thu, 21 Feb 2013 12:38:51 +0100 Subject: [PATCH 0687/2344] rsync additions - adding / otherwise you will endup with output on remote - adding --cvs-exclude (to not sync cvs stuff) --- pelican/tools/templates/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index b15f48ae..c16fd7c0 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -61,7 +61,7 @@ ssh_upload: publish scp -P $$(SSH_PORT) -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) rsync_upload: publish - rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR) $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) + rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude dropbox_upload: publish cp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) From a13e31a76b46a37c78461ab7201098de9fa189a5 Mon Sep 17 00:00:00 2001 From: Richard Duivenvoorde Date: Thu, 21 Feb 2013 12:43:42 +0100 Subject: [PATCH 0688/2344] adding a stopsever target for make --- pelican/tools/templates/Makefile.in | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index c16fd7c0..35c41bb7 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -28,6 +28,7 @@ help: @echo ' make publish generate using production settings ' @echo ' make serve serve site at http://localhost:8000' @echo ' make devserver start/restart develop_server.sh ' + @echo ' make stopserver stop local server ' @echo ' ssh_upload upload the web site via SSH ' @echo ' rsync_upload upload the web site via rsync+ssh ' @echo ' dropbox_upload upload the web site via Dropbox ' @@ -54,6 +55,11 @@ serve: devserver: $$(BASEDIR)/develop_server.sh restart +stopserver: +_ kill -9 `cat pelican.pid` +_ kill -9 `cat srv.pid` +_ @echo 'Stopped Pelican and SimpleHTTPServer processes running in background. + publish: $$(PELICAN) $$(INPUTDIR) -o $$(OUTPUTDIR) -s $$(PUBLISHCONF) $$(PELICANOPTS) From 60ae7aa667e5143079c59da3f2ff0beb981ca50d Mon Sep 17 00:00:00 2001 From: yegle Date: Sun, 17 Feb 2013 10:44:14 -0500 Subject: [PATCH 0689/2344] Fix: hashlib.md5 funcition only accepts bytes as input --- pelican/plugins/gravatar.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pelican/plugins/gravatar.py b/pelican/plugins/gravatar.py index a4d11456..2b8520df 100644 --- a/pelican/plugins/gravatar.py +++ b/pelican/plugins/gravatar.py @@ -1,4 +1,5 @@ import hashlib +import six from pelican import signals """ @@ -33,8 +34,9 @@ def add_gravatar(generator, metadata): #then add gravatar url if 'email' in metadata.keys(): + email_bytes = six.b(metadata['email']).lower() gravatar_url = "http://www.gravatar.com/avatar/" + \ - hashlib.md5(metadata['email'].lower()).hexdigest() + hashlib.md5(email_bytes).hexdigest() metadata["author_gravatar"] = gravatar_url From 205792e9d4fb974491cf4465cda5c866414e5d25 Mon Sep 17 00:00:00 2001 From: Andrew Spiers Date: Fri, 15 Feb 2013 00:43:47 +1100 Subject: [PATCH 0690/2344] string types have no decode method in py3 --- pelican/tools/pelican_quickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 9f25f2fe..6d4264d3 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -47,7 +47,7 @@ else: def decoding_strings(f): def wrapper(*args, **kwargs): out = f(*args, **kwargs) - if isinstance(out, six.string_types): + if isinstance(out, six.string_types) and not six.PY3: # todo: make encoding configurable? return out.decode(sys.stdin.encoding) return out From 4a63695ae2cc871bd2849bc718b7bb2dfc6bc44c Mon Sep 17 00:00:00 2001 From: nfletton Date: Sat, 9 Feb 2013 17:23:59 -0700 Subject: [PATCH 0691/2344] Fixed pagination link error when _SAVE_AS setting used. The unit test for this scenario was passing as it was testing for an incorrect 'page_name' variable being set. --- pelican/generators.py | 4 ++-- tests/test_generators.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index ede0b7b3..e3ebf994 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -259,8 +259,8 @@ class ArticlesGenerator(Generator): continue write(save_as, self.get_template(template), - self.context, blog=True, paginated=paginated, - page_name=template) + self.context, blog=True, paginated=paginated, + page_name=os.path.splitext(save_as)[0]) def generate_tags(self, write): """Generate Tags pages.""" diff --git a/tests/test_generators.py b/tests/test_generators.py index 7a6e67fb..48c7bf91 100644 --- a/tests/test_generators.py +++ b/tests/test_generators.py @@ -140,7 +140,7 @@ class TestArticlesGenerator(unittest.TestCase): generator.generate_direct_templates(write) write.assert_called_with("archives/index.html", generator.get_template("archives"), settings, - blog=True, paginated={}, page_name='archives') + blog=True, paginated={}, page_name='archives/index') def test_direct_templates_save_as_false(self): From 44351aaf3126ea54508aef0db92ad4f556dc4e34 Mon Sep 17 00:00:00 2001 From: dave mankoff Date: Sat, 9 Feb 2013 18:01:40 -0500 Subject: [PATCH 0692/2344] delete output directory properly --- pelican/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index f57d2af7..0e3db788 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -224,7 +224,9 @@ def parse_arguments(): parser.add_argument('-d', '--delete-output-directory', dest='delete_outputdir', - action='store_true', help='Delete the output directory.') + action='store_true', + default=None, + help='Delete the output directory.') parser.add_argument('-v', '--verbose', action='store_const', const=logging.INFO, dest='verbosity', From ccef2a6f13b495b507d8b595c5c0b9083d7d0fac Mon Sep 17 00:00:00 2001 From: Eric Date: Wed, 23 Jan 2013 18:35:25 -0600 Subject: [PATCH 0693/2344] Settings file is pelicanconf.py now. --- pelican/plugins/related_posts.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/plugins/related_posts.py b/pelican/plugins/related_posts.py index c2765c3c..29c39435 100644 --- a/pelican/plugins/related_posts.py +++ b/pelican/plugins/related_posts.py @@ -13,7 +13,7 @@ To enable, add from pelican.plugins import related_posts PLUGINS = [related_posts] -to your settings.py. +to your settings's file pelicanconf.py . Usage ----- From 11bdb437d2c773096c06c0f62a37d2e9ed2e778b Mon Sep 17 00:00:00 2001 From: Eric Date: Thu, 24 Jan 2013 19:57:22 -0600 Subject: [PATCH 0694/2344] added unique filtering and config limit param I hacked some code from other modules and some quick googling, first time with py so this may need to be cleaned up. The functionality is to have a config var in pythonconfig.py and to remove the duplicates `sorted(set())` --- pelican/plugins/related_posts.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/pelican/plugins/related_posts.py b/pelican/plugins/related_posts.py index 29c39435..dc52de9a 100644 --- a/pelican/plugins/related_posts.py +++ b/pelican/plugins/related_posts.py @@ -13,14 +13,21 @@ To enable, add from pelican.plugins import related_posts PLUGINS = [related_posts] -to your settings's file pelicanconf.py . +to your pelicanconf.py. + +Control the number of entries with in the config file with: + +RELATED_POSTS = { + 'numentries': 6, +} + Usage ----- {% if article.related_posts %} {% endif %} @@ -40,12 +47,24 @@ def add_related_posts(generator, metadata): if len(related_posts) < 1: return + + metadata["related_posts"] = sorted(set(related_posts)) relation_score = dict(list(zip(set(related_posts), list(map(related_posts.count, set(related_posts)))))) ranked_related = sorted(relation_score, key=relation_score.get) + + #Load the confg file and get the number of entries specified there + settings = generator.settings + config = settings.get('RELATED_POSTS', {}) - metadata["related_posts"] = ranked_related[:5] + #check if the related_posts var is set in the pythonconfig.py + if not isinstance(config, dict): + info("realted_links plugin: Using default number of related links ("+numentries+")") + else: + numentries = config.get('numentries', 5) + + metadata["related_posts"] = ranked_related[:numentries] def register(): From 6f5d8eae9637533a65ac768982175fe65edf2e5f Mon Sep 17 00:00:00 2001 From: Eric Date: Tue, 29 Jan 2013 22:08:47 -0600 Subject: [PATCH 0695/2344] Relative URL issues with the related post examples I noted that if you set the `ARTICLE_URL` site variable to have some depth and just create relative links, they will not link correctly. by prefacing the link with `{{ SITEURL}}/` it seems to ensure proper links are created and works with the `make devserver` mode --- docs/plugins.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 77b114cf..3537f16b 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -302,7 +302,7 @@ For example:: {% if article.related_posts %} {% endif %} From 92e9f3b31378e4a3d12d5d2c2933b50d7f4c64f1 Mon Sep 17 00:00:00 2001 From: Joseph Reagle Date: Wed, 23 Jan 2013 12:38:29 -0500 Subject: [PATCH 0696/2344] bom detection and removal --- pelican/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index a761917a..8f9afcc0 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -14,7 +14,7 @@ import fnmatch from collections import defaultdict, Hashable from functools import partial -from codecs import open +from codecs import open, BOM_UTF8 from datetime import datetime from itertools import groupby from jinja2 import Markup @@ -192,7 +192,10 @@ class pelican_open(object): self.filename = filename def __enter__(self): - return open(self.filename, encoding='utf-8').read() + content = open(self.filename, encoding='utf-8').read() + if content[0] == BOM_UTF8.decode('utf8'): + content = content[1:] + return content def __exit__(self, exc_type, exc_value, traceback): pass From 9ed4e77049d15428cf25b14ebd9118f38a0b26a7 Mon Sep 17 00:00:00 2001 From: Joseph Reagle Date: Wed, 23 Jan 2013 12:34:12 -0500 Subject: [PATCH 0697/2344] improve spacing of p and nested lists --- pelican/themes/notmyidea/static/css/main.css | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/pelican/themes/notmyidea/static/css/main.css b/pelican/themes/notmyidea/static/css/main.css index 29cce82c..ae8fe3d6 100644 --- a/pelican/themes/notmyidea/static/css/main.css +++ b/pelican/themes/notmyidea/static/css/main.css @@ -65,7 +65,8 @@ h1 a:hover { } /* Paragraphs */ -p {margin-bottom: 1.143em;} +p { margin-top: 1em; + margin-bottom: 1em;} strong, b {font-weight: bold;} em, i {font-style: italic;} @@ -73,12 +74,12 @@ em, i {font-style: italic;} /* Lists */ ul { list-style: outside disc; - margin: 1em 0 1.5em 1.5em; + margin: 0.5em 0 0 1.5em; } ol { list-style: outside decimal; - margin: 1em 0 1.5em 1.5em; + margin: 0.5em 0 0 1.5em; } .post-info { @@ -88,6 +89,7 @@ ol { } .post-info p{ + margin-top: 1px; margin-bottom: 1px; } From 168d713df8f58fb8030443f9f0ea71b798284da5 Mon Sep 17 00:00:00 2001 From: Joseph Reagle Date: Wed, 23 Jan 2013 12:46:41 -0500 Subject: [PATCH 0698/2344] ul/li have no top/bottom margins, but list do --- pelican/themes/notmyidea/static/css/main.css | 6 ++++-- tests/output/basic/theme/css/main.css | 10 +++++++--- tests/output/custom/theme/css/main.css | 10 +++++++--- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/pelican/themes/notmyidea/static/css/main.css b/pelican/themes/notmyidea/static/css/main.css index ae8fe3d6..0295f6b2 100644 --- a/pelican/themes/notmyidea/static/css/main.css +++ b/pelican/themes/notmyidea/static/css/main.css @@ -74,14 +74,16 @@ em, i {font-style: italic;} /* Lists */ ul { list-style: outside disc; - margin: 0.5em 0 0 1.5em; + margin: 0em 0 0 1.5em; } ol { list-style: outside decimal; - margin: 0.5em 0 0 1.5em; + margin: 0em 0 0 1.5em; } +li { margin-top: 0.5em;} + .post-info { float:right; margin:10px; diff --git a/tests/output/basic/theme/css/main.css b/tests/output/basic/theme/css/main.css index 29cce82c..0295f6b2 100644 --- a/tests/output/basic/theme/css/main.css +++ b/tests/output/basic/theme/css/main.css @@ -65,7 +65,8 @@ h1 a:hover { } /* Paragraphs */ -p {margin-bottom: 1.143em;} +p { margin-top: 1em; + margin-bottom: 1em;} strong, b {font-weight: bold;} em, i {font-style: italic;} @@ -73,14 +74,16 @@ em, i {font-style: italic;} /* Lists */ ul { list-style: outside disc; - margin: 1em 0 1.5em 1.5em; + margin: 0em 0 0 1.5em; } ol { list-style: outside decimal; - margin: 1em 0 1.5em 1.5em; + margin: 0em 0 0 1.5em; } +li { margin-top: 0.5em;} + .post-info { float:right; margin:10px; @@ -88,6 +91,7 @@ ol { } .post-info p{ + margin-top: 1px; margin-bottom: 1px; } diff --git a/tests/output/custom/theme/css/main.css b/tests/output/custom/theme/css/main.css index 29cce82c..0295f6b2 100644 --- a/tests/output/custom/theme/css/main.css +++ b/tests/output/custom/theme/css/main.css @@ -65,7 +65,8 @@ h1 a:hover { } /* Paragraphs */ -p {margin-bottom: 1.143em;} +p { margin-top: 1em; + margin-bottom: 1em;} strong, b {font-weight: bold;} em, i {font-style: italic;} @@ -73,14 +74,16 @@ em, i {font-style: italic;} /* Lists */ ul { list-style: outside disc; - margin: 1em 0 1.5em 1.5em; + margin: 0em 0 0 1.5em; } ol { list-style: outside decimal; - margin: 1em 0 1.5em 1.5em; + margin: 0em 0 0 1.5em; } +li { margin-top: 0.5em;} + .post-info { float:right; margin:10px; @@ -88,6 +91,7 @@ ol { } .post-info p{ + margin-top: 1px; margin-bottom: 1px; } From 7cafcf6c24e25608f112989c7ffdfb282dbfeffd Mon Sep 17 00:00:00 2001 From: Eric Date: Mon, 14 Jan 2013 19:33:03 -0600 Subject: [PATCH 0699/2344] Fix the tag cloud example --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 7280f105..5babedbd 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -386,7 +386,7 @@ The default theme does not support tag clouds, but it is pretty easy to add:: From 4f6467ce08628a72ecf1373b2fe660bb819a635f Mon Sep 17 00:00:00 2001 From: Leroy Jiang Date: Sat, 5 Jan 2013 16:22:32 +0800 Subject: [PATCH 0700/2344] add disqus_url to comment js block --- pelican/themes/notmyidea/templates/article.html | 3 ++- tests/output/custom/a-markdown-powered-article.html | 1 + tests/output/custom/article-1.html | 1 + tests/output/custom/article-2.html | 1 + tests/output/custom/article-3.html | 1 + tests/output/custom/drafts/a-draft-article.html | 12 ------------ tests/output/custom/filename_metadata-example.html | 1 + tests/output/custom/oh-yeah-fr.html | 1 + tests/output/custom/oh-yeah.html | 1 + tests/output/custom/second-article-fr.html | 1 + tests/output/custom/second-article.html | 1 + tests/output/custom/this-is-a-super-article.html | 1 + tests/output/custom/unbelievable.html | 1 + 13 files changed, 13 insertions(+), 13 deletions(-) diff --git a/pelican/themes/notmyidea/templates/article.html b/pelican/themes/notmyidea/templates/article.html index 737d3789..516fd3b5 100644 --- a/pelican/themes/notmyidea/templates/article.html +++ b/pelican/themes/notmyidea/templates/article.html @@ -14,12 +14,13 @@ {% include 'article_infos.html' %} {{ article.content }} - {% if DISQUS_SITENAME %} + {% if DISQUS_SITENAME and SITEURL and article.status != "draft" %}

    Comments !

    -
    diff --git a/tests/output/custom/filename_metadata-example.html b/tests/output/custom/filename_metadata-example.html index af05059b..432a1cdf 100644 --- a/tests/output/custom/filename_metadata-example.html +++ b/tests/output/custom/filename_metadata-example.html @@ -61,6 +61,7 @@
    +

    You're mutually oblivious.

    -

    a root-relative link to unbelievable -a file-relative link to unbelievable

    +

    a root-relative link to unbelievable +a file-relative link to unbelievable

    diff --git a/pelican/tests/output/basic/archives.html b/pelican/tests/output/basic/archives.html index 06b3e6e6..c941849e 100644 --- a/pelican/tests/output/basic/archives.html +++ b/pelican/tests/output/basic/archives.html @@ -3,31 +3,31 @@ A Pelican Blog - + + + +
    @@ -35,23 +35,23 @@
    Fri 30 November 2012
    -
    FILENAME_METADATA example
    +
    FILENAME_METADATA example
    Wed 29 February 2012
    -
    Second article
    +
    Second article
    Wed 20 April 2011
    -
    A markdown powered article
    +
    A markdown powered article
    Thu 17 February 2011
    -
    Article 1
    +
    Article 1
    Thu 17 February 2011
    -
    Article 2
    +
    Article 2
    Thu 17 February 2011
    -
    Article 3
    +
    Article 3
    Thu 02 December 2010
    -
    This is a super article !
    +
    This is a super article !
    Wed 20 October 2010
    -
    Oh yeah !
    +
    Oh yeah !
    Fri 15 October 2010
    -
    Unbelievable !
    +
    Unbelievable !
    diff --git a/pelican/tests/output/basic/article-1.html b/pelican/tests/output/basic/article-1.html index fb425644..a86bcbd0 100644 --- a/pelican/tests/output/basic/article-1.html +++ b/pelican/tests/output/basic/article-1.html @@ -3,38 +3,38 @@ Article 1 - + + + +

    Article 1

    diff --git a/pelican/tests/output/basic/article-2.html b/pelican/tests/output/basic/article-2.html index 39d55c6b..da74685d 100644 --- a/pelican/tests/output/basic/article-2.html +++ b/pelican/tests/output/basic/article-2.html @@ -3,38 +3,38 @@ Article 2 - + + + +

    Article 2

    diff --git a/pelican/tests/output/basic/article-3.html b/pelican/tests/output/basic/article-3.html index e7e59440..03641539 100644 --- a/pelican/tests/output/basic/article-3.html +++ b/pelican/tests/output/basic/article-3.html @@ -3,38 +3,38 @@ Article 3 - + + + +

    Article 3

    diff --git a/pelican/tests/output/basic/author/alexis-metaireau.html b/pelican/tests/output/basic/author/alexis-metaireau.html index 8b83c8a6..9c47c7a0 100644 --- a/pelican/tests/output/basic/author/alexis-metaireau.html +++ b/pelican/tests/output/basic/author/alexis-metaireau.html @@ -3,31 +3,31 @@ A Pelican Blog - Alexis Métaireau - + + + + @@ -35,17 +35,17 @@

    Multi-line metadata should be supported as well as inline markup.

    - read more + read more diff --git a/pelican/tests/output/basic/categories.html b/pelican/tests/output/basic/categories.html index cdcbb04f..8f6d9f41 100644 --- a/pelican/tests/output/basic/categories.html +++ b/pelican/tests/output/basic/categories.html @@ -3,38 +3,38 @@ A Pelican Blog - + + + +

    Article 1

    - read more + read more @@ -78,7 +78,7 @@
  • Article 2

    - read more + read more @@ -100,7 +100,7 @@
  • Article 3

    - read more + read more diff --git a/pelican/tests/output/basic/category/misc.html b/pelican/tests/output/basic/category/misc.html index cdf2a437..f966bf89 100644 --- a/pelican/tests/output/basic/category/misc.html +++ b/pelican/tests/output/basic/category/misc.html @@ -3,31 +3,31 @@ A Pelican Blog - misc - + + + + @@ -35,13 +35,13 @@

    This is some article, in english

    - read more + read more @@ -79,7 +79,7 @@
  • Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    - read more + read more diff --git a/pelican/tests/output/basic/category/yeah.html b/pelican/tests/output/basic/category/yeah.html index fc108e93..bce27b13 100644 --- a/pelican/tests/output/basic/category/yeah.html +++ b/pelican/tests/output/basic/category/yeah.html @@ -3,31 +3,31 @@ A Pelican Blog - yeah - + + + + @@ -35,17 +35,17 @@

    Some cool stuff!

    diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html index 657ea233..d109f535 100644 --- a/pelican/tests/output/basic/index.html +++ b/pelican/tests/output/basic/index.html @@ -3,31 +3,31 @@ A Pelican Blog - + + + + @@ -35,13 +35,13 @@

    This is some article, in english

    - read more + read more @@ -79,7 +79,7 @@
  • You're mutually oblivious.

    -

    a root-relative link to unbelievable -a file-relative link to unbelievable

    - read more +

    a root-relative link to unbelievable +a file-relative link to unbelievable

    + read more @@ -102,7 +102,7 @@
  • Article 1

    - read more + read more @@ -124,7 +124,7 @@
  • Article 2

    - read more + read more @@ -146,7 +146,7 @@
  • Article 3

    - read more + read more @@ -168,7 +168,7 @@
  • Multi-line metadata should be supported as well as inline markup.

    - read more + read more @@ -194,7 +194,7 @@ as well as inline markup.

  • Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! @@ -216,7 +216,7 @@ YEAH !

    alternate text
    - read more + read more @@ -224,7 +224,7 @@ YEAH !

  • Or completely awesome. Depends the needs.

    -

    a root-relative link to markdown-article -a file-relative link to markdown-article

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    - read more + read more diff --git a/pelican/tests/output/basic/oh-yeah.html b/pelican/tests/output/basic/oh-yeah.html index 761ae0ff..82b90905 100644 --- a/pelican/tests/output/basic/oh-yeah.html +++ b/pelican/tests/output/basic/oh-yeah.html @@ -3,38 +3,38 @@ Oh yeah ! - + + + +

    Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! diff --git a/pelican/tests/output/basic/override/index.html b/pelican/tests/output/basic/override/index.html index 20995de3..82c1e184 100644 --- a/pelican/tests/output/basic/override/index.html +++ b/pelican/tests/output/basic/override/index.html @@ -3,31 +3,31 @@ Override url/save_as - + + + +

    diff --git a/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html b/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html index 6f1f71ee..06e4bcc1 100644 --- a/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html +++ b/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html @@ -3,31 +3,31 @@ This is a test hidden page - + + + + diff --git a/pelican/tests/output/basic/pages/this-is-a-test-page.html b/pelican/tests/output/basic/pages/this-is-a-test-page.html index ce9ffd2c..c40fc879 100644 --- a/pelican/tests/output/basic/pages/this-is-a-test-page.html +++ b/pelican/tests/output/basic/pages/this-is-a-test-page.html @@ -3,31 +3,31 @@ This is a test page - + + + + diff --git a/pelican/tests/output/basic/second-article-fr.html b/pelican/tests/output/basic/second-article-fr.html index 67c206af..6b3f422e 100644 --- a/pelican/tests/output/basic/second-article-fr.html +++ b/pelican/tests/output/basic/second-article-fr.html @@ -3,38 +3,38 @@ Deuxième article - + + + +

    Ceci est un article, en français.

    diff --git a/pelican/tests/output/basic/second-article.html b/pelican/tests/output/basic/second-article.html index e779e0da..657e1e5d 100644 --- a/pelican/tests/output/basic/second-article.html +++ b/pelican/tests/output/basic/second-article.html @@ -3,38 +3,38 @@ Second article - + + + +

    This is some article, in english

    diff --git a/pelican/tests/output/basic/tag/bar.html b/pelican/tests/output/basic/tag/bar.html index 6d4138f2..725cd165 100644 --- a/pelican/tests/output/basic/tag/bar.html +++ b/pelican/tests/output/basic/tag/bar.html @@ -3,31 +3,31 @@ A Pelican Blog - bar - + + + + @@ -35,15 +35,15 @@

    Multi-line metadata should be supported as well as inline markup.

    - read more + read more @@ -83,7 +83,7 @@ as well as inline markup.

  • Why not ?

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! @@ -105,7 +105,7 @@ YEAH !

    alternate text
    - read more + read more diff --git a/pelican/tests/output/basic/tag/baz.html b/pelican/tests/output/basic/tag/baz.html index dd44e38a..6a8baa42 100644 --- a/pelican/tests/output/basic/tag/baz.html +++ b/pelican/tests/output/basic/tag/baz.html @@ -3,31 +3,31 @@ A Pelican Blog - baz - + + + + @@ -35,15 +35,15 @@

    Multi-line metadata should be supported as well as inline markup.

    - read more + read more diff --git a/pelican/tests/output/basic/tag/foobar.html b/pelican/tests/output/basic/tag/foobar.html index 83ace5e3..ab728689 100644 --- a/pelican/tests/output/basic/tag/foobar.html +++ b/pelican/tests/output/basic/tag/foobar.html @@ -3,31 +3,31 @@ A Pelican Blog - foobar - + + + + @@ -35,17 +35,17 @@ +
    +

    Other articles

    +
    +
      - read more +
    1. +
      +

      Oh yeah !

      +
      + +
      +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more
    diff --git a/pelican/tests/output/custom/author/alexis-metaireau.html b/pelican/tests/output/custom/author/alexis-metaireau.html index e732fdcc..ded2e38d 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau.html +++ b/pelican/tests/output/custom/author/alexis-metaireau.html @@ -30,7 +30,57 @@ +
    +

    Other articles

    +
    +
      + +
    1. + +
    2. - -
      -

      Other articles

      -
      -
        +a file-relative link to unbelievable

        + read more +

        There are comments.

        +
      1. - -
      2. - -

      Page 1 / 3 diff --git a/pelican/tests/output/custom/author/alexis-metaireau2.html b/pelican/tests/output/custom/author/alexis-metaireau2.html index d984d5e7..ceb6877c 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau2.html +++ b/pelican/tests/output/custom/author/alexis-metaireau2.html @@ -32,25 +32,72 @@

      1. + +
      2. + +
      3. - -
      4. - -

      « From a4ce664f176f668eb56402ae978a29c943dc0f22 Mon Sep 17 00:00:00 2001 From: karl Date: Sat, 3 Aug 2013 22:31:54 -0400 Subject: [PATCH 0942/2344] fixing the inline code markup --- docs/faq.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index bb348d45..2cd363d8 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -90,13 +90,13 @@ For reStructuredText, this metadata should of course be prefixed with a colon:: :Modified: 2012-08-08 -This metadata can then be accessed in templates such as `article.html` via:: +This metadata can then be accessed in templates such as ``article.html`` via:: {% if article.modified %} Last modified: {{ article.modified }} {% endif %} -If you want to include metadata in templates outside the article context (e.g., `base.html`), the `if` statement should instead be: +If you want to include metadata in templates outside the article context (e.g., ``base.html``), the ``if`` statement should instead be: {% if article and article.modified %} From 4977de8453fca685ee2a16285074ae9724e08981 Mon Sep 17 00:00:00 2001 From: Russ Webber Date: Sun, 4 Aug 2013 14:00:56 +0800 Subject: [PATCH 0943/2344] fix: clear directory before generation of context fixes #927 --- pelican/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index a9aa916c..66463f56 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -168,16 +168,16 @@ class Pelican(object): ) for cls in self.get_generator_classes() ] - for p in generators: - if hasattr(p, 'generate_context'): - p.generate_context() - # erase the directory if it is not the source and if that's # explicitely asked if (self.delete_outputdir and not os.path.realpath(self.path).startswith(self.output_path)): clean_output_dir(self.output_path, self.output_retention) + for p in generators: + if hasattr(p, 'generate_context'): + p.generate_context() + writer = self.get_writer() for p in generators: From dc58a17e647bb1fb8e8c6cde00f3f42f0ad1363c Mon Sep 17 00:00:00 2001 From: Russ Webber Date: Sun, 4 Aug 2013 17:21:35 +0800 Subject: [PATCH 0944/2344] fix missing 'kind' arg in importer fixes #983 --- pelican/tools/pelican_import.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 46582937..46410c13 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -400,8 +400,9 @@ def tumblr2fields(api_key, blogname): content = '

      %s: %s

      \n%s' % (post.get('asking_name'), post.get('asking_url'), post.get('question'), post.get('answer')) content = content.rstrip() + '\n' - - yield (title, content, slug, date, post.get('blog_name'), [type], tags, format) + kind = 'article' + yield (title, content, slug, date, post.get('blog_name'), [type], + tags, kind, format) offset += len(posts) posts = get_tumblr_posts(api_key, blogname, offset) From e0a2f1906df513cc48b3fc6e386c22e484b1fabd Mon Sep 17 00:00:00 2001 From: Russ Webber Date: Sun, 4 Aug 2013 18:52:53 +0800 Subject: [PATCH 0945/2344] Remove old mercurial files --- .hgignore | 9 --------- .hgtags | 29 ----------------------------- 2 files changed, 38 deletions(-) delete mode 100644 .hgignore delete mode 100644 .hgtags diff --git a/.hgignore b/.hgignore deleted file mode 100644 index a0f6b7c5..00000000 --- a/.hgignore +++ /dev/null @@ -1,9 +0,0 @@ -syntax: glob -output/* -*.pyc -MANIFEST -build -dist -docs/_build -Paste-* -*.egg-info diff --git a/.hgtags b/.hgtags deleted file mode 100644 index 6d4c8d99..00000000 --- a/.hgtags +++ /dev/null @@ -1,29 +0,0 @@ -7acafbf7e47b1287525026ad8b4f1efe443d5403 1.2 -7acafbf7e47b1287525026ad8b4f1efe443d5403 1.2 -ae850ab0fd62a98a98da7ce74ac794319c6a5066 1.2 -54a0309f79d6c5b54d8e1e3b5e3f744856b68a73 1.1 -8f5e0eb037768351eb08840e588a4364266a69b3 1.1.1 -bb986ed591734ca469f726753cbc48ebbfce0dcc 1.2.1 -8a3dad99cbfa6bb5d0ef073213d0d86e0b4c5dba 1.2.2 -4a20105a242ab154f6202aa6651979bfbb4cf95e 1.2.3 -803aa0976cca3dd737777c640722988b1f3769fe 1.2.4 -703c4511105fd9c8b85afda951a294c194e7cf3e 1.2.5 -6e46a40aaa850a979f5d09dd95d02791ec7ab0ef 2.0 -bf14d1a5c1fae9475447698f0f9b8d35c551f732 2.1 -da86343ebd543e5865050e47ecb0937755528d13 2.1.1 -760187f048bb23979402f950ecb5d3c5493995b1 2.2 -20aa16fe4daa3b70f6c063f170edc916b49837ed 2.3 -f9c1d94081504f21f5b2ba147a38099e45db1769 2.4 -e65199a0b2706d2fb48f7a3c015e869716e0bec1 2.4.1 -89dbd7b6f114508eae62fc821326f4797dfc8b23 2.4.2 -979b4473af56a191a278c83058bc9c8fa1fde30e 2.4.3 -26a444fbb78becae358afa0a5b47587db8739b21 2.4.4 -3542b65fd1963ae7065b6a3bc912fbb6c150e98c 2.4.5 -87745dfdd51b96bf18eaaf6c402effa902c1b856 2.5.0 -294a2830a393d5a97671dc211dbdb5254a15e604 2.5.1 -294a2830a393d5a97671dc211dbdb5254a15e604 2.5.1 -92b31e41134cb2c1a156ce623338cf634d2ebc3e 2.5.1 -7d728f8e771cbbc802ce81e424e08a8eecbd48dc 2.5.2 -7d728f8e771cbbc802ce81e424e08a8eecbd48dc 2.5.2 -6d368a1739a4ce48d2d04b00db04fa538e2bf90a 2.5.2 -1f9dd44b546425216b1fa35fd88d3d532da8916b 2.5.3 From 0999d4d6915574cb0377048157661e1a5e6d9ced Mon Sep 17 00:00:00 2001 From: Rogdham Date: Thu, 20 Jun 2013 21:58:51 +0100 Subject: [PATCH 0946/2344] Deliberate overriding of an existing file to tests Deliberate overriding via `save_as` metadata should be allowed, even after the overwrite detection feature. This commit is to add tests for deliberate overriding. As a result, the relevant tests *should fail* after this commit. Added a page and an article, both to override a tag, with very old dates so it limits the amount of diff in the generated pages. Overriding feature introduced by d0e9c52410e70e14008d2ef827ba7ac306243e72 Overwrite detection introduced by ff7410ce2ada85b486a67ae11874d60d135ff939 --- .../basic/a-markdown-powered-article.html | 1 + pelican/tests/output/basic/archives.html | 3 ++ pelican/tests/output/basic/article-1.html | 1 + pelican/tests/output/basic/article-2.html | 1 + pelican/tests/output/basic/article-3.html | 1 + .../output/basic/author/alexis-metaireau.html | 1 + pelican/tests/output/basic/categories.html | 1 + pelican/tests/output/basic/category/bar.html | 1 + pelican/tests/output/basic/category/cat1.html | 1 + pelican/tests/output/basic/category/misc.html | 21 ++++++++ pelican/tests/output/basic/category/yeah.html | 1 + .../tests/output/basic/feeds/all-en.atom.xml | 1 + pelican/tests/output/basic/feeds/all.atom.xml | 1 + .../tests/output/basic/feeds/misc.atom.xml | 1 + .../basic/filename_metadata-example.html | 1 + pelican/tests/output/basic/index.html | 21 ++++++++ pelican/tests/output/basic/oh-yeah.html | 1 + .../tests/output/basic/override/index.html | 1 + .../pages/this-is-a-test-hidden-page.html | 1 + .../basic/pages/this-is-a-test-page.html | 1 + .../tests/output/basic/second-article-fr.html | 1 + .../tests/output/basic/second-article.html | 1 + pelican/tests/output/basic/tag/bar.html | 1 + pelican/tests/output/basic/tag/baz.html | 33 +++++++------ pelican/tests/output/basic/tag/foo.html | 1 + pelican/tests/output/basic/tag/foobar.html | 1 + pelican/tests/output/basic/tag/oh.html | 31 +++--------- pelican/tests/output/basic/tag/yeah.html | 1 + .../output/basic/this-is-a-super-article.html | 1 + pelican/tests/output/basic/unbelievable.html | 1 + .../custom/a-markdown-powered-article.html | 1 + pelican/tests/output/custom/archives.html | 3 ++ pelican/tests/output/custom/article-1.html | 1 + pelican/tests/output/custom/article-2.html | 1 + pelican/tests/output/custom/article-3.html | 1 + .../custom/author/alexis-metaireau.html | 1 + .../custom/author/alexis-metaireau2.html | 1 + .../custom/author/alexis-metaireau3.html | 24 +++++++++ pelican/tests/output/custom/categories.html | 1 + pelican/tests/output/custom/category/bar.html | 1 + .../tests/output/custom/category/cat1.html | 1 + .../tests/output/custom/category/misc.html | 24 +++++++++ .../tests/output/custom/category/yeah.html | 1 + .../output/custom/drafts/a-draft-article.html | 1 + .../tests/output/custom/feeds/all-en.atom.xml | 1 + .../tests/output/custom/feeds/all.atom.xml | 1 + pelican/tests/output/custom/feeds/all.rss.xml | 3 +- .../tests/output/custom/feeds/misc.atom.xml | 1 + .../tests/output/custom/feeds/misc.rss.xml | 3 +- .../custom/filename_metadata-example.html | 1 + pelican/tests/output/custom/index.html | 1 + pelican/tests/output/custom/index2.html | 1 + pelican/tests/output/custom/index3.html | 24 +++++++++ .../tests/output/custom/jinja2_template.html | 1 + pelican/tests/output/custom/oh-yeah-fr.html | 1 + pelican/tests/output/custom/oh-yeah.html | 1 + .../tests/output/custom/override/index.html | 1 + .../pages/this-is-a-test-hidden-page.html | 1 + .../custom/pages/this-is-a-test-page.html | 1 + .../output/custom/second-article-fr.html | 1 + .../tests/output/custom/second-article.html | 1 + pelican/tests/output/custom/tag/bar.html | 1 + pelican/tests/output/custom/tag/baz.html | 49 ++++++++++++------- pelican/tests/output/custom/tag/foo.html | 1 + pelican/tests/output/custom/tag/foobar.html | 1 + pelican/tests/output/custom/tag/oh.html | 36 +++----------- pelican/tests/output/custom/tag/yeah.html | 1 + .../custom/this-is-a-super-article.html | 1 + pelican/tests/output/custom/unbelievable.html | 1 + samples/content/article_tag_baz.rst | 8 +++ samples/content/pages/override_tag_oh.rst | 8 +++ 71 files changed, 261 insertions(+), 86 deletions(-) create mode 100644 samples/content/article_tag_baz.rst create mode 100644 samples/content/pages/override_tag_oh.rst diff --git a/pelican/tests/output/basic/a-markdown-powered-article.html b/pelican/tests/output/basic/a-markdown-powered-article.html index 6f854ae4..b7a90f02 100644 --- a/pelican/tests/output/basic/a-markdown-powered-article.html +++ b/pelican/tests/output/basic/a-markdown-powered-article.html @@ -15,6 +15,7 @@
      diff --git a/pelican/tests/output/basic/article-1.html b/pelican/tests/output/basic/article-1.html index 3d55751d..114e4774 100644 --- a/pelican/tests/output/basic/article-1.html +++ b/pelican/tests/output/basic/article-1.html @@ -15,6 +15,7 @@
    diff --git a/pelican/tests/output/basic/category/yeah.html b/pelican/tests/output/basic/category/yeah.html index b7c383fa..a894dabb 100644 --- a/pelican/tests/output/basic/category/yeah.html +++ b/pelican/tests/output/basic/category/yeah.html @@ -15,6 +15,7 @@
    diff --git a/pelican/tests/output/basic/oh-yeah.html b/pelican/tests/output/basic/oh-yeah.html index cb29ea80..940ebaed 100644 --- a/pelican/tests/output/basic/oh-yeah.html +++ b/pelican/tests/output/basic/oh-yeah.html @@ -15,6 +15,7 @@
    diff --git a/pelican/tests/output/custom/article-1.html b/pelican/tests/output/custom/article-1.html index 80f1ceaf..8511a11d 100644 --- a/pelican/tests/output/custom/article-1.html +++ b/pelican/tests/output/custom/article-1.html @@ -19,6 +19,7 @@

    blogroll

    diff --git a/pelican/tests/output/custom/tag/foo.html b/pelican/tests/output/custom/tag/foo.html index b6c741bd..3bc93546 100644 --- a/pelican/tests/output/custom/tag/foo.html +++ b/pelican/tests/output/custom/tag/foo.html @@ -19,6 +19,7 @@

    blogroll

    diff --git a/pelican/tests/output/custom/tag/yeah.html b/pelican/tests/output/custom/tag/yeah.html index ba6089f0..ba2da881 100644 --- a/pelican/tests/output/custom/tag/yeah.html +++ b/pelican/tests/output/custom/tag/yeah.html @@ -19,6 +19,7 @@
    diff --git a/pelican/tests/output/basic/feeds/all-en.atom.xml b/pelican/tests/output/basic/feeds/all-en.atom.xml index 9b819f84..6d0c563f 100644 --- a/pelican/tests/output/basic/feeds/all-en.atom.xml +++ b/pelican/tests/output/basic/feeds/all-en.atom.xml @@ -27,5 +27,11 @@ YEAH !</p> Unbelievable !2010-10-15T20:30:00Ztag:,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/all.atom.xml b/pelican/tests/output/basic/feeds/all.atom.xml index 63628281..1abf742a 100644 --- a/pelican/tests/output/basic/feeds/all.atom.xml +++ b/pelican/tests/output/basic/feeds/all.atom.xml @@ -28,5 +28,11 @@ YEAH !</p> Unbelievable !2010-10-15T20:30:00Ztag:,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/misc.atom.xml b/pelican/tests/output/basic/feeds/misc.atom.xml index f2885b1d..b5588ce7 100644 --- a/pelican/tests/output/basic/feeds/misc.atom.xml +++ b/pelican/tests/output/basic/feeds/misc.atom.xml @@ -4,5 +4,11 @@ Unbelievable !2010-10-15T20:30:00Ztag:,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html index 6a4fb8f3..6989f25a 100644 --- a/pelican/tests/output/basic/index.html +++ b/pelican/tests/output/basic/index.html @@ -215,6 +215,12 @@ YEAH !

    Or completely awesome. Depends the needs.

    a root-relative link to markdown-article a file-relative link to markdown-article

    +
    +

    Testing sourcecode directive

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    +
    read more diff --git a/pelican/tests/output/basic/unbelievable.html b/pelican/tests/output/basic/unbelievable.html index 97df4b07..3f2d2f80 100644 --- a/pelican/tests/output/basic/unbelievable.html +++ b/pelican/tests/output/basic/unbelievable.html @@ -43,6 +43,12 @@

    Or completely awesome. Depends the needs.

    a root-relative link to markdown-article a file-relative link to markdown-article

    +
    +

    Testing sourcecode directive

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    +
    diff --git a/pelican/tests/output/custom/author/alexis-metaireau3.html b/pelican/tests/output/custom/author/alexis-metaireau3.html index 15e8ac9c..e3e07e10 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom/author/alexis-metaireau3.html @@ -51,6 +51,12 @@

    Or completely awesome. Depends the needs.

    a root-relative link to markdown-article a file-relative link to markdown-article

    +
    +

    Testing sourcecode directive

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    +
    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html index e950d863..63c659da 100644 --- a/pelican/tests/output/custom/category/misc.html +++ b/pelican/tests/output/custom/category/misc.html @@ -95,6 +95,12 @@

    Or completely awesome. Depends the needs.

    a root-relative link to markdown-article a file-relative link to markdown-article

    +
    +

    Testing sourcecode directive

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    +
    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/feeds/all-en.atom.xml b/pelican/tests/output/custom/feeds/all-en.atom.xml index 49b0de79..d4631d7c 100644 --- a/pelican/tests/output/custom/feeds/all-en.atom.xml +++ b/pelican/tests/output/custom/feeds/all-en.atom.xml @@ -27,5 +27,11 @@ YEAH !</p> Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/all.atom.xml b/pelican/tests/output/custom/feeds/all.atom.xml index a9e67acd..2a673ada 100644 --- a/pelican/tests/output/custom/feeds/all.atom.xml +++ b/pelican/tests/output/custom/feeds/all.atom.xml @@ -29,5 +29,11 @@ YEAH !</p> Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/all.rss.xml b/pelican/tests/output/custom/feeds/all.rss.xml index 7d7890a9..e8cd9b80 100644 --- a/pelican/tests/output/custom/feeds/all.rss.xml +++ b/pelican/tests/output/custom/feeds/all.rss.xml @@ -29,5 +29,11 @@ YEAH !</p> Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:oh-yeah.htmlohbaryeahUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.htmlThe baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/misc.atom.xml b/pelican/tests/output/custom/feeds/misc.atom.xml index 029184b0..250b1b65 100644 --- a/pelican/tests/output/custom/feeds/misc.atom.xml +++ b/pelican/tests/output/custom/feeds/misc.atom.xml @@ -4,5 +4,11 @@ Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/misc.rss.xml b/pelican/tests/output/custom/feeds/misc.rss.xml index ab2639cf..195812cc 100644 --- a/pelican/tests/output/custom/feeds/misc.rss.xml +++ b/pelican/tests/output/custom/feeds/misc.rss.xml @@ -4,5 +4,11 @@ Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.htmlThe baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom/index3.html b/pelican/tests/output/custom/index3.html index 67988a51..52657306 100644 --- a/pelican/tests/output/custom/index3.html +++ b/pelican/tests/output/custom/index3.html @@ -51,6 +51,12 @@

    Or completely awesome. Depends the needs.

    a root-relative link to markdown-article a file-relative link to markdown-article

    +
    +

    Testing sourcecode directive

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    +
    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/unbelievable.html b/pelican/tests/output/custom/unbelievable.html index fcf4adaf..26b60f38 100644 --- a/pelican/tests/output/custom/unbelievable.html +++ b/pelican/tests/output/custom/unbelievable.html @@ -50,6 +50,12 @@

    Or completely awesome. Depends the needs.

    a root-relative link to markdown-article a file-relative link to markdown-article

    +
    +

    Testing sourcecode directive

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    +
    diff --git a/samples/content/unbelievable.rst b/samples/content/unbelievable.rst index 20cb9dc7..745ff217 100644 --- a/samples/content/unbelievable.rst +++ b/samples/content/unbelievable.rst @@ -7,3 +7,14 @@ Or completely awesome. Depends the needs. `a root-relative link to markdown-article <|filename|/cat1/markdown-article.md>`_ `a file-relative link to markdown-article <|filename|cat1/markdown-article.md>`_ + +Testing sourcecode directive +---------------------------- + +.. sourcecode:: python + :linenos: + + formatter = self.options and VARIANTS[self.options.keys()[0]] + + +Lovely. From 42f9726ffafac947b91425df58a70cc49aceb100 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Thu, 25 Jul 2013 23:25:05 +0200 Subject: [PATCH 0956/2344] Support TAGS_* and AUTHORS_* by default. --- docs/settings.rst | 2 +- pelican/settings.py | 2 +- pelican/tests/output/basic/authors.html | 51 +++++++++++ pelican/tests/output/basic/tags.html | 56 +++++++++++++ pelican/tests/output/custom/authors.html | 79 +++++++++++++++++ pelican/tests/output/custom/tags.html | 84 +++++++++++++++++++ .../themes/notmyidea/templates/authors.html | 15 ++++ pelican/themes/notmyidea/templates/tags.html | 15 ++++ pelican/themes/simple/templates/authors.html | 10 +++ pelican/themes/simple/templates/tags.html | 10 +++ 10 files changed, 322 insertions(+), 2 deletions(-) create mode 100644 pelican/tests/output/basic/authors.html create mode 100644 pelican/tests/output/custom/authors.html create mode 100644 pelican/themes/notmyidea/templates/tags.html create mode 100644 pelican/themes/simple/templates/authors.html diff --git a/docs/settings.rst b/docs/settings.rst index 8ecac7c9..0d8f924f 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -244,7 +244,7 @@ Setting name (default value) What does it do? `CATEGORY_SAVE_AS` (``'category/{slug}.html'``) The location to save a category. `TAG_URL` (``'tag/{slug}.html'``) The URL to use for a tag. `TAG_SAVE_AS` (``'tag/{slug}.html'``) The location to save the tag page. -`TAGS_URL` (``'tag/{slug}.html'``) The URL to use for the tag list. +`TAGS_URL` (``'tags.html'``) The URL to use for the tag list. `TAGS_SAVE_AS` (``'tags.html'``) The location to save the tag list. `AUTHOR_URL` (``'author/{slug}.html'``) The URL to use for an author. `AUTHOR_SAVE_AS` (``'author/{slug}.html'``) The location to save an author. diff --git a/pelican/settings.py b/pelican/settings.py index 0f37c98d..d4ce0c5c 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -84,7 +84,7 @@ DEFAULT_CONFIG = { 'DEFAULT_LANG': 'en', 'TAG_CLOUD_STEPS': 4, 'TAG_CLOUD_MAX_ITEMS': 100, - 'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'archives'), + 'DIRECT_TEMPLATES': ('index', 'tags', 'categories', 'authors', 'archives'), 'EXTRA_TEMPLATES_PATHS': [], 'PAGINATED_DIRECT_TEMPLATES': ('index', ), 'PELICAN_CLASS': 'pelican.Pelican', diff --git a/pelican/tests/output/basic/authors.html b/pelican/tests/output/basic/authors.html new file mode 100644 index 00000000..766bf566 --- /dev/null +++ b/pelican/tests/output/basic/authors.html @@ -0,0 +1,51 @@ + + + + + A Pelican Blog - Authors + + + + + + + + + +
    +

    Authors on A Pelican Blog

  • Alexis Métaireau (2)
  • +
    + +
    + +
    + + + + + \ No newline at end of file diff --git a/pelican/tests/output/basic/tags.html b/pelican/tests/output/basic/tags.html index e69de29b..b9fa57f9 100644 --- a/pelican/tests/output/basic/tags.html +++ b/pelican/tests/output/basic/tags.html @@ -0,0 +1,56 @@ + + + + + A Pelican Blog - Tags + + + + + + + + + +
    +

    Tags for A Pelican Blog

  • bar (3)
  • +
  • baz (1)
  • +
  • foo (2)
  • +
  • foobar (1)
  • +
  • oh (1)
  • +
  • yeah (1)
  • +
    + +
    + +
    + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom/authors.html b/pelican/tests/output/custom/authors.html new file mode 100644 index 00000000..264c1698 --- /dev/null +++ b/pelican/tests/output/custom/authors.html @@ -0,0 +1,79 @@ + + + + + Alexis' log - Authors + + + + + + + + + +Fork me on GitHub + + + +
    +

    Authors on Alexis' log

  • Alexis Métaireau (10)
  • +
    + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom/tags.html b/pelican/tests/output/custom/tags.html index e69de29b..7130b3ae 100644 --- a/pelican/tests/output/custom/tags.html +++ b/pelican/tests/output/custom/tags.html @@ -0,0 +1,84 @@ + + + + + Alexis' log - Tags + + + + + + + + + +Fork me on GitHub + + + +
    +

    Tags for Alexis' log

  • bar (3)
  • +
  • baz (1)
  • +
  • foo (2)
  • +
  • foobar (1)
  • +
  • oh (1)
  • +
  • yeah (1)
  • +
    + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/themes/notmyidea/templates/authors.html b/pelican/themes/notmyidea/templates/authors.html index e69de29b..a203422b 100644 --- a/pelican/themes/notmyidea/templates/authors.html +++ b/pelican/themes/notmyidea/templates/authors.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Authors{% endblock %} + +{% block content %} + +
    +

    Authors on {{ SITENAME }}

    + + {%- for author, articles in authors|sort %} +
  • {{ author }} ({{ articles|count }})
  • + {% endfor %} +
    + +{% endblock %} diff --git a/pelican/themes/notmyidea/templates/tags.html b/pelican/themes/notmyidea/templates/tags.html new file mode 100644 index 00000000..76955f27 --- /dev/null +++ b/pelican/themes/notmyidea/templates/tags.html @@ -0,0 +1,15 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Tags{% endblock %} + +{% block content %} + +
    +

    Tags for {{ SITENAME }}

    + + {%- for tag, articles in tags|sort %} +
  • {{ tag }} ({{ articles|count }})
  • + {% endfor %} +
    + +{% endblock %} diff --git a/pelican/themes/simple/templates/authors.html b/pelican/themes/simple/templates/authors.html new file mode 100644 index 00000000..fa9b5170 --- /dev/null +++ b/pelican/themes/simple/templates/authors.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Authors{% endblock %} + +{% block content %} +

    Authors on {{ SITENAME }}

    + {%- for author, articles in authors|sort %} +
  • {{ author }} ({{ articles|count }})
  • + {% endfor %} +{% endblock %} diff --git a/pelican/themes/simple/templates/tags.html b/pelican/themes/simple/templates/tags.html index e69de29b..b5d1482d 100644 --- a/pelican/themes/simple/templates/tags.html +++ b/pelican/themes/simple/templates/tags.html @@ -0,0 +1,10 @@ +{% extends "base.html" %} + +{% block title %}{{ SITENAME }} - Tags{% endblock %} + +{% block content %} +

    Tags for {{ SITENAME }}

    + {%- for tag, articles in tags|sort %} +
  • {{ tag }} ({{ articles|count }})
  • + {% endfor %} +{% endblock %} From bbea6d1747c3f95ab4b30aec47691e81bd4ef453 Mon Sep 17 00:00:00 2001 From: Danilo Bargen Date: Mon, 5 Aug 2013 19:18:43 +0200 Subject: [PATCH 0957/2344] Explicitly set locale when generating test output --- docs/contribute.rst | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index 80d07644..304d1de8 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -88,9 +88,10 @@ Pelican, and the changes to that output are expected and deemed correct given the nature of your changes, then you should update the output used by the functional tests. To do so, you can use the following two commands:: - $ pelican -o pelican/tests/output/custom/ -s samples/pelican.conf.py \ + $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \ + -s samples/pelican.conf.py samples/content/ + $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ samples/content/ - $ pelican -o pelican/tests/output/basic/ samples/content/ Testing on Python 2 and 3 ------------------------- From 6b68d940797a6889466cc95af4e3c1585d0d8b07 Mon Sep 17 00:00:00 2001 From: Nicholas Kuechler Date: Tue, 11 Jun 2013 21:43:23 -0500 Subject: [PATCH 0958/2344] Adds Rackspace Cloud Files support to quickstart and fabfile --- pelican/tools/pelican_quickstart.py | 7 +++++++ pelican/tools/templates/Makefile.in | 10 +++++++++- pelican/tools/templates/fabfile.py.in | 15 ++++++++++++++- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 3f02355a..ba11d968 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -27,6 +27,9 @@ CONF = { 'ssh_user': 'root', 'ssh_target_dir': '/var/www', 's3_bucket': 'my_s3_bucket', + 'cloudfiles_username': 'my_rackspace_username', + 'cloudfiles_api_key': 'my_rackspace_api_key', + 'cloudfiles_container': 'my_cloudfiles_container', 'dropbox_dir': '~/Dropbox/Public/', 'default_pagination': 10, 'siteurl': '', @@ -210,6 +213,10 @@ needed by Pelican. CONF['dropbox_dir'] = ask('Where is your Dropbox directory?', str_compat, CONF['dropbox_dir']) if ask('Do you want to upload your website using S3?', answer=bool, default=False): CONF['s3_bucket'] = ask('What is the name of your S3 bucket?', str_compat, CONF['s3_bucket']) + if ask('Do you want to upload your website using Rackspace Cloud Files?', answer=bool, default=False): + CONF['cloudfiles_username'] = ask('What is your Rackspace Cloud username?', str_compat, CONF['cloudfiles_username']) + CONF['cloudfiles_api_key'] = ask('What is your Rackspace Cloud API key?', str_compat, CONF['cloudfiles_api_key']) + CONF['cloudfiles_container'] = ask('What is the name of your Cloud Files container?', str_compat, CONF['cloudfiles_container']) try: os.makedirs(os.path.join(CONF['basedir'], 'content')) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index f68694e3..4ca0af6a 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -18,6 +18,10 @@ SSH_TARGET_DIR=$ssh_target_dir S3_BUCKET=$s3_bucket +CLOUDFILES_USERNAME=$cloudfiles_username +CLOUDFILES_API_KEY=$cloudfiles_api_key +CLOUDFILES_CONTAINER=$cloudfiles_container + DROPBOX_DIR=$dropbox_dir DEBUG ?= 0 @@ -41,6 +45,7 @@ help: @echo ' dropbox_upload upload the web site via Dropbox ' @echo ' ftp_upload upload the web site via FTP ' @echo ' s3_upload upload the web site via S3 ' + @echo ' cf_upload upload the web site via Cloud Files' @echo ' github upload the web site via gh-pages ' @echo ' ' @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html' @@ -92,8 +97,11 @@ ftp_upload: publish s3_upload: publish s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed +cf_upload: publish + cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) . + github: publish ghp-import $$(OUTPUTDIR) git push origin gh-pages -.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload github +.PHONY: html help clean regenerate serve devserver publish ssh_upload rsync_upload dropbox_upload ftp_upload s3_upload cf_upload github diff --git a/pelican/tools/templates/fabfile.py.in b/pelican/tools/templates/fabfile.py.in index e991b763..73c64ac8 100644 --- a/pelican/tools/templates/fabfile.py.in +++ b/pelican/tools/templates/fabfile.py.in @@ -4,12 +4,17 @@ import os # Local path configuration (can be absolute or relative to fabfile) env.deploy_path = 'output' +DEPLOY_PATH = env.deploy_path # Remote server configuration production = '$ssh_user@$ssh_host:$ssh_port' dest_path = '$ssh_target_dir' -DEPLOY_PATH = env.deploy_path +# Rackspace Cloud Files configuration settings +env.cloudfiles_username = '$cloudfiles_username' +env.cloudfiles_api_key = '$cloudfiles_api_key' +env.cloudfiles_container = '$cloudfiles_container' + def clean(): if os.path.isdir(DEPLOY_PATH): @@ -36,6 +41,14 @@ def reserve(): def preview(): local('pelican -s publishconf.py') +def cf_upload(): + rebuild() + local('cd {deploy_path} && ' + 'swift -v -A https://auth.api.rackspacecloud.com/v1.0 ' + '-U {cloudfiles_username} ' + '-K {cloudfiles_api_key} ' + 'upload -c {cloudfiles_container} .'.format(**env)) + @hosts(production) def publish(): local('pelican -s publishconf.py') From ece437f8fd69975c9a78aa1bb4c04910d97e7a0e Mon Sep 17 00:00:00 2001 From: SDGSDG Date: Mon, 5 Aug 2013 19:53:32 -0700 Subject: [PATCH 0959/2344] Added more pygments options for code blocks --- pelican/rstdirectives.py | 39 ++++++++++---- pelican/tests/output/basic/category/misc.html | 4 +- .../tests/output/basic/feeds/all-en.atom.xml | 10 ++++ pelican/tests/output/basic/feeds/all.atom.xml | 10 ++++ .../tests/output/basic/feeds/misc.atom.xml | 10 ++++ pelican/tests/output/basic/index.html | 4 +- pelican/tests/output/basic/unbelievable.html | 10 ++++ .../custom/author/alexis-metaireau3.html | 4 +- .../tests/output/custom/category/misc.html | 4 +- .../tests/output/custom/feeds/all-en.atom.xml | 10 ++++ .../tests/output/custom/feeds/all.atom.xml | 10 ++++ pelican/tests/output/custom/feeds/all.rss.xml | 10 ++++ .../tests/output/custom/feeds/misc.atom.xml | 10 ++++ .../tests/output/custom/feeds/misc.rss.xml | 10 ++++ pelican/tests/output/custom/index3.html | 4 +- pelican/tests/output/custom/unbelievable.html | 10 ++++ samples/content/unbelievable.rst | 53 +++++++++++++++++++ 17 files changed, 196 insertions(+), 16 deletions(-) diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index 1fdd09d6..ba3a6b89 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -8,20 +8,29 @@ from pygments import highlight from pygments.lexers import get_lexer_by_name, TextLexer import re -INLINESTYLES = False -DEFAULT = HtmlFormatter(noclasses=INLINESTYLES) -VARIANTS = { - 'linenos': HtmlFormatter(noclasses=INLINESTYLES, linenos=True), -} - class Pygments(Directive): - """ Source code syntax hightlighting. + """ Source code syntax highlighting. """ required_arguments = 1 optional_arguments = 0 final_argument_whitespace = True - option_spec = dict([(key, directives.flag) for key in VARIANTS]) + option_spec = { + 'anchorlinenos': directives.flag, + 'classprefix': directives.unchanged, + 'hl_lines': directives.unchanged, + 'lineanchors': directives.unchanged, + 'linenos': directives.unchanged, + 'linenospecial': directives.nonnegative_int, + 'linenostart': directives.nonnegative_int, + 'linenostep': directives.nonnegative_int, + 'lineseparator': directives.unchanged, + 'linespans': directives.unchanged, + 'nobackground': directives.flag, + 'nowrap': directives.flag, + 'tagsfile': directives.unchanged, + 'tagurlformat': directives.unchanged, + } has_content = True def run(self): @@ -31,9 +40,17 @@ class Pygments(Directive): except ValueError: # no lexer found - use the text one instead of an exception lexer = TextLexer() - # take an arbitrary option if more than one is given - formatter = self.options and VARIANTS[list(self.options.keys())[0]] \ - or DEFAULT + + if ('linenos' in self.options and + self.options['linenos'] not in ('table', 'inline')): + self.options['linenos'] = 'table' + + for flag in ('nowrap', 'nobackground', 'anchorlinenos'): + if flag in self.options: + self.options[flag] = True + + # noclasses should already default to False, but just in case... + formatter = HtmlFormatter(noclasses=False, **self.options) parsed = highlight('\n'.join(self.content), lexer, formatter) return [nodes.raw('', parsed, format='html')] diff --git a/pelican/tests/output/basic/category/misc.html b/pelican/tests/output/basic/category/misc.html index f3b9e451..1c4af16a 100644 --- a/pelican/tests/output/basic/category/misc.html +++ b/pelican/tests/output/basic/category/misc.html @@ -88,7 +88,9 @@

    Lovely.

    - +
    +

    Testing more sourcecode directives

    +
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    read more diff --git a/pelican/tests/output/basic/feeds/all-en.atom.xml b/pelican/tests/output/basic/feeds/all-en.atom.xml index 6d0c563f..5b8eb591 100644 --- a/pelican/tests/output/basic/feeds/all-en.atom.xml +++ b/pelican/tests/output/basic/feeds/all-en.atom.xml @@ -33,5 +33,15 @@ YEAH !</p> </pre></div> </td></tr></table><p>Lovely.</p> </div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/all.atom.xml b/pelican/tests/output/basic/feeds/all.atom.xml index 1abf742a..d19b0c30 100644 --- a/pelican/tests/output/basic/feeds/all.atom.xml +++ b/pelican/tests/output/basic/feeds/all.atom.xml @@ -34,5 +34,15 @@ YEAH !</p> </pre></div> </td></tr></table><p>Lovely.</p> </div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/misc.atom.xml b/pelican/tests/output/basic/feeds/misc.atom.xml index b5588ce7..34b6b4fb 100644 --- a/pelican/tests/output/basic/feeds/misc.atom.xml +++ b/pelican/tests/output/basic/feeds/misc.atom.xml @@ -10,5 +10,15 @@ </pre></div> </td></tr></table><p>Lovely.</p> </div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html index 6989f25a..5ecaa393 100644 --- a/pelican/tests/output/basic/index.html +++ b/pelican/tests/output/basic/index.html @@ -221,7 +221,9 @@ YEAH !

    Lovely.

    - +
    +

    Testing more sourcecode directives

    +
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    read more diff --git a/pelican/tests/output/basic/unbelievable.html b/pelican/tests/output/basic/unbelievable.html index 3f2d2f80..1fcb5553 100644 --- a/pelican/tests/output/basic/unbelievable.html +++ b/pelican/tests/output/basic/unbelievable.html @@ -48,6 +48,16 @@
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
     

    Lovely.

    + +
    +

    Testing more sourcecode directives

    +
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError:
    # no lexer found - use the text one instead of an exception
    14 lexer = TextLexer()

    16 if ('linenos' in self.options and
    self.options['linenos'] not in ('table', 'inline')):
    18 self.options['linenos'] = 'table'

    20 for flag in ('nowrap', 'nobackground', 'anchorlinenos'):
    if flag in self.options:
    22 self.options[flag] = True

    24 # noclasses should already default to False, but just in case...
    formatter = HtmlFormatter(noclasses=False, **self.options)
    26 parsed = highlight('\n'.join(self.content), lexer, formatter)
    return [nodes.raw('', parsed, format='html')]
    +

    Lovely.

    +
    +
    +

    Testing even more sourcecode directives

    +formatter = self.options and VARIANTS[self.options.keys()[0]] +

    Lovely.

    diff --git a/pelican/tests/output/custom/author/alexis-metaireau3.html b/pelican/tests/output/custom/author/alexis-metaireau3.html index e3e07e10..659c0e37 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom/author/alexis-metaireau3.html @@ -57,7 +57,9 @@

    Lovely.

    - +
    +

    Testing more sourcecode directives

    +
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html index 63c659da..db11dd9e 100644 --- a/pelican/tests/output/custom/category/misc.html +++ b/pelican/tests/output/custom/category/misc.html @@ -101,7 +101,9 @@

    Lovely.

    - +
    +

    Testing more sourcecode directives

    +
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/feeds/all-en.atom.xml b/pelican/tests/output/custom/feeds/all-en.atom.xml index d4631d7c..ce25290d 100644 --- a/pelican/tests/output/custom/feeds/all-en.atom.xml +++ b/pelican/tests/output/custom/feeds/all-en.atom.xml @@ -33,5 +33,15 @@ YEAH !</p> </pre></div> </td></tr></table><p>Lovely.</p> </div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/all.atom.xml b/pelican/tests/output/custom/feeds/all.atom.xml index 2a673ada..68986d40 100644 --- a/pelican/tests/output/custom/feeds/all.atom.xml +++ b/pelican/tests/output/custom/feeds/all.atom.xml @@ -35,5 +35,15 @@ YEAH !</p> </pre></div> </td></tr></table><p>Lovely.</p> </div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/all.rss.xml b/pelican/tests/output/custom/feeds/all.rss.xml index e8cd9b80..7fee491a 100644 --- a/pelican/tests/output/custom/feeds/all.rss.xml +++ b/pelican/tests/output/custom/feeds/all.rss.xml @@ -35,5 +35,15 @@ YEAH !</p> </pre></div> </td></tr></table><p>Lovely.</p> </div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.htmlThe baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/misc.atom.xml b/pelican/tests/output/custom/feeds/misc.atom.xml index 250b1b65..9328e05a 100644 --- a/pelican/tests/output/custom/feeds/misc.atom.xml +++ b/pelican/tests/output/custom/feeds/misc.atom.xml @@ -10,5 +10,15 @@ </pre></div> </td></tr></table><p>Lovely.</p> </div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/misc.rss.xml b/pelican/tests/output/custom/feeds/misc.rss.xml index 195812cc..b708c70d 100644 --- a/pelican/tests/output/custom/feeds/misc.rss.xml +++ b/pelican/tests/output/custom/feeds/misc.rss.xml @@ -10,5 +10,15 @@ </pre></div> </td></tr></table><p>Lovely.</p> </div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.htmlThe baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom/index3.html b/pelican/tests/output/custom/index3.html index 52657306..821182fd 100644 --- a/pelican/tests/output/custom/index3.html +++ b/pelican/tests/output/custom/index3.html @@ -57,7 +57,9 @@

    Lovely.

    - +
    +

    Testing more sourcecode directives

    +
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/unbelievable.html b/pelican/tests/output/custom/unbelievable.html index 26b60f38..99512327 100644 --- a/pelican/tests/output/custom/unbelievable.html +++ b/pelican/tests/output/custom/unbelievable.html @@ -55,6 +55,16 @@
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
     

    Lovely.

    + +
    +

    Testing more sourcecode directives

    +
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError:
    # no lexer found - use the text one instead of an exception
    14 lexer = TextLexer()

    16 if ('linenos' in self.options and
    self.options['linenos'] not in ('table', 'inline')):
    18 self.options['linenos'] = 'table'

    20 for flag in ('nowrap', 'nobackground', 'anchorlinenos'):
    if flag in self.options:
    22 self.options[flag] = True

    24 # noclasses should already default to False, but just in case...
    formatter = HtmlFormatter(noclasses=False, **self.options)
    26 parsed = highlight('\n'.join(self.content), lexer, formatter)
    return [nodes.raw('', parsed, format='html')]
    +

    Lovely.

    +
    +
    +

    Testing even more sourcecode directives

    +formatter = self.options and VARIANTS[self.options.keys()[0]] +

    Lovely.

    diff --git a/samples/content/unbelievable.rst b/samples/content/unbelievable.rst index 745ff217..b990d20c 100644 --- a/samples/content/unbelievable.rst +++ b/samples/content/unbelievable.rst @@ -18,3 +18,56 @@ Testing sourcecode directive Lovely. + +Testing more sourcecode directives +---------------------------------- + +.. sourcecode:: python + :anchorlinenos: + :classprefix: testing + :hl_lines: 10,11,12 + :lineanchors: foo + :linenos: inline + :linenospecial: 2 + :linenostart: 8 + :linenostep: 2 + :lineseparator:
    + :linespans: foo + :nobackground: + + def run(self): + self.assert_has_content() + try: + lexer = get_lexer_by_name(self.arguments[0]) + except ValueError: + # no lexer found - use the text one instead of an exception + lexer = TextLexer() + + if ('linenos' in self.options and + self.options['linenos'] not in ('table', 'inline')): + self.options['linenos'] = 'table' + + for flag in ('nowrap', 'nobackground', 'anchorlinenos'): + if flag in self.options: + self.options[flag] = True + + # noclasses should already default to False, but just in case... + formatter = HtmlFormatter(noclasses=False, **self.options) + parsed = highlight('\n'.join(self.content), lexer, formatter) + return [nodes.raw('', parsed, format='html')] + + +Lovely. + +Testing even more sourcecode directives +--------------------------------------- + +.. sourcecode:: python + :linenos: table + :nowrap: + + + formatter = self.options and VARIANTS[self.options.keys()[0]] + + +Lovely. From 4bc4b1500c91b63a37891e60a1e262e4f3fada1c Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sun, 4 Aug 2013 17:02:58 +0200 Subject: [PATCH 0960/2344] Refactor readers and remove MARKUP Add a `Readers` class which contains a dict of file extensions / `Reader` instances. This dict can be overwritten with a `READERS` settings, for instance to avoid processing *.html files: READERS = {'html': None} Or to add a custom reader for the `foo` extension: READERS = {'foo': FooReader} This dict is no storing the Reader classes as it was done before with `EXTENSIONS`. It stores the instances of the Reader classes to avoid instancing for each file reading. --- pelican/__init__.py | 22 ++-- pelican/generators.py | 37 +++--- pelican/readers.py | 209 +++++++++++++++++-------------- pelican/settings.py | 56 +++++---- pelican/tests/test_generators.py | 63 +++++----- pelican/tests/test_readers.py | 6 +- pelican/tests/test_utils.py | 11 +- 7 files changed, 201 insertions(+), 203 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 9bce4926..8ba79e0a 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -17,6 +17,7 @@ from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, SourceFileGenerator, TemplatePagesGenerator) from pelican.log import init +from pelican.readers import Readers from pelican.settings import read_settings from pelican.utils import clean_output_dir, folder_watcher, file_watcher from pelican.writers import Writer @@ -46,7 +47,6 @@ class Pelican(object): self.path = settings['PATH'] self.theme = settings['THEME'] self.output_path = settings['OUTPUT_PATH'] - self.markup = settings['MARKUP'] self.ignore_files = settings['IGNORE_FILES'] self.delete_outputdir = settings['DELETE_OUTPUT_DIRECTORY'] self.output_retention = settings['OUTPUT_RETENTION'] @@ -164,7 +164,6 @@ class Pelican(object): path=self.path, theme=self.theme, output_path=self.output_path, - markup=self.markup, ) for cls in self.get_generator_classes() ] @@ -236,10 +235,6 @@ def parse_arguments(): help='Where to output the generated files. If not specified, a ' 'directory will be created, named "output" in the current path.') - parser.add_argument('-m', '--markup', dest='markup', - help='The list of markup language to use (rst or md). Please indicate ' - 'them separated by commas.') - parser.add_argument('-s', '--settings', dest='settings', help='The settings of the application, this is automatically set to ' '{0} if a file exists with this name.'.format(DEFAULT_CONFIG_NAME)) @@ -279,8 +274,6 @@ def get_config(args): if args.output: config['OUTPUT_PATH'] = \ os.path.abspath(os.path.expanduser(args.output)) - if args.markup: - config['MARKUP'] = [a.strip().lower() for a in args.markup.split(',')] if args.theme: abstheme = os.path.abspath(os.path.expanduser(args.theme)) config['THEME'] = abstheme if os.path.exists(abstheme) else args.theme @@ -296,8 +289,6 @@ def get_config(args): for key in config: if key in ('PATH', 'OUTPUT_PATH', 'THEME'): config[key] = config[key].decode(enc) - if key == "MARKUP": - config[key] = [a.decode(enc) for a in config[key]] return config @@ -315,16 +306,17 @@ def get_instance(args): module = __import__(module) cls = getattr(module, cls_name) - return cls(settings) + return cls(settings), settings def main(): args = parse_arguments() init(args.verbosity) - pelican = get_instance(args) + pelican, settings = get_instance(args) + readers = Readers(settings) watchers = {'content': folder_watcher(pelican.path, - pelican.markup, + readers.extensions, pelican.ignore_files), 'theme': folder_watcher(pelican.theme, [''], @@ -333,8 +325,8 @@ def main(): try: if args.autoreload: - print(' --- AutoReload Mode: Monitoring `content`, `theme` and `settings`' - ' for changes. ---') + print(' --- AutoReload Mode: Monitoring `content`, `theme` and' + ' `settings` for changes. ---') while True: try: diff --git a/pelican/generators.py b/pelican/generators.py index 1444c95c..72c76b32 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -13,16 +13,13 @@ from functools import partial from itertools import chain, groupby from operator import attrgetter, itemgetter -from jinja2 import ( - Environment, FileSystemLoader, PrefixLoader, ChoiceLoader, BaseLoader, - TemplateNotFound -) +from jinja2 import (Environment, FileSystemLoader, PrefixLoader, ChoiceLoader, + BaseLoader, TemplateNotFound) from pelican.contents import Article, Page, Static, is_valid_content -from pelican.readers import read_file +from pelican.readers import Readers from pelican.utils import copy, process_translations, mkdir_p, DateFormatter from pelican import signals -import pelican.utils logger = logging.getLogger(__name__) @@ -31,23 +28,23 @@ logger = logging.getLogger(__name__) class Generator(object): """Baseclass generator""" - def __init__(self, context, settings, path, theme, output_path, markup, - **kwargs): + def __init__(self, context, settings, path, theme, output_path, **kwargs): self.context = context self.settings = settings self.path = path self.theme = theme self.output_path = output_path - self.markup = markup for arg, value in kwargs.items(): setattr(self, arg, value) + self.readers = Readers(self.settings) + # templates cache self._templates = {} self._templates_path = [] self._templates_path.append(os.path.expanduser( - os.path.join(self.theme, 'templates'))) + os.path.join(self.theme, 'templates'))) self._templates_path += self.settings['EXTRA_TEMPLATES_PATHS'] theme_path = os.path.dirname(os.path.abspath(__file__)) @@ -85,9 +82,8 @@ class Generator(object): try: self._templates[name] = self.env.get_template(name + '.html') except TemplateNotFound: - raise Exception( - ('[templates] unable to load %s.html from %s' - % (name, self._templates_path))) + raise Exception('[templates] unable to load %s.html from %s' + % (name, self._templates_path)) return self._templates[name] def _include_path(self, path, extensions=None): @@ -98,7 +94,7 @@ class Generator(object): extensions are allowed) """ if extensions is None: - extensions = tuple(self.markup) + extensions = tuple(self.readers.extensions) basename = os.path.basename(path) if extensions is False or basename.endswith(extensions): return True @@ -388,9 +384,9 @@ class ArticlesGenerator(Generator): self.settings['ARTICLE_DIR'], exclude=self.settings['ARTICLE_EXCLUDES']): try: - article = read_file( + article = self.readers.read_file( base_path=self.path, path=f, content_class=Article, - settings=self.settings, context=self.context, + context=self.context, preread_signal=signals.article_generator_preread, preread_sender=self, context_signal=signals.article_generator_context, @@ -496,9 +492,9 @@ class PagesGenerator(Generator): self.settings['PAGE_DIR'], exclude=self.settings['PAGE_EXCLUDES']): try: - page = read_file( + page = self.readers.read_file( base_path=self.path, path=f, content_class=Page, - settings=self.settings, context=self.context, + context=self.context, preread_signal=signals.page_generator_preread, preread_sender=self, context_signal=signals.page_generator_context, @@ -557,10 +553,9 @@ class StaticGenerator(Generator): for static_path in self.settings['STATIC_PATHS']: for f in self.get_files( static_path, extensions=False): - static = read_file( + static = self.readers.read_file( base_path=self.path, path=f, content_class=Static, - fmt='static', - settings=self.settings, context=self.context, + fmt='static', context=self.context, preread_signal=signals.static_generator_preread, preread_sender=self, context_signal=signals.static_generator_context, diff --git a/pelican/readers.py b/pelican/readers.py index 3923245e..9cf78042 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -37,7 +37,6 @@ except ImportError: from pelican.contents import Page, Category, Tag, Author from pelican.utils import get_date, pelican_open -logger = logging.getLogger(__name__) METADATA_PROCESSORS = { 'tags': lambda x, y: [Tag(tag, y) for tag in x.split(',')], @@ -50,7 +49,7 @@ METADATA_PROCESSORS = { logger = logging.getLogger(__name__) -class Reader(object): +class BaseReader(object): enabled = True file_extensions = ['static'] extensions = None @@ -110,7 +109,7 @@ class PelicanHTMLTranslator(HTMLTranslator): return HTMLTranslator.visit_image(self, node) -class RstReader(Reader): +class RstReader(BaseReader): enabled = bool(docutils) file_extensions = ['rst'] @@ -166,7 +165,7 @@ class RstReader(Reader): return content, metadata -class MarkdownReader(Reader): +class MarkdownReader(BaseReader): enabled = bool(Markdown) file_extensions = ['md', 'markdown', 'mkd', 'mdown'] @@ -174,7 +173,6 @@ class MarkdownReader(Reader): super(MarkdownReader, self).__init__(*args, **kwargs) self.extensions = self.settings['MD_EXTENSIONS'] self.extensions.append('meta') - self._md = Markdown(extensions=self.extensions) def _parse_metadata(self, meta): """Return the dict containing document metadata""" @@ -194,6 +192,7 @@ class MarkdownReader(Reader): def read(self, source_path): """Parse content and metadata of markdown files""" + self._md = Markdown(extensions=self.extensions) with pelican_open(source_path) as text: content = self._md.convert(text) @@ -201,7 +200,7 @@ class MarkdownReader(Reader): return content, metadata -class HTMLReader(Reader): +class HTMLReader(BaseReader): """Parses HTML files as input, looking for meta, title, and body tags""" file_extensions = ['htm', 'html'] enabled = True @@ -312,7 +311,7 @@ class HTMLReader(Reader): return parser.body, metadata -class AsciiDocReader(Reader): +class AsciiDocReader(BaseReader): enabled = bool(asciidoc) file_extensions = ['asc'] default_options = ["--no-header-footer", "-a newline=\\n"] @@ -344,109 +343,125 @@ class AsciiDocReader(Reader): return content, metadata -EXTENSIONS = {} +class Readers(object): -for cls in [Reader] + Reader.__subclasses__(): - for ext in cls.file_extensions: - EXTENSIONS[ext] = cls + def __init__(self, settings=None): + self.settings = settings or {} + self.readers = {} + extensions = {} + for cls in [BaseReader] + BaseReader.__subclasses__(): + for ext in cls.file_extensions: + extensions[ext] = cls -def read_file(base_path, path, content_class=Page, fmt=None, - settings=None, context=None, - preread_signal=None, preread_sender=None, - context_signal=None, context_sender=None): - """Return a content object parsed with the given format.""" - path = os.path.abspath(os.path.join(base_path, path)) - source_path = os.path.relpath(path, base_path) - base, ext = os.path.splitext(os.path.basename(path)) - logger.debug('read file {} -> {}'.format( + if self.settings['READERS']: + extensions.update(self.settings['READERS']) + + for fmt, reader_class in extensions.items(): + if not reader_class: + continue + + if not reader_class.enabled: + logger.warning('Missing dependencies for {}'.format(fmt)) + continue + + self.readers[fmt] = reader_class(self.settings) + + settings_key = '%s_EXTENSIONS' % fmt.upper() + + if settings_key in self.settings: + self.readers[fmt].extensions = self.settings[settings_key] + + @property + def extensions(self): + return self.readers.keys() + + def read_file(self, base_path, path, content_class=Page, fmt=None, + context=None, preread_signal=None, preread_sender=None, + context_signal=None, context_sender=None): + """Return a content object parsed with the given format.""" + + path = os.path.abspath(os.path.join(base_path, path)) + source_path = os.path.relpath(path, base_path) + logger.debug('read file {} -> {}'.format( source_path, content_class.__name__)) - if not fmt: - fmt = ext[1:] - if fmt not in EXTENSIONS: - raise TypeError('Pelican does not know how to parse {}'.format(path)) + if not fmt: + _, ext = os.path.splitext(os.path.basename(path)) + fmt = ext[1:] - if preread_signal: - logger.debug('signal {}.send({})'.format( + if fmt not in self.readers: + raise TypeError( + 'Pelican does not know how to parse {}'.format(path)) + + if preread_signal: + logger.debug('signal {}.send({})'.format( preread_signal, preread_sender)) - preread_signal.send(preread_sender) + preread_signal.send(preread_sender) - if settings is None: - settings = {} + reader = self.readers[fmt] - reader_class = EXTENSIONS[fmt] - if not reader_class.enabled: - raise ValueError('Missing dependencies for {}'.format(fmt)) - - reader = reader_class(settings) - - settings_key = '%s_EXTENSIONS' % fmt.upper() - - if settings and settings_key in settings: - reader.extensions = settings[settings_key] - - metadata = default_metadata( - settings=settings, process=reader.process_metadata) - metadata.update(path_metadata( - full_path=path, source_path=source_path, settings=settings)) - metadata.update(parse_path_metadata( - source_path=source_path, settings=settings, + metadata = default_metadata( + settings=self.settings, process=reader.process_metadata) + metadata.update(path_metadata( + full_path=path, source_path=source_path, + settings=self.settings)) + metadata.update(parse_path_metadata( + source_path=source_path, settings=self.settings, process=reader.process_metadata)) - content, reader_metadata = reader.read(path) - metadata.update(reader_metadata) - # create warnings for all images with empty alt (up to a certain number) - # as they are really likely to be accessibility flaws - if content: - # find images with empty alt - imgs = re.compile(r""" - (?: - # src before alt - ]* - src=(['"])(.*)\1 - [^\>]* - alt=(['"])\3 - )|(?: - # alt before src - ]* - alt=(['"])\4 - [^\>]* - src=(['"])(.*)\5 - ) - """, re.X) - matches = re.findall(imgs, content) - # find a correct threshold - nb_warnings = 10 - if len(matches) == nb_warnings + 1: - nb_warnings += 1 # avoid bad looking case - # print one warning per image with empty alt until threshold - for match in matches[:nb_warnings]: - logger.warning('Empty alt attribute for image {} in {}'.format( - os.path.basename(match[1] + match[5]), path)) - # print one warning for the other images with empty alt - if len(matches) > nb_warnings: - logger.warning('{} other images with empty alt attributes'.format( - len(matches) - nb_warnings)) + content, reader_metadata = reader.read(path) + metadata.update(reader_metadata) - # eventually filter the content with typogrify if asked so - if content and settings and settings['TYPOGRIFY']: - from typogrify.filters import typogrify - content = typogrify(content) - metadata['title'] = typogrify(metadata['title']) + # create warnings for all images with empty alt (up to a certain + # number) # as they are really likely to be accessibility flaws + if content: + # find images with empty alt + imgs = re.compile(r""" + (?: + # src before alt + ]* + src=(['"])(.*)\1 + [^\>]* + alt=(['"])\3 + )|(?: + # alt before src + ]* + alt=(['"])\4 + [^\>]* + src=(['"])(.*)\5 + ) + """, re.X) + matches = re.findall(imgs, content) + # find a correct threshold + nb_warnings = 10 + if len(matches) == nb_warnings + 1: + nb_warnings += 1 # avoid bad looking case + # print one warning per image with empty alt until threshold + for match in matches[:nb_warnings]: + logger.warning('Empty alt attribute for image {} in {}'.format( + os.path.basename(match[1] + match[5]), path)) + # print one warning for the other images with empty alt + if len(matches) > nb_warnings: + logger.warning('{} other images with empty alt attributes' + .format(len(matches) - nb_warnings)) - if context_signal: - logger.debug('signal {}.send({}, )'.format( + # eventually filter the content with typogrify if asked so + if content and self.settings['TYPOGRIFY']: + from typogrify.filters import typogrify + content = typogrify(content) + metadata['title'] = typogrify(metadata['title']) + + if context_signal: + logger.debug('signal {}.send({}, )'.format( context_signal, context_sender)) - context_signal.send(context_sender, metadata=metadata) - return content_class( - content=content, - metadata=metadata, - settings=settings, - source_path=path, - context=context) + context_signal.send(context_sender, metadata=metadata) + + return content_class(content=content, metadata=metadata, + settings=self.settings, source_path=path, + context=context) def default_metadata(settings=None, process=None): @@ -482,7 +497,7 @@ def parse_path_metadata(source_path, settings=None, process=None): ... 'PATH_METADATA': ... '(?P[^/]*)/(?P\d{4}-\d{2}-\d{2})/.*', ... } - >>> reader = Reader(settings=settings) + >>> reader = BaseReader(settings=settings) >>> metadata = parse_path_metadata( ... source_path='my-cat/2013-01-01/my-slug.html', ... settings=settings, diff --git a/pelican/settings.py b/pelican/settings.py index 0f37c98d..e71796a2 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -33,7 +33,7 @@ DEFAULT_CONFIG = { 'PAGE_EXCLUDES': (), 'THEME': DEFAULT_THEME, 'OUTPUT_PATH': 'output', - 'MARKUP': ('rst', 'md'), + 'READERS': {}, 'STATIC_PATHS': ['images', ], 'THEME_STATIC_DIR': 'theme', 'THEME_STATIC_PATHS': ['static', ], @@ -112,6 +112,7 @@ DEFAULT_CONFIG = { 'SLUG_SUBSTITUTIONS': (), } + def read_settings(path=None, override=None): if path: local_settings = get_settings_from_file(path) @@ -120,7 +121,7 @@ def read_settings(path=None, override=None): if p in local_settings and local_settings[p] is not None \ and not isabs(local_settings[p]): absp = os.path.abspath(os.path.normpath(os.path.join( - os.path.dirname(path), local_settings[p]))) + os.path.dirname(path), local_settings[p]))) if p not in ('THEME', 'PLUGIN_PATH') or os.path.exists(absp): local_settings[p] = absp else: @@ -138,7 +139,7 @@ def get_settings_from_module(module=None, default_settings=DEFAULT_CONFIG): context = copy.deepcopy(default_settings) if module is not None: context.update( - (k, v) for k, v in inspect.getmembers(module) if k.isupper()) + (k, v) for k, v in inspect.getmembers(module) if k.isupper()) return context @@ -221,17 +222,18 @@ def configure_settings(settings): settings['FEED_DOMAIN'] = settings['SITEURL'] # Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined - feed_keys = ['FEED_ATOM', 'FEED_RSS', - 'FEED_ALL_ATOM', 'FEED_ALL_RSS', - 'CATEGORY_FEED_ATOM', 'CATEGORY_FEED_RSS', - 'TAG_FEED_ATOM', 'TAG_FEED_RSS', - 'TRANSLATION_FEED_ATOM', 'TRANSLATION_FEED_RSS', - ] + feed_keys = [ + 'FEED_ATOM', 'FEED_RSS', + 'FEED_ALL_ATOM', 'FEED_ALL_RSS', + 'CATEGORY_FEED_ATOM', 'CATEGORY_FEED_RSS', + 'TAG_FEED_ATOM', 'TAG_FEED_RSS', + 'TRANSLATION_FEED_ATOM', 'TRANSLATION_FEED_RSS', + ] if any(settings.get(k) for k in feed_keys): if not settings.get('SITEURL'): - logger.warning('Feeds generated without SITEURL set properly may not' - ' be valid') + logger.warning('Feeds generated without SITEURL set properly may' + ' not be valid') if not 'TIMEZONE' in settings: logger.warning( @@ -255,26 +257,26 @@ def configure_settings(settings): # Save people from accidentally setting a string rather than a list path_keys = ( - 'ARTICLE_EXCLUDES', - 'DEFAULT_METADATA', - 'DIRECT_TEMPLATES', - 'EXTRA_TEMPLATES_PATHS', - 'FILES_TO_COPY', - 'IGNORE_FILES', - 'JINJA_EXTENSIONS', - 'MARKUP', - 'PAGINATED_DIRECT_TEMPLATES', - 'PLUGINS', - 'STATIC_PATHS', - 'THEME_STATIC_PATHS',) + 'ARTICLE_EXCLUDES', + 'DEFAULT_METADATA', + 'DIRECT_TEMPLATES', + 'EXTRA_TEMPLATES_PATHS', + 'FILES_TO_COPY', + 'IGNORE_FILES', + 'JINJA_EXTENSIONS', + 'PAGINATED_DIRECT_TEMPLATES', + 'PLUGINS', + 'STATIC_PATHS', + 'THEME_STATIC_PATHS', + ) for PATH_KEY in filter(lambda k: k in settings, path_keys): if isinstance(settings[PATH_KEY], six.string_types): - logger.warning("Detected misconfiguration with %s setting (must " - "be a list), falling back to the default" - % PATH_KEY) + logger.warning("Detected misconfiguration with %s setting " + "(must be a list), falling back to the default" + % PATH_KEY) settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY] - for old,new,doc in [ + for old, new, doc in [ ('LESS_GENERATOR', 'the Webassets plugin', None), ('FILES_TO_COPY', 'STATIC_PATHS and EXTRA_PATH_METADATA', 'https://github.com/getpelican/pelican/blob/master/docs/settings.rst#path-metadata'), diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index d8a4336d..bd4e6021 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -20,8 +20,7 @@ class TestGenerator(unittest.TestCase): def setUp(self): self.settings = get_settings() self.generator = Generator(self.settings.copy(), self.settings, - CUR_DIR, self.settings['THEME'], None, - self.settings['MARKUP']) + CUR_DIR, self.settings['THEME'], None) def test_include_path(self): filename = os.path.join(CUR_DIR, 'content', 'article.rst') @@ -30,10 +29,6 @@ class TestGenerator(unittest.TestCase): self.assertTrue(include_path(filename, extensions=('rst',))) self.assertFalse(include_path(filename, extensions=('md',))) - # markup must be a tuple, test that this works also with a list - self.generator.markup = ['rst', 'md'] - self.assertTrue(include_path(filename)) - class TestArticlesGenerator(unittest.TestCase): @@ -45,8 +40,7 @@ class TestArticlesGenerator(unittest.TestCase): cls.generator = ArticlesGenerator( context=settings.copy(), settings=settings, - path=CONTENT_DIR, theme=settings['THEME'], - output_path=None, markup=settings['MARKUP']) + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) cls.generator.generate_context() cls.articles = [[page.title, page.status, page.category.name, page.template] for page in cls.generator.articles] @@ -55,8 +49,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings() generator = ArticlesGenerator( context=settings, settings=settings, - path=None, theme=settings['THEME'], - output_path=None, markup=settings['MARKUP']) + path=None, theme=settings['THEME'], output_path=None) writer = MagicMock() generator.generate_feeds(writer) writer.write_feed.assert_called_with([], settings, @@ -64,8 +57,7 @@ class TestArticlesGenerator(unittest.TestCase): generator = ArticlesGenerator( context=settings, settings=get_settings(FEED_ALL_ATOM=None), - path=None, theme=settings['THEME'], - output_path=None, markup=None) + path=None, theme=settings['THEME'], output_path=None) writer = MagicMock() generator.generate_feeds(writer) self.assertFalse(writer.write_feed.called) @@ -74,26 +66,33 @@ class TestArticlesGenerator(unittest.TestCase): articles_expected = [ ['Article title', 'published', 'Default', 'article'], - ['Article with markdown and summary metadata single', 'published', - 'Default', 'article'], ['Article with markdown and summary metadata multi', 'published', 'Default', 'article'], + ['Article with markdown and summary metadata single', 'published', + 'Default', 'article'], + ['Article with markdown containing footnotes', 'published', + 'Default', 'article'], ['Article with template', 'published', 'Default', 'custom'], - ['Test md File', 'published', 'test', 'article'], ['Rst with filename metadata', 'published', 'yeah', 'article'], ['Test Markdown extensions', 'published', 'Default', 'article'], + ['Test markdown File', 'published', 'test', 'article'], + ['Test md File', 'published', 'test', 'article'], + ['Test mdown File', 'published', 'test', 'article'], + ['Test mkd File', 'published', 'test', 'article'], ['This is a super article !', 'published', 'Yeah', 'article'], + ['This is a super article !', 'published', 'Yeah', 'article'], + ['This is a super article !', 'published', 'yeah', 'article'], + ['This is a super article !', 'published', 'yeah', 'article'], + ['This is a super article !', 'published', 'yeah', 'article'], + ['This is a super article !', 'published', 'Default', 'article'], ['This is an article with category !', 'published', 'yeah', - 'article'], + 'article'], ['This is an article without category !', 'published', 'Default', 'article'], ['This is an article without category !', 'published', 'TestCategory', 'article'], - ['This is a super article !', 'published', 'yeah', 'article'], - ['マックOS X 10.8でパイソンとVirtualenvをインストールと設定', - 'published', '指導書', 'article'], - ['Article with markdown containing footnotes', 'published', - 'Default', 'article'] + ['マックOS X 10.8でパイソンとVirtualenvをインストールと設定', 'published', + '指導書', 'article'], ] self.assertEqual(sorted(articles_expected), sorted(self.articles)) @@ -124,8 +123,7 @@ class TestArticlesGenerator(unittest.TestCase): settings['filenames'] = {} generator = ArticlesGenerator( context=settings.copy(), settings=settings, - path=CONTENT_DIR, theme=settings['THEME'], - output_path=None, markup=settings['MARKUP']) + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) generator.generate_context() # test for name # categories are grouped by slug; if two categories have the same slug @@ -147,8 +145,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings(filenames={}) generator = ArticlesGenerator( context=settings, settings=settings, - path=None, theme=settings['THEME'], - output_path=None, markup=settings['MARKUP']) + path=None, theme=settings['THEME'], output_path=None) write = MagicMock() generator.generate_direct_templates(write) write.assert_called_with("archives.html", @@ -162,8 +159,7 @@ class TestArticlesGenerator(unittest.TestCase): settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' generator = ArticlesGenerator( context=settings, settings=settings, - path=None, theme=settings['THEME'], - output_path=None, markup=settings['MARKUP']) + path=None, theme=settings['THEME'], output_path=None) write = MagicMock() generator.generate_direct_templates(write) write.assert_called_with("archives/index.html", @@ -178,8 +174,7 @@ class TestArticlesGenerator(unittest.TestCase): settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' generator = ArticlesGenerator( context=settings, settings=settings, - path=None, theme=settings['THEME'], - output_path=None, markup=settings['MARKUP']) + path=None, theme=settings['THEME'], output_path=None) write = MagicMock() generator.generate_direct_templates(write) write.assert_called_count == 0 @@ -212,8 +207,7 @@ class TestPageGenerator(unittest.TestCase): generator = PagesGenerator( context=settings.copy(), settings=settings, - path=CUR_DIR, theme=settings['THEME'], - output_path=None, markup=settings['MARKUP']) + path=CUR_DIR, theme=settings['THEME'], output_path=None) generator.generate_context() pages = self.distill_pages(generator.pages) hidden_pages = self.distill_pages(generator.hidden_pages) @@ -252,13 +246,12 @@ class TestTemplatePagesGenerator(unittest.TestCase): settings = get_settings() settings['STATIC_PATHS'] = ['static'] settings['TEMPLATE_PAGES'] = { - 'template/source.html': 'generated/file.html' - } + 'template/source.html': 'generated/file.html' + } generator = TemplatePagesGenerator( context={'foo': 'bar'}, settings=settings, - path=self.temp_content, theme='', - output_path=self.temp_output, markup=None) + path=self.temp_content, theme='', output_path=self.temp_output) # create a dummy template file template_dir = os.path.join(self.temp_content, 'template') diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index c67b8a1f..43cf5ecf 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -19,8 +19,8 @@ class ReaderTest(unittest.TestCase): def read_file(self, path, **kwargs): # Isolate from future API changes to readers.read_file - return readers.read_file( - base_path=CONTENT_PATH, path=path, settings=get_settings(**kwargs)) + r = readers.Readers(settings=get_settings(**kwargs)) + return r.read_file(base_path=CONTENT_PATH, path=path) class RstReaderTest(ReaderTest): @@ -160,7 +160,7 @@ class MdReaderTest(ReaderTest): ' with some footnotes' '2

    \n' - + '
    \n' '
    \n
      \n
    1. \n' '

      Numbered footnote ' diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 0e65003a..3a1cceca 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -353,12 +353,13 @@ class TestDateFormatter(unittest.TestCase): 'French locale needed') def test_french_locale(self): settings = read_settings( - override = {'LOCALE': locale.normalize('fr_FR.UTF-8'), - 'TEMPLATE_PAGES': {'template/source.html': - 'generated/file.html'}}) + override={'LOCALE': locale.normalize('fr_FR.UTF-8'), + 'TEMPLATE_PAGES': {'template/source.html': + 'generated/file.html'}}) - generator = TemplatePagesGenerator({'date': self.date}, settings, - self.temp_content, '', self.temp_output, None) + generator = TemplatePagesGenerator( + {'date': self.date}, settings, + self.temp_content, '', self.temp_output) generator.env.filters.update({'strftime': utils.DateFormatter()}) writer = Writer(self.temp_output, settings=settings) From cfe72c2736755173c774fb8a612ba3a84dd81131 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sun, 4 Aug 2013 21:17:15 +0200 Subject: [PATCH 0961/2344] Disable asciidoc files for tests --- pelican/tests/test_generators.py | 3 +++ pelican/tests/test_utils.py | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index bd4e6021..f47ce7d3 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -19,6 +19,7 @@ CONTENT_DIR = os.path.join(CUR_DIR, 'content') class TestGenerator(unittest.TestCase): def setUp(self): self.settings = get_settings() + self.settings['READERS'] = {'asc': None} self.generator = Generator(self.settings.copy(), self.settings, CUR_DIR, self.settings['THEME'], None) @@ -37,6 +38,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings(filenames={}) settings['DEFAULT_CATEGORY'] = 'Default' settings['DEFAULT_DATE'] = (1970, 1, 1) + settings['READERS'] = {'asc': None} cls.generator = ArticlesGenerator( context=settings.copy(), settings=settings, @@ -120,6 +122,7 @@ class TestArticlesGenerator(unittest.TestCase): settings['DEFAULT_CATEGORY'] = 'Default' settings['DEFAULT_DATE'] = (1970, 1, 1) settings['USE_FOLDER_AS_CATEGORY'] = False + settings['READERS'] = {'asc': None} settings['filenames'] = {} generator = ArticlesGenerator( context=settings.copy(), settings=settings, diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 3a1cceca..0642926e 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -386,8 +386,9 @@ class TestDateFormatter(unittest.TestCase): 'TEMPLATE_PAGES': {'template/source.html': 'generated/file.html'}}) - generator = TemplatePagesGenerator({'date': self.date}, settings, - self.temp_content, '', self.temp_output, None) + generator = TemplatePagesGenerator( + {'date': self.date}, settings, + self.temp_content, '', self.temp_output) generator.env.filters.update({'strftime': utils.DateFormatter()}) writer = Writer(self.temp_output, settings=settings) From 85ea737a98d5e269a0140039f12bffbd43fe0bbb Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Wed, 7 Aug 2013 00:01:12 +0200 Subject: [PATCH 0962/2344] Add a signal to give access to the dict of Reader classes. --- pelican/readers.py | 13 ++++++++----- pelican/signals.py | 4 ++++ 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 9cf78042..e5283de7 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -34,6 +34,7 @@ try: except ImportError: from HTMLParser import HTMLParser +from pelican import signals from pelican.contents import Page, Category, Tag, Author from pelican.utils import get_date, pelican_open @@ -348,16 +349,18 @@ class Readers(object): def __init__(self, settings=None): self.settings = settings or {} self.readers = {} + self.reader_classes = {} - extensions = {} for cls in [BaseReader] + BaseReader.__subclasses__(): for ext in cls.file_extensions: - extensions[ext] = cls + self.reader_classes[ext] = cls if self.settings['READERS']: - extensions.update(self.settings['READERS']) + self.reader_classes.update(self.settings['READERS']) - for fmt, reader_class in extensions.items(): + signals.readers_init.send(self) + + for fmt, reader_class in self.reader_classes.items(): if not reader_class: continue @@ -484,7 +487,7 @@ def path_metadata(full_path, source_path, settings=None): metadata['date'] = datetime.datetime.fromtimestamp( os.stat(full_path).st_ctime) metadata.update(settings.get('EXTRA_PATH_METADATA', {}).get( - source_path, {})) + source_path, {})) return metadata diff --git a/pelican/signals.py b/pelican/signals.py index cb010d37..77802e88 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -8,6 +8,10 @@ initialized = signal('pelican_initialized') get_generators = signal('get_generators') finalized = signal('pelican_finalized') +# Reader-level signals + +readers_init = signal('readers_init') + # Generator-level signals generator_init = signal('generator_init') From bab8d0b26a80ab3c9b38311d26fccad938ec2220 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Wed, 7 Aug 2013 00:10:26 +0200 Subject: [PATCH 0963/2344] Move the "find image with an empty alt" block in a function. --- pelican/readers.py | 79 +++++++++++++++++++++++++--------------------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index e5283de7..3b3bfd12 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -416,40 +416,9 @@ class Readers(object): content, reader_metadata = reader.read(path) metadata.update(reader_metadata) - # create warnings for all images with empty alt (up to a certain - # number) # as they are really likely to be accessibility flaws if content: # find images with empty alt - imgs = re.compile(r""" - (?: - # src before alt - ]* - src=(['"])(.*)\1 - [^\>]* - alt=(['"])\3 - )|(?: - # alt before src - ]* - alt=(['"])\4 - [^\>]* - src=(['"])(.*)\5 - ) - """, re.X) - matches = re.findall(imgs, content) - # find a correct threshold - nb_warnings = 10 - if len(matches) == nb_warnings + 1: - nb_warnings += 1 # avoid bad looking case - # print one warning per image with empty alt until threshold - for match in matches[:nb_warnings]: - logger.warning('Empty alt attribute for image {} in {}'.format( - os.path.basename(match[1] + match[5]), path)) - # print one warning for the other images with empty alt - if len(matches) > nb_warnings: - logger.warning('{} other images with empty alt attributes' - .format(len(matches) - nb_warnings)) + find_empty_alt(content, path) # eventually filter the content with typogrify if asked so if content and self.settings['TYPOGRIFY']: @@ -467,6 +436,45 @@ class Readers(object): context=context) +def find_empty_alt(content, path): + """Find images with empty alt + + Create warnings for all images with empty alt (up to a certain number), + as they are really likely to be accessibility flaws. + + """ + imgs = re.compile(r""" + (?: + # src before alt + ]* + src=(['"])(.*)\1 + [^\>]* + alt=(['"])\3 + )|(?: + # alt before src + ]* + alt=(['"])\4 + [^\>]* + src=(['"])(.*)\5 + ) + """, re.X) + matches = re.findall(imgs, content) + # find a correct threshold + nb_warnings = 10 + if len(matches) == nb_warnings + 1: + nb_warnings += 1 # avoid bad looking case + # print one warning per image with empty alt until threshold + for match in matches[:nb_warnings]: + logger.warning('Empty alt attribute for image {} in {}'.format( + os.path.basename(match[1] + match[5]), path)) + # print one warning for the other images with empty alt + if len(matches) > nb_warnings: + logger.warning('{} other images with empty alt attributes' + .format(len(matches) - nb_warnings)) + + def default_metadata(settings=None, process=None): metadata = {} if settings: @@ -516,13 +524,12 @@ def parse_path_metadata(source_path, settings=None, process=None): subdir = os.path.basename(dirname) if settings: checks = [] - for key,data in [('FILENAME_METADATA', base), - ('PATH_METADATA', source_path), - ]: + for key, data in [('FILENAME_METADATA', base), + ('PATH_METADATA', source_path)]: checks.append((settings.get(key, None), data)) if settings.get('USE_FOLDER_AS_CATEGORY', None): checks.insert(0, ('(?P.*)', subdir)) - for regexp,data in checks: + for regexp, data in checks: if regexp and data: match = re.match(regexp, data) if match: From f47f054d0be29d95ecb22e025f1a50932c00fd2b Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Sun, 4 Aug 2013 22:03:37 +0200 Subject: [PATCH 0964/2344] Add documentation for readers. --- docs/internals.rst | 4 ++-- docs/plugins.rst | 15 ++++++++------- docs/settings.rst | 7 ++++--- pelican/readers.py | 26 ++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 12 deletions(-) diff --git a/docs/internals.rst b/docs/internals.rst index 704122ba..f69a9bb8 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -24,7 +24,7 @@ The logic is separated into different classes and concepts: then passed to the generators. * **Readers** are used to read from various formats (AsciiDoc, HTML, Markdown and - reStructuredText for now, but the system is extensible). Given a file, they + reStructuredText for now, but the system is extensible). Given a file, they return metadata (author, tags, category, etc.) and content (HTML-formatted). * **Generators** generate the different outputs. For instance, Pelican comes with @@ -44,7 +44,7 @@ method that returns HTML content and some metadata. Take a look at the Markdown reader:: - class MarkdownReader(Reader): + class MarkdownReader(BaseReader): enabled = bool(Markdown) def read(self, source_path): diff --git a/docs/plugins.rst b/docs/plugins.rst index 93307afb..582f40a7 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -71,6 +71,7 @@ finalized pelican object invoked after al - minifying js/css assets. - notify/ping search engines with an updated sitemap. generator_init generator invoked in the Generator.__init__ +readers_init readers invoked in the Readers.__init__ article_generate_context article_generator, metadata article_generate_preread article_generator invoked before a article is read in ArticlesGenerator.generate_context; use if code needs to do something before every article is parsed @@ -144,13 +145,13 @@ write and don't slow down pelican itself when they're not active. No more talking, here is the example:: from pelican import signals - from pelican.readers import EXTENSIONS, Reader + from pelican.readers import BaseReader - # Create a new reader class, inheriting from the pelican.reader.Reader - class NewReader(Reader): + # Create a new reader class, inheriting from the pelican.reader.BaseReader + class NewReader(BaseReader): enabled = True # Yeah, you probably want that :-) - # The list of extensions you want this reader to match with. + # The list of file extensions you want this reader to match with. # In the case multiple readers use the same extensions, the latest will # win (so the one you're defining here, most probably). file_extensions = ['yeah'] @@ -168,12 +169,12 @@ No more talking, here is the example:: return "Some content", parsed - def add_reader(arg): - EXTENSIONS['yeah'] = NewReader + def add_reader(readers): + readers.reader_classes['yeah'] = NewReader # this is how pelican works. def register(): - signals.initialized.connect(add_reader) + signals.readers_init.connect(add_reader) Adding a new generator diff --git a/docs/settings.rst b/docs/settings.rst index 8ecac7c9..04574127 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -84,9 +84,10 @@ Setting name (default value) What doe here or a single string representing one locale. When providing a list, all the locales will be tried until one works. -`MARKUP` (``('rst', 'md')``) A list of available markup languages you want - to use. For the moment, the only available values - are `rst`, `md`, `markdown`, `mkd`, `mdown`, `html`, and `htm`. +`READERS` (``{}``) A dict of file extensions / Reader classes to overwrite or + add file readers. for instance, to avoid processing .html files: + ``READERS = {'html': None}``. Or to add a custom reader for the + `foo` extension: ``READERS = {'foo': FooReader}`` `IGNORE_FILES` (``['.#*']``) A list of file globbing patterns to match against the source files to be ignored by the processor. For example, the default ``['.#*']`` will ignore emacs lock files. diff --git a/pelican/readers.py b/pelican/readers.py index 3b3bfd12..97a184d0 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -51,6 +51,18 @@ logger = logging.getLogger(__name__) class BaseReader(object): + """Base class to read files. + + This class is used to process static files, and it can be inherited for + other types of file. A Reader class must have the following attributes: + + - enabled: (boolean) tell if the Reader class is enabled. It + generally depends on the import of some dependency. + - file_extensions: a list of file extensions that the Reader will process. + - extensions: a list of extensions to use in the reader (typical use is + Markdown). + + """ enabled = True file_extensions = ['static'] extensions = None @@ -111,6 +123,8 @@ class PelicanHTMLTranslator(HTMLTranslator): class RstReader(BaseReader): + """Reader for reStructuredText files""" + enabled = bool(docutils) file_extensions = ['rst'] @@ -167,6 +181,8 @@ class RstReader(BaseReader): class MarkdownReader(BaseReader): + """Reader for Markdown files""" + enabled = bool(Markdown) file_extensions = ['md', 'markdown', 'mkd', 'mdown'] @@ -203,6 +219,7 @@ class MarkdownReader(BaseReader): class HTMLReader(BaseReader): """Parses HTML files as input, looking for meta, title, and body tags""" + file_extensions = ['htm', 'html'] enabled = True @@ -313,6 +330,8 @@ class HTMLReader(BaseReader): class AsciiDocReader(BaseReader): + """Reader for AsciiDoc files""" + enabled = bool(asciidoc) file_extensions = ['asc'] default_options = ["--no-header-footer", "-a newline=\\n"] @@ -345,7 +364,14 @@ class AsciiDocReader(BaseReader): class Readers(object): + """Interface for all readers. + This class contains a mapping of file extensions / Reader classes, to know + which Reader class must be used to read a file (based on its extension). + This is customizable both with the 'READERS' setting, and with the + 'readers_init' signall for plugins. + + """ def __init__(self, settings=None): self.settings = settings or {} self.readers = {} From 24e2ad5b3f0143851f74fd2f23b41b6fb85ed99a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 7 Aug 2013 12:45:26 -0700 Subject: [PATCH 0965/2344] Improve AsciiDoc parts of Getting Started docs --- docs/getting_started.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index eb503295..6d9a8c41 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -48,7 +48,7 @@ Markdown library as well:: $ pip install Markdown -If you want to use AsciiDoc you need to install it from `source +If you want to use AsciiDoc_ you need to install it from `source `_ or use your operating system's package manager. @@ -323,6 +323,9 @@ pattern:: This is the content of my super blog post. +Conventions for AsciiDoc_ posts, which should have an ``.asc`` extension, can +be found on the AsciiDoc_ site. + Pelican can also process HTML files ending in ``.html`` and ``.htm``. Pelican interprets the HTML in a very straightforward manner, reading metadata from ``meta`` tags, the title from the ``title`` tag, and the body out from the @@ -551,3 +554,4 @@ listed on the index page nor on any category page. .. _virtualenv: http://www.virtualenv.org/ .. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime .. _Fabric: http://fabfile.org/ +.. _AsciiDoc: http://www.methods.co.nz/asciidoc/ From c875c27e83941ecd2bcd401efe07b35421de704c Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Wed, 7 Aug 2013 22:43:08 +0200 Subject: [PATCH 0966/2344] Don't warn too loud about missing dependencies. - Show the messages only once for each Reader - Decrease the logging level --- pelican/readers.py | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 97a184d0..3f01a72c 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -372,15 +372,28 @@ class Readers(object): 'readers_init' signall for plugins. """ + + # used to warn about missing dependencies only once, at the first + # instanciation of a Readers object. + warn_missing_deps = True + def __init__(self, settings=None): self.settings = settings or {} self.readers = {} self.reader_classes = {} for cls in [BaseReader] + BaseReader.__subclasses__(): + if not cls.enabled: + if self.__class__.warn_missing_deps: + logger.debug('Missing dependencies for {}' + .format(', '.join(cls.file_extensions))) + continue + for ext in cls.file_extensions: self.reader_classes[ext] = cls + self.__class__.warn_missing_deps = False + if self.settings['READERS']: self.reader_classes.update(self.settings['READERS']) @@ -390,10 +403,6 @@ class Readers(object): if not reader_class: continue - if not reader_class.enabled: - logger.warning('Missing dependencies for {}'.format(fmt)) - continue - self.readers[fmt] = reader_class(self.settings) settings_key = '%s_EXTENSIONS' % fmt.upper() From f2aef81c963c8daaa29ac28dba84243e6198c30f Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 8 Aug 2013 12:08:30 -0700 Subject: [PATCH 0967/2344] Work around pytz & pip 1.4+ problem. Fixes #996. The latest version of pip (1.4) no longer installs pre-release versions (alpha, beta, etc.) by default. Because pytz uses an unorthodox version number scheme, pip thinks it's a pre-release and skips it. This change to setup.py should alleviate the problem until it is otherwise resolved. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 69f76b3c..f56a7c41 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils', - 'pytz', 'blinker', 'unidecode', 'six'] + 'pytz >= 0a', 'blinker', 'unidecode', 'six'] entry_points = { 'console_scripts': [ From a7152716e2e068c69c4ecde7f2cedeb3547a3411 Mon Sep 17 00:00:00 2001 From: Talha Mansoor Date: Sun, 11 Aug 2013 01:43:27 +0500 Subject: [PATCH 0968/2344] Receive the two values returned from get_instance() `get_instance()` returns two values. Old code, instead of unpacking two values in two variables, placed the tuple in a single variable `pelican`. Later in the same block when `pelican.run()` was called, it resulted in error. ``` -> Modified: content, theme, settings. re-generating... CRITICAL: ("'tuple' object has no attribute 'run'",) CRITICAL: 'tuple' object has no attribute 'run' Traceback (most recent call last): File "/Users/talha/Repos/VirtualEnvs/pelican-dev/bin/pelican", line 8, in load_entry_point('pelican==3.3', 'console_scripts', 'pelican')() File "/Users/talha/Repos/VirtualEnvs/pelican-dev/lib/python2.7/site-packages/pelican-3.3-py2.7.egg/pelican/__init__.py", line 353, in main pelican.run() ``` Either the returned value should be unpacked properly or `pelican[0].run` should be called. --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 8ba79e0a..f2bd2e07 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -338,7 +338,7 @@ def main(): modified = {k: next(v) for k, v in watchers.items()} if modified['settings']: - pelican = get_instance(args) + pelican, settings = get_instance(args) if any(modified.values()): print('\n-> Modified: {}. re-generating...'.format( From b0a13a851c5e6d5088023a2eef5f239c42b0a134 Mon Sep 17 00:00:00 2001 From: Talha Mansoor Date: Sun, 11 Aug 2013 02:18:25 +0500 Subject: [PATCH 0969/2344] Fix a typo in the docs getpelican/pelican@f2d6f77462976f5ea291481cba40e041d42d9e8c changed `article_generate_context` to `article_generator_context`. This commit updates the docs to reflect the change. --- docs/plugins.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 582f40a7..6e292efd 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -72,8 +72,8 @@ finalized pelican object invoked after al - notify/ping search engines with an updated sitemap. generator_init generator invoked in the Generator.__init__ readers_init readers invoked in the Readers.__init__ -article_generate_context article_generator, metadata -article_generate_preread article_generator invoked before a article is read in ArticlesGenerator.generate_context; +article_generator_context article_generator, metadata +article_generator_preread article_generator invoked before a article is read in ArticlesGenerator.generate_context; use if code needs to do something before every article is parsed article_generator_init article_generator invoked in the ArticlesGenerator.__init__ article_generator_finalized article_generator invoked at the end of ArticlesGenerator.generate_context From 472abb6fd9e9e1a5cfaebd70ec64c8469ddba8b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Mon, 12 Aug 2013 14:49:25 +0200 Subject: [PATCH 0970/2344] Activate coveralls.io support --- .travis.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 918fd3f9..0c6bac89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,11 @@ before_install: install: - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi - pip install mock + - pip install mock nose nose-cov - pip install . - pip install Markdown -script: python -m unittest discover +script: nosetests -sv --with-coverage --cover-package=pelican pelican +after_success: + # Report coverage results to coveralls.io + - pip install coveralls + - coveralls From 3b315fbc53efe48012662dbcb39c82c2c5117ca4 Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Mon, 12 Aug 2013 19:23:57 +0100 Subject: [PATCH 0971/2344] Fixing #1038 by allowing nice URLs. --- pelican/server.py | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/pelican/server.py b/pelican/server.py index 24f3ae04..0f7472c5 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -1,5 +1,7 @@ from __future__ import print_function +import os import sys +import logging try: import SimpleHTTPServer as srvmod except ImportError: @@ -11,19 +13,36 @@ except ImportError: import socketserver # NOQA PORT = len(sys.argv) == 2 and int(sys.argv[1]) or 8000 +SUFFIXES = ['','.html','/index.html'] -Handler = srvmod.SimpleHTTPRequestHandler +class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): + def do_GET(self): + # we are trying to detect the file by having a fallback mechanism + r = None + for suffix in SUFFIXES: + if not hasattr(self,'original_path'): + self.original_path = self.path + self.path = self.original_path + suffix + path = self.translate_path(self.path) + if os.path.exists(path): + r = srvmod.SimpleHTTPRequestHandler.do_GET(self) + if r is not None: + break + logging.warning("Unable to find %s file." % self.path) + return r + +Handler = ComplexHTTPRequestHandler try: httpd = socketserver.TCPServer(("", PORT), Handler) except OSError as e: - print("Could not listen on port", PORT) + logging.error("Could not listen on port %s" % PORT) sys.exit(getattr(e, 'exitcode', 1)) -print("serving at port", PORT) +logging.info("serving at port %s" % PORT) try: httpd.serve_forever() except KeyboardInterrupt as e: - print("shutting down server") - httpd.socket.close() + logging.info("shutting down server") + httpd.socket.close() \ No newline at end of file From d9816be5deec20528d53adc5fc7455c973b8e63e Mon Sep 17 00:00:00 2001 From: Daniel Goldsmith Date: Tue, 13 Aug 2013 10:46:41 +0100 Subject: [PATCH 0972/2344] Tag Cloud made functional --- docs/settings.rst | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 55721c11..c709a339 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -522,14 +522,34 @@ Setting name (default value) What does it do? The default theme does not include a tag cloud, but it is pretty easy to add:: -

        + -You should then also define a CSS style with the appropriate classes (tag-0 to tag-N, where -N matches `TAG_CLOUD_STEPS` -1). +You should then also define CSS styles with appropriate classes (tag-0 to tag-N, where +N matches `TAG_CLOUD_STEPS` -1), tag-0 being the most frequent, and define a ul.tagcloud +class with appropriate list-style to create the cloud, for example:: + + ul.tagcloud { + list-style: none; + padding: 0; + } + + ul.tagcloud li { + display: inline-block; + } + + li.tag-0 { + font-size: 150%; + } + + li.tag-1 { + font-size: 120%; + } + + ... Translations ============ From 6191b2919e39d2ed61411b2defb99af2c4dee816 Mon Sep 17 00:00:00 2001 From: Ken Jung Date: Fri, 16 Aug 2013 13:31:14 -0700 Subject: [PATCH 0973/2344] StaticGenerator now stores file list in context. This allows plugins and other generators to easily add files to be simply copied over. --- pelican/generators.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 72c76b32..26fa40ea 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -562,13 +562,14 @@ class StaticGenerator(Generator): context_sender=self) self.staticfiles.append(static) self.add_source_path(static) + self._update_context(('staticfiles',)) def generate_output(self, writer): self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme, self.settings['THEME_STATIC_DIR'], self.output_path, os.curdir) # copy all Static files - for sc in self.staticfiles: + for sc in self.context['staticfiles']: source_path = os.path.join(self.path, sc.source_path) save_as = os.path.join(self.output_path, sc.save_as) mkdir_p(os.path.dirname(save_as)) From 73b37989f74c8f7f5b9c7cd4c625cece4cbef048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sat, 17 Aug 2013 01:02:07 +0200 Subject: [PATCH 0974/2344] update the readers tests --- pelican/tests/test_readers.py | 41 +++++++++++++++-------------------- 1 file changed, 18 insertions(+), 23 deletions(-) diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index cb7db575..1b3a2055 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -14,17 +14,6 @@ CONTENT_PATH = os.path.join(CUR_DIR, 'content') def _path(*args): return os.path.join(CONTENT_PATH, *args) -class ReaderTests(unittest.TestCase): - def test_readfile_unknown_extension(self): - f = _path('article_with_metadata.unknownextension') - with self.assertRaises(TypeError) as cm: - readers.read_file(f) - ex = cm.exception - self.assertEqual('Pelican does not know how to parse ' + f, ex.message) - #, setattr, root.c1.c2, 'text', "test") - # self.assertTrue(1 == 0) - # except TypeError: - # self.assertTrue(1 == 1) class ReaderTest(unittest.TestCase): @@ -34,6 +23,15 @@ class ReaderTest(unittest.TestCase): return r.read_file(base_path=CONTENT_PATH, path=path) +class DefaultReaderTest(ReaderTest): + + def test_readfile_unknown_extension(self): + with self.assertRaises(TypeError) as cm: + self.read_file(path='article_with_metadata.unknownextension') + ex = cm.exception + self.assertIn('Pelican does not know how to parse', ex.message) + + class RstReaderTest(ReaderTest): def test_article_with_metadata(self): @@ -98,11 +96,11 @@ class RstReaderTest(ReaderTest): # Keys of metadata should be lowercase. reader = readers.RstReader(settings=get_settings()) content, metadata = reader.read( - _path('article_with_uppercase_metadata.rst')) + _path('article_with_uppercase_metadata.rst')) self.assertIn('category', metadata, 'Key should be lowercase.') self.assertEqual('Yeah', metadata.get('category'), - 'Value keeps case.') + 'Value keeps case.') def test_typogrify(self): # if nothing is specified in the settings, the content should be @@ -158,7 +156,6 @@ class MdReaderTest(ReaderTest): for key, value in metadata.items(): self.assertEqual(value, expected[key], key) - @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_footnote(self): reader = readers.MarkdownReader(settings=get_settings()) @@ -179,8 +176,8 @@ class MdReaderTest(ReaderTest): 'title="Jump back to footnote 1 in the text">↩

        \n' '\n
      • \n' '

        Named footnote ' - '

        \n' + '

        \n' '
      • \n
    \n
    ') expected_metadata = { 'title': 'Article with markdown containing footnotes', @@ -194,7 +191,6 @@ class MdReaderTest(ReaderTest): for key, value in metadata.items(): self.assertEqual(value, expected_metadata[key], key) - @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_file_extensions(self): reader = readers.MarkdownReader(settings=get_settings()) @@ -203,9 +199,9 @@ class MdReaderTest(ReaderTest): content, metadata = reader.read( _path('article_with_md_extension.md')) expected = ( - "

    Test Markdown File Header

    \n" - "

    Used for pelican test

    \n" - "

    The quick brown fox jumped over the lazy dog's back.

    ") + "

    Test Markdown File Header

    \n" + "

    Used for pelican test

    \n" + "

    The quick brown fox jumped over the lazy dog's back.

    ") self.assertEqual(content, expected) # test to ensure the mkd file extension is being processed by the # correct reader @@ -319,7 +315,7 @@ class AdReaderTest(ReaderTest): def test_article_with_asc_options(self): # test to ensure the ASCIIDOC_OPTIONS is being used reader = readers.AsciiDocReader( - dict(ASCIIDOC_OPTIONS=["-a revision=1.0.42"])) + dict(ASCIIDOC_OPTIONS=["-a revision=1.0.42"])) content, metadata = reader.read(_path('article_with_asc_options.asc')) expected = ('
    \n

    Used for' ' pelican test

    \n

    version 1.0.42

    \n' @@ -375,7 +371,6 @@ class HTMLReaderTest(ReaderTest): for key, value in expected.items(): self.assertEqual(value, page.metadata[key], key) - def test_article_with_null_attributes(self): page = self.read_file(path='article_with_null_attributes.html') @@ -389,4 +384,4 @@ class HTMLReaderTest(ReaderTest): page = self.read_file(path='article_with_uppercase_metadata.html') self.assertIn('category', page.metadata, 'Key should be lowercase.') self.assertEqual('Yeah', page.metadata.get('category'), - 'Value keeps cases.') + 'Value keeps cases.') From aae56fee3935b771619c3fcf68976aae79bbfde0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sat, 17 Aug 2013 01:12:39 +0200 Subject: [PATCH 0975/2344] exception.message was removed in py 3.X --- pelican/tests/test_readers.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 1b3a2055..b6652d03 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -26,10 +26,8 @@ class ReaderTest(unittest.TestCase): class DefaultReaderTest(ReaderTest): def test_readfile_unknown_extension(self): - with self.assertRaises(TypeError) as cm: + with self.assertRaises(TypeError): self.read_file(path='article_with_metadata.unknownextension') - ex = cm.exception - self.assertIn('Pelican does not know how to parse', ex.message) class RstReaderTest(ReaderTest): From 2a599b864624f483149739bb2c86e812cb74a2e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sat, 17 Aug 2013 01:23:09 +0200 Subject: [PATCH 0976/2344] Reactivate travis IRC reports. --- .travis.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0c6bac89..1df32baa 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,12 +8,15 @@ before_install: - sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 install: - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi - - pip install mock - - pip install mock nose nose-cov + - pip install mock nose nose-cov Markdown - pip install . - - pip install Markdown script: nosetests -sv --with-coverage --cover-package=pelican pelican after_success: # Report coverage results to coveralls.io - pip install coveralls - coveralls +notifications: + irc: + channels: + - "irc.freenode.org#pelican" + on_success: change From 339955376e1f84fb5209dad9f18bc802f006d0e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sat, 17 Aug 2013 12:48:34 +0200 Subject: [PATCH 0977/2344] Add a content_written signal --- docs/plugins.rst | 1 + pelican/signals.py | 3 +++ pelican/writers.py | 7 +++++++ 3 files changed, 11 insertions(+) diff --git a/docs/plugins.rst b/docs/plugins.rst index 6e292efd..29d67e24 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -84,6 +84,7 @@ page_generate_context page_generator, metadata page_generator_init page_generator invoked in the PagesGenerator.__init__ page_generator_finalized page_generator invoked at the end of PagesGenerator.generate_context content_object_init content_object invoked at the end of Content.__init__ (see note below) +content_written path, context invoked each time a content file is written. ============================= ============================ =========================================================================== The list is currently small, so don't hesitate to add signals and make a pull diff --git a/pelican/signals.py b/pelican/signals.py index 77802e88..e92272c9 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -37,3 +37,6 @@ static_generator_preread = signal('static_generator_preread') static_generator_context = signal('static_generator_context') content_object_init = signal('content_object_init') + +# Writers signals +content_written = signal('content_written') diff --git a/pelican/writers.py b/pelican/writers.py index 59642cd9..da105929 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -11,8 +11,10 @@ if not six.PY3: from feedgenerator import Atom1Feed, Rss201rev2Feed from jinja2 import Markup + from pelican.paginator import Paginator from pelican.utils import get_relative_path, path_to_url, set_date_tzinfo +from pelican import signals logger = logging.getLogger(__name__) @@ -151,10 +153,15 @@ class Writer(object): os.makedirs(os.path.dirname(path)) except Exception: pass + with self._open_w(path, 'utf-8', override=override) as f: f.write(output) logger.info('writing {}'.format(path)) + # Send a signal to say we're writing a file with some specific + # local context. + signals.content_written.send(path, context=localcontext) + localcontext = context.copy() if relative_urls: relative_url = path_to_url(get_relative_path(name)) From e2ca6d76086eb3bbde961dfa2e7e1dd3a9a8452d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sat, 17 Aug 2013 17:36:13 +0200 Subject: [PATCH 0978/2344] Add categories and tags to the replacement mechanism. --- docs/getting_started.rst | 4 ++++ pelican/contents.py | 4 ++++ pelican/tests/test_contents.py | 24 ++++++++++++++++++++++++ 3 files changed, 32 insertions(+) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 6d9a8c41..bad9bbda 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -459,6 +459,10 @@ following to ``pelicanconf.py``:: And then the ``pdfs`` directory would also be copied to ``output/static/``. +You can also link to categories or tags, using the `|tag|tagname` and +`|category|foobar` syntax. + + Importing an existing blog -------------------------- diff --git a/pelican/contents.py b/pelican/contents.py index ed213c31..900049a2 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -216,6 +216,10 @@ class Content(object): else: logger.warning("Unable to find {fn}, skipping url" " replacement".format(fn=value)) + elif what == 'category': + origin = Category(value, self.settings).url + elif what == 'tag': + origin = Tag(value, self.settings).url return ''.join((m.group('markup'), m.group('quote'), origin, m.group('quote'))) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index af97db3f..936903c1 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -180,6 +180,30 @@ class TestPage(unittest.TestCase): Page(**self.page_kwargs) self.assertTrue(content_object_init.has_receivers_for(Page)) + def test_get_content(self): + # Test that the content is updated with the relative links to + # filenames, tags and categories. + settings = get_settings() + args = self.page_kwargs.copy() + args['settings'] = settings + + # Tag + args['content'] = ('A simple test, with a ' + 'link') + page = Page(**args) + content = page.get_content('http://notmyidea.org') + self.assertEquals(content, ('A simple test, with a ' + 'link')) + + # Category + args['content'] = ('A simple test, with a ' + 'link') + page = Page(**args) + content = page.get_content('http://notmyidea.org') + self.assertEquals(content, + ('A simple test, with a ' + 'link')) + class TestArticle(TestPage): def test_template(self): From 56371aaf0f9e7b3e756160147486f29838820f9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sat, 17 Aug 2013 17:42:54 +0200 Subject: [PATCH 0979/2344] update the changelog --- docs/changelog.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 0804c8b0..61cae1d9 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -9,6 +9,7 @@ Release history longer article-specific * Deprecate ``FILES_TO_COPY`` in favor of ``STATIC_PATHS`` and ``EXTRA_PATH_METADATA`` +* Add support for |tag| and |category| relative links. 3.2.1 and 3.2.2 =============== From 895945e3cc1b25a00708227307bdeee5e0ed20f9 Mon Sep 17 00:00:00 2001 From: Kura Date: Mon, 19 Aug 2013 11:45:59 +0100 Subject: [PATCH 0980/2344] Removed YouTube directive as it's been moved to a Plugin --- pelican/rstdirectives.py | 57 ---------------------------------------- 1 file changed, 57 deletions(-) diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index fb4a6c93..07c40f5e 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -41,63 +41,6 @@ directives.register_directive('code-block', Pygments) directives.register_directive('sourcecode', Pygments) -class YouTube(Directive): - """ Embed YouTube video in posts. - - Courtesy of Brian Hsu: https://gist.github.com/1422773 - - VIDEO_ID is required, with / height are optional integer, - and align could be left / center / right. - - Usage: - .. youtube:: VIDEO_ID - :width: 640 - :height: 480 - :align: center - """ - - def align(argument): - """Conversion function for the "align" option.""" - return directives.choice(argument, ('left', 'center', 'right')) - - required_arguments = 1 - optional_arguments = 2 - option_spec = { - 'width': directives.positive_int, - 'height': directives.positive_int, - 'align': align - } - - final_argument_whitespace = False - has_content = False - - def run(self): - videoID = self.arguments[0].strip() - width = 420 - height = 315 - align = 'left' - - if 'width' in self.options: - width = self.options['width'] - - if 'height' in self.options: - height = self.options['height'] - - if 'align' in self.options: - align = self.options['align'] - - url = 'http://www.youtube.com/embed/%s' % videoID - div_block = '
    ' % align - embed_block = '' % (width, height, url) - - return [ - nodes.raw('', div_block, format='html'), - nodes.raw('', embed_block, format='html'), - nodes.raw('', '
    ', format='html')] - -directives.register_directive('youtube', YouTube) - _abbr_re = re.compile('\((.*)\)$') From d11b33030f4220e16b62bdfe94b80dc1290ead4a Mon Sep 17 00:00:00 2001 From: Axel Haustant Date: Wed, 27 Mar 2013 09:15:35 +0100 Subject: [PATCH 0981/2344] Use .dev suffix for development versions --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index f2bd2e07..2e1763ac 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -25,7 +25,7 @@ from pelican.writers import Writer __major__ = 3 __minor__ = 2 __micro__ = 0 -__version__ = "{0}.{1}.{2}".format(__major__, __minor__, __micro__) +__version__ = "{0}.{1}.{2}.dev".format(__major__, __minor__, __micro__) DEFAULT_CONFIG_NAME = 'pelicanconf.py' From 469c531ae4fbc9f8093b3f50607755e3d43e3e26 Mon Sep 17 00:00:00 2001 From: Axel Haustant Date: Wed, 27 Mar 2013 09:16:19 +0100 Subject: [PATCH 0982/2344] Include version in doc and warn if it's a dev version. --- docs/conf.py | 16 ++++++++++++---- docs/index.rst | 15 ++++++++++++--- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 40de84c7..84531182 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,18 +4,26 @@ import sys, os sys.path.append(os.path.abspath(os.pardir)) -from pelican import __version__, __major__ +from pelican import __version__, __major__, __minor__ # -- General configuration ----------------------------------------------------- templates_path = ['_templates'] -extensions = ['sphinx.ext.autodoc',] +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.ifconfig', 'sphinx.ext.extlinks'] source_suffix = '.rst' master_doc = 'index' project = 'Pelican' copyright = '2010, Alexis Metaireau and contributors' exclude_patterns = ['_build'] -version = __version__ -release = __major__ +version = '%s.%s' % (__major__, __minor__) +release = __version__ +last_stable = '3.1.1' +rst_prolog = ''' +.. |last_stable| replace:: :pelican-doc:`{0}` +'''.format(last_stable) + +extlinks = { + 'pelican-doc': ('http://docs.getpelican.com/%s/', '') +} # -- Options for HTML output --------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 914c2a7e..eb8883ce 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,5 +1,14 @@ -Pelican -======= +Pelican |release| +================= + + +.. ifconfig:: release.endswith('.dev') + + .. warning:: + + This documentation is for the version of Pelican currently under development. + Were you looking for version |last_stable| documentation? + Pelican is a static site generator, written in Python_. @@ -12,7 +21,7 @@ Pelican is a static site generator, written in Python_. Features -------- -Pelican currently supports: +Pelican |version| currently supports: * Articles (e.g., blog posts) and pages (e.g., "About", "Projects", "Contact") * Comments, via an external service (Disqus). (Please note that while From e6e99ffbb9c671da9a80c61cf7d47c12d77f2ef4 Mon Sep 17 00:00:00 2001 From: Axel Haustant Date: Wed, 27 Mar 2013 10:11:45 +0100 Subject: [PATCH 0983/2344] Change current release section with a constant title --- docs/changelog.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 61cae1d9..c020d7f4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,7 +1,7 @@ Release history ############### -3.3 (XXXX-XX-XX) +Next release ================ * Rename signals for better consistency (some plugins may need to be updated) From 9d583961e700667b7f1e78c4f2e0c88954becf15 Mon Sep 17 00:00:00 2001 From: bmcorser Date: Wed, 21 Aug 2013 19:57:55 +0100 Subject: [PATCH 0984/2344] Fix for THEME_STATIC_PATHS by copying sensitively If more than one path is defined in THEME_STATIC_PATHS, the theme's static directory in output is deleted and replaced by the following path's files. Using `shutil.rmtree` to remove the entire destination tree if overwrite is `True` assumes that we didn't want anything at all that was there. We should recurse through the directory and their subdirs instead, leaving things put there by the previous path where they were. I lazily copied almost verbatim the solution for recursively copying a diectory from http://stackoverflow.com/a/1994840. The reason for this is patch is that without it, my plugin is broken! It also makes my code a lot less crazy: https://github.com/bmcorser/pelicanfly/commit/a83f066 --- pelican/utils.py | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index 054c1f40..e028c84c 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -275,16 +275,24 @@ def copy(path, source, destination, destination_path=None, overwrite=False): destination_ = os.path.abspath( os.path.expanduser(os.path.join(destination, destination_path))) + def recurse(source, destination): + for entry in os.listdir(source): + entry_path = os.path.join(source, entry) + if os.path.isdir(entry_path): + entry_dest = os.path.join(destination, entry) + if os.path.exists(entry_dest): + if not os.path.isdir(entry_dest): + raise IOError('Failed to copy {0} a directory.' + .format(entry_dest)) + recurse(entry_path, entry_dest) + else: + shutil.copytree(entry_path, entry_dest) + else: + shutil.copy(entry_path, destination) + + if os.path.isdir(source_): - try: - shutil.copytree(source_, destination_) - logger.info('copying %s to %s' % (source_, destination_)) - except OSError: - if overwrite: - shutil.rmtree(destination_) - shutil.copytree(source_, destination_) - logger.info('replacement of %s with %s' % (source_, - destination_)) + recurse(source_, destination_) elif os.path.isfile(source_): dest_dir = os.path.dirname(destination_) From 2826c1a5580508932b4b27b5b0bb38cea4a45240 Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Wed, 21 Aug 2013 22:58:50 -0400 Subject: [PATCH 0985/2344] Added metadata information. Refs #1028 --- pelican/themes/simple/templates/article.html | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index 98cc852c..8da555a1 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -1,4 +1,14 @@ {% extends "base.html" %} +{% block head %} + {% for keyword in article.keywords %} + + {% endfor %} + + {% for description in article.description %} + + {% endfor %} +{% endblock %} + {% block content %}
    From d22b0892418b60b752551ebc95c4616926bb513f Mon Sep 17 00:00:00 2001 From: bmcorser Date: Sat, 24 Aug 2013 13:41:22 +0100 Subject: [PATCH 0986/2344] Adding placeholder files for regression test --- samples/theme_standard/a_stylesheet | 0 samples/theme_standard/a_template | 0 samples/very/exciting/new/files/bap! | 0 samples/very/exciting/new/files/boom! | 0 samples/very/exciting/new/files/wow! | 0 5 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 samples/theme_standard/a_stylesheet create mode 100644 samples/theme_standard/a_template create mode 100644 samples/very/exciting/new/files/bap! create mode 100644 samples/very/exciting/new/files/boom! create mode 100644 samples/very/exciting/new/files/wow! diff --git a/samples/theme_standard/a_stylesheet b/samples/theme_standard/a_stylesheet new file mode 100644 index 00000000..e69de29b diff --git a/samples/theme_standard/a_template b/samples/theme_standard/a_template new file mode 100644 index 00000000..e69de29b diff --git a/samples/very/exciting/new/files/bap! b/samples/very/exciting/new/files/bap! new file mode 100644 index 00000000..e69de29b diff --git a/samples/very/exciting/new/files/boom! b/samples/very/exciting/new/files/boom! new file mode 100644 index 00000000..e69de29b diff --git a/samples/very/exciting/new/files/wow! b/samples/very/exciting/new/files/wow! new file mode 100644 index 00000000..e69de29b From 0f4058a3170724cc1709837c1d8f89d364c08bf5 Mon Sep 17 00:00:00 2001 From: bmcorser Date: Sat, 24 Aug 2013 13:42:55 +0100 Subject: [PATCH 0987/2344] Add regressison test for recursively copying files --- pelican/tests/test_pelican.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index d6c0d8e9..db2d0e6b 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -92,3 +92,22 @@ class TestPelican(LoggedTestCase): mute(True)(pelican.run)() dcmp = dircmp(self.temp_path, os.path.join(OUTPUT_PATH, 'custom')) self.assertFilesEqual(recursiveDiff(dcmp)) + + def test_theme_static_paths_copy(self): + # the same thing with a specified set of settings should work + settings = read_settings(path=SAMPLE_CONFIG, override={ + 'PATH': INPUT_PATH, + 'OUTPUT_PATH': self.temp_path, + 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, 'very'), + os.path.join(SAMPLES_PATH, 'theme_standard')] + }) + pelican = Pelican(settings=settings) + mute(True)(pelican.run)() + theme_output = os.path.join(self.temp_path, 'theme') + extra_path = os.path.join(theme_output, 'exciting', 'new', 'files') + + for file in ['a_stylesheet', 'a_template']: + self.assertTrue(os.path.exists(os.path.join(theme_output, file))) + + for file in ['wow!', 'boom!', 'bap!']: + self.assertTrue(os.path.exists(os.path.join(extra_path, file))) From b144c3cfbd6ea0e5bd1bba5d30d6bf3605499794 Mon Sep 17 00:00:00 2001 From: bmcorser Date: Sat, 24 Aug 2013 14:38:06 +0100 Subject: [PATCH 0988/2344] Hack out `overwrite` param --- pelican/generators.py | 2 +- pelican/utils.py | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 26fa40ea..d695c7c8 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -544,7 +544,7 @@ class StaticGenerator(Generator): """Copy all the paths from source to destination""" for path in paths: copy(path, source, os.path.join(output_path, destination), - final_path, overwrite=True) + final_path) def generate_context(self): self.staticfiles = [] diff --git a/pelican/utils.py b/pelican/utils.py index e028c84c..d306de65 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -256,7 +256,7 @@ def slugify(value, substitutions=()): return value.decode('ascii') -def copy(path, source, destination, destination_path=None, overwrite=False): +def copy(path, source, destination, destination_path=None): """Copy path from origin to destination. The function is able to copy either files or directories. @@ -265,8 +265,6 @@ def copy(path, source, destination, destination_path=None, overwrite=False): :param source: the source dir :param destination: the destination dir :param destination_path: the destination path (optional) - :param overwrite: whether to overwrite the destination if already exists - or not """ if not destination_path: destination_path = path From c61f6f402a417e807c9cb6f01c9293fced678892 Mon Sep 17 00:00:00 2001 From: Axel Haustant Date: Wed, 27 Mar 2013 09:30:54 +0100 Subject: [PATCH 0989/2344] Prepare for bumpr --- bumpr.rc | 30 ++++++++++++++++++++++++++++++ docs/changelog.rst | 2 +- docs/conf.py | 6 +++--- pelican/__init__.py | 5 +---- 4 files changed, 35 insertions(+), 8 deletions(-) create mode 100644 bumpr.rc diff --git a/bumpr.rc b/bumpr.rc new file mode 100644 index 00000000..cfc90fd7 --- /dev/null +++ b/bumpr.rc @@ -0,0 +1,30 @@ +[bumpr] +file = pelican/__init__.py +vcs = git +clean = + python setup.py clean + rm -rf *egg-info build dist +tests = tox +publish = python setup.py sdist register upload +files = README.rst + +[bump] +unsuffix = true +message = Bump version {version} + +[prepare] +part = patch +suffix = dev +message = Prepare version {version} for next development cycle + +[changelog] +file = docs/changelog.rst +separator = = +bump = {version} ({date:%Y-%m-%d}) +prepare = Next release + +[readthedoc] +url = http://docs.getpelican.com/{tag} + +[commands] +bump = sed -i "s/last_stable\s*=.*/last_stable = '{version}'/" docs/conf.py diff --git a/docs/changelog.rst b/docs/changelog.rst index c020d7f4..27938d4d 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -2,7 +2,7 @@ Release history ############### Next release -================ +============ * Rename signals for better consistency (some plugins may need to be updated) * Move metadata extraction from generators to readers; metadata extraction no diff --git a/docs/conf.py b/docs/conf.py index 84531182..5ac81b9e 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -4,7 +4,7 @@ import sys, os sys.path.append(os.path.abspath(os.pardir)) -from pelican import __version__, __major__, __minor__ +from pelican import __version__ # -- General configuration ----------------------------------------------------- templates_path = ['_templates'] @@ -14,9 +14,9 @@ master_doc = 'index' project = 'Pelican' copyright = '2010, Alexis Metaireau and contributors' exclude_patterns = ['_build'] -version = '%s.%s' % (__major__, __minor__) release = __version__ -last_stable = '3.1.1' +version = '.'.join(release.split('.')[:1]) +last_stable = '3.2.2' rst_prolog = ''' .. |last_stable| replace:: :pelican-doc:`{0}` '''.format(last_stable) diff --git a/pelican/__init__.py b/pelican/__init__.py index 2e1763ac..cecab54b 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -22,10 +22,7 @@ from pelican.settings import read_settings from pelican.utils import clean_output_dir, folder_watcher, file_watcher from pelican.writers import Writer -__major__ = 3 -__minor__ = 2 -__micro__ = 0 -__version__ = "{0}.{1}.{2}.dev".format(__major__, __minor__, __micro__) +__version__ = "3.2.3.dev" DEFAULT_CONFIG_NAME = 'pelicanconf.py' From bad8cfb3d9883845c054772b75a5934a96aeb394 Mon Sep 17 00:00:00 2001 From: Axel Haustant Date: Sat, 24 Aug 2013 20:20:37 +0200 Subject: [PATCH 0990/2344] Added bumpr as a development requirement to perform release --- dev_requirements.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dev_requirements.txt b/dev_requirements.txt index fa2634a0..0a4a4589 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -6,3 +6,6 @@ Markdown BeautifulSoup4 lxml typogrify + +# To perform release +bumpr From 8d41d6ba2419e5d380f42f98e530a898c428f516 Mon Sep 17 00:00:00 2001 From: Alex Stephen Date: Sat, 24 Aug 2013 23:36:07 -0400 Subject: [PATCH 0991/2344] Refs #1028. Now iterating over tags --- pelican/themes/simple/templates/article.html | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index 8da555a1..2356c2f6 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -7,6 +7,11 @@ {% for description in article.description %} {% endfor %} + + {% for tag in article.tags %} + Date: Sun, 25 Aug 2013 14:14:43 +0200 Subject: [PATCH 0992/2344] Pin bumpr version to avoid config breakage with new versions --- dev_requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index 0a4a4589..c90ac630 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -8,4 +8,4 @@ lxml typogrify # To perform release -bumpr +bumpr==0.2.0 From 71cca7a444f8ac81be3dd55ba678eb69f5d1269a Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Mon, 26 Aug 2013 23:22:08 +0200 Subject: [PATCH 0993/2344] Fix the behavior of Markdown extensions. There was several issues here: - `self.extensions` was adding 'meta' multiple times (ref #1058) - `self.extensions` was keeping a reference to `self.settings['MD_EXTENSIONS']`, so adding 'meta' to it. - the `%s_EXTENSIONS` block coming after, it was overriding `self.extensions` with `self.settings['EXTENSIONS']` (while it was a reference, it was working, but ...). As this is currently used only for Mardown, the simplest solution is to remove this, and let each reader manage its `_EXTENSIONS` setting. --- pelican/readers.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 3f01a72c..067bbb85 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -188,8 +188,9 @@ class MarkdownReader(BaseReader): def __init__(self, *args, **kwargs): super(MarkdownReader, self).__init__(*args, **kwargs) - self.extensions = self.settings['MD_EXTENSIONS'] - self.extensions.append('meta') + self.extensions = list(self.settings['MD_EXTENSIONS']) + if 'meta' not in self.extensions: + self.extensions.append('meta') def _parse_metadata(self, meta): """Return the dict containing document metadata""" @@ -405,11 +406,6 @@ class Readers(object): self.readers[fmt] = reader_class(self.settings) - settings_key = '%s_EXTENSIONS' % fmt.upper() - - if settings_key in self.settings: - self.readers[fmt].extensions = self.settings[settings_key] - @property def extensions(self): return self.readers.keys() From 2f34307e129a8ae14b29262b9c63c0ab091f0f7f Mon Sep 17 00:00:00 2001 From: Talha Mansoor Date: Thu, 29 Aug 2013 23:14:47 +0500 Subject: [PATCH 0994/2344] Change the regex so that it parse |filename| and {filename} equally Updates getpelican/pelican#1061 --- pelican/contents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index 900049a2..94790612 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -187,7 +187,7 @@ class Content(object): (?:href|src)\s*=) (?P["\']) # require value to be quoted - (?P\|(?P.*?)\|(?P.*?)) # the url value + (?P[|{](?P.*?)[|}](?P.*?)) # the url value \2""", re.X) def replacer(m): From 8d352d9a7863fde988645b9b401c76ab2f8f512d Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 29 Aug 2013 17:35:48 -0700 Subject: [PATCH 0995/2344] Correct upload targets in Makefile.in --- pelican/tools/templates/Makefile.in | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index 4ca0af6a..524bf82e 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -27,7 +27,7 @@ DROPBOX_DIR=$dropbox_dir DEBUG ?= 0 ifeq ($(DEBUG), 1) PELICANOPTS += -D -endif +endif help: @echo 'Makefile for a pelican Web site ' @@ -40,13 +40,13 @@ help: @echo ' make serve [PORT=8000] serve site at http://localhost:8000' @echo ' make devserver [PORT=8000] start/restart develop_server.sh ' @echo ' make stopserver stop local server ' - @echo ' ssh_upload upload the web site via SSH ' - @echo ' rsync_upload upload the web site via rsync+ssh ' - @echo ' dropbox_upload upload the web site via Dropbox ' - @echo ' ftp_upload upload the web site via FTP ' - @echo ' s3_upload upload the web site via S3 ' - @echo ' cf_upload upload the web site via Cloud Files' - @echo ' github upload the web site via gh-pages ' + @echo ' make ssh_upload upload the web site via SSH ' + @echo ' make rsync_upload upload the web site via rsync+ssh ' + @echo ' make dropbox_upload upload the web site via Dropbox ' + @echo ' make ftp_upload upload the web site via FTP ' + @echo ' make s3_upload upload the web site via S3 ' + @echo ' make cf_upload upload the web site via Cloud Files' + @echo ' make github upload the web site via gh-pages ' @echo ' ' @echo 'Set the DEBUG variable to 1 to enable debugging, e.g. make DEBUG=1 html' @echo ' ' From ef16c915d4dfec668788bcff367a860214d01e55 Mon Sep 17 00:00:00 2001 From: bmcorser Date: Sat, 31 Aug 2013 21:48:19 +0100 Subject: [PATCH 0996/2344] Clarification of THEME_STATIC_PATHS behaviour --- docs/settings.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index c709a339..075bea83 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -597,7 +597,10 @@ Setting name (default value) What does it do? `THEME_STATIC_PATHS`. Default is `theme`. `THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default value is `static`, but if your theme has - other static paths, you can put them here. + other static paths, you can put them here. If files + or directories with the same names are included in + the paths defined in this settings, they will be + progressively overwritten. `CSS_FILE` (``'main.css'``) Specify the CSS file you want to load. ================================================ ===================================================== From 10c62b27dd3ca59972978ee4d57022739769bb2b Mon Sep 17 00:00:00 2001 From: bmcorser Date: Sat, 31 Aug 2013 22:00:52 +0100 Subject: [PATCH 0997/2344] More exciting files --- samples/kinda/exciting/new/files/zap! | 0 samples/kinda/exciting/old | 0 2 files changed, 0 insertions(+), 0 deletions(-) create mode 100644 samples/kinda/exciting/new/files/zap! create mode 100644 samples/kinda/exciting/old diff --git a/samples/kinda/exciting/new/files/zap! b/samples/kinda/exciting/new/files/zap! new file mode 100644 index 00000000..e69de29b diff --git a/samples/kinda/exciting/old b/samples/kinda/exciting/old new file mode 100644 index 00000000..e69de29b From 089059aec611b0827b925b987cb0f59bbfe4c485 Mon Sep 17 00:00:00 2001 From: bmcorser Date: Sat, 31 Aug 2013 22:11:03 +0100 Subject: [PATCH 0998/2344] Clarify revised functinality --- pelican/tests/test_pelican.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index db2d0e6b..e829e1a5 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -99,6 +99,7 @@ class TestPelican(LoggedTestCase): 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, 'very'), + os.path.join(SAMPLES_PATH, 'kinda'), os.path.join(SAMPLES_PATH, 'theme_standard')] }) pelican = Pelican(settings=settings) @@ -109,5 +110,5 @@ class TestPelican(LoggedTestCase): for file in ['a_stylesheet', 'a_template']: self.assertTrue(os.path.exists(os.path.join(theme_output, file))) - for file in ['wow!', 'boom!', 'bap!']: + for file in ['wow!', 'boom!', 'bap!', 'zap!']: self.assertTrue(os.path.exists(os.path.join(extra_path, file))) From b7bc5702154e0e5d7d95ae61dfc22dd9a7ba5c62 Mon Sep 17 00:00:00 2001 From: jeekajoo Date: Mon, 2 Sep 2013 19:25:46 +0200 Subject: [PATCH 0999/2344] add async and defer attributes to piwik.js inspired from http://piwik.org/docs/javascript-tracking/#toc-where-can-i-find-the-piwik-tracking-code --- pelican/themes/notmyidea/templates/piwik.html | 33 ++++++++++--------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/pelican/themes/notmyidea/templates/piwik.html b/pelican/themes/notmyidea/templates/piwik.html index ff459af7..f9126264 100644 --- a/pelican/themes/notmyidea/templates/piwik.html +++ b/pelican/themes/notmyidea/templates/piwik.html @@ -1,16 +1,19 @@ {% if PIWIK_URL and PIWIK_SITE_ID %} - -{% endif %} \ No newline at end of file + +{% endif %} From 6813cd923fed8b6a4f30a6951327049a6420e5f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Sun, 8 Sep 2013 17:07:30 +0200 Subject: [PATCH 1000/2344] Close some HTML tags. Fix #1076 --- pelican/tests/output/basic/a-markdown-powered-article.html | 4 ++-- pelican/tests/output/basic/archives.html | 4 ++-- pelican/tests/output/basic/article-1.html | 4 ++-- pelican/tests/output/basic/article-2.html | 4 ++-- pelican/tests/output/basic/article-3.html | 4 ++-- pelican/tests/output/basic/author/alexis-metaireau.html | 4 ++-- pelican/tests/output/basic/authors.html | 4 ++-- pelican/tests/output/basic/categories.html | 4 ++-- pelican/tests/output/basic/category/bar.html | 4 ++-- pelican/tests/output/basic/category/cat1.html | 4 ++-- pelican/tests/output/basic/category/misc.html | 4 ++-- pelican/tests/output/basic/category/yeah.html | 4 ++-- pelican/tests/output/basic/filename_metadata-example.html | 4 ++-- pelican/tests/output/basic/index.html | 4 ++-- pelican/tests/output/basic/oh-yeah.html | 4 ++-- pelican/tests/output/basic/override/index.html | 4 ++-- .../output/basic/pages/this-is-a-test-hidden-page.html | 4 ++-- pelican/tests/output/basic/pages/this-is-a-test-page.html | 4 ++-- pelican/tests/output/basic/second-article-fr.html | 4 ++-- pelican/tests/output/basic/second-article.html | 4 ++-- pelican/tests/output/basic/tag/bar.html | 4 ++-- pelican/tests/output/basic/tag/baz.html | 4 ++-- pelican/tests/output/basic/tag/foo.html | 4 ++-- pelican/tests/output/basic/tag/foobar.html | 4 ++-- pelican/tests/output/basic/tag/oh.html | 4 ++-- pelican/tests/output/basic/tag/yeah.html | 4 ++-- pelican/tests/output/basic/tags.html | 4 ++-- pelican/tests/output/basic/this-is-a-super-article.html | 4 ++-- pelican/tests/output/basic/unbelievable.html | 4 ++-- pelican/tests/output/custom/a-markdown-powered-article.html | 4 ++-- pelican/tests/output/custom/archives.html | 4 ++-- pelican/tests/output/custom/article-1.html | 4 ++-- pelican/tests/output/custom/article-2.html | 4 ++-- pelican/tests/output/custom/article-3.html | 4 ++-- pelican/tests/output/custom/author/alexis-metaireau.html | 4 ++-- pelican/tests/output/custom/author/alexis-metaireau2.html | 4 ++-- pelican/tests/output/custom/author/alexis-metaireau3.html | 4 ++-- pelican/tests/output/custom/authors.html | 4 ++-- pelican/tests/output/custom/categories.html | 4 ++-- pelican/tests/output/custom/category/bar.html | 4 ++-- pelican/tests/output/custom/category/cat1.html | 4 ++-- pelican/tests/output/custom/category/misc.html | 4 ++-- pelican/tests/output/custom/category/yeah.html | 4 ++-- pelican/tests/output/custom/drafts/a-draft-article.html | 4 ++-- pelican/tests/output/custom/filename_metadata-example.html | 4 ++-- pelican/tests/output/custom/index.html | 4 ++-- pelican/tests/output/custom/index2.html | 4 ++-- pelican/tests/output/custom/index3.html | 4 ++-- pelican/tests/output/custom/jinja2_template.html | 4 ++-- pelican/tests/output/custom/oh-yeah-fr.html | 4 ++-- pelican/tests/output/custom/oh-yeah.html | 4 ++-- pelican/tests/output/custom/override/index.html | 4 ++-- .../output/custom/pages/this-is-a-test-hidden-page.html | 4 ++-- pelican/tests/output/custom/pages/this-is-a-test-page.html | 4 ++-- pelican/tests/output/custom/second-article-fr.html | 4 ++-- pelican/tests/output/custom/second-article.html | 4 ++-- pelican/tests/output/custom/tag/bar.html | 4 ++-- pelican/tests/output/custom/tag/baz.html | 4 ++-- pelican/tests/output/custom/tag/foo.html | 4 ++-- pelican/tests/output/custom/tag/foobar.html | 4 ++-- pelican/tests/output/custom/tag/oh.html | 4 ++-- pelican/tests/output/custom/tag/yeah.html | 4 ++-- pelican/tests/output/custom/tags.html | 4 ++-- pelican/tests/output/custom/this-is-a-super-article.html | 4 ++-- pelican/tests/output/custom/unbelievable.html | 4 ++-- pelican/themes/notmyidea/templates/base.html | 4 ++-- pelican/themes/simple/templates/article.html | 6 +++--- 67 files changed, 135 insertions(+), 135 deletions(-) diff --git a/pelican/tests/output/basic/a-markdown-powered-article.html b/pelican/tests/output/basic/a-markdown-powered-article.html index b7a90f02..6bc29eba 100644 --- a/pelican/tests/output/basic/a-markdown-powered-article.html +++ b/pelican/tests/output/basic/a-markdown-powered-article.html @@ -1,9 +1,9 @@ - + A markdown powered article - + diff --git a/pelican/tests/output/basic/feeds/all-en.atom.xml b/pelican/tests/output/basic/feeds/all-en.atom.xml index 5b8eb591..da537344 100644 --- a/pelican/tests/output/basic/feeds/all-en.atom.xml +++ b/pelican/tests/output/basic/feeds/all-en.atom.xml @@ -31,7 +31,14 @@ YEAH !</p> <h2>Testing sourcecode directive</h2> <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> </pre></div> -</td></tr></table><p>Lovely.</p> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> </div> <div class="section" id="testing-more-sourcecode-directives"> <h2>Testing more sourcecode directives</h2> @@ -43,5 +50,12 @@ YEAH !</p> <span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> <p>Lovely.</p> </div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/all.atom.xml b/pelican/tests/output/basic/feeds/all.atom.xml index d19b0c30..d837c895 100644 --- a/pelican/tests/output/basic/feeds/all.atom.xml +++ b/pelican/tests/output/basic/feeds/all.atom.xml @@ -32,7 +32,14 @@ YEAH !</p> <h2>Testing sourcecode directive</h2> <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> </pre></div> -</td></tr></table><p>Lovely.</p> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> </div> <div class="section" id="testing-more-sourcecode-directives"> <h2>Testing more sourcecode directives</h2> @@ -44,5 +51,12 @@ YEAH !</p> <span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> <p>Lovely.</p> </div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/misc.atom.xml b/pelican/tests/output/basic/feeds/misc.atom.xml index 34b6b4fb..8b988614 100644 --- a/pelican/tests/output/basic/feeds/misc.atom.xml +++ b/pelican/tests/output/basic/feeds/misc.atom.xml @@ -8,7 +8,14 @@ <h2>Testing sourcecode directive</h2> <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> </pre></div> -</td></tr></table><p>Lovely.</p> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> </div> <div class="section" id="testing-more-sourcecode-directives"> <h2>Testing more sourcecode directives</h2> @@ -20,5 +27,12 @@ <span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> <p>Lovely.</p> </div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00Ztag:,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html index 08c4ad09..24b00606 100644 --- a/pelican/tests/output/basic/index.html +++ b/pelican/tests/output/basic/index.html @@ -219,11 +219,11 @@ YEAH !

    Testing sourcecode directive

    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
     
    -

    Lovely.

    - -
    -

    Testing more sourcecode directives

    -
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    + +
    +

    Testing another case

    +

    This will now have a line number in 'custom' since it's the default in +pelican.conf, it ...

    read more diff --git a/pelican/tests/output/basic/unbelievable.html b/pelican/tests/output/basic/unbelievable.html index db8d0bdf..aef78474 100644 --- a/pelican/tests/output/basic/unbelievable.html +++ b/pelican/tests/output/basic/unbelievable.html @@ -47,7 +47,14 @@

    Testing sourcecode directive

    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
     
    -

    Lovely.

    + +
    +

    Testing another case

    +

    This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.

    +
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    Testing more sourcecode directives

    @@ -58,6 +65,13 @@

    Testing even more sourcecode directives

    formatter = self.options and VARIANTS[self.options.keys()[0]]

    Lovely.

    +
    +
    +

    Testing overriding config defaults

    +

    Even if the default is line numbers, we can override it here

    +
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    diff --git a/pelican/tests/output/custom/author/alexis-metaireau3.html b/pelican/tests/output/custom/author/alexis-metaireau3.html index 4b598914..77c9cdfe 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom/author/alexis-metaireau3.html @@ -55,11 +55,11 @@

    Testing sourcecode directive

    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
     
    -

    Lovely.

    - -
    -

    Testing more sourcecode directives

    -
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    + +
    +

    Testing another case

    +

    This will now have a line number in 'custom' since it's the default in +pelican.conf, it ...

    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html index f32e04c3..36479803 100644 --- a/pelican/tests/output/custom/category/misc.html +++ b/pelican/tests/output/custom/category/misc.html @@ -99,11 +99,11 @@

    Testing sourcecode directive

    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
     
    -

    Lovely.

    - -
    -

    Testing more sourcecode directives

    -
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    + +
    +

    Testing another case

    +

    This will now have a line number in 'custom' since it's the default in +pelican.conf, it ...

    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/feeds/all-en.atom.xml b/pelican/tests/output/custom/feeds/all-en.atom.xml index ce25290d..69ba08c6 100644 --- a/pelican/tests/output/custom/feeds/all-en.atom.xml +++ b/pelican/tests/output/custom/feeds/all-en.atom.xml @@ -31,6 +31,13 @@ YEAH !</p> <h2>Testing sourcecode directive</h2> <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> </pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> </td></tr></table><p>Lovely.</p> </div> <div class="section" id="testing-more-sourcecode-directives"> @@ -43,5 +50,12 @@ YEAH !</p> <span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> <p>Lovely.</p> </div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/all.atom.xml b/pelican/tests/output/custom/feeds/all.atom.xml index 68986d40..2eb31731 100644 --- a/pelican/tests/output/custom/feeds/all.atom.xml +++ b/pelican/tests/output/custom/feeds/all.atom.xml @@ -33,6 +33,13 @@ YEAH !</p> <h2>Testing sourcecode directive</h2> <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> </pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> </td></tr></table><p>Lovely.</p> </div> <div class="section" id="testing-more-sourcecode-directives"> @@ -45,5 +52,12 @@ YEAH !</p> <span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> <p>Lovely.</p> </div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/all.rss.xml b/pelican/tests/output/custom/feeds/all.rss.xml index 7fee491a..69e30bfd 100644 --- a/pelican/tests/output/custom/feeds/all.rss.xml +++ b/pelican/tests/output/custom/feeds/all.rss.xml @@ -33,6 +33,13 @@ YEAH !</p> <h2>Testing sourcecode directive</h2> <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> </pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> </td></tr></table><p>Lovely.</p> </div> <div class="section" id="testing-more-sourcecode-directives"> @@ -45,5 +52,12 @@ YEAH !</p> <span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> <p>Lovely.</p> </div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.htmlThe baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/misc.atom.xml b/pelican/tests/output/custom/feeds/misc.atom.xml index 9328e05a..91d6b28f 100644 --- a/pelican/tests/output/custom/feeds/misc.atom.xml +++ b/pelican/tests/output/custom/feeds/misc.atom.xml @@ -8,6 +8,13 @@ <h2>Testing sourcecode directive</h2> <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> </pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> </td></tr></table><p>Lovely.</p> </div> <div class="section" id="testing-more-sourcecode-directives"> @@ -20,5 +27,12 @@ <span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> <p>Lovely.</p> </div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/misc.rss.xml b/pelican/tests/output/custom/feeds/misc.rss.xml index b708c70d..3493d2a3 100644 --- a/pelican/tests/output/custom/feeds/misc.rss.xml +++ b/pelican/tests/output/custom/feeds/misc.rss.xml @@ -8,6 +8,13 @@ <h2>Testing sourcecode directive</h2> <table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> </pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> </td></tr></table><p>Lovely.</p> </div> <div class="section" id="testing-more-sourcecode-directives"> @@ -20,5 +27,12 @@ <span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> <p>Lovely.</p> </div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.htmlThe baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom/index3.html b/pelican/tests/output/custom/index3.html index 69f9d20c..b4d9ffc6 100644 --- a/pelican/tests/output/custom/index3.html +++ b/pelican/tests/output/custom/index3.html @@ -55,11 +55,11 @@

    Testing sourcecode directive

    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
     
    -

    Lovely.

    - -
    -

    Testing more sourcecode directives

    -
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError ...
    + +
    +

    Testing another case

    +

    This will now have a line number in 'custom' since it's the default in +pelican.conf, it ...

    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/unbelievable.html b/pelican/tests/output/custom/unbelievable.html index 74bfa83c..03b533bb 100644 --- a/pelican/tests/output/custom/unbelievable.html +++ b/pelican/tests/output/custom/unbelievable.html @@ -54,6 +54,13 @@

    Testing sourcecode directive

    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
     
    +
    +
    +

    Testing another case

    +

    This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +

    Lovely.

    @@ -65,6 +72,13 @@

    Testing even more sourcecode directives

    formatter = self.options and VARIANTS[self.options.keys()[0]]

    Lovely.

    +
    +
    +

    Testing overriding config defaults

    +

    Even if the default is line numbers, we can override it here

    +
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    diff --git a/samples/content/unbelievable.rst b/samples/content/unbelievable.rst index b990d20c..209e3557 100644 --- a/samples/content/unbelievable.rst +++ b/samples/content/unbelievable.rst @@ -12,9 +12,20 @@ Testing sourcecode directive ---------------------------- .. sourcecode:: python - :linenos: + :linenos: - formatter = self.options and VARIANTS[self.options.keys()[0]] + formatter = self.options and VARIANTS[self.options.keys()[0]] + + +Testing another case +-------------------- + +This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default. + +.. sourcecode:: python + + formatter = self.options and VARIANTS[self.options.keys()[0]] Lovely. @@ -71,3 +82,17 @@ Testing even more sourcecode directives Lovely. + +Testing overriding config defaults +---------------------------------- + +Even if the default is line numbers, we can override it here + +.. sourcecode:: python + :linenos: none + + + formatter = self.options and VARIANTS[self.options.keys()[0]] + + +Lovely. diff --git a/samples/pelican.conf.py b/samples/pelican.conf.py index 4d5cd06d..d6a87923 100755 --- a/samples/pelican.conf.py +++ b/samples/pelican.conf.py @@ -48,6 +48,9 @@ STATIC_PATHS = [ # custom page generated with a jinja2 template TEMPLATE_PAGES = {'pages/jinja2_template.html': 'jinja2_template.html'} +# code blocks with line numbers +PYGMENTS_RST_OPTIONS = {'linenos': 'table'} + # foobar will not be used, because it's not in caps. All configuration keys # have to be in caps foobar = "barbaz" From 22da74211d1874edf4e6d3c01f7526d5b633a0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 17 Sep 2013 17:32:08 +0200 Subject: [PATCH 1009/2344] Fix a broken link --- docs/faq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.rst b/docs/faq.rst index c1d4f5a0..f7ee6826 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -49,7 +49,7 @@ themes to style code syntax highlighting via CSS. Specifically, you can customize the appearance of your syntax highlighting via the ``.highlight pre`` class in your theme's CSS file. To see how various styles can be used to render Django code, for example, use the style selector drop-down at top-right on the -`Pygments project demo site `_. +`Pygments project demo site `_. You can use the following example commands to generate a starting CSS file from a Pygments built-in style (in this case, "monokai") and then copy the generated From 07f87969ea7a66a89f6a54ea575659f839d6d1d7 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 23 Sep 2013 19:28:06 +0200 Subject: [PATCH 1010/2344] Update changelog --- docs/changelog.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/changelog.rst b/docs/changelog.rst index 064c8fd2..ebf84f34 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,13 +4,27 @@ Release history Next release ============ +* Drop Python 3.2 support in favor of Python 3.3 +* Add ``Fabfile`` so Fabric can be used for workflow automation instead of Make +* ``OUTPUT_RETENTION`` setting can be used to preserve metadata (e.g., VCS + data such as ``.hg`` and ``.git``) from being removed from output directory +* Tumblr import +* Improve logic and consistency when cleaning output folder +* Improve documentation versioning and release automation +* Improve pagination flexibility * Rename signals for better consistency (some plugins may need to be updated) * Move metadata extraction from generators to readers; metadata extraction no longer article-specific * Deprecate ``FILES_TO_COPY`` in favor of ``STATIC_PATHS`` and ``EXTRA_PATH_METADATA`` +* Summaries in Markdown posts no longer include footnotes +* Remove unnecessary whitespace in output via ``lstrip_blocks`` Jinja parameter +* Move PDF generation from core to plugin +* Replace ``MARKUP`` setting with ``READERS`` +* Add warning if img tag is missing ``alt`` attribute * Add support for ``{}`` in relative links syntax, besides ``||`` * Add support for ``{tag}`` and ``{category}`` relative links +* Add a ``content_written`` signal 3.2.1 and 3.2.2 =============== From f6c9237a0115491b7db3206717e63a4250c6c2b8 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 23 Sep 2013 19:30:51 +0200 Subject: [PATCH 1011/2344] Enhance and correct documentation --- docs/faq.rst | 13 +++---- docs/getting_started.rst | 60 ++++++++++++++++--------------- docs/index.rst | 10 ++++-- docs/plugins.rst | 16 ++++----- docs/settings.rst | 77 ++++++++++++++++++++-------------------- docs/themes.rst | 23 ++++++------ docs/tips.rst | 48 +++++++++++++------------ 7 files changed, 129 insertions(+), 118 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index f7ee6826..da37af04 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -23,8 +23,8 @@ How can I help? There are several ways to help out. First, you can report any Pelican suggestions or problems you might have via IRC or the `issue tracker `_. If submitting an issue -report, please check the existing issue list first in order to avoid submitting -a duplicate issue. +report, please first check the existing issue list (both open and closed) in +order to avoid submitting a duplicate issue. If you want to contribute, please fork `the git repository `_, create a new feature branch, make @@ -96,7 +96,8 @@ This metadata can then be accessed in templates such as ``article.html`` via:: Last modified: {{ article.modified }} {% endif %} -If you want to include metadata in templates outside the article context (e.g., ``base.html``), the ``if`` statement should instead be:: +If you want to include metadata in templates outside the article context (e.g., +``base.html``), the ``if`` statement should instead be:: {% if article and article.modified %} @@ -196,10 +197,10 @@ Is Pelican only suitable for blogs? =================================== No. Pelican can be easily configured to create and maintain any type of static site. -This may require little customization of your theme and Pelican configuration. +This may require a little customization of your theme and Pelican configuration. For example, if you are building a launch site for your product and do not need -tags on your site. You can hide tags by removing relevant html code from your theme. -You can also disable generation of tags pages:: +tags on your site, you could remove the relevant HTML code from your theme. +You can also disable generation of tag-related pages via:: TAGS_SAVE_AS = '' TAG_SAVE_AS = '' diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 2605c3a1..201b9ad4 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -83,15 +83,20 @@ Viewing the generated files --------------------------- The files generated by Pelican are static files, so you don't actually need -anything special to view them. You can either use your browser to open the -files on your disk:: +anything special to view them. You can use your browser to open the generated +HTML files directly:: firefox output/index.html -Or run a simple web server using Python:: +Because the above method may have trouble locating your CSS and other linked +assets, running a simple web server using Python will often provide a more +reliable previewing experience:: cd output && python -m SimpleHTTPServer +Once the ``SimpleHTTPServer`` has been started, you can preview your site at +http://localhost:8000/ + Upgrading --------- @@ -452,25 +457,24 @@ And ``image-test.md`` would include:: ![Alt Text]({filename}/images/han.jpg) Any content can be linked in this way. What happens is that the ``images`` -directory gets copied to ``output/static/`` upon publishing. This is -because ``images`` is in the ``settings["STATIC_PATHS"]`` list by default. If -you want to have another directory, say ``pdfs`` you would need to add the -following to ``pelicanconf.py``:: +directory gets copied to ``output/`` during site generation because Pelican +includes ``images`` in the ``STATIC_PATHS`` setting's list by default. If +you want to have another directory, say ``pdfs``, copied from your content to +your output during site generation, you would need to add the following to +your settings file:: STATIC_PATHS = ['images', 'pdfs'] -And then the ``pdfs`` directory would also be copied to ``output/static/``. +After the above line has been added, subsequent site generation should copy the +``content/pdfs/`` directory to ``output/pdfs/``. You can also link to categories or tags, using the ``{tag}tagname`` and ``{category}foobar`` syntax. -For backward compatibility, Pelican also supports bars ``||``, besides ``{}``, -i.e. the ``filename``, ``tag`` and ``category`` identifiers can be enclosed -in bars ``|`` instead of braces ``{}``, for example, ``|filename|an_article.rst``, -``|tag|tagname``, ``|category|foobar``. - -Using ``{}`` ensures that the syntax will not collide with markdown extensions or -reST directives. +For backward compatibility, Pelican also supports bars (``||``) in addition to +curly braces (``{}``). For example: ``|filename|an_article.rst``, +``|tag|tagname``, ``|category|foobar``. The syntax was changed from ``||`` to +``{}`` to avoid collision with Markdown extensions or reST directives. Importing an existing blog -------------------------- @@ -590,12 +594,12 @@ tagsfile string ctags file to use for name definitions. tagurlformat string format for the ctag links. ============= ============ ========================================= -Note that, depending on its version, your pygments module might not have -all of these available. See the `Pygments documentation -`_ for the HTML formatter for more +Note that, depending on the version, your Pygments module might not have +all of these options available. Refer to the *HtmlFormatter* section of the +`Pygments documentation `_ for more details on each of the options. -for example the below code block enables line numbers, starting at 153, +For example, the following code block enables line numbers, starting at 153, and prefixes the Pygments CSS classes with *pgcss* to make the names more unique and avoid possible CSS conflicts:: @@ -606,25 +610,25 @@ more unique and avoid possible CSS conflicts:: -It is also possible to specify the ``PYGMENTS_RST_OPTIONS`` variable -in your Pelican configuration file for settings that will be -automatically applied to every code block. +It is also possible to specify the ``PYGMENTS_RST_OPTIONS`` variable in your +Pelican settings file to include options that will be automatically applied to +every code block. -For example, if you wanted to have line numbers on for every code block +For example, if you want to have line numbers displayed for every code block and a CSS prefix you would set this variable to:: - PYGMENTS_RST_OPTIONS = { 'classprefix': 'pgcss', 'linenos': 'table'} + PYGMENTS_RST_OPTIONS = {'classprefix': 'pgcss', 'linenos': 'table'} -If specified, settings for individual code blocks will override the -defaults in the configuration file. +If specified, settings for individual code blocks will override the defaults in +your settings file. Publishing drafts ----------------- If you want to publish an article as a draft (for friends to review before -publishing, for example), you can add a ``status: draft`` attribute to its +publishing, for example), you can add a ``Status: draft`` attribute to its metadata. That article will then be output to the ``drafts`` folder and not -listed on the index page nor on any category page. +listed on the index page nor on any category or tag page. .. _virtualenv: http://www.virtualenv.org/ .. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime diff --git a/docs/index.rst b/docs/index.rst index eb8883ce..35e859d5 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -51,9 +51,13 @@ If you want to see new features in Pelican, don't hesitate to offer suggestions, clone the repository, etc. There are many ways to :doc:`contribute`. That's open source, dude! -Send a message to "authors at getpelican dot com" with any requests/feedback! You -can also join the team at `#pelican on Freenode`_ (or if you don't have an IRC -client handy, use the webchat_ for quick feedback. +Send a message to "authors at getpelican dot com" with any requests/feedback. +For a more immediate response, you can also join the team via IRC at +`#pelican on Freenode`_ — if you don't have an IRC client handy, use the +webchat_ for quick feedback. If you ask a question via IRC and don't get an +immediate response, don't leave the channel! It may take a few hours because +of time zone differences, but f you are patient and remain in the channel, +someone will almost always respond to your inquiry. Documentation ------------- diff --git a/docs/plugins.rst b/docs/plugins.rst index 29d67e24..6de01d05 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -135,15 +135,15 @@ shared in the documentation somewhere, so here they are! How to create a new reader -------------------------- -One thing you might want is to add the support for your very own input -format. While it might make sense to add this feature in pelican core, we -wisely chose to avoid this situation, and have the different readers defined in -plugins. +One thing you might want is to add support for your very own input format. +While it might make sense to add this feature in Pelican core, we +wisely chose to avoid this situation and instead have the different readers +defined via plugins. The rationale behind this choice is mainly that plugins are really easy to -write and don't slow down pelican itself when they're not active. +write and don't slow down Pelican itself when they're not active. -No more talking, here is the example:: +No more talking — here is an example:: from pelican import signals from pelican.readers import BaseReader @@ -153,7 +153,7 @@ No more talking, here is the example:: enabled = True # Yeah, you probably want that :-) # The list of file extensions you want this reader to match with. - # In the case multiple readers use the same extensions, the latest will + # If multiple readers were to use the same extension, the latest will # win (so the one you're defining here, most probably). file_extensions = ['yeah'] @@ -173,7 +173,7 @@ No more talking, here is the example:: def add_reader(readers): readers.reader_classes['yeah'] = NewReader - # this is how pelican works. + # This is how pelican works. def register(): signals.readers_init.connect(add_reader) diff --git a/docs/settings.rst b/docs/settings.rst index e8965731..b6c18fa9 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -84,10 +84,10 @@ Setting name (default value) What doe here or a single string representing one locale. When providing a list, all the locales will be tried until one works. -`READERS` (``{}``) A dict of file extensions / Reader classes to overwrite or - add file readers. for instance, to avoid processing .html files: - ``READERS = {'html': None}``. Or to add a custom reader for the - `foo` extension: ``READERS = {'foo': FooReader}`` +`READERS` (``{}``) A dictionary of file extensions / Reader classes for Pelican to + process or ignore. For example, to avoid processing .html files, + set: ``READERS = {'html': None}``. To add a custom reader for the + `foo` extension, set: ``READERS = {'foo': FooReader}`` `IGNORE_FILES` (``['.#*']``) A list of file globbing patterns to match against the source files to be ignored by the processor. For example, the default ``['.#*']`` will ignore emacs lock files. @@ -106,11 +106,9 @@ Setting name (default value) What doe `PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages. `ARTICLE_DIR` (``''``) Directory to look at for articles, relative to `PATH`. `ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles. -`PDF_GENERATOR` (``False``) Set to ``True`` if you want PDF versions of your documents to be. - generated. You will need to install ``rst2pdf``. `OUTPUT_SOURCES` (``False``) Set to True if you want to copy the articles and pages in their original format (e.g. Markdown or reStructuredText) to the - specified OUTPUT_PATH. + specified ``OUTPUT_PATH``. `OUTPUT_SOURCES_EXTENSION` (``.text``) Controls the extension that will be used by the SourcesGenerator. Defaults to ``.text``. If not a valid string the default value will be used. @@ -144,7 +142,7 @@ Setting name (default value) What doe are not needed, set ``DIRECT_TEMPLATES = ('index', 'archives')`` `PAGINATED_DIRECT_TEMPLATES` (``('index',)``) Provides the direct templates that should be paginated. `SUMMARY_MAX_LENGTH` (``50``) When creating a short summary of an article, this will - be the default length in words of the text created. + be the default length (measured in words) of the text created. This only applies if your content does not otherwise specify a summary. Setting to ``None`` will cause the summary to be a copy of the original content. @@ -155,9 +153,9 @@ Setting name (default value) What doe `ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to AsciiDoc. See the `manpage `_ `WITH_FUTURE_DATES` (``True``) If disabled, content with dates in the future will get a - default status of draft. + default status of ``draft``. `INTRASITE_LINK_REGEX` (``'[{|](?P.*?)[|}]'``) Regular expression that is used to parse internal links. - Default syntax of links to internal files, tags, etc. is + Default syntax of links to internal files, tags, etc., is to enclose the identifier, say ``filename``, in ``{}`` or ``||``. Identifier between ``{`` and ``}`` goes into the ``what`` capturing group. For details see :ref:`ref-linking-to-internal-content`. @@ -173,7 +171,7 @@ URL settings ------------ The first thing to understand is that there are currently two supported methods -for URL formation: *relative* and *absolute*. Document-relative URLs are useful +for URL formation: *relative* and *absolute*. Relative URLs are useful when testing locally, and absolute URLs are reliable and most useful when publishing. One method of supporting both is to have one Pelican configuration file for local development and another for publishing. To see an example of this @@ -181,16 +179,17 @@ type of setup, use the ``pelican-quickstart`` script as described at the top of the :doc:`Getting Started ` page, which will produce two separate configuration files for local development and publishing, respectively. -You can customize the URLs and locations where files will be saved. The URLs and -SAVE_AS variables use Python's format strings. These variables allow you to place -your articles in a location such as ``{slug}/index.html`` and link to them as -``{slug}`` for clean URLs. These settings give you the flexibility to place your -articles and pages anywhere you want. +You can customize the URLs and locations where files will be saved. The +``*_URL`` and ``*_SAVE_AS`` variables use Python's format strings. These +variables allow you to place your articles in a location such as +``{slug}/index.html`` and link to them as ``{slug}`` for clean URLs. These +settings give you the flexibility to place your articles and pages anywhere you +want. .. note:: - If you specify a datetime directive, it will be substituted using the + If you specify a ``datetime`` directive, it will be substituted using the input files' date metadata attribute. If the date is not specified for a - particular file, Pelican will rely on the file's mtime timestamp. + particular file, Pelican will rely on the file's ``mtime`` timestamp. Check the Python datetime documentation at http://bit.ly/cNcJUC for more information. @@ -213,7 +212,7 @@ and the URL to this would be ``/posts/2011/Aug/07/sample-post/``. Pelican can optionally create per-year, per-month, and per-day archives of your posts. These secondary archives are disabled by default but are automatically -enabled if you supply format strings for their respective `_SAVE_AS` settings. +enabled if you supply format strings for their respective ``_SAVE_AS`` settings. Period archives fit intuitively with the hierarchical model of web URLs and can make it easier for readers to navigate through the posts you've written over time. @@ -222,12 +221,12 @@ Example usage: * YEAR_ARCHIVE_SAVE_AS = ``'posts/{date:%Y}/index.html'`` * MONTH_ARCHIVE_SAVE_AS = ``'posts/{date:%Y}/{date:%b}/index.html'`` -With these settings, Pelican will create an archive of all your posts for the year -at (for instance) 'posts/2011/index.html', and an archive of all your posts for -the month at 'posts/2011/Aug/index.html'. +With these settings, Pelican will create an archive of all your posts for the +year at (for instance) ``posts/2011/index.html`` and an archive of all your +posts for the month at ``posts/2011/Aug/index.html``. .. note:: - Period archives work best when the final path segment is 'index.html'. + Period archives work best when the final path segment is ``index.html``. This way a reader can remove a portion of your URL and automatically arrive at an appropriate archive of posts, without having to specify a page name. @@ -299,10 +298,11 @@ Have a look at `the wikipedia page`_ to get a list of valid timezone values. Date format and locale ---------------------- -If no DATE_FORMATS are set, Pelican will fall back to DEFAULT_DATE_FORMAT. If -you need to maintain multiple languages with different date formats, you can -set this dict using the language name (``lang`` metadata in your post content) -as the key. Regarding available format codes, see `strftime document of python`_ : +If no ``DATE_FORMATS`` are set, Pelican will fall back to +``DEFAULT_DATE_FORMAT``. If you need to maintain multiple languages with +different date formats, you can set the ``DATE_FORMATS`` dictionary using the +language name (``lang`` metadata in your post content) as the key. Regarding +available format codes, see `strftime document of python`_ : .. parsed-literal:: @@ -320,8 +320,8 @@ You can set locale to further control date format: ) Also, it is possible to set different locale settings for each language. If you -put (locale, format) tuples in the dict, this will override the LOCALE setting -above: +put (locale, format) tuples in the dict, this will override the ``LOCALE`` +setting above: .. parsed-literal:: # On Unix/Linux @@ -473,9 +473,9 @@ Pagination ========== The default behaviour of Pelican is to list all the article titles along -with a short description on the index page. While it works pretty well -for small-to-medium blogs, for sites with large quantity of articles it would -be convenient to have a way to paginate the list. +with a short description on the index page. While this works well for +small-to-medium sites, sites with a large quantity of articles will probably +benefit from paginating this list. You can use the following settings to configure the pagination. @@ -483,8 +483,8 @@ You can use the following settings to configure the pagination. Setting name (default value) What does it do? ================================================ ===================================================== `DEFAULT_ORPHANS` (``0``) The minimum number of articles allowed on the - last page. Use this when you don't want to - have a last page with very few articles. + last page. Use this when you don't want the last page + to only contain a handful of articles. `DEFAULT_PAGINATION` (``False``) The maximum number of articles to include on a page, not including orphans. False to disable pagination. @@ -528,7 +528,7 @@ Setting name (default value) What does it do? `TAG_CLOUD_MAX_ITEMS` (``100``) Maximum number of tags in the cloud. ================================================ ===================================================== -The default theme does not include a tag cloud, but it is pretty easy to add:: +The default theme does not include a tag cloud, but it is pretty easy to add one::
      {% for tag in tag_cloud %} @@ -536,9 +536,10 @@ The default theme does not include a tag cloud, but it is pretty easy to add:: {% endfor %}
    -You should then also define CSS styles with appropriate classes (tag-0 to tag-N, where -N matches `TAG_CLOUD_STEPS` -1), tag-0 being the most frequent, and define a ul.tagcloud -class with appropriate list-style to create the cloud, for example:: +You should then also define CSS styles with appropriate classes (tag-0 to tag-N, +where N matches ``TAG_CLOUD_STEPS`` -1), tag-0 being the most frequent, and +define a ``ul.tagcloud`` class with appropriate list-style to create the cloud. +For example:: ul.tagcloud { list-style: none; diff --git a/docs/themes.rst b/docs/themes.rst index ddf509f8..c5aafb46 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -30,12 +30,12 @@ To make your own theme, you must follow the following structure:: └── tags.html // must list all the tags. Can be a tag cloud. * `static` contains all the static assets, which will be copied to the output - `theme` folder. I've put the CSS and image folders here, but they are - just examples. Put what you need here. + `theme` folder. The above filesystem layout includes CSS and image folders, + but those are just examples. Put what you need here. * `templates` contains all the templates that will be used to generate the content. - I've just put the mandatory templates here; you can define your own if it helps - you keep things organized while creating your theme. + The template files listed above are mandatory; you can add your own templates + if it helps you keep things organized while creating your theme. Templates and variables ======================= @@ -44,8 +44,8 @@ The idea is to use a simple syntax that you can embed into your HTML pages. This document describes which templates should exist in a theme, and which variables will be passed to each template at generation time. -All templates will receive the variables defined in your settings file, if they -are in all-caps. You can access them directly. +All templates will receive the variables defined in your settings file, as long +as they are in all-caps. You can access them directly. Common variables ---------------- @@ -58,19 +58,18 @@ Variable Description output_file The name of the file currently being generated. For instance, when Pelican is rendering the homepage, output_file will be "index.html". -articles The list of articles, ordered descending by date +articles The list of articles, ordered descending by date. All the elements are `Article` objects, so you can access their attributes (e.g. title, summary, author etc.). Sometimes this is shadowed (for instance in the tags page). You will then find info about it in the `all_articles` variable. dates The same list of articles, but ordered by date, - ascending + ascending. tags A list of (tag, articles) tuples, containing all the tags. categories A list of (category, articles) tuples, containing - all the categories. - and the list of respective articles (values) + all the categories and corresponding articles (values) pages The list of pages ============= =================================================== @@ -91,9 +90,9 @@ __ http://jinja.pocoo.org/docs/templates/#sort Date Formatting --------------- -Pelican formats the date with according to your settings and locale +Pelican formats the date according to your settings and locale (``DATE_FORMATS``/``DEFAULT_DATE_FORMAT``) and provides a -``locale_date`` attribute. On the other hand, ``date`` attribute will +``locale_date`` attribute. On the other hand, the ``date`` attribute will be a `datetime`_ object. If you need custom formatting for a date different than your settings, use the Jinja filter ``strftime`` that comes with Pelican. Usage is same as Python `strftime`_ format, diff --git a/docs/tips.rst b/docs/tips.rst index 1864f0dd..7629481f 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -15,16 +15,16 @@ Project Pages and User Pages. Project Pages ------------- -To publish a Pelican site as Project Pages you need to *push* the content of +To publish a Pelican site as a Project Page you need to *push* the content of the ``output`` dir generated by Pelican to a repository's ``gh-pages`` branch on GitHub. The excellent `ghp-import `_, which can be installed with ``easy_install`` or ``pip``, makes this process really easy. -For example, if the sources of your Pelican site are contained in a GitHub -repository, and if you want to publish your Pelican site as Project Pages of -this repository, you can then use the following:: +For example, if the source of your Pelican site is contained in a GitHub +repository, and if you want to publish that Pelican site in the form of Project +Pages to this repository, you can then use the following:: $ pelican content -o output -s pelicanconf.py $ ghp-import output @@ -38,28 +38,28 @@ already exist). The ``git push origin gh-pages`` command updates the remote .. note:: The ``github`` target of the Makefile created by the ``pelican-quickstart`` - command publishes the Pelican site as Project Pages as described above. + command publishes the Pelican site as Project Pages, as described above. User Pages ---------- -To publish a Pelican site as User Pages you need to *push* the content of the -``output`` dir generated by Pelican to the ``master`` branch of your -``.github.com`` repository on GitHub. +To publish a Pelican site in the form of User Pages, you need to *push* the +content of the ``output`` dir generated by Pelican to the ``master`` branch of +your ``.github.io`` repository on GitHub. Again, you can take advantage of ``ghp-import``:: $ pelican content -o output -s pelicanconf.py $ ghp-import output - $ git push git@github.com:elemoine/elemoine.github.com.git gh-pages:master + $ git push git@github.com:elemoine/elemoine.github.io.git gh-pages:master The ``git push`` command pushes the local ``gh-pages`` branch (freshly updated -by the ``ghp-import`` command) to the ``elemoine.github.com`` repository's +by the ``ghp-import`` command) to the ``elemoine.github.io`` repository's ``master`` branch on GitHub. .. note:: - To publish your Pelican site as User Pages feel free to adjust the the + To publish your Pelican site as User Pages, feel free to adjust the ``github`` target of the Makefile. Extra Tips @@ -67,28 +67,30 @@ Extra Tips Tip #1: -To automatically update your Pelican site on each commit you can create +To automatically update your Pelican site on each commit, you can create a post-commit hook. For example, you can add the following to ``.git/hooks/post-commit``:: - pelican pelican content -o output -s pelicanconf.py && ghp-import output && git push origin gh-pages + pelican content -o output -s pelicanconf.py && ghp-import output && git push origin gh-pages Tip #2: To use a `custom domain `_ with -GitHub Pages you need to have a ``CNAME`` file at the root of your pages. For -that you will add ``CNAME`` file to your ``content``, dir and use the -``FILES_TO_COPY`` setting variable to tell Pelican to copy that file -to the ``output`` dir. For example:: +GitHub Pages, you need to put the domain of your site (e.g., +``blog.example.com``) inside a ``CNAME`` file at the root of your site. To do +this, create the ``content/extras/`` directory and add a ``CNAME`` file to it. +Then use the ``STATIC_PATHS`` setting to tell Pelican to copy this file to your +output directory. For example:: - FILES_TO_COPY = (('extra/CNAME', 'CNAME'),) + STATIC_PATHS = ['images', 'extra/CNAME'] + EXTRA_PATH_METADATA = {'extra/CNAME': {'path': 'CNAME'},} -How to add Youtube or Vimeo Videos +How to add YouTube or Vimeo Videos ================================== -The easiest way is to paste embed code of the video from these sites in your -markup file. +The easiest way is to paste the embed code of the video from these sites +directly into your source content. -Alternatively, you can also use Pelican plugins like ``liquid_tags`` or ``pelican_youtube`` -or ``pelican_vimeo`` to embed videos in your blog. +Alternatively, you can also use Pelican plugins like ``liquid_tags``, +``pelican_youtube``, or ``pelican_vimeo`` to embed videos in your content. From e5c0a54c57eb7d9cd718a382f66977ea8becf24a Mon Sep 17 00:00:00 2001 From: Honza Javorek Date: Tue, 24 Sep 2013 14:19:47 +0200 Subject: [PATCH 1012/2344] Removed obsolete comment. --- pelican/contents.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index b453f61b..1858013c 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -197,10 +197,6 @@ class Content(object): value = m.group('value') origin = m.group('path') - # we support only filename for now. the plan is to support - # categories, tags, etc. in the future, but let's keep things - # simple for now. - # XXX Put this in a different location. if what == 'filename': if value.startswith('/'): From 7d43c4fa00fa31c9ef445a5f923255da870bf650 Mon Sep 17 00:00:00 2001 From: Honza Javorek Date: Tue, 24 Sep 2013 15:18:09 +0200 Subject: [PATCH 1013/2344] Support for params and fragments in intrasite links. Adresses #1063. --- pelican/contents.py | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 1858013c..83fbad8f 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -5,6 +5,7 @@ import six import copy import locale import logging +import urlparse import functools import os import re @@ -194,30 +195,36 @@ class Content(object): def replacer(m): what = m.group('what') - value = m.group('value') + value = urlparse.urlparse(m.group('value')) + path = value.path origin = m.group('path') # XXX Put this in a different location. if what == 'filename': - if value.startswith('/'): - value = value[1:] + if path.startswith('/'): + path = path[1:] else: # relative to the source path of this content - value = self.get_relative_source_path( - os.path.join(self.relative_dir, value) + path = self.get_relative_source_path( + os.path.join(self.relative_dir, path) ) - if value in self._context['filenames']: + if path in self._context['filenames']: origin = '/'.join((siteurl, - self._context['filenames'][value].url)) - origin = origin.replace('\\', '/') # Fow windows paths. + self._context['filenames'][path].url)) + origin = origin.replace('\\', '/') # for Windows paths. else: logger.warning("Unable to find {fn}, skipping url" - " replacement".format(fn=value)) + " replacement".format(fn=path)) elif what == 'category': - origin = Category(value, self.settings).url + origin = Category(path, self.settings).url elif what == 'tag': - origin = Tag(value, self.settings).url + origin = Tag(path, self.settings).url + + # keep all other parts, such as query, fragment, etc. + parts = list(value) + parts[2] = origin + origin = urlparse.urlunparse(parts) return ''.join((m.group('markup'), m.group('quote'), origin, m.group('quote'))) From 5f23aab8072bb28631043e6c0f8585fde6c2dd93 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 24 Sep 2013 21:28:59 +0200 Subject: [PATCH 1014/2344] Change Bumpr test from tox to unittest There are currently some minor problems when running tox that are not present when running "python -m unittest discover". Once those problems have been resolved, we should probably change this setting back to tox. --- bumpr.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumpr.rc b/bumpr.rc index cfc90fd7..fd35b042 100644 --- a/bumpr.rc +++ b/bumpr.rc @@ -4,7 +4,7 @@ vcs = git clean = python setup.py clean rm -rf *egg-info build dist -tests = tox +tests = python -m unittest discover publish = python setup.py sdist register upload files = README.rst From 2f57b86560f93037ead2466016cdd5e358cae872 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 24 Sep 2013 21:37:53 +0200 Subject: [PATCH 1015/2344] Modify sed command in bumpr.rc to support BSD It appears that BSD sed, unlike Linux, has a requirement that you provide an extension to the -i option. So, while Linux allows: sed -i "sed-command" ... to edit in-place, the BSD variant needs to have: sed -i "" "sed-command" i.e., with an empty backup suffix. --- bumpr.rc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bumpr.rc b/bumpr.rc index fd35b042..969fdb24 100644 --- a/bumpr.rc +++ b/bumpr.rc @@ -27,4 +27,4 @@ prepare = Next release url = http://docs.getpelican.com/{tag} [commands] -bump = sed -i "s/last_stable\s*=.*/last_stable = '{version}'/" docs/conf.py +bump = sed -i "" "s/last_stable\s*=.*/last_stable = '{version}'/" docs/conf.py From b35ce43b7fc2cb96d6534dd0392bb41d2de1d933 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 24 Sep 2013 21:57:07 +0200 Subject: [PATCH 1016/2344] Bump version 3.3.0 --- README.rst | 2 +- docs/changelog.rst | 4 ++-- pelican/__init__.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.rst b/README.rst index 20c3f217..278f3a44 100644 --- a/README.rst +++ b/README.rst @@ -61,7 +61,7 @@ client handy, use the webchat_ for quick feedback. .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Markdown: http://daringfireball.net/projects/markdown/ .. _Jinja2: http://jinja.pocoo.org/ -.. _`Pelican documentation`: http://docs.getpelican.com/latest/ +.. _`Pelican documentation`: http://docs.getpelican.com/3.3.0/ .. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html .. _`#pelican on Freenode`: irc://irc.freenode.net/pelican .. _webchat: http://webchat.freenode.net/?channels=pelican&uio=d4 diff --git a/docs/changelog.rst b/docs/changelog.rst index ebf84f34..a5f0c1f3 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,8 +1,8 @@ Release history ############### -Next release -============ +3.3.0 (2013-09-24) +================== * Drop Python 3.2 support in favor of Python 3.3 * Add ``Fabfile`` so Fabric can be used for workflow automation instead of Make diff --git a/pelican/__init__.py b/pelican/__init__.py index cecab54b..9daeed76 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -22,7 +22,7 @@ from pelican.settings import read_settings from pelican.utils import clean_output_dir, folder_watcher, file_watcher from pelican.writers import Writer -__version__ = "3.2.3.dev" +__version__ = "3.3.0" DEFAULT_CONFIG_NAME = 'pelicanconf.py' From 2c468f091a587257f3d455f5727fa4c05cbbca87 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 24 Sep 2013 21:57:28 +0200 Subject: [PATCH 1017/2344] Prepare version 3.3.1.dev for next development cycle --- README.rst | 2 +- docs/changelog.rst | 5 +++++ pelican/__init__.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 278f3a44..20c3f217 100644 --- a/README.rst +++ b/README.rst @@ -61,7 +61,7 @@ client handy, use the webchat_ for quick feedback. .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Markdown: http://daringfireball.net/projects/markdown/ .. _Jinja2: http://jinja.pocoo.org/ -.. _`Pelican documentation`: http://docs.getpelican.com/3.3.0/ +.. _`Pelican documentation`: http://docs.getpelican.com/latest/ .. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html .. _`#pelican on Freenode`: irc://irc.freenode.net/pelican .. _webchat: http://webchat.freenode.net/?channels=pelican&uio=d4 diff --git a/docs/changelog.rst b/docs/changelog.rst index a5f0c1f3..54b0d871 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Release history ############### +Next release +============ + +- Nothing yet + 3.3.0 (2013-09-24) ================== diff --git a/pelican/__init__.py b/pelican/__init__.py index 9daeed76..b3ffe21a 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -22,7 +22,7 @@ from pelican.settings import read_settings from pelican.utils import clean_output_dir, folder_watcher, file_watcher from pelican.writers import Writer -__version__ = "3.3.0" +__version__ = "3.3.1.dev" DEFAULT_CONFIG_NAME = 'pelicanconf.py' From a987b65bd2abe6faa37425c4f061362435125382 Mon Sep 17 00:00:00 2001 From: "M. Utku Altinkaya" Date: Wed, 25 Sep 2013 04:43:06 +0300 Subject: [PATCH 1018/2344] Watch static folders in Autoreload mode --- pelican/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pelican/__init__.py b/pelican/__init__.py index b3ffe21a..5cf89927 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -320,6 +320,9 @@ def main(): pelican.ignore_files), 'settings': file_watcher(args.settings)} + for static_path in settings.get("STATIC_PATHS", []): + watchers[static_path] = file_watcher(static_path) + try: if args.autoreload: print(' --- AutoReload Mode: Monitoring `content`, `theme` and' From 6fb0335269e9d9dbd79c2f4cb020cd9a6b03313a Mon Sep 17 00:00:00 2001 From: Honza Javorek Date: Wed, 25 Sep 2013 11:39:29 +0200 Subject: [PATCH 1019/2344] Attempt to be compilant with Python 3. --- pelican/contents.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 83fbad8f..dbc33716 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -5,12 +5,16 @@ import six import copy import locale import logging -import urlparse import functools import os import re import sys +try: + from urlparse import urlparse, urlunparse +except ImportError: + from urllib.parse import urlparse, urlunparse + from datetime import datetime @@ -195,7 +199,7 @@ class Content(object): def replacer(m): what = m.group('what') - value = urlparse.urlparse(m.group('value')) + value = urlparse(m.group('value')) path = value.path origin = m.group('path') @@ -224,7 +228,7 @@ class Content(object): # keep all other parts, such as query, fragment, etc. parts = list(value) parts[2] = origin - origin = urlparse.urlunparse(parts) + origin = urlunparse(parts) return ''.join((m.group('markup'), m.group('quote'), origin, m.group('quote'))) From 7415d370e6a9c6f9b96da927685ffe9a6bc6eada Mon Sep 17 00:00:00 2001 From: Honza Javorek Date: Wed, 25 Sep 2013 16:13:28 +0200 Subject: [PATCH 1020/2344] Added tests. --- pelican/tests/test_contents.py | 60 ++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 936903c1..2e44253a 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -204,6 +204,66 @@ class TestPage(unittest.TestCase): ('A simple test, with a ' 'link')) + def test_intrasite_link(self): + article = type(b'_DummyArticle', (object,), {'url': 'article.html'}) + + args = self.page_kwargs.copy() + args['settings'] = get_settings() + args['source_path'] = 'content' + args['context']['filenames'] = {'article.rst': article} + + # Classic intrasite link via filename + args['content'] = ( + 'A simple test, with a ' + 'link' + ) + content = Page(**args).get_content('http://notmyidea.org') + self.assertEquals( + content, + 'A simple test, with a ' + 'link' + ) + + # fragment + args['content'] = ( + 'A simple test, with a ' + 'link' + ) + content = Page(**args).get_content('http://notmyidea.org') + self.assertEquals( + content, + 'A simple test, with a ' + 'link' + ) + + # query + args['content'] = ( + 'A simple test, with a ' + 'link' + ) + content = Page(**args).get_content('http://notmyidea.org') + self.assertEquals( + content, + 'A simple test, with a ' + 'link' + ) + + # combination + args['content'] = ( + 'A simple test, with a ' + 'link' + ) + content = Page(**args).get_content('http://notmyidea.org') + self.assertEquals( + content, + 'A simple test, with a ' + 'link' + ) + class TestArticle(TestPage): def test_template(self): From 6ed23fec7dc1c907b9dcc3eb3d08eca61c1bb9b5 Mon Sep 17 00:00:00 2001 From: Honza Javorek Date: Wed, 25 Sep 2013 16:31:23 +0200 Subject: [PATCH 1021/2344] Tuned the tests so they are PY3 compilant. --- pelican/tests/test_contents.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 2e44253a..437d0228 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import six from datetime import datetime from sys import platform @@ -205,7 +206,10 @@ class TestPage(unittest.TestCase): 'link')) def test_intrasite_link(self): - article = type(b'_DummyArticle', (object,), {'url': 'article.html'}) + # type does not take unicode in PY2 and bytes in PY3, which in + # combination with unicode literals leads to following insane line: + cls_name = '_DummyArticle' if six.PY3 else b'_DummyArticle' + article = type(cls_name, (object,), {'url': 'article.html'}) args = self.page_kwargs.copy() args['settings'] = get_settings() From a49b744e951a810040baca27ff04fda23f973e26 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Thu, 26 Sep 2013 00:37:35 +0200 Subject: [PATCH 1022/2344] Fix tests with latest versions of smartypants. smartypants is now py3 compatible but the default settings for double quotes has been changed (http://pythonhosted.org/smartypants/changes.html). This commit: - update the typogrify test (change quotes, and add more test casesi: caps word, ellipsis) - install typogrify on travis - uses upstream version of smartypants in tox instead of dmdm's fork for py3 --- .travis.yml | 2 ++ pelican/tests/content/article.rst | 2 +- pelican/tests/test_readers.py | 13 +++++++------ tox.ini | 1 - 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1df32baa..62373e68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ before_install: - sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 install: - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi + - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install typogrify ; fi + - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then pip install git+https://github.com/dmdm/typogrify.git@py3k#egg=typogrify; fi - pip install mock nose nose-cov Markdown - pip install . script: nosetests -sv --with-coverage --cover-package=pelican pelican diff --git a/pelican/tests/content/article.rst b/pelican/tests/content/article.rst index 7109c29b..793e6869 100644 --- a/pelican/tests/content/article.rst +++ b/pelican/tests/content/article.rst @@ -1,6 +1,6 @@ Article title ############# -This is some content. With some stuff to "typogrify". +THIS is some content. With some stuff to "typogrify"... Now with added support for :abbr:`TLA (three letter acronym)`. diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index b6652d03..841e3d34 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -104,8 +104,8 @@ class RstReaderTest(ReaderTest): # if nothing is specified in the settings, the content should be # unmodified page = self.read_file(path='article.rst') - expected = ('

    This is some content. With some stuff to ' - '"typogrify".

    \n

    Now with added ' + expected = ('

    THIS is some content. With some stuff to ' + '"typogrify"...

    \n

    Now with added ' 'support for ' 'TLA.

    \n') @@ -114,10 +114,11 @@ class RstReaderTest(ReaderTest): try: # otherwise, typogrify should be applied page = self.read_file(path='article.rst', TYPOGRIFY=True) - expected = ('

    This is some content. With some stuff to ' - '“typogrify”.

    \n

    Now with added ' - 'support for ' - 'TLA.

    \n') + expected = ( + '

    THIS is some content. ' + 'With some stuff to "typogrify"…

    \n' + '

    Now with added support for TLA.

    \n') self.assertEqual(page.content, expected) except ImportError: diff --git a/tox.ini b/tox.ini index 8763c963..440216cf 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,5 @@ deps = mock Markdown BeautifulSoup4 - git+https://github.com/dmdm/smartypants.git#egg=smartypants git+https://github.com/dmdm/typogrify.git@py3k#egg=typogrify lxml From cb82e486369479432624b293aa1176f11c11f074 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 4 Oct 2013 16:23:19 +0200 Subject: [PATCH 1023/2344] None, not False, in *_SAVE_AS docs. Fixes #1106. --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index b6c18fa9..82752436 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -278,7 +278,7 @@ Setting name (default value) What does it do? If you do not want one or more of the default pages to be created (e.g., you are the only author on your site and thus do not need an Authors page), - set the corresponding ``*_SAVE_AS`` setting to ``False`` to prevent the + set the corresponding ``*_SAVE_AS`` setting to ``None`` to prevent the relevant page from being generated. Timezone From 9657071301ffb7029d17a675f9544e7ec458b202 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 6 Oct 2013 15:30:14 +0200 Subject: [PATCH 1024/2344] Python 3.3 got mock --- pelican/tests/test_generators.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index f47ce7d3..e821bb86 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -3,7 +3,10 @@ from __future__ import unicode_literals import os from codecs import open -from mock import MagicMock +try: + from unittest.mock import MagicMock +except ImportError: + from mock import MagicMock from shutil import rmtree from tempfile import mkdtemp From 67d3ab8883ba072cc10da214db25dceedb0000a1 Mon Sep 17 00:00:00 2001 From: Tshepang Lekhonkhobe Date: Sun, 6 Oct 2013 16:15:43 +0200 Subject: [PATCH 1025/2344] assertEquals is deprecated in favor of assertEqual --- pelican/tests/test_contents.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 437d0228..9c894ffc 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -193,17 +193,17 @@ class TestPage(unittest.TestCase): 'link') page = Page(**args) content = page.get_content('http://notmyidea.org') - self.assertEquals(content, ('A simple test, with a ' - 'link')) + self.assertEqual(content, ('A simple test, with a ' + 'link')) # Category args['content'] = ('A simple test, with a ' 'link') page = Page(**args) content = page.get_content('http://notmyidea.org') - self.assertEquals(content, - ('A simple test, with a ' - 'link')) + self.assertEqual(content, + ('A simple test, with a ' + 'link')) def test_intrasite_link(self): # type does not take unicode in PY2 and bytes in PY3, which in @@ -222,7 +222,7 @@ class TestPage(unittest.TestCase): 'link' ) content = Page(**args).get_content('http://notmyidea.org') - self.assertEquals( + self.assertEqual( content, 'A simple test, with a ' 'link' @@ -234,7 +234,7 @@ class TestPage(unittest.TestCase): 'link' ) content = Page(**args).get_content('http://notmyidea.org') - self.assertEquals( + self.assertEqual( content, 'A simple test, with a ' 'link' @@ -247,7 +247,7 @@ class TestPage(unittest.TestCase): '?utm_whatever=234&highlight=word">link' ) content = Page(**args).get_content('http://notmyidea.org') - self.assertEquals( + self.assertEqual( content, 'A simple test, with a ' 'link' ) content = Page(**args).get_content('http://notmyidea.org') - self.assertEquals( + self.assertEqual( content, 'A simple test, with a ' ' Date: Tue, 8 Oct 2013 13:20:56 +0200 Subject: [PATCH 1027/2344] Add Tumblr and Posterous to importer description --- pelican/tools/pelican_import.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 8cc5b083..69e1f1b4 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -98,7 +98,7 @@ def decode_wp_content(content, br=True): def wp2fields(xml): - """Opens a wordpress XML file, and yield pelican fields""" + """Opens a wordpress XML file, and yield Pelican fields""" try: from bs4 import BeautifulSoup except ImportError: @@ -551,8 +551,9 @@ def fields2pelican(fields, out_markup, output_path, def main(): parser = argparse.ArgumentParser( - description="Transform feed, Wordpress or Dotclear files to reST (rst) " - "or Markdown (md) files. Be sure to have pandoc installed.", + description="Transform feed, WordPress, Tumblr, Dotclear, or Posterous " + "files into reST (rst) or Markdown (md) files. Be sure to " + "have pandoc installed.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument(dest='input', help='The input file to read') From 00150f3556b99f68ef8290bd65d1e7865d9a278e Mon Sep 17 00:00:00 2001 From: David Branner Date: Wed, 9 Oct 2013 11:53:11 -0400 Subject: [PATCH 1028/2344] xml => lxml for bs4, in pelican-import.wp2fields() --- pelican/tools/pelican_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 69e1f1b4..54a2be2f 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -109,7 +109,7 @@ def wp2fields(xml): with open(xml, encoding='utf-8') as infile: xmlfile = infile.read() - soup = BeautifulSoup(xmlfile, "xml") + soup = BeautifulSoup(xmlfile, "lxml") items = soup.rss.channel.findAll('item') for item in items: From 6dafe69ac66a9732c4bb5bbcb889bb297e9e4964 Mon Sep 17 00:00:00 2001 From: Torrance Date: Thu, 10 Oct 2013 14:29:42 +1300 Subject: [PATCH 1029/2344] Ensure headers from base.html are included. --- pelican/themes/simple/templates/article.html | 1 + 1 file changed, 1 insertion(+) diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index 5025a5e7..79124725 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -1,5 +1,6 @@ {% extends "base.html" %} {% block head %} + {{ super() }} {% for keyword in article.keywords %} {% endfor %} From caa833877dc11362090c97552135668240b0b588 Mon Sep 17 00:00:00 2001 From: Adrien Oliva Date: Fri, 11 Oct 2013 15:52:47 +0200 Subject: [PATCH 1030/2344] Change StandardError to RuntimeError Since built-in exception "StandardError" does not exist in the latest python version (at least in version 3.3), use RuntimeError instead (which exists from python2.6 to python3.4) --- pelican/writers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/writers.py b/pelican/writers.py index da105929..6cf5232d 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -60,7 +60,7 @@ class Writer(object): """ if filename in self._overridden_files: if override: - raise StandardError('File %s is set to be overridden twice' + raise RuntimeError('File %s is set to be overridden twice' % filename) else: logger.info('skipping %s' % filename) @@ -69,7 +69,7 @@ class Writer(object): if override: logger.info('overwriting %s' % filename) else: - raise StandardError('File %s is to be overwritten' % filename) + raise RuntimeError('File %s is to be overwritten' % filename) if override: self._overridden_files.add(filename) self._written_files.add(filename) From 2b5db0321b021e54f8a966c1aa01a1f8f34d9ddd Mon Sep 17 00:00:00 2001 From: Jed Brown Date: Fri, 11 Oct 2013 22:28:43 -0500 Subject: [PATCH 1031/2344] docs/plugins.rst: fix signal name "page_generator_context" The old "pages_generate_context" dates from before pelican-3.2 standardization, but AFAIK, "page_generate_context" was never correct. --- docs/plugins.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 6de01d05..5e311fb6 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -80,7 +80,7 @@ article_generator_finalized article_generator invoked at the e get_generators generators invoked in Pelican.get_generator_classes, can return a Generator, or several generator in a tuple or in a list. -page_generate_context page_generator, metadata +page_generator_context page_generator, metadata page_generator_init page_generator invoked in the PagesGenerator.__init__ page_generator_finalized page_generator invoked at the end of PagesGenerator.generate_context content_object_init content_object invoked at the end of Content.__init__ (see note below) From eb6d4bb0087bcc218795625ee3bfe5a6d230dc75 Mon Sep 17 00:00:00 2001 From: zhouji Date: Tue, 15 Oct 2013 10:37:03 +0800 Subject: [PATCH 1032/2344] Preserve file metadata (esp. timestamps) when copy static files to output folder. --- pelican/generators.py | 2 +- pelican/utils.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index d695c7c8..c55cdc37 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -573,7 +573,7 @@ class StaticGenerator(Generator): source_path = os.path.join(self.path, sc.source_path) save_as = os.path.join(self.output_path, sc.save_as) mkdir_p(os.path.dirname(save_as)) - shutil.copy(source_path, save_as) + shutil.copy2(source_path, save_as) logger.info('copying {} to {}'.format(sc.source_path, sc.save_as)) diff --git a/pelican/utils.py b/pelican/utils.py index f222f63c..4b25ec7f 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -289,7 +289,7 @@ def copy(path, source, destination, destination_path=None): else: shutil.copytree(entry_path, entry_dest) else: - shutil.copy(entry_path, destination) + shutil.copy2(entry_path, destination) if os.path.isdir(source_): @@ -299,7 +299,7 @@ def copy(path, source, destination, destination_path=None): dest_dir = os.path.dirname(destination_) if not os.path.exists(dest_dir): os.makedirs(dest_dir) - shutil.copy(source_, destination_) + shutil.copy2(source_, destination_) logger.info('copying %s to %s' % (source_, destination_)) else: logger.warning('skipped copy %s to %s' % (source_, destination_)) From 04dba17b800b7c67e43706a8a164ebf697bba10f Mon Sep 17 00:00:00 2001 From: zhouji Date: Wed, 16 Oct 2013 17:06:56 +0800 Subject: [PATCH 1033/2344] Fix #1117 Make intra-link support all url-value HTML attributes. --- pelican/contents.py | 58 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 55 insertions(+), 3 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index dbc33716..39322e99 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -125,6 +125,52 @@ class Content(object): if 'summary' in metadata: self._summary = metadata['summary'] + # prepare the list of HTML tag attributes which have a URL value. + # refer: http://stackoverflow.com/questions/2725156/complete-list-of-html-tag-attributes-which-have-a-url-value + self._url_attributes = { # each item in this set is a tuple composed by tag_name, attr_name + # HTML4 tags + ('a', 'href'), + ('applet', 'codebase'), + ('area', 'href'), + ('base', 'href'), + ('blockquote', 'cite'), + ('body', 'background'), + ('del', 'cite'), + ('form', 'action'), + ('frame', 'longdesc'), + ('frame', 'src'), + ('head', 'profile'), + ('iframe', 'longdesc'), + ('iframe', 'src'), + ('img', 'longdesc'), + ('img', 'src'), + ('img', 'usemap'), + ('input', 'src'), + ('input', 'usemap'), + ('ins', 'cite'), + ('link', 'href'), + ('object', 'classid'), + ('object', 'codebase'), + ('object', 'data'), + ('object', 'usemap'), + ('q', 'cite'), + ('script', 'src'), + + # HTML5 tags + ('audio', 'src'), + ('button', 'formaction'), + ('command', 'icon'), + ('embed', 'src'), + ('html', 'manifest'), + ('input', 'formaction'), + ('source', 'src'), + ('video', 'poster'), + ('video', 'src'), + } + """:type: set of (tuple of (string, string)""" + attribute_names = set(pair[1] for pair in self._url_attributes) + self._url_attr_pattern = '|'.join(attribute_names) + signals.content_object_init.send(self) def __str__(self): @@ -189,12 +235,12 @@ class Content(object): instrasite_link_regex = self.settings['INTRASITE_LINK_REGEX'] regex = r""" - (?P<\s*[^\>]* # match tag with src and href attr - (?:href|src)\s*=) + (?P<\s*(?P[^\s\>]+)[^\>]* # match tag with all url-value attributes + (?P{1})\s*=) (?P["\']) # require value to be quoted (?P{0}(?P.*?)) # the url value - \2""".format(instrasite_link_regex) + \4""".format(instrasite_link_regex, self._url_attr_pattern) hrefs = re.compile(regex, re.X) def replacer(m): @@ -203,6 +249,12 @@ class Content(object): path = value.path origin = m.group('path') + # verify HTML tag and attribute pair to avoid miss-replacing + tag = m.group('tag') + attr = m.group('attr') + if attr != 'href' and attr != 'src' and (tag, attr) not in self._url_attributes: + return m.group(0) + # XXX Put this in a different location. if what == 'filename': if path.startswith('/'): From e538aa2cdeb4eed2df40bcf0a414c0930ab05e25 Mon Sep 17 00:00:00 2001 From: zhouji Date: Thu, 17 Oct 2013 11:33:34 +0800 Subject: [PATCH 1034/2344] Fine-tune url-value HTML attributes list. --- pelican/contents.py | 58 ++-------------------------------- pelican/tests/test_contents.py | 55 ++++++++++++++++++++++++++++++++ 2 files changed, 58 insertions(+), 55 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 39322e99..059c54a7 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -125,52 +125,6 @@ class Content(object): if 'summary' in metadata: self._summary = metadata['summary'] - # prepare the list of HTML tag attributes which have a URL value. - # refer: http://stackoverflow.com/questions/2725156/complete-list-of-html-tag-attributes-which-have-a-url-value - self._url_attributes = { # each item in this set is a tuple composed by tag_name, attr_name - # HTML4 tags - ('a', 'href'), - ('applet', 'codebase'), - ('area', 'href'), - ('base', 'href'), - ('blockquote', 'cite'), - ('body', 'background'), - ('del', 'cite'), - ('form', 'action'), - ('frame', 'longdesc'), - ('frame', 'src'), - ('head', 'profile'), - ('iframe', 'longdesc'), - ('iframe', 'src'), - ('img', 'longdesc'), - ('img', 'src'), - ('img', 'usemap'), - ('input', 'src'), - ('input', 'usemap'), - ('ins', 'cite'), - ('link', 'href'), - ('object', 'classid'), - ('object', 'codebase'), - ('object', 'data'), - ('object', 'usemap'), - ('q', 'cite'), - ('script', 'src'), - - # HTML5 tags - ('audio', 'src'), - ('button', 'formaction'), - ('command', 'icon'), - ('embed', 'src'), - ('html', 'manifest'), - ('input', 'formaction'), - ('source', 'src'), - ('video', 'poster'), - ('video', 'src'), - } - """:type: set of (tuple of (string, string)""" - attribute_names = set(pair[1] for pair in self._url_attributes) - self._url_attr_pattern = '|'.join(attribute_names) - signals.content_object_init.send(self) def __str__(self): @@ -235,12 +189,12 @@ class Content(object): instrasite_link_regex = self.settings['INTRASITE_LINK_REGEX'] regex = r""" - (?P<\s*(?P[^\s\>]+)[^\>]* # match tag with all url-value attributes - (?P{1})\s*=) + (?P<\s*[^\>]* # match tag with all url-value attributes + (?:href|src|poster|data|cite|formaction|action)\s*=) (?P["\']) # require value to be quoted (?P{0}(?P.*?)) # the url value - \4""".format(instrasite_link_regex, self._url_attr_pattern) + \2""".format(instrasite_link_regex) hrefs = re.compile(regex, re.X) def replacer(m): @@ -249,12 +203,6 @@ class Content(object): path = value.path origin = m.group('path') - # verify HTML tag and attribute pair to avoid miss-replacing - tag = m.group('tag') - attr = m.group('attr') - if attr != 'href' and attr != 'src' and (tag, attr) not in self._url_attributes: - return m.group(0) - # XXX Put this in a different location. if what == 'filename': if path.startswith('/'): diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 9c894ffc..92e61355 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -268,6 +268,61 @@ class TestPage(unittest.TestCase): '?utm_whatever=234&highlight=word#section-2">link' ) + def test_intrasite_link_more(self): + # type does not take unicode in PY2 and bytes in PY3, which in + # combination with unicode literals leads to following insane line: + cls_name = '_DummyAsset' if six.PY3 else b'_DummyAsset' + + args = self.page_kwargs.copy() + args['settings'] = get_settings() + args['source_path'] = 'content' + args['context']['filenames'] = { + 'images/poster.jpg': type(cls_name, (object,), {'url': 'images/poster.jpg'}), + 'assets/video.mp4': type(cls_name, (object,), {'url': 'assets/video.mp4'}), + 'images/graph.svg': type(cls_name, (object,), {'url': 'images/graph.svg'}), + 'reference.rst': type(cls_name, (object,), {'url': 'reference.html'}), + } + + # video.poster + args['content'] = ( + 'There is a video with poster ' + '' + ) + content = Page(**args).get_content('http://notmyidea.org') + self.assertEqual( + content, + 'There is a video with poster ' + '' + ) + + # object.data + args['content'] = ( + 'There is a svg object ' + '' + ) + content = Page(**args).get_content('http://notmyidea.org') + self.assertEqual( + content, + 'There is a svg object ' + '' + ) + + # blockquote.cite + args['content'] = ( + 'There is a blockquote with cite attribute ' + '
    blah blah
    ' + ) + content = Page(**args).get_content('http://notmyidea.org') + self.assertEqual( + content, + 'There is a blockquote with cite attribute ' + '
    blah blah
    ' + ) + class TestArticle(TestPage): def test_template(self): From ae2afa27fc6841a9785f13f14bfd17bebbd1f516 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 19 Oct 2013 17:20:13 +0200 Subject: [PATCH 1035/2344] Clarify FAQ entry re: need to install Markdown Folks keep running into this error, which probably signals a need to change this behavior. After all, it wouldn't be hard for us to detect what's going on and provide a better error message, such as: "It looks like you're trying to process Markdown, but the Markdown library is not currently installed. Please install the Python-Markdown library via 'pip install markdown'." Until we implement something akin to the above, this should serve as a slightly-improved FAQ entry in the interim. --- docs/faq.rst | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index da37af04..80e14d21 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -65,12 +65,13 @@ How do I create my own theme? Please refer to :ref:`theming-pelican`. -I want to use Markdown, but I got an error. -=========================================== +I'm using Markdown and getting ``No valid files found in content`` errors. +========================================================================== -Markdown is not a hard dependency for Pelican, so you will need to explicitly -install it. You can do so by typing the following command, prepending ``sudo`` -if permissions require it:: +Markdown is not a hard dependency for Pelican, so if you have content in +Markdown format, you will need to explicitly install the Markdown library. +You can do so by typing the following command, prepending ``sudo`` if +permissions require it:: pip install markdown From 9331e42ee10c0a3537d93b000c0a41508758d401 Mon Sep 17 00:00:00 2001 From: Jon Chen Date: Thu, 24 Oct 2013 14:36:03 -0400 Subject: [PATCH 1036/2344] use // instead of explicitly defining http for twitter as well update sample output --- pelican/tests/output/custom/a-markdown-powered-article.html | 4 ++-- pelican/tests/output/custom/archives.html | 2 +- pelican/tests/output/custom/article-1.html | 4 ++-- pelican/tests/output/custom/article-2.html | 4 ++-- pelican/tests/output/custom/article-3.html | 4 ++-- pelican/tests/output/custom/author/alexis-metaireau.html | 2 +- pelican/tests/output/custom/author/alexis-metaireau2.html | 2 +- pelican/tests/output/custom/author/alexis-metaireau3.html | 2 +- pelican/tests/output/custom/authors.html | 2 +- pelican/tests/output/custom/categories.html | 2 +- pelican/tests/output/custom/category/bar.html | 2 +- pelican/tests/output/custom/category/cat1.html | 2 +- pelican/tests/output/custom/category/misc.html | 2 +- pelican/tests/output/custom/category/yeah.html | 2 +- pelican/tests/output/custom/drafts/a-draft-article.html | 2 +- pelican/tests/output/custom/filename_metadata-example.html | 4 ++-- pelican/tests/output/custom/index.html | 2 +- pelican/tests/output/custom/index2.html | 2 +- pelican/tests/output/custom/index3.html | 2 +- pelican/tests/output/custom/jinja2_template.html | 2 +- pelican/tests/output/custom/oh-yeah-fr.html | 4 ++-- pelican/tests/output/custom/oh-yeah.html | 4 ++-- pelican/tests/output/custom/override/index.html | 2 +- .../tests/output/custom/pages/this-is-a-test-hidden-page.html | 2 +- pelican/tests/output/custom/pages/this-is-a-test-page.html | 2 +- pelican/tests/output/custom/second-article-fr.html | 4 ++-- pelican/tests/output/custom/second-article.html | 4 ++-- pelican/tests/output/custom/tag/bar.html | 2 +- pelican/tests/output/custom/tag/baz.html | 4 ++-- pelican/tests/output/custom/tag/foo.html | 2 +- pelican/tests/output/custom/tag/foobar.html | 2 +- pelican/tests/output/custom/tag/oh.html | 2 +- pelican/tests/output/custom/tag/yeah.html | 2 +- pelican/tests/output/custom/tags.html | 2 +- pelican/tests/output/custom/this-is-a-super-article.html | 4 ++-- pelican/tests/output/custom/unbelievable.html | 4 ++-- pelican/themes/notmyidea/templates/article.html | 2 +- pelican/themes/notmyidea/templates/disqus_script.html | 2 +- pelican/themes/notmyidea/templates/twitter.html | 4 ++-- 39 files changed, 52 insertions(+), 52 deletions(-) diff --git a/pelican/tests/output/custom/a-markdown-powered-article.html b/pelican/tests/output/custom/a-markdown-powered-article.html index 4d1fe16f..515b0298 100644 --- a/pelican/tests/output/custom/a-markdown-powered-article.html +++ b/pelican/tests/output/custom/a-markdown-powered-article.html @@ -59,7 +59,7 @@ var disqus_url = "./a-markdown-powered-article.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -105,7 +105,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/archives.html b/pelican/tests/output/custom/archives.html index a2ab7430..13c3d980 100644 --- a/pelican/tests/output/custom/archives.html +++ b/pelican/tests/output/custom/archives.html @@ -92,7 +92,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/article-1.html b/pelican/tests/output/custom/article-1.html index 89e12914..6faed3be 100644 --- a/pelican/tests/output/custom/article-1.html +++ b/pelican/tests/output/custom/article-1.html @@ -58,7 +58,7 @@ var disqus_url = "./article-1.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -104,7 +104,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/article-2.html b/pelican/tests/output/custom/article-2.html index 1113e5e8..d1e89db8 100644 --- a/pelican/tests/output/custom/article-2.html +++ b/pelican/tests/output/custom/article-2.html @@ -58,7 +58,7 @@ var disqus_url = "./article-2.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -104,7 +104,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/article-3.html b/pelican/tests/output/custom/article-3.html index c7306605..5c287a13 100644 --- a/pelican/tests/output/custom/article-3.html +++ b/pelican/tests/output/custom/article-3.html @@ -58,7 +58,7 @@ var disqus_url = "./article-3.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -104,7 +104,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/author/alexis-metaireau.html b/pelican/tests/output/custom/author/alexis-metaireau.html index d2350bd5..19c254a0 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau.html +++ b/pelican/tests/output/custom/author/alexis-metaireau.html @@ -165,7 +165,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/author/alexis-metaireau2.html b/pelican/tests/output/custom/author/alexis-metaireau2.html index 91ef0696..772d2939 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau2.html +++ b/pelican/tests/output/custom/author/alexis-metaireau2.html @@ -175,7 +175,7 @@ YEAH !

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/author/alexis-metaireau3.html b/pelican/tests/output/custom/author/alexis-metaireau3.html index 77c9cdfe..f3d985c3 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom/author/alexis-metaireau3.html @@ -130,7 +130,7 @@ pelican.conf, it ...

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/authors.html b/pelican/tests/output/custom/authors.html index adb3d992..eb2becfd 100644 --- a/pelican/tests/output/custom/authors.html +++ b/pelican/tests/output/custom/authors.html @@ -71,7 +71,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/categories.html b/pelican/tests/output/custom/categories.html index 5d839648..17d9de76 100644 --- a/pelican/tests/output/custom/categories.html +++ b/pelican/tests/output/custom/categories.html @@ -72,7 +72,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/category/bar.html b/pelican/tests/output/custom/category/bar.html index 3f1bbc4a..30545518 100644 --- a/pelican/tests/output/custom/category/bar.html +++ b/pelican/tests/output/custom/category/bar.html @@ -95,7 +95,7 @@ YEAH !

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/category/cat1.html b/pelican/tests/output/custom/category/cat1.html index 81718322..9a737b76 100644 --- a/pelican/tests/output/custom/category/cat1.html +++ b/pelican/tests/output/custom/category/cat1.html @@ -162,7 +162,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html index 36479803..b70afcdf 100644 --- a/pelican/tests/output/custom/category/misc.html +++ b/pelican/tests/output/custom/category/misc.html @@ -173,7 +173,7 @@ pelican.conf, it ...

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/category/yeah.html b/pelican/tests/output/custom/category/yeah.html index 53666b0b..02d07413 100644 --- a/pelican/tests/output/custom/category/yeah.html +++ b/pelican/tests/output/custom/category/yeah.html @@ -99,7 +99,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/drafts/a-draft-article.html b/pelican/tests/output/custom/drafts/a-draft-article.html index b8306208..440780a3 100644 --- a/pelican/tests/output/custom/drafts/a-draft-article.html +++ b/pelican/tests/output/custom/drafts/a-draft-article.html @@ -92,7 +92,7 @@ listed anywhere else.

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/filename_metadata-example.html b/pelican/tests/output/custom/filename_metadata-example.html index fcbda9c2..1252aba8 100644 --- a/pelican/tests/output/custom/filename_metadata-example.html +++ b/pelican/tests/output/custom/filename_metadata-example.html @@ -58,7 +58,7 @@ var disqus_url = "./filename_metadata-example.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -104,7 +104,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/index.html b/pelican/tests/output/custom/index.html index 3fa1d5c3..c7174715 100644 --- a/pelican/tests/output/custom/index.html +++ b/pelican/tests/output/custom/index.html @@ -165,7 +165,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/index2.html b/pelican/tests/output/custom/index2.html index 8769d098..b349b3ca 100644 --- a/pelican/tests/output/custom/index2.html +++ b/pelican/tests/output/custom/index2.html @@ -175,7 +175,7 @@ YEAH !

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/index3.html b/pelican/tests/output/custom/index3.html index b4d9ffc6..c668dba6 100644 --- a/pelican/tests/output/custom/index3.html +++ b/pelican/tests/output/custom/index3.html @@ -130,7 +130,7 @@ pelican.conf, it ...

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/jinja2_template.html b/pelican/tests/output/custom/jinja2_template.html index 31beac32..0eafa913 100644 --- a/pelican/tests/output/custom/jinja2_template.html +++ b/pelican/tests/output/custom/jinja2_template.html @@ -69,7 +69,7 @@ Some text (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/oh-yeah-fr.html b/pelican/tests/output/custom/oh-yeah-fr.html index 410c721f..4450514a 100644 --- a/pelican/tests/output/custom/oh-yeah-fr.html +++ b/pelican/tests/output/custom/oh-yeah-fr.html @@ -60,7 +60,7 @@ Translations: var disqus_url = "./oh-yeah-fr.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -106,7 +106,7 @@ Translations: (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/oh-yeah.html b/pelican/tests/output/custom/oh-yeah.html index dab28171..95cf0317 100644 --- a/pelican/tests/output/custom/oh-yeah.html +++ b/pelican/tests/output/custom/oh-yeah.html @@ -65,7 +65,7 @@ YEAH !

    var disqus_url = "./oh-yeah.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -111,7 +111,7 @@ YEAH !

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/override/index.html b/pelican/tests/output/custom/override/index.html index 9c48d76f..e84d79fe 100644 --- a/pelican/tests/output/custom/override/index.html +++ b/pelican/tests/output/custom/override/index.html @@ -73,7 +73,7 @@ at a custom location.

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/pages/this-is-a-test-hidden-page.html b/pelican/tests/output/custom/pages/this-is-a-test-hidden-page.html index a061b7ee..dced8107 100644 --- a/pelican/tests/output/custom/pages/this-is-a-test-hidden-page.html +++ b/pelican/tests/output/custom/pages/this-is-a-test-hidden-page.html @@ -73,7 +73,7 @@ Anyone can see this page but it's not linked to anywhere!

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/pages/this-is-a-test-page.html b/pelican/tests/output/custom/pages/this-is-a-test-page.html index af50adf8..46ea4fef 100644 --- a/pelican/tests/output/custom/pages/this-is-a-test-page.html +++ b/pelican/tests/output/custom/pages/this-is-a-test-page.html @@ -73,7 +73,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/second-article-fr.html b/pelican/tests/output/custom/second-article-fr.html index cbeef437..b4a04ee8 100644 --- a/pelican/tests/output/custom/second-article-fr.html +++ b/pelican/tests/output/custom/second-article-fr.html @@ -60,7 +60,7 @@ var disqus_url = "./second-article-fr.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -106,7 +106,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/second-article.html b/pelican/tests/output/custom/second-article.html index 57009066..04f038c8 100644 --- a/pelican/tests/output/custom/second-article.html +++ b/pelican/tests/output/custom/second-article.html @@ -60,7 +60,7 @@ var disqus_url = "./second-article.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -106,7 +106,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/tag/bar.html b/pelican/tests/output/custom/tag/bar.html index 9560b712..7a90eff2 100644 --- a/pelican/tests/output/custom/tag/bar.html +++ b/pelican/tests/output/custom/tag/bar.html @@ -148,7 +148,7 @@ YEAH !

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/tag/baz.html b/pelican/tests/output/custom/tag/baz.html index c6ebe542..f794b351 100644 --- a/pelican/tests/output/custom/tag/baz.html +++ b/pelican/tests/output/custom/tag/baz.html @@ -58,7 +58,7 @@ var disqus_url = "../tag/baz.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -104,7 +104,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/tag/foo.html b/pelican/tests/output/custom/tag/foo.html index d5b0d413..d99df63b 100644 --- a/pelican/tests/output/custom/tag/foo.html +++ b/pelican/tests/output/custom/tag/foo.html @@ -118,7 +118,7 @@ as well as inline markup.

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/tag/foobar.html b/pelican/tests/output/custom/tag/foobar.html index 0b4d2471..ded91f12 100644 --- a/pelican/tests/output/custom/tag/foobar.html +++ b/pelican/tests/output/custom/tag/foobar.html @@ -99,7 +99,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/tag/oh.html b/pelican/tests/output/custom/tag/oh.html index 3b30a39c..21c8e352 100644 --- a/pelican/tests/output/custom/tag/oh.html +++ b/pelican/tests/output/custom/tag/oh.html @@ -72,7 +72,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/tag/yeah.html b/pelican/tests/output/custom/tag/yeah.html index a6764575..523358b5 100644 --- a/pelican/tests/output/custom/tag/yeah.html +++ b/pelican/tests/output/custom/tag/yeah.html @@ -95,7 +95,7 @@ YEAH !

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/tags.html b/pelican/tests/output/custom/tags.html index bc9b9d20..2e70c9e8 100644 --- a/pelican/tests/output/custom/tags.html +++ b/pelican/tests/output/custom/tags.html @@ -76,7 +76,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/this-is-a-super-article.html b/pelican/tests/output/custom/this-is-a-super-article.html index 0a580e25..d251b0ec 100644 --- a/pelican/tests/output/custom/this-is-a-super-article.html +++ b/pelican/tests/output/custom/this-is-a-super-article.html @@ -69,7 +69,7 @@ var disqus_url = "./this-is-a-super-article.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -115,7 +115,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/tests/output/custom/unbelievable.html b/pelican/tests/output/custom/unbelievable.html index 03b533bb..0d87bbf6 100644 --- a/pelican/tests/output/custom/unbelievable.html +++ b/pelican/tests/output/custom/unbelievable.html @@ -90,7 +90,7 @@ pelican.conf, it will have nothing in default.

    var disqus_url = "./unbelievable.html"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://blog-notmyidea.disqus.com/embed.js'; + dsq.src = '//blog-notmyidea.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); @@ -136,7 +136,7 @@ pelican.conf, it will have nothing in default.

    (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/themes/notmyidea/templates/article.html b/pelican/themes/notmyidea/templates/article.html index 516fd3b5..367222b2 100644 --- a/pelican/themes/notmyidea/templates/article.html +++ b/pelican/themes/notmyidea/templates/article.html @@ -23,7 +23,7 @@ var disqus_url = "{{ SITEURL }}/{{ article.url }}"; (function() { var dsq = document.createElement('script'); dsq.type = 'text/javascript'; dsq.async = true; - dsq.src = 'http://{{ DISQUS_SITENAME }}.disqus.com/embed.js'; + dsq.src = '//{{ DISQUS_SITENAME }}.disqus.com/embed.js'; (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(dsq); })(); diff --git a/pelican/themes/notmyidea/templates/disqus_script.html b/pelican/themes/notmyidea/templates/disqus_script.html index c4f442c8..4ee419bb 100644 --- a/pelican/themes/notmyidea/templates/disqus_script.html +++ b/pelican/themes/notmyidea/templates/disqus_script.html @@ -4,7 +4,7 @@ (function () { var s = document.createElement('script'); s.async = true; s.type = 'text/javascript'; - s.src = 'http://' + disqus_shortname + '.disqus.com/count.js'; + s.src = '//' + disqus_shortname + '.disqus.com/count.js'; (document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s); }()); diff --git a/pelican/themes/notmyidea/templates/twitter.html b/pelican/themes/notmyidea/templates/twitter.html index c6b159f4..7247a0c6 100644 --- a/pelican/themes/notmyidea/templates/twitter.html +++ b/pelican/themes/notmyidea/templates/twitter.html @@ -1,3 +1,3 @@ {% if TWITTER_USERNAME %} - -{% endif %} \ No newline at end of file + +{% endif %} From 6c808e426fe5287b49fdd6a56067aa90eaaba963 Mon Sep 17 00:00:00 2001 From: Kevin Deldycke Date: Mon, 21 Oct 2013 23:38:25 +0200 Subject: [PATCH 1037/2344] Document video support in Markdown and reST. --- THANKS | 1 + docs/tips.rst | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/THANKS b/THANKS index e4eed231..1d867471 100644 --- a/THANKS +++ b/THANKS @@ -88,6 +88,7 @@ Joseph Reagle Joshua Adelman Julian Berman Justin Mayer +Kevin Deldycke Kyle Fuller Laureline Guerin Leonard Huang diff --git a/docs/tips.rst b/docs/tips.rst index 7629481f..b140ea3c 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -94,3 +94,8 @@ directly into your source content. Alternatively, you can also use Pelican plugins like ``liquid_tags``, ``pelican_youtube``, or ``pelican_vimeo`` to embed videos in your content. + +Moreover, markup languages like reST and Markdown have plugins that let you +embed videos in the markup. You can use `reST video directive +`_ for reST or `mdx_video plugin +`_ for Markdown. From 5e5510cfcf65b873881d9e08adcb54ac1db9c730 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 27 Oct 2013 09:27:30 -0700 Subject: [PATCH 1038/2344] Improve Disqus embed code in notmyidea theme According to Disqus, the disqus_shortname variable is a required field. Also added a
    -

    Authors on A Pelican Blog

  • Alexis Métaireau (2)
  • +

    Authors on A Pelican Blog

    +
    @@ -48,4 +51,4 @@ - \ No newline at end of file + diff --git a/pelican/tests/output/basic/tags.html b/pelican/tests/output/basic/tags.html index 8172f6ae..0eda47d7 100644 --- a/pelican/tests/output/basic/tags.html +++ b/pelican/tests/output/basic/tags.html @@ -26,12 +26,15 @@
    -

    Tags for A Pelican Blog

  • bar (3)
  • +

    Tags for A Pelican Blog

    +
    @@ -53,4 +56,4 @@ - \ No newline at end of file + diff --git a/pelican/tests/output/custom/authors.html b/pelican/tests/output/custom/authors.html index eb2becfd..d9aaef34 100644 --- a/pelican/tests/output/custom/authors.html +++ b/pelican/tests/output/custom/authors.html @@ -30,7 +30,10 @@
    -

    Authors on Alexis' log

  • Alexis Métaireau (10)
  • +

    Authors on Alexis' log

    +
    @@ -76,4 +79,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/tags.html b/pelican/tests/output/custom/tags.html index 2e70c9e8..ba8d53a4 100644 --- a/pelican/tests/output/custom/tags.html +++ b/pelican/tests/output/custom/tags.html @@ -30,12 +30,15 @@
    -

    Tags for Alexis' log

  • bar (3)
  • +

    Tags for Alexis' log

    +
    @@ -81,4 +84,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/themes/notmyidea/templates/authors.html b/pelican/themes/notmyidea/templates/authors.html index b145902e..e61a332f 100644 --- a/pelican/themes/notmyidea/templates/authors.html +++ b/pelican/themes/notmyidea/templates/authors.html @@ -6,9 +6,11 @@

    Authors on {{ SITENAME }}

    - {%- for author, articles in authors|sort %} +
      + {% for author, articles in authors|sort %}
    • {{ author }} ({{ articles|count }})
    • {% endfor %} +
    {% endblock %} diff --git a/pelican/themes/notmyidea/templates/tags.html b/pelican/themes/notmyidea/templates/tags.html index 76955f27..fb099557 100644 --- a/pelican/themes/notmyidea/templates/tags.html +++ b/pelican/themes/notmyidea/templates/tags.html @@ -6,10 +6,11 @@

    Tags for {{ SITENAME }}

    - - {%- for tag, articles in tags|sort %} +
      + {% for tag, articles in tags|sort %}
    • {{ tag }} ({{ articles|count }})
    • {% endfor %} +
    {% endblock %} From cff9d0aa5832e2d4c296a8c9b34ac5f88c9b0d3d Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Wed, 12 Feb 2014 12:42:27 +0100 Subject: [PATCH 1104/2344] Fix stray and
    if only one article is displayed. We already check if loop.length > 1 before outputting
    and
      tags, but we neglected to do the same check when outputting the corresponding end tags. Also, since I had to read the code when I touched it, simplified a conditional: if (a) if (a and (b or not b and c)) can be simplified to if (a) if (b or c) Note the "b or not b", it was just too ugly to not fix. --- pelican/tests/output/basic/category/bar.html | 4 +--- pelican/tests/output/basic/category/yeah.html | 4 +--- pelican/tests/output/basic/tag/foobar.html | 4 +--- pelican/tests/output/basic/tag/yeah.html | 4 +--- pelican/tests/output/custom/category/bar.html | 4 +--- pelican/tests/output/custom/category/yeah.html | 4 +--- pelican/tests/output/custom/tag/foobar.html | 4 +--- pelican/tests/output/custom/tag/yeah.html | 4 +--- pelican/themes/notmyidea/templates/index.html | 11 +++++++---- 9 files changed, 15 insertions(+), 28 deletions(-) diff --git a/pelican/tests/output/basic/category/bar.html b/pelican/tests/output/basic/category/bar.html index 54b1db3e..763cfe77 100644 --- a/pelican/tests/output/basic/category/bar.html +++ b/pelican/tests/output/basic/category/bar.html @@ -46,8 +46,6 @@ YEAH !

      -
    -
    - -
    - -
    - -

    blogroll

    @@ -100,4 +98,4 @@ YEAH !

    }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/category/yeah.html b/pelican/tests/output/custom/category/yeah.html index c8e066c8..11fd181d 100644 --- a/pelican/tests/output/custom/category/yeah.html +++ b/pelican/tests/output/custom/category/yeah.html @@ -63,8 +63,6 @@ Page 1 / 1

    - -

    blogroll

    @@ -108,4 +106,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/tag/foobar.html b/pelican/tests/output/custom/tag/foobar.html index c62d3418..c224992e 100644 --- a/pelican/tests/output/custom/tag/foobar.html +++ b/pelican/tests/output/custom/tag/foobar.html @@ -63,8 +63,6 @@ Page 1 / 1

    - -

    blogroll

    @@ -108,4 +106,4 @@ }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom/tag/yeah.html b/pelican/tests/output/custom/tag/yeah.html index 288f4ec7..49c78359 100644 --- a/pelican/tests/output/custom/tag/yeah.html +++ b/pelican/tests/output/custom/tag/yeah.html @@ -55,8 +55,6 @@ YEAH !

    Page 1 / 1

    - -

    blogroll

    @@ -100,4 +98,4 @@ YEAH !

    }()); - \ No newline at end of file + diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index 2d45bb2a..c8982476 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -42,12 +42,15 @@ {% endif %} {% if loop.last %} - - {% if loop.last and (articles_page.has_previous() - or not articles_page.has_previous() and loop.length > 1) %} + {% if loop.length > 1 %} + + {% endif %} + {% if articles_page.has_previous() or loop.length > 1 %} {% include 'pagination.html' %} {% endif %} -
    + {% if loop.length > 1 %} +
    + {% endif %} {% endif %} {% endfor %} {% else %} From e500e64ebd888d61c555e0eefba8b3ae529b5e63 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Sun, 9 Feb 2014 15:17:23 +0100 Subject: [PATCH 1105/2344] Some browsers like Lynx render adjacent links without implicit spaces. Put an extra space at the end of each link to a tag so that Lynx doesnt render the tags as a single word. --- pelican/themes/notmyidea/templates/taglist.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/themes/notmyidea/templates/taglist.html b/pelican/themes/notmyidea/templates/taglist.html index c792fd7d..b8f4ba95 100644 --- a/pelican/themes/notmyidea/templates/taglist.html +++ b/pelican/themes/notmyidea/templates/taglist.html @@ -1,2 +1,2 @@ -{% if article.tags %}

    tags: {% for tag in article.tags %}{{ tag }}{% endfor %}

    {% endif %} +{% if article.tags %}

    tags: {% for tag in article.tags %}{{ tag }} {% endfor %}

    {% endif %} {% if PDF_PROCESSOR %}

    get the pdf

    {% endif %} From a7ca52dee05819be269b95556da01f965d107a50 Mon Sep 17 00:00:00 2001 From: Mario Lang Date: Tue, 18 Feb 2014 15:01:31 +0100 Subject: [PATCH 1106/2344] Run tag name through escape filter to avoid invalid HTML If a tag contains characters like <> or &, we currently generate invalid HTML. This is easily fixed by sending the tag through the jinja escape filter. (This bug is not theoretical, I hit it when using C++ template names for tags, like "boost::variant<>".) --- pelican/themes/notmyidea/templates/taglist.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/themes/notmyidea/templates/taglist.html b/pelican/themes/notmyidea/templates/taglist.html index b8f4ba95..1e0b95a7 100644 --- a/pelican/themes/notmyidea/templates/taglist.html +++ b/pelican/themes/notmyidea/templates/taglist.html @@ -1,2 +1,2 @@ -{% if article.tags %}

    tags: {% for tag in article.tags %}{{ tag }} {% endfor %}

    {% endif %} +{% if article.tags %}

    tags: {% for tag in article.tags %}{{ tag | escape }} {% endfor %}

    {% endif %} {% if PDF_PROCESSOR %}

    get the pdf

    {% endif %} From 05d357e98e9c948eaddfcfe3db9895b7ab5e9bf0 Mon Sep 17 00:00:00 2001 From: Ben Bridts Date: Tue, 18 Feb 2014 17:56:57 +0100 Subject: [PATCH 1107/2344] Split multiple authors on ',' --- pelican/readers.py | 2 +- pelican/tests/content/article_with_multiple_authors.html | 6 ++++++ pelican/tests/test_readers.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 pelican/tests/content/article_with_multiple_authors.html diff --git a/pelican/readers.py b/pelican/readers.py index 1e00aefa..fb800b2b 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -46,7 +46,7 @@ METADATA_PROCESSORS = { 'status': lambda x, y: x.strip(), 'category': Category, 'author': Author, - 'authors': lambda x, y: [Author(author, y) for author in x], + 'authors': lambda x, y: [Author(author.strip(), y) for author in x.split(',')], } logger = logging.getLogger(__name__) diff --git a/pelican/tests/content/article_with_multiple_authors.html b/pelican/tests/content/article_with_multiple_authors.html new file mode 100644 index 00000000..a74442c9 --- /dev/null +++ b/pelican/tests/content/article_with_multiple_authors.html @@ -0,0 +1,6 @@ + + + This is an article with multiple authors! + + + diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index acb268fb..6274bdc5 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -361,7 +361,7 @@ class HTMLReaderTest(ReaderTest): self.assertEqual(value, page.metadata[key], key) def test_article_with_multiple_authors(self): - page = self.read_file(path='article_with_multiple_authors.rst') + page = self.read_file(path='article_with_multiple_authors.html') expected = { 'authors': ['First Author', 'Second Author'] } From 7f2bc2a23b6e8c8f0865cb293942a560a06d74e0 Mon Sep 17 00:00:00 2001 From: Stefan hr Berder Date: Sun, 16 Feb 2014 12:51:52 +0100 Subject: [PATCH 1108/2344] change date metadata parsing to dateutil.parser --- docs/getting_started.rst | 2 ++ pelican/tests/test_utils.py | 32 +++++++++++++++++++++++++++--- pelican/utils.py | 39 +++++-------------------------------- setup.py | 2 +- 4 files changed, 37 insertions(+), 38 deletions(-) diff --git a/docs/getting_started.rst b/docs/getting_started.rst index 6655d8d6..8ee37162 100644 --- a/docs/getting_started.rst +++ b/docs/getting_started.rst @@ -130,6 +130,8 @@ automatically installed without any action on your part: utilities * `MarkupSafe `_, for a markup safe string implementation +* `python-dateutil `_, to read + the date metadata If you want the following optional packages, you will need to install them manually via ``pip``: diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index f6f96a1c..9047593f 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -41,6 +41,12 @@ class TestUtils(LoggedTestCase): date = datetime.datetime(year=2012, month=11, day=22) date_hour = datetime.datetime( year=2012, month=11, day=22, hour=22, minute=11) + date_hour_z = datetime.datetime( + year=2012, month=11, day=22, hour=22, minute=11, + tzinfo=pytz.timezone('UTC')) + date_hour_est = datetime.datetime( + year=2012, month=11, day=22, hour=22, minute=11, + tzinfo=pytz.timezone('EST')) date_hour_sec = datetime.datetime( year=2012, month=11, day=22, hour=22, minute=11, second=10) date_hour_sec_z = datetime.datetime( @@ -61,22 +67,42 @@ class TestUtils(LoggedTestCase): '22/11/2012': date, '22.11.2012': date, '22.11.2012 22:11': date_hour, + '2012-11-22T22:11Z': date_hour_z, + '2012-11-22T22:11-0500': date_hour_est, '2012-11-22 22:11:10': date_hour_sec, '2012-11-22T22:11:10Z': date_hour_sec_z, '2012-11-22T22:11:10-0500': date_hour_sec_est, '2012-11-22T22:11:10.123Z': date_hour_sec_frac_z, } + # examples from http://www.w3.org/TR/NOTE-datetime + iso_8601_date = datetime.datetime(year=1997, month=7, day=16) + iso_8601_date_hour_tz = datetime.datetime( + year=1997, month=7, day=16, hour=19, minute=20, + tzinfo=pytz.timezone('CET')) + iso_8601_date_hour_sec_tz = datetime.datetime( + year=1997, month=7, day=16, hour=19, minute=20, second=30, + tzinfo=pytz.timezone('CET')) + iso_8601_date_hour_sec_ms_tz = datetime.datetime( + year=1997, month=7, day=16, hour=19, minute=20, second=30, + microsecond=450000, tzinfo=pytz.timezone('CET')) + iso_8601 = { + '1997-07-16': iso_8601_date, + '1997-07-16T19:20+01:00': iso_8601_date_hour_tz, + '1997-07-16T19:20:30+01:00': iso_8601_date_hour_sec_tz, + '1997-07-16T19:20:30.45+01:00': iso_8601_date_hour_sec_ms_tz, + } + # invalid ones invalid_dates = ['2010-110-12', 'yay'] - if version_info < (3, 2): - dates.pop('2012-11-22T22:11:10-0500') - invalid_dates.append('2012-11-22T22:11:10-0500') for value, expected in dates.items(): self.assertEqual(utils.get_date(value), expected, value) + for value, expected in iso_8601.items(): + self.assertEqual(utils.get_date(value), expected, value) + for item in invalid_dates: self.assertRaises(ValueError, utils.get_date, item) diff --git a/pelican/utils.py b/pelican/utils.py index 822e50e9..c5aacaa3 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -15,7 +15,7 @@ import traceback from collections import Hashable from contextlib import contextmanager -from datetime import datetime +import dateutil.parser from functools import partial from itertools import groupby from jinja2 import Markup @@ -181,39 +181,10 @@ def get_date(string): If no format matches the given date, raise a ValueError. """ string = re.sub(' +', ' ', string) - formats = [ - # ISO 8601 - '%Y', - '%Y-%m', - '%Y-%m-%d', - '%Y-%m-%dT%H:%M%z', - '%Y-%m-%dT%H:%MZ', - '%Y-%m-%dT%H:%M', - '%Y-%m-%dT%H:%M:%S%z', - '%Y-%m-%dT%H:%M:%SZ', - '%Y-%m-%dT%H:%M:%S', - '%Y-%m-%dT%H:%M:%S.%f%z', - '%Y-%m-%dT%H:%M:%S.%fZ', - '%Y-%m-%dT%H:%M:%S.%f', - # end ISO 8601 forms - '%Y-%m-%d %H:%M', - '%Y-%m-%d %H:%M:%S', - '%Y/%m/%d %H:%M', - '%Y/%m/%d', - '%d-%m-%Y', - '%d.%m.%Y %H:%M', - '%d.%m.%Y', - '%d/%m/%Y', - ] - for date_format in formats: - try: - date = datetime.strptime(string, date_format) - except ValueError: - continue - if date_format.endswith('Z'): - date = date.replace(tzinfo=pytz.timezone('UTC')) - return date - raise ValueError('{0!r} is not a valid date'.format(string)) + try: + return dateutil.parser.parse(string) + except (TypeError, ValueError): + raise ValueError('{0!r} is not a valid date'.format(string)) @contextmanager diff --git a/setup.py b/setup.py index f56a7c41..e989d549 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ from setuptools import setup requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils', - 'pytz >= 0a', 'blinker', 'unidecode', 'six'] + 'pytz >= 0a', 'blinker', 'unidecode', 'six', 'python-dateutil'] entry_points = { 'console_scripts': [ From 652eb3686f15a24f8e8830f2d4345ab8c50cf761 Mon Sep 17 00:00:00 2001 From: Stefan hr Berder Date: Thu, 26 Dec 2013 19:30:55 +0100 Subject: [PATCH 1109/2344] add lang support for drafts (#826 & #1107) Fix #826 Fix #1107 --- docs/settings.rst | 10 +++++-- pelican/__init__.py | 12 ++++++--- pelican/contents.py | 5 ++++ pelican/generators.py | 27 +++++++++++++------ pelican/settings.py | 4 +++ .../output/custom/drafts/a-draft-article.html | 4 +-- 6 files changed, 46 insertions(+), 16 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index ca92a19e..a8e96d71 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -237,12 +237,18 @@ posts for the month at ``posts/2011/Aug/index.html``. ==================================================== ===================================================== Setting name (default value) What does it do? ==================================================== ===================================================== -`ARTICLE_URL` (``'{slug}.html'``) The URL to refer to an ARTICLE. +`ARTICLE_URL` (``'{slug}.html'``) The URL to refer to an article. `ARTICLE_SAVE_AS` (``'{slug}.html'``) The place where we will save an article. -`ARTICLE_LANG_URL` (``'{slug}-{lang}.html'``) The URL to refer to an ARTICLE which doesn't use the +`ARTICLE_LANG_URL` (``'{slug}-{lang}.html'``) The URL to refer to an article which doesn't use the default language. `ARTICLE_LANG_SAVE_AS` (``'{slug}-{lang}.html'``) The place where we will save an article which doesn't use the default language. +`DRAFT_URL` (``'drafts/{slug}.html'``) The URL to refer to an article draft. +`DRAFT_SAVE_AS` (``'drafts/{slug}.html'``) The place where we will save an article draft. +`DRAFT_LANG_URL` (``'drafts/{slug}-{lang}.html'``) The URL to refer to an article draft which doesn't + use the default language. +`DRAFT_LANG_SAVE_AS` (``'drafts/{slug}-{lang}.html'``) The place where we will save an article draft which + doesn't use the default language. `PAGE_URL` (``'pages/{slug}.html'``) The URL we will use to link to a page. `PAGE_SAVE_AS` (``'pages/{slug}.html'``) The location we will save the page. This value has to be the same as PAGE_URL or you need to use a rewrite in diff --git a/pelican/__init__.py b/pelican/__init__.py index 47260551..08dd484e 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -114,9 +114,10 @@ class Pelican(object): structure = re.sub('^/', '', structure) for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', - 'PAGE_LANG_URL', 'ARTICLE_SAVE_AS', - 'ARTICLE_LANG_SAVE_AS', 'PAGE_SAVE_AS', - 'PAGE_LANG_SAVE_AS'): + 'PAGE_LANG_URL', 'DRAFT_URL', 'DRAFT_LANG_URL', + 'ARTICLE_SAVE_AS', 'ARTICLE_LANG_SAVE_AS', + 'DRAFT_SAVE_AS', 'DRAFT_LANG_SAVE_AS', + 'PAGE_SAVE_AS', 'PAGE_LANG_SAVE_AS'): self.settings[setting] = os.path.join(structure, self.settings[setting]) logger.warning("%s = '%s'" % (setting, self.settings[setting])) @@ -174,8 +175,11 @@ class Pelican(object): pages_generator = next(g for g in generators if isinstance(g, PagesGenerator)) - print('Done: Processed {} articles and {} pages in {:.2f} seconds.'.format( + print('Done: Processed {} article(s), {} draft(s) and {} page(s) in ' \ + '{:.2f} seconds.'.format( len(articles_generator.articles) + len(articles_generator.translations), + len(articles_generator.drafts) + \ + len(articles_generator.drafts_translations), len(pages_generator.pages) + len(pages_generator.translations), time.time() - start_time)) diff --git a/pelican/contents.py b/pelican/contents.py index 69b7fa69..2ba81c1d 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -328,6 +328,11 @@ class Article(Page): default_template = 'article' +class Draft(Page): + mandatory_properties = ('title', 'category') + default_template = 'article' + + class Quote(Page): base_properties = ('author', 'date') diff --git a/pelican/generators.py b/pelican/generators.py index d1034eb0..bfdac1a5 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -18,7 +18,7 @@ from operator import attrgetter, itemgetter from jinja2 import (Environment, FileSystemLoader, PrefixLoader, ChoiceLoader, BaseLoader, TemplateNotFound) -from pelican.contents import Article, Page, Static, is_valid_content +from pelican.contents import Article, Draft, Page, Static, is_valid_content from pelican.readers import Readers from pelican.utils import copy, process_translations, mkdir_p, DateFormatter from pelican import signals @@ -190,7 +190,8 @@ class ArticlesGenerator(Generator): self.categories = defaultdict(list) self.related_posts = [] self.authors = defaultdict(list) - self.drafts = [] + self.drafts = [] # only drafts in default language + self.drafts_translations = [] super(ArticlesGenerator, self).__init__(*args, **kwargs) signals.article_generator_init.send(self) @@ -376,11 +377,11 @@ class ArticlesGenerator(Generator): def generate_drafts(self, write): """Generate drafts pages.""" - for article in self.drafts: - write(os.path.join('drafts', '%s.html' % article.slug), - self.get_template(article.template), self.context, - article=article, category=article.category, - all_articles=self.articles) + for draft in chain(self.drafts_translations, self.drafts): + write(draft.save_as, self.get_template(draft.template), + self.context, article=draft, category=draft.category, + override_output=hasattr(draft, 'override_save_as'), + all_articles=self.articles) def generate_pages(self, writer): """Generate the pages on the disk""" @@ -403,6 +404,7 @@ class ArticlesGenerator(Generator): """Add the articles into the shared context""" all_articles = [] + all_drafts = [] for f in self.get_files( self.settings['ARTICLE_DIR'], exclude=self.settings['ARTICLE_EXCLUDES']): @@ -426,13 +428,22 @@ class ArticlesGenerator(Generator): if article.status.lower() == "published": all_articles.append(article) elif article.status.lower() == "draft": - self.drafts.append(article) + draft = self.readers.read_file( + base_path=self.path, path=f, content_class=Draft, + context=self.context, + preread_signal=signals.article_generator_preread, + preread_sender=self, + context_signal=signals.article_generator_context, + context_sender=self) + all_drafts.append(draft) else: logger.warning("Unknown status %s for file %s, skipping it." % (repr(article.status), repr(f))) self.articles, self.translations = process_translations(all_articles) + self.drafts, self.drafts_translations = \ + process_translations(all_drafts) signals.article_generator_pretaxonomy.send(self) diff --git a/pelican/settings.py b/pelican/settings.py index 99828935..225a1e9d 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -59,6 +59,10 @@ DEFAULT_CONFIG = { 'ARTICLE_SAVE_AS': '{slug}.html', 'ARTICLE_LANG_URL': '{slug}-{lang}.html', 'ARTICLE_LANG_SAVE_AS': '{slug}-{lang}.html', + 'DRAFT_URL': 'drafts/{slug}.html', + 'DRAFT_SAVE_AS': os.path.join('drafts', '{slug}.html'), + 'DRAFT_LANG_URL': 'drafts/{slug}-{lang}.html', + 'DRAFT_LANG_SAVE_AS': os.path.join('drafts', '{slug}-{lang}.html'), 'PAGE_URL': 'pages/{slug}.html', 'PAGE_SAVE_AS': os.path.join('pages', '{slug}.html'), 'PAGE_LANG_URL': 'pages/{slug}-{lang}.html', diff --git a/pelican/tests/output/custom/drafts/a-draft-article.html b/pelican/tests/output/custom/drafts/a-draft-article.html index 9050c04e..57eea18c 100644 --- a/pelican/tests/output/custom/drafts/a-draft-article.html +++ b/pelican/tests/output/custom/drafts/a-draft-article.html @@ -32,7 +32,7 @@

    - A draft article

    @@ -97,4 +97,4 @@ listed anywhere else.

    }()); - \ No newline at end of file + From 011cd50e2e768a80234781584bde0cddc971ca55 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 1 Mar 2014 18:25:07 +0100 Subject: [PATCH 1110/2344] Minor improvements to Settings docs --- docs/settings.rst | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index a8e96d71..b75ce53d 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -6,7 +6,8 @@ the command line:: $ pelican content -s path/to/your/settingsfile.py -(If you used the `pelican-quickstart` command, your primary settings file will be named `pelicanconf.py` by default.) +(If you used the `pelican-quickstart` command, your primary settings file will +be named `pelicanconf.py` by default.) Settings are configured in the form of a Python module (a file). There is an `example settings file @@ -193,9 +194,10 @@ want. If you specify a ``datetime`` directive, it will be substituted using the input files' date metadata attribute. If the date is not specified for a particular file, Pelican will rely on the file's ``mtime`` timestamp. + Check the `Python datetime documentation`_ for more information. -Check the Python datetime documentation at http://bit.ly/cNcJUC for more -information. +.. _Python datetime documentation: + http://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior Also, you can use other file metadata attributes as well: From 56b0061393d682f2487901b27bcafd5f0fbbd4a7 Mon Sep 17 00:00:00 2001 From: th3aftermath Date: Fri, 31 Jan 2014 19:42:20 -0500 Subject: [PATCH 1111/2344] Add the setting SLUGIFY_ATTRIBUTE --- docs/settings.rst | 4 ++++ pelican/contents.py | 12 +++++++++--- pelican/settings.py | 1 + pelican/tests/test_contents.py | 11 +++++++++-- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index b75ce53d..3873a479 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -166,6 +166,10 @@ Setting name (default value) `PYGMENTS_RST_OPTIONS` (``[]``) A list of default Pygments settings for your reStructuredText code blocks. See :ref:`internal_pygments_options` for a list of supported options. + +`SLUGIFY_SOURCE` (``'input'``) Specifies where you want the slug to be automatically generated + from. Can be set to 'title' to use the Title: metadata tag or + 'basename' to use the articles basename to make a slug. =============================================================================== ===================================================================== .. [#] Default is the system locale. diff --git a/pelican/contents.py b/pelican/contents.py index 2ba81c1d..66602666 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -96,9 +96,15 @@ class Content(object): self.in_default_lang = (self.lang == default_lang) - # create the slug if not existing, from the title - if not hasattr(self, 'slug') and hasattr(self, 'title'): - self.slug = slugify(self.title, + # create the slug if not existing, generate slug according to + # setting of SLUG_ATTRIBUTE + if not hasattr(self, 'slug'): + if settings['SLUGIFY_SOURCE'] == 'title' and hasattr(self, 'title'): + self.slug = slugify(self.title, + settings.get('SLUG_SUBSTITUTIONS', ())) + elif settings['SLUGIFY_SOURCE'] == 'basename' and source_path != None: + basename = os.path.basename(os.path.splitext(source_path)[0]) + self.slug = slugify(basename, settings.get('SLUG_SUBSTITUTIONS', ())) self.source_path = source_path diff --git a/pelican/settings.py b/pelican/settings.py index 225a1e9d..7ab43a82 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -116,6 +116,7 @@ DEFAULT_CONFIG = { 'IGNORE_FILES': ['.#*'], 'SLUG_SUBSTITUTIONS': (), 'INTRASITE_LINK_REGEX': '[{|](?P.*?)[|}]', + 'SLUGIFY_SOURCE': 'title' } PYGMENTS_RST_OPTIONS = None diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index f831f061..4c6f8ed1 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -32,6 +32,7 @@ class TestPage(unittest.TestCase): 'title': 'foo bar', 'author': 'Blogger', }, + 'source_path': '/path/to/file/foo.ext' } def test_use_args(self): @@ -77,9 +78,15 @@ class TestPage(unittest.TestCase): self.assertEqual(page.summary, '') def test_slug(self): - # If a title is given, it should be used to generate the slug. - page = Page(**self.page_kwargs) + page_kwargs = self._copy_page_kwargs() + settings = get_settings() + page_kwargs['settings'] = settings + settings['SLUGIFY_SOURCE'] = "title" + page = Page(**page_kwargs) self.assertEqual(page.slug, 'foo-bar') + settings['SLUGIFY_SOURCE'] = "basename" + page = Page(**page_kwargs) + self.assertEqual(page.slug, 'foo') def test_defaultlang(self): # If no lang is given, default to the default one. From 990ddb5a5e020cd68117e6c17b310e51f69c804e Mon Sep 17 00:00:00 2001 From: th3aftermath Date: Sat, 8 Mar 2014 12:56:30 -0500 Subject: [PATCH 1112/2344] Fix Issue #1165 allows extensions to be set by certain settings PAGINATION_PATTERNS was hard coded so that all files had a ".html" extension. This fixes that and add a test to ensure that the pagination code is not changing the filename incorrectly. --- pelican/paginator.py | 3 +- pelican/settings.py | 2 +- pelican/tests/test_paginator.py | 50 +++++++++++++++++++++++++++++++++ pelican/writers.py | 3 +- 4 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 pelican/tests/test_paginator.py diff --git a/pelican/paginator.py b/pelican/paginator.py index df8606ec..757c9120 100644 --- a/pelican/paginator.py +++ b/pelican/paginator.py @@ -69,7 +69,7 @@ class Paginator(object): class Page(object): def __init__(self, name, object_list, number, paginator, settings): - self.name = name + self.name, self.extension = os.path.splitext(name) self.object_list = object_list self.number = number self.paginator = paginator @@ -143,6 +143,7 @@ class Page(object): 'settings': self.settings, 'base_name': os.path.dirname(self.name), 'number_sep': '/', + 'extension': self.extension, } if self.number == 1: diff --git a/pelican/settings.py b/pelican/settings.py index 7ab43a82..796678e0 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -79,7 +79,7 @@ DEFAULT_CONFIG = { 'AUTHOR_URL': 'author/{slug}.html', 'AUTHOR_SAVE_AS': os.path.join('author', '{slug}.html'), 'PAGINATION_PATTERNS': [ - (0, '{name}{number}.html', '{name}{number}.html'), + (0, '{name}{number}{extension}', '{name}{number}{extension}'), ], 'YEAR_ARCHIVE_SAVE_AS': False, 'MONTH_ARCHIVE_SAVE_AS': False, diff --git a/pelican/tests/test_paginator.py b/pelican/tests/test_paginator.py new file mode 100644 index 00000000..f454d47d --- /dev/null +++ b/pelican/tests/test_paginator.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals, absolute_import +import six + +from pelican.tests.support import unittest, get_settings + +from pelican.paginator import Paginator +from pelican.contents import Article +from pelican.settings import DEFAULT_CONFIG +from jinja2.utils import generate_lorem_ipsum + +# generate one paragraph, enclosed with

    +TEST_CONTENT = str(generate_lorem_ipsum(n=1)) +TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False) + +class TestPage(unittest.TestCase): + def setUp(self): + super(TestPage, self).setUp() + self.page_kwargs = { + 'content': TEST_CONTENT, + 'context': { + 'localsiteurl': '', + }, + 'metadata': { + 'summary': TEST_SUMMARY, + 'title': 'foo bar', + 'author': 'Blogger', + }, + 'source_path': '/path/to/file/foo.ext' + } + + def test_save_as_preservation(self): + settings = get_settings() + # fix up pagination rules + from pelican.paginator import PaginationRule + pagination_rules = [ + PaginationRule(*r) for r in settings.get( + 'PAGINATION_PATTERNS', + DEFAULT_CONFIG['PAGINATION_PATTERNS'], + ) + ] + settings['PAGINATION_PATTERNS'] = sorted( + pagination_rules, + key=lambda r: r[0], + ) + + object_list = [Article(**self.page_kwargs), Article(**self.page_kwargs)] + paginator = Paginator('foobar.foo', object_list, settings) + page = paginator.page(1) + self.assertEqual(page.save_as, 'foobar.foo') \ No newline at end of file diff --git a/pelican/writers.py b/pelican/writers.py index 580a3990..63d74126 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -179,10 +179,9 @@ class Writer(object): # pagination if paginated: - name_root = os.path.splitext(name)[0] # pagination needed, init paginators - paginators = {key: Paginator(name_root, val, self.settings) + paginators = {key: Paginator(name, val, self.settings) for key, val in paginated.items()} # generated pages, and write From 91d576eb45d416d8cbaeee2bc72765c573c824e6 Mon Sep 17 00:00:00 2001 From: Jean Lauliac Date: Mon, 24 Mar 2014 14:50:49 -0400 Subject: [PATCH 1113/2344] Apply typogrify on article summary as well --- pelican/readers.py | 9 ++++--- .../tests/content/article_with_metadata.rst | 2 +- pelican/tests/test_readers.py | 27 ++++++++++++++++++- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 1e00aefa..20f391eb 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -462,10 +462,13 @@ class Readers(object): find_empty_alt(content, path) # eventually filter the content with typogrify if asked so - if content and self.settings['TYPOGRIFY']: + if self.settings['TYPOGRIFY']: from typogrify.filters import typogrify - content = typogrify(content) - metadata['title'] = typogrify(metadata['title']) + if content: + content = typogrify(content) + metadata['title'] = typogrify(metadata['title']) + if 'summary' in metadata: + metadata['summary'] = typogrify(metadata['summary']) if context_signal: logger.debug('signal {}.send({}, )'.format( diff --git a/pelican/tests/content/article_with_metadata.rst b/pelican/tests/content/article_with_metadata.rst index c5768cfb..9b65a4b0 100644 --- a/pelican/tests/content/article_with_metadata.rst +++ b/pelican/tests/content/article_with_metadata.rst @@ -9,5 +9,5 @@ This is a super article ! :author: Alexis Métaireau :summary: Multi-line metadata should be supported - as well as **inline markup**. + as well as **inline markup** and stuff to "typogrify"... :custom_field: http://notmyidea.org diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index acb268fb..d605d785 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -40,7 +40,8 @@ class RstReaderTest(ReaderTest): 'title': 'This is a super article !', 'summary': '

    Multi-line metadata should be' ' supported\nas well as inline' - ' markup.

    \n', + ' markup
    and stuff to "typogrify' + '"...

    \n', 'date': datetime.datetime(2010, 12, 2, 10, 14), 'modified': datetime.datetime(2010, 12, 2, 10, 20), 'tags': ['foo', 'bar', 'foobar'], @@ -125,6 +126,30 @@ class RstReaderTest(ReaderTest): except ImportError: return unittest.skip('need the typogrify distribution') + def test_typogrify_summary(self): + # if nothing is specified in the settings, the summary should be + # unmodified + page = self.read_file(path='article_with_metadata.rst') + expected = ('

    Multi-line metadata should be' + ' supported\nas well as inline' + ' markup and stuff to "typogrify' + '"...

    \n') + + self.assertEqual(page.metadata['summary'], expected) + + try: + # otherwise, typogrify should be applied + page = self.read_file(path='article_with_metadata.rst', + TYPOGRIFY=True) + expected = ('

    Multi-line metadata should be' + ' supported\nas well as inline' + ' markup and stuff to "typogrify' + '"…

    \n') + + self.assertEqual(page.metadata['summary'], expected) + except ImportError: + return unittest.skip('need the typogrify distribution') + class MdReaderTest(ReaderTest): From 01ad449f29b8f9cdd17ce204312384a5f15b6c44 Mon Sep 17 00:00:00 2001 From: th3aftermath Date: Sun, 30 Mar 2014 14:35:22 -0400 Subject: [PATCH 1114/2344] Fix indentation error in the settings doc This was accidentally caused by me in #1248 As a result the Basic Settings table was not being updated. --- docs/settings.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 3873a479..b579ae95 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -167,9 +167,9 @@ Setting name (default value) code blocks. See :ref:`internal_pygments_options` for a list of supported options. -`SLUGIFY_SOURCE` (``'input'``) Specifies where you want the slug to be automatically generated - from. Can be set to 'title' to use the Title: metadata tag or - 'basename' to use the articles basename to make a slug. +`SLUGIFY_SOURCE` (``'input'``) Specifies where you want the slug to be automatically generated + from. Can be set to 'title' to use the 'Title:' metadata tag or + 'basename' to use the articles basename when creating the slug. =============================================================================== ===================================================================== .. [#] Default is the system locale. From 382c09c187293310dca226cc0b873564a5993c7b Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 30 Mar 2014 11:59:32 -0700 Subject: [PATCH 1115/2344] Fix docs last_stable version and copyright date --- docs/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 5ac81b9e..6db0f3d1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -12,11 +12,11 @@ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.ifconfig', 'sphinx.ext.extlinks' source_suffix = '.rst' master_doc = 'index' project = 'Pelican' -copyright = '2010, Alexis Metaireau and contributors' +copyright = '2014, Alexis Metaireau and contributors' exclude_patterns = ['_build'] release = __version__ version = '.'.join(release.split('.')[:1]) -last_stable = '3.2.2' +last_stable = '3.3.0' rst_prolog = ''' .. |last_stable| replace:: :pelican-doc:`{0}` '''.format(last_stable) From 3f304a2e9277a5c512ac722279cc278bb866ea5c Mon Sep 17 00:00:00 2001 From: Helmut Grohne Date: Mon, 31 Mar 2014 19:38:49 +0200 Subject: [PATCH 1116/2344] change the inhibition value of *_SAVE_AS to '' Previously, the documentation claimed the value of None for this purpose even though False was used for certain defaults. The values False and None cause warnings to be emitted from URLWrapper._from_settings though, so the new way of inhibiting page generation is to set a *_SAVE_AS value to the empty string. --- docs/settings.rst | 8 ++++---- pelican/settings.py | 6 +++--- pelican/writers.py | 2 +- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index b579ae95..0c16db3c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -269,9 +269,9 @@ Setting name (default value) What does it do? `TAG_SAVE_AS` (``'tag/{slug}.html'``) The location to save the tag page. `AUTHOR_URL` (``'author/{slug}.html'``) The URL to use for an author. `AUTHOR_SAVE_AS` (``'author/{slug}.html'``) The location to save an author. -`YEAR_ARCHIVE_SAVE_AS` (False) The location to save per-year archives of your posts. -`MONTH_ARCHIVE_SAVE_AS` (False) The location to save per-month archives of your posts. -`DAY_ARCHIVE_SAVE_AS` (False) The location to save per-day archives of your posts. +`YEAR_ARCHIVE_SAVE_AS` (``''``) The location to save per-year archives of your posts. +`MONTH_ARCHIVE_SAVE_AS` (``''``) The location to save per-month archives of your posts. +`DAY_ARCHIVE_SAVE_AS` (``''``) The location to save per-day archives of your posts. `SLUG_SUBSTITUTIONS` (``()``) Substitutions to make prior to stripping out non-alphanumerics when generating slugs. Specified as a list of 2-tuples of ``(from, to)`` which are @@ -282,7 +282,7 @@ Setting name (default value) What does it do? If you do not want one or more of the default pages to be created (e.g., you are the only author on your site and thus do not need an Authors page), - set the corresponding ``*_SAVE_AS`` setting to ``None`` to prevent the + set the corresponding ``*_SAVE_AS`` setting to ``''`` to prevent the relevant page from being generated. `DIRECT_TEMPLATES` diff --git a/pelican/settings.py b/pelican/settings.py index 796678e0..ffd0bc8f 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -81,9 +81,9 @@ DEFAULT_CONFIG = { 'PAGINATION_PATTERNS': [ (0, '{name}{number}{extension}', '{name}{number}{extension}'), ], - 'YEAR_ARCHIVE_SAVE_AS': False, - 'MONTH_ARCHIVE_SAVE_AS': False, - 'DAY_ARCHIVE_SAVE_AS': False, + 'YEAR_ARCHIVE_SAVE_AS': '', + 'MONTH_ARCHIVE_SAVE_AS': '', + 'DAY_ARCHIVE_SAVE_AS': '', 'RELATIVE_URLS': False, 'DEFAULT_LANG': 'en', 'TAG_CLOUD_STEPS': 4, diff --git a/pelican/writers.py b/pelican/writers.py index 63d74126..19e36e39 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -140,7 +140,7 @@ class Writer(object): :param **kwargs: additional variables to pass to the templates """ - if name is False: + if name is False or name == "": return elif not name: # other stuff, just return for now From d9b0091357565391854e6a00563a551b8b7bfe13 Mon Sep 17 00:00:00 2001 From: Rogdham Date: Tue, 1 Apr 2014 20:44:09 +0200 Subject: [PATCH 1117/2344] Limit and filter logs Drop duplicates logs. Allow for logs to be grouped, enforcing a maximum number of logs per group. Add the LOG_FILTER setting to ask from the configuration file to ignore some logs (of level up to warning). --- docs/contribute.rst | 38 ++++++++++++++++++++ docs/settings.rst | 20 +++++++++++ pelican/__init__.py | 5 ++- pelican/contents.py | 6 ++-- pelican/log.py | 65 ++++++++++++++++++++++++++++++++--- pelican/readers.py | 34 ++++++------------ pelican/settings.py | 9 ++++- pelican/tests/test_pelican.py | 2 +- 8 files changed, 146 insertions(+), 33 deletions(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index 304d1de8..28df1fcd 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -143,3 +143,41 @@ and Python 3 at the same time: changed it where I felt necessary. - Changed xrange() back to range(), so it is valid in both Python versions. + + +Logging tips +============ + +Try to use logging with appropriate levels. + +For logging messages that are not repeated, use the usual Python way: + + # at top of file + import logging + logger = logging.getLogger(__name__) + + # when needed + logger.warning('A warning that could occur only once") + +However, if you want to log messages that may occur several times, instead of +a string, gives a tuple to the logging method, with two arguments: + + 1. The message to log for this very execution + 2. A generic message that will appear if the previous one would occur to many + times. + +For example, if you want to log missing resources, use the following code: + + for ressource in ressources: + if ressource.is_missing: + logger.warning(( + 'The resource {r} is missing'.format(r=ressource.name), + 'Other resources were missing')) + +The logs will be displayed as follows: + + WARNING: The resource prettiest_cat.jpg is missing + WARNING: The resource best_cat_ever.jpg is missing + WARNING: The resource cutest_cat.jpg is missing + WARNING: The resource lolcat.jpg is missing + WARNING: Other resources were missing diff --git a/docs/settings.rst b/docs/settings.rst index 0c16db3c..f7cfa69d 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -88,6 +88,9 @@ Setting name (default value) here or a single string representing one locale. When providing a list, all the locales will be tried until one works. +`LOG_FILTER` (``[]``) A list of tuples containing the logging level (up to warning) + and the message to be ignored. + For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]`` `READERS` (``{}``) A dictionary of file extensions / Reader classes for Pelican to process or ignore. For example, to avoid processing .html files, set: ``READERS = {'html': None}``. To add a custom reader for the @@ -694,6 +697,23 @@ adding the following to your configuration:: CSS_FILE = "wide.css" + +Logging +======= + +Sometimes, useless lines of log appears while the generation occurs. Finding +**the** meaningful error message in the middle of tons of annoying log outputs +can be quite tricky. To be able to filter out all useless log messages, Pelican +comes with the ``LOG_FILTER`` setting. + +``LOG_FILTER`` should be a list of tuples ``(level, msg)``, each of them being +composed of the logging level (up to warning) and the message to be ignored. +Simply populate the list with the logs you want to hide and they will be +filtered out. + +For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]`` + + Example settings ================ diff --git a/pelican/__init__.py b/pelican/__init__.py index 08dd484e..494e7e43 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -11,12 +11,15 @@ import argparse import locale import collections +# pelican.log has to be the first pelican module to be loaded +# because logging.setLoggerClass has to be called before logging.getLogger +from pelican.log import init + from pelican import signals from pelican.generators import (ArticlesGenerator, PagesGenerator, StaticGenerator, SourceFileGenerator, TemplatePagesGenerator) -from pelican.log import init from pelican.readers import Readers from pelican.settings import read_settings from pelican.utils import clean_output_dir, folder_watcher, file_watcher diff --git a/pelican/contents.py b/pelican/contents.py index 66602666..3096a064 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -239,8 +239,10 @@ class Content(object): self._context['filenames'][path].url)) origin = origin.replace('\\', '/') # for Windows paths. else: - logger.warning("Unable to find {fn}, skipping url" - " replacement".format(fn=path)) + logger.warning(("Unable to find {fn}, skipping url" + " replacement".format(fn=value), + "Other ressources were not found" + " and their urls not replaced")) elif what == 'category': origin = Category(path, self.settings).url elif what == 'tag': diff --git a/pelican/log.py b/pelican/log.py index bde8037e..d3aae012 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -9,7 +9,7 @@ import os import sys import logging -from logging import Formatter, getLogger, StreamHandler, DEBUG +from collections import defaultdict RESET_TERM = '\033[0;m' @@ -30,7 +30,7 @@ def ansi(color, text): return '\033[1;{0}m{1}{2}'.format(code, text, RESET_TERM) -class ANSIFormatter(Formatter): +class ANSIFormatter(logging.Formatter): """Convert a `logging.LogRecord' object into colored text, using ANSI escape sequences. @@ -51,7 +51,7 @@ class ANSIFormatter(Formatter): return ansi('white', record.levelname) + ': ' + msg -class TextFormatter(Formatter): +class TextFormatter(logging.Formatter): """ Convert a `logging.LogRecord' object into text. """ @@ -63,7 +63,62 @@ class TextFormatter(Formatter): return record.levelname + ': ' + record.getMessage() -def init(level=None, logger=getLogger(), handler=StreamHandler()): +class LimitFilter(logging.Filter): + """ + Remove duplicates records, and limit the number of records in the same + group. + + Groups are specified by the message to use when the number of records in + the same group hit the limit. + E.g.: log.warning(('43 is not the answer', 'More erroneous answers')) + """ + + ignore = set() + threshold = 5 + group_count = defaultdict(int) + + def filter(self, record): + # don't limit levels over warnings + if record.levelno > logging.WARN: + return record + # extract group + group = None + if len(record.msg) == 2: + record.msg, group = record.msg + # ignore record if it was already raised + # use .getMessage() and not .msg for string formatting + ignore_key = (record.levelno, record.getMessage()) + to_ignore = ignore_key in LimitFilter.ignore + LimitFilter.ignore.add(ignore_key) + if to_ignore: + return False + # check if we went over threshold + if group: + key = (record.levelno, group) + LimitFilter.group_count[key] += 1 + if LimitFilter.group_count[key] == LimitFilter.threshold: + record.msg = group + if LimitFilter.group_count[key] > LimitFilter.threshold: + return False + return record + + +class LimitLogger(logging.Logger): + """ + A logger which add LimitFilter automatically + """ + + limit_filter = LimitFilter() + + def __init__(self, *args, **kwargs): + super(LimitLogger, self).__init__(*args, **kwargs) + self.addFilter(LimitLogger.limit_filter) + +logging.setLoggerClass(LimitLogger) + + +def init(level=None, handler=logging.StreamHandler()): + logger = logging.getLogger() if (os.isatty(sys.stdout.fileno()) @@ -79,7 +134,7 @@ def init(level=None, logger=getLogger(), handler=StreamHandler()): if __name__ == '__main__': - init(level=DEBUG) + init(level=logging.DEBUG) root_logger = logging.getLogger() root_logger.debug('debug') diff --git a/pelican/readers.py b/pelican/readers.py index 26329af6..35c38220 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -318,7 +318,11 @@ class HTMLReader(BaseReader): if not contents: contents = self._attr_value(attrs, 'contents', '') if contents: - logger.warning("Meta tag attribute 'contents' used in file %s, should be changed to 'content'", self._filename) + logger.warning(( + "Meta tag attribute 'contents' used in file {}, should" + " be changed to 'content'".format(self._filename), + "Other files have meta tag attribute 'contents' that" + " should be changed to 'content'")) if name == 'keywords': name = 'tags' @@ -385,10 +389,6 @@ class Readers(object): """ - # used to warn about missing dependencies only once, at the first - # instanciation of a Readers object. - warn_missing_deps = True - def __init__(self, settings=None): self.settings = settings or {} self.readers = {} @@ -396,16 +396,13 @@ class Readers(object): for cls in [BaseReader] + BaseReader.__subclasses__(): if not cls.enabled: - if self.__class__.warn_missing_deps: - logger.debug('Missing dependencies for {}' - .format(', '.join(cls.file_extensions))) + logger.debug('Missing dependencies for {}' + .format(', '.join(cls.file_extensions))) continue for ext in cls.file_extensions: self.reader_classes[ext] = cls - self.__class__.warn_missing_deps = False - if self.settings['READERS']: self.reader_classes.update(self.settings['READERS']) @@ -505,19 +502,10 @@ def find_empty_alt(content, path): src=(['"])(.*)\5 ) """, re.X) - matches = re.findall(imgs, content) - # find a correct threshold - nb_warnings = 10 - if len(matches) == nb_warnings + 1: - nb_warnings += 1 # avoid bad looking case - # print one warning per image with empty alt until threshold - for match in matches[:nb_warnings]: - logger.warning('Empty alt attribute for image {} in {}'.format( - os.path.basename(match[1] + match[5]), path)) - # print one warning for the other images with empty alt - if len(matches) > nb_warnings: - logger.warning('{} other images with empty alt attributes' - .format(len(matches) - nb_warnings)) + for match in re.findall(imgs, content): + logger.warning(('Empty alt attribute for image {} in {}'.format( + os.path.basename(match[1] + match[5]), path), + 'Other images have empty alt attributes')) def default_metadata(settings=None, process=None): diff --git a/pelican/settings.py b/pelican/settings.py index ffd0bc8f..f70f74a8 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -19,6 +19,8 @@ except ImportError: from os.path import isabs +from pelican.log import LimitFilter + logger = logging.getLogger(__name__) @@ -98,6 +100,7 @@ DEFAULT_CONFIG = { 'MD_EXTENSIONS': ['codehilite(css_class=highlight)', 'extra'], 'JINJA_EXTENSIONS': [], 'JINJA_FILTERS': {}, + 'LOG_FILTER': [], 'LOCALE': [''], # defaults to user locale 'DEFAULT_PAGINATION': False, 'DEFAULT_ORPHANS': 0, @@ -170,12 +173,16 @@ def get_settings_from_file(path, default_settings=DEFAULT_CONFIG): def configure_settings(settings): """Provide optimizations, error checking and warnings for the given settings. - + Set up the logs to be ignored as well. """ if not 'PATH' in settings or not os.path.isdir(settings['PATH']): raise Exception('You need to specify a path containing the content' ' (see pelican --help for more information)') + # set up logs to be ignored + LimitFilter.ignore.update(set(settings.get('LOG_FILTER', + DEFAULT_CONFIG['LOG_FILTER']))) + # lookup the theme in "pelican/themes" if the given one doesn't exist if not os.path.isdir(settings['THEME']): theme_path = os.path.join( diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index 21a77e6b..2d4bbdfc 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -83,7 +83,7 @@ class TestPelican(LoggedTestCase): mute(True)(pelican.run)() self.assertDirsEqual(self.temp_path, os.path.join(OUTPUT_PATH, 'basic')) self.assertLogCountEqual( - count=4, + count=3, msg="Unable to find.*skipping url replacement", level=logging.WARNING) From 80842cbc0e2bbaed991c23de318752ca866a32a9 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 2 Apr 2014 12:38:49 -0700 Subject: [PATCH 1118/2344] Fix deprecated logger warning for Python 3 logger.warn() has been deprecated in Python 3 in favor of logger.warning() --- pelican/tools/pelican_import.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index d6b57c47..30d6346c 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -135,7 +135,7 @@ def wp2fields(xml, wp_custpost=False): title = HTMLParser().unescape(item.title.contents[0]) except IndexError: title = 'No title [%s]' % item.find('post_name').string - logger.warn('Post "%s" is lacking a proper title' % title) + logger.warning('Post "%s" is lacking a proper title' % title) filename = item.find('post_name').string post_id = item.find('post_id').string @@ -601,11 +601,11 @@ def download_attachments(output_path, urls): except URLError as e: error = ("No file could be downloaded from {}; Error {}" .format(url, e)) - logger.warn(error) + logger.warning(error) except IOError as e: #Python 2.7 throws an IOError rather Than URLError error = ("No file could be downloaded from {}; Error {}" .format(url, e)) - logger.warn(error) + logger.warning(error) return locations From c6ff88d0fce7f7ab5e05f2c414a365aa9faa6454 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 7 Apr 2014 14:29:21 -0700 Subject: [PATCH 1119/2344] Minor correction to settings documentation --- docs/settings.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 0c16db3c..53a25f8c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -36,7 +36,7 @@ Setting name (default value) =============================================================================== ===================================================================== `AUTHOR` Default author (put your name) `DATE_FORMATS` (``{}``) If you manage multiple languages, you can set the date formatting - here. See the "Date format and locales" section below for details. + here. See the "Date format and locale" section below for details. `USE_FOLDER_AS_CATEGORY` (``True``) When you don't specify a category in your post metadata, set this setting to ``True``, and organize your articles in subfolders, the subfolder will become the category of your post. If set to ``False``, @@ -167,9 +167,9 @@ Setting name (default value) code blocks. See :ref:`internal_pygments_options` for a list of supported options. -`SLUGIFY_SOURCE` (``'input'``) Specifies where you want the slug to be automatically generated - from. Can be set to 'title' to use the 'Title:' metadata tag or - 'basename' to use the articles basename when creating the slug. +`SLUGIFY_SOURCE` (``'input'``) Specifies where you want the slug to be automatically generated + from. Can be set to 'title' to use the 'Title:' metadata tag or + 'basename' to use the articles basename when creating the slug. =============================================================================== ===================================================================== .. [#] Default is the system locale. From 03976b650d0e96251a63a9510d23fff7d9aec2d1 Mon Sep 17 00:00:00 2001 From: Antoine Brenner Date: Mon, 14 Apr 2014 20:43:19 +0200 Subject: [PATCH 1120/2344] Fix unittest issue related to python2/python3 differences The test_datetime test passed on python3 but not python2 because datetime.strftime is a byte string in python2, and a unicode string in python3 This patch allows the test to pass in both python2 and python3 (3.3+ only) --- pelican/tests/test_contents.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 4c6f8ed1..27d2a897 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -129,9 +129,15 @@ class TestPage(unittest.TestCase): page_kwargs['metadata']['date'] = dt page = Page(**page_kwargs) - self.assertEqual(page.locale_date, - dt.strftime(DEFAULT_CONFIG['DEFAULT_DATE_FORMAT'])) + # page.locale_date is a unicode string in both python2 and python3 + dt_date = dt.strftime(DEFAULT_CONFIG['DEFAULT_DATE_FORMAT']) + # dt_date is a byte string in python2, and a unicode string in python3 + # Let's make sure it is a unicode string (relies on python 3.3 supporting the u prefix) + if type(dt_date) != type(u''): + # python2: + dt_date = unicode(dt_date, 'utf8') + self.assertEqual(page.locale_date, dt_date ) page_kwargs['settings'] = get_settings() # I doubt this can work on all platforms ... From 7e06912bcad1eeb71d8f154dff21555a5ed865ca Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 14 Apr 2014 16:18:07 -0400 Subject: [PATCH 1121/2344] Minor text changes to log message limitation --- docs/contribute.rst | 16 ++++++++-------- docs/settings.rst | 14 +++++++------- pelican/contents.py | 2 +- pelican/log.py | 4 ++-- pelican/settings.py | 6 +++--- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index 28df1fcd..57349156 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -157,24 +157,24 @@ For logging messages that are not repeated, use the usual Python way: logger = logging.getLogger(__name__) # when needed - logger.warning('A warning that could occur only once") + logger.warning("A warning that would usually occur only once") However, if you want to log messages that may occur several times, instead of -a string, gives a tuple to the logging method, with two arguments: +a string, give a tuple to the logging method, with two arguments: - 1. The message to log for this very execution - 2. A generic message that will appear if the previous one would occur to many + 1. The message to log for the initial execution + 2. A generic message that will appear if the previous one would occur too many times. For example, if you want to log missing resources, use the following code: - for ressource in ressources: - if ressource.is_missing: + for resource in resources: + if resource.is_missing: logger.warning(( - 'The resource {r} is missing'.format(r=ressource.name), + 'The resource {r} is missing'.format(r=resource.name), 'Other resources were missing')) -The logs will be displayed as follows: +The log messages will be displayed as follows: WARNING: The resource prettiest_cat.jpg is missing WARNING: The resource best_cat_ever.jpg is missing diff --git a/docs/settings.rst b/docs/settings.rst index c35bf08d..36cc3f9a 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -88,7 +88,7 @@ Setting name (default value) here or a single string representing one locale. When providing a list, all the locales will be tried until one works. -`LOG_FILTER` (``[]``) A list of tuples containing the logging level (up to warning) +`LOG_FILTER` (``[]``) A list of tuples containing the logging level (up to ``warning``) and the message to be ignored. For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]`` `READERS` (``{}``) A dictionary of file extensions / Reader classes for Pelican to @@ -701,15 +701,15 @@ adding the following to your configuration:: Logging ======= -Sometimes, useless lines of log appears while the generation occurs. Finding -**the** meaningful error message in the middle of tons of annoying log outputs -can be quite tricky. To be able to filter out all useless log messages, Pelican +Sometimes, a long list of warnings may appear during site generation. Finding +the **meaningful** error message in the middle of tons of annoying log output +can be quite tricky. In order to filter out redundant log messages, Pelican comes with the ``LOG_FILTER`` setting. ``LOG_FILTER`` should be a list of tuples ``(level, msg)``, each of them being -composed of the logging level (up to warning) and the message to be ignored. -Simply populate the list with the logs you want to hide and they will be -filtered out. +composed of the logging level (up to ``warning``) and the message to be ignored. +Simply populate the list with the log messages you want to hide, and they will +be filtered out. For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]`` diff --git a/pelican/contents.py b/pelican/contents.py index 3096a064..615a7fd8 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -241,7 +241,7 @@ class Content(object): else: logger.warning(("Unable to find {fn}, skipping url" " replacement".format(fn=value), - "Other ressources were not found" + "Other resources were not found" " and their urls not replaced")) elif what == 'category': origin = Category(path, self.settings).url diff --git a/pelican/log.py b/pelican/log.py index d3aae012..fdf41cb0 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -78,7 +78,7 @@ class LimitFilter(logging.Filter): group_count = defaultdict(int) def filter(self, record): - # don't limit levels over warnings + # don't limit log messages for anything above "warning" if record.levelno > logging.WARN: return record # extract group @@ -105,7 +105,7 @@ class LimitFilter(logging.Filter): class LimitLogger(logging.Logger): """ - A logger which add LimitFilter automatically + A logger which adds LimitFilter automatically """ limit_filter = LimitFilter() diff --git a/pelican/settings.py b/pelican/settings.py index f70f74a8..7277c121 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -171,15 +171,15 @@ def get_settings_from_file(path, default_settings=DEFAULT_CONFIG): def configure_settings(settings): - """Provide optimizations, error checking and warnings for the given + """Provide optimizations, error checking, and warnings for the given settings. - Set up the logs to be ignored as well. + Also, specify the log messages to be ignored. """ if not 'PATH' in settings or not os.path.isdir(settings['PATH']): raise Exception('You need to specify a path containing the content' ' (see pelican --help for more information)') - # set up logs to be ignored + # specify the log messages to be ignored LimitFilter.ignore.update(set(settings.get('LOG_FILTER', DEFAULT_CONFIG['LOG_FILTER']))) From aabb7f9345853c7afb73e781ac1cc65f6a2094dd Mon Sep 17 00:00:00 2001 From: Antoine Brenner Date: Mon, 14 Apr 2014 22:28:25 +0200 Subject: [PATCH 1122/2344] Fix error in download_attachments() triggered by python2 unit test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The download_attachments error is triggered in the unit tests by a japanese error message (接続を拒否されました) (connexion denied), that python is not able to serialize the into a byte string. This error weirdly does not appear every time the unit tests are run. It might be related to the order in which the tests are run. This error was found and fixed during the PyconUS 2014 pelican sprint. It was discovered on a Linux Fedora20 computer running Python2.7 in virtualenv --- pelican/tools/pelican_import.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 30d6346c..27e47754 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -603,8 +603,18 @@ def download_attachments(output_path, urls): .format(url, e)) logger.warning(error) except IOError as e: #Python 2.7 throws an IOError rather Than URLError - error = ("No file could be downloaded from {}; Error {}" - .format(url, e)) + # For japanese, the error might look kind of like this: + # e = IOError( 'socket error', socket.error(111, u'\u63a5\u7d9a\u3092\u62d2\u5426\u3055\u308c\u307e\u3057\u305f') ) + # and not be suitable to use in "{}".format(e) , raising UnicodeDecodeError + # (This is at least the case on my Fedora running Python 2.7.5 + # (default, Feb 19 2014, 13:47:28) [GCC 4.8.2 20131212 (Red Hat 4.8.2-7)] on linux2 + try: + error = ("No file could be downloaded from {}; Error {}" + .format(url, e)) + except UnicodeDecodeError: + # For lack of a better log message because we could not decode e, let's use repr(e) + error = ("No file could be downloaded from {}; Error {}" + .format(url, repr(e))) logger.warning(error) return locations From fd779267000ac539ee0a9ba5856d103fbbc7cd7c Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Sat, 15 Feb 2014 21:20:51 +0100 Subject: [PATCH 1123/2344] Cache content to speed up reading. Fixes #224. Cache read content so that it doesn't have to be read next time if its source has not been modified. --- docs/faq.rst | 19 ++++++ docs/settings.rst | 64 ++++++++++++++++- pelican/__init__.py | 19 ++++++ pelican/contents.py | 7 ++ pelican/generators.py | 72 ++++++++++++-------- pelican/settings.py | 7 +- pelican/tests/test_generators.py | 59 ++++++++++++++++ pelican/tests/test_pelican.py | 6 ++ pelican/utils.py | 113 +++++++++++++++++++++++++++++++ 9 files changed, 334 insertions(+), 32 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 80e14d21..bb9377e6 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -205,3 +205,22 @@ You can also disable generation of tag-related pages via:: TAGS_SAVE_AS = '' TAG_SAVE_AS = '' + +Why does Pelican always write all HTML files even with content caching enabled? +=============================================================================== + +In order to reliably determine whether the HTML output is different +before writing it, a large part of the generation environment +including the template contexts, imported plugins, etc. would have to +be saved and compared, at least in the form of a hash (which would +require special handling of unhashable types), because of all the +possible combinations of plugins, pagination, etc. which may change in +many different ways. This would require a lot more processing time +and memory and storage space. Simply writing the files each time is a +lot faster and a lot more reliable. + +However, this means that the modification time of the files changes +every time, so a ``rsync`` based upload will transfer them even if +their content hasn't changed. A simple solution is to make ``rsync`` +use the ``--checksum`` option, which will make it compare the file +checksums in a much faster way than Pelican would. diff --git a/docs/settings.rst b/docs/settings.rst index 36cc3f9a..d8690230 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -173,6 +173,12 @@ Setting name (default value) `SLUGIFY_SOURCE` (``'input'``) Specifies where you want the slug to be automatically generated from. Can be set to 'title' to use the 'Title:' metadata tag or 'basename' to use the articles basename when creating the slug. +`CACHE_CONTENT` (``True``) If ``True``, save read content in a cache file. + See :ref:`reading_only_modified_content` for details about caching. +`CACHE_DIRECTORY` (``cache``) Directory in which to store cache files. +`CHECK_MODIFIED_METHOD` (``mtime``) Controls how files are checked for modifications. +`LOAD_CONTENT_CACHE` (``True``) If ``True``, load unmodified content from cache. +`GZIP_CACHE` (``True``) If ``True``, use gzip to (de)compress the cache files. =============================================================================== ===================================================================== .. [#] Default is the system locale. @@ -602,7 +608,7 @@ Setting name (default value) What does it do? .. [3] %s is the language Ordering content -================= +================ ================================================ ===================================================== Setting name (default value) What does it do? @@ -697,7 +703,6 @@ adding the following to your configuration:: CSS_FILE = "wide.css" - Logging ======= @@ -713,6 +718,61 @@ be filtered out. For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]`` +.. _reading_only_modified_content: + +Reading only modified content +============================= + +To speed up the build process, pelican can optionally read only articles +and pages with modified content. + +When Pelican is about to read some content source file: + +1. The hash or modification time information for the file from a + previous build are loaded from a cache file if `LOAD_CONTENT_CACHE` + is ``True``. These files are stored in the `CACHE_DIRECTORY` + directory. If the file has no record in the cache file, it is read + as usual. +2. The file is checked according to `CHECK_MODIFIED_METHOD`: + + - If set to ``'mtime'``, the modification time of the file is + checked. + - If set to a name of a function provided by the ``hashlib`` + module, e.g. ``'md5'``, the file hash is checked. + - If set to anything else or the necessary information about the + file cannot be found in the cache file, the content is read as + usual. + +3. If the file is considered unchanged, the content object saved in a + previous build corresponding to the file is loaded from the cache + and the file is not read. +4. If the file is considered changed, the file is read and the new + modification information and the content object are saved to the + cache if `CACHE_CONTENT` is ``True``. + +Modification time based checking is faster than comparing file hashes, +but is not as reliable, because mtime information can be lost when +e.g. copying the content sources using the ``cp`` or ``rsync`` +commands without the mtime preservation mode (invoked e.g. by +``--archive``). + +The cache files are Python pickles, so they may not be readable by +different versions of Python as the pickle format often changes. If +such an error is encountered, the cache files have to be rebuilt +using the pelican command-line option ``--full-rebuild``. +The cache files also have to be rebuilt when changing the +`GZIP_CACHE` setting for cache file reading to work. + +The ``--full-rebuild`` command-line option is also useful when the +whole site needs to be regenerated due to e.g. modifications to the +settings file or theme files. When pelican runs in autorealod mode, +modification of the settings file or theme will trigger a full rebuild +automatically. + +Note that even when using cached content, all output is always +written, so the modification times of the ``*.html`` files always +change. Therefore, ``rsync`` based upload may benefit from the +``--checksum`` option. Example settings ================ diff --git a/pelican/__init__.py b/pelican/__init__.py index 494e7e43..b6bfe326 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -260,6 +260,10 @@ def parse_arguments(): action='store_true', help='Relaunch pelican each time a modification occurs' ' on the content files.') + + parser.add_argument('-f', '--full-rebuild', action='store_true', + dest='full_rebuild', help='Rebuild everything by not loading from cache') + return parser.parse_args() @@ -275,6 +279,8 @@ def get_config(args): config['THEME'] = abstheme if os.path.exists(abstheme) else args.theme if args.delete_outputdir is not None: config['DELETE_OUTPUT_DIRECTORY'] = args.delete_outputdir + if args.full_rebuild: + config['LOAD_CONTENT_CACHE'] = False # argparse returns bytes in Py2. There is no definite answer as to which # encoding argparse (or sys.argv) uses. @@ -327,6 +333,7 @@ def main(): print(' --- AutoReload Mode: Monitoring `content`, `theme` and' ' `settings` for changes. ---') + first_run = True # load cache on first run while True: try: # Check source dir for changed files ending with the given @@ -335,9 +342,14 @@ def main(): # have changed, no matter what extension the filenames # have. modified = {k: next(v) for k, v in watchers.items()} + original_load_cache = settings['LOAD_CONTENT_CACHE'] if modified['settings']: pelican, settings = get_instance(args) + if not first_run: + original_load_cache = settings['LOAD_CONTENT_CACHE'] + # invalidate cache + pelican.settings['LOAD_CONTENT_CACHE'] = False if any(modified.values()): print('\n-> Modified: {}. re-generating...'.format( @@ -349,8 +361,15 @@ def main(): if modified['theme'] is None: logger.warning('Empty theme folder. Using `basic` ' 'theme.') + elif modified['theme']: + # theme modified, needs full rebuild -> no cache + if not first_run: # but not on first run + pelican.settings['LOAD_CONTENT_CACHE'] = False pelican.run() + first_run = False + # restore original caching policy + pelican.settings['LOAD_CONTENT_CACHE'] = original_load_cache except KeyboardInterrupt: logger.warning("Keyboard interrupt, quitting.") diff --git a/pelican/contents.py b/pelican/contents.py index 615a7fd8..c02047b8 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -325,6 +325,13 @@ class Content(object): os.path.abspath(self.settings['PATH'])) ) + def __eq__(self, other): + """Compare with metadata and content of other Content object""" + return other and self.metadata == other.metadata and self.content == other.content + + # keep basic hashing functionality for caching to work + __hash__ = object.__hash__ + class Page(Content): mandatory_properties = ('title',) diff --git a/pelican/generators.py b/pelican/generators.py index bfdac1a5..7c2dbbf2 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -20,14 +20,15 @@ from jinja2 import (Environment, FileSystemLoader, PrefixLoader, ChoiceLoader, from pelican.contents import Article, Draft, Page, Static, is_valid_content from pelican.readers import Readers -from pelican.utils import copy, process_translations, mkdir_p, DateFormatter +from pelican.utils import (copy, process_translations, mkdir_p, DateFormatter, + FileStampDataCacher) from pelican import signals logger = logging.getLogger(__name__) -class Generator(object): +class Generator(FileStampDataCacher): """Baseclass generator""" def __init__(self, context, settings, path, theme, output_path, **kwargs): @@ -73,6 +74,10 @@ class Generator(object): custom_filters = self.settings['JINJA_FILTERS'] self.env.filters.update(custom_filters) + # set up caching + super(Generator, self).__init__(settings, 'CACHE_CONTENT', + 'LOAD_CONTENT_CACHE') + signals.generator_init.send(self) def get_template(self, name): @@ -408,20 +413,24 @@ class ArticlesGenerator(Generator): for f in self.get_files( self.settings['ARTICLE_DIR'], exclude=self.settings['ARTICLE_EXCLUDES']): - try: - article = self.readers.read_file( - base_path=self.path, path=f, content_class=Article, - context=self.context, - preread_signal=signals.article_generator_preread, - preread_sender=self, - context_signal=signals.article_generator_context, - context_sender=self) - except Exception as e: - logger.warning('Could not process {}\n{}'.format(f, e)) - continue + article = self.get_cached_data(f, None) + if article is None: + try: + article = self.readers.read_file( + base_path=self.path, path=f, content_class=Article, + context=self.context, + preread_signal=signals.article_generator_preread, + preread_sender=self, + context_signal=signals.article_generator_context, + context_sender=self) + except Exception as e: + logger.warning('Could not process {}\n{}'.format(f, e)) + continue - if not is_valid_content(article, f): - continue + if not is_valid_content(article, f): + continue + + self.cache_data(f, article) self.add_source_path(article) @@ -502,7 +511,7 @@ class ArticlesGenerator(Generator): self._update_context(('articles', 'dates', 'tags', 'categories', 'tag_cloud', 'authors', 'related_posts')) - + self.save_cache() signals.article_generator_finalized.send(self) def generate_output(self, writer): @@ -527,20 +536,24 @@ class PagesGenerator(Generator): for f in self.get_files( self.settings['PAGE_DIR'], exclude=self.settings['PAGE_EXCLUDES']): - try: - page = self.readers.read_file( - base_path=self.path, path=f, content_class=Page, - context=self.context, - preread_signal=signals.page_generator_preread, - preread_sender=self, - context_signal=signals.page_generator_context, - context_sender=self) - except Exception as e: - logger.warning('Could not process {}\n{}'.format(f, e)) - continue + page = self.get_cached_data(f, None) + if page is None: + try: + page = self.readers.read_file( + base_path=self.path, path=f, content_class=Page, + context=self.context, + preread_signal=signals.page_generator_preread, + preread_sender=self, + context_signal=signals.page_generator_context, + context_sender=self) + except Exception as e: + logger.warning('Could not process {}\n{}'.format(f, e)) + continue - if not is_valid_content(page, f): - continue + if not is_valid_content(page, f): + continue + + self.cache_data(f, page) self.add_source_path(page) @@ -560,6 +573,7 @@ class PagesGenerator(Generator): self._update_context(('pages', )) self.context['PAGES'] = self.pages + self.save_cache() signals.page_generator_finalized.send(self) def generate_output(self, writer): diff --git a/pelican/settings.py b/pelican/settings.py index 7277c121..baf2a497 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -119,7 +119,12 @@ DEFAULT_CONFIG = { 'IGNORE_FILES': ['.#*'], 'SLUG_SUBSTITUTIONS': (), 'INTRASITE_LINK_REGEX': '[{|](?P.*?)[|}]', - 'SLUGIFY_SOURCE': 'title' + 'SLUGIFY_SOURCE': 'title', + 'CACHE_CONTENT': True, + 'CACHE_DIRECTORY': 'cache', + 'GZIP_CACHE': True, + 'CHECK_MODIFIED_METHOD': 'mtime', + 'LOAD_CONTENT_CACHE': True, } PYGMENTS_RST_OPTIONS = None diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 6f13aeb6..a500f87a 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -42,6 +42,7 @@ class TestArticlesGenerator(unittest.TestCase): settings['DEFAULT_CATEGORY'] = 'Default' settings['DEFAULT_DATE'] = (1970, 1, 1) settings['READERS'] = {'asc': None} + settings['CACHE_CONTENT'] = False # cache not needed for this logic tests cls.generator = ArticlesGenerator( context=settings.copy(), settings=settings, @@ -50,8 +51,15 @@ class TestArticlesGenerator(unittest.TestCase): cls.articles = [[page.title, page.status, page.category.name, page.template] for page in cls.generator.articles] + def setUp(self): + self.temp_cache = mkdtemp(prefix='pelican_cache.') + + def tearDown(self): + rmtree(self.temp_cache) + def test_generate_feeds(self): settings = get_settings() + settings['CACHE_DIRECTORY'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=None, theme=settings['THEME'], output_path=None) @@ -127,6 +135,7 @@ class TestArticlesGenerator(unittest.TestCase): settings['DEFAULT_CATEGORY'] = 'Default' settings['DEFAULT_DATE'] = (1970, 1, 1) settings['USE_FOLDER_AS_CATEGORY'] = False + settings['CACHE_DIRECTORY'] = self.temp_cache settings['READERS'] = {'asc': None} settings['filenames'] = {} generator = ArticlesGenerator( @@ -151,6 +160,7 @@ class TestArticlesGenerator(unittest.TestCase): def test_direct_templates_save_as_default(self): settings = get_settings(filenames={}) + settings['CACHE_DIRECTORY'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=None, theme=settings['THEME'], output_path=None) @@ -165,6 +175,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings() settings['DIRECT_TEMPLATES'] = ['archives'] settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' + settings['CACHE_DIRECTORY'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=None, theme=settings['THEME'], output_path=None) @@ -180,6 +191,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings() settings['DIRECT_TEMPLATES'] = ['archives'] settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' + settings['CACHE_DIRECTORY'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=None, theme=settings['THEME'], output_path=None) @@ -206,6 +218,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings(filenames={}) settings['YEAR_ARCHIVE_SAVE_AS'] = 'posts/{date:%Y}/index.html' + settings['CACHE_DIRECTORY'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=CONTENT_DIR, theme=settings['THEME'], output_path=None) @@ -268,6 +281,25 @@ class TestArticlesGenerator(unittest.TestCase): authors_expected = ['alexis-metaireau', 'first-author', 'second-author'] self.assertEqual(sorted(authors), sorted(authors_expected)) + def test_content_caching(self): + """Test that the articles are read only once when caching""" + settings = get_settings(filenames={}) + settings['CACHE_DIRECTORY'] = self.temp_cache + settings['READERS'] = {'asc': None} + + generator = ArticlesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.generate_context() + self.assertTrue(hasattr(generator, '_cache')) + + generator = ArticlesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.readers.read_file = MagicMock() + generator.generate_context() + generator.readers.read_file.assert_called_count == 0 + class TestPageGenerator(unittest.TestCase): # Note: Every time you want to test for a new field; Make sure the test @@ -275,12 +307,19 @@ class TestPageGenerator(unittest.TestCase): # distill_pages Then update the assertEqual in test_generate_context # to match expected + def setUp(self): + self.temp_cache = mkdtemp(prefix='pelican_cache.') + + def tearDown(self): + rmtree(self.temp_cache) + def distill_pages(self, pages): return [[page.title, page.status, page.template] for page in pages] def test_generate_context(self): settings = get_settings(filenames={}) settings['PAGE_DIR'] = 'TestPages' # relative to CUR_DIR + settings['CACHE_DIRECTORY'] = self.temp_cache settings['DEFAULT_DATE'] = (1970, 1, 1) generator = PagesGenerator( @@ -306,6 +345,26 @@ class TestPageGenerator(unittest.TestCase): self.assertEqual(sorted(pages_expected), sorted(pages)) self.assertEqual(sorted(hidden_pages_expected), sorted(hidden_pages)) + def test_content_caching(self): + """Test that the pages are read only once when caching""" + settings = get_settings(filenames={}) + settings['CACHE_DIRECTORY'] = 'cache_dir' #TODO + settings['CACHE_DIRECTORY'] = self.temp_cache + settings['READERS'] = {'asc': None} + + generator = PagesGenerator( + context=settings.copy(), settings=settings, + path=CUR_DIR, theme=settings['THEME'], output_path=None) + generator.generate_context() + self.assertTrue(hasattr(generator, '_cache')) + + generator = PagesGenerator( + context=settings.copy(), settings=settings, + path=CUR_DIR, theme=settings['THEME'], output_path=None) + generator.readers.read_file = MagicMock() + generator.generate_context() + generator.readers.read_file.assert_called_count == 0 + class TestTemplatePagesGenerator(unittest.TestCase): diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index 2d4bbdfc..15876095 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -43,12 +43,14 @@ class TestPelican(LoggedTestCase): def setUp(self): super(TestPelican, self).setUp() self.temp_path = mkdtemp(prefix='pelicantests.') + self.temp_cache = mkdtemp(prefix='pelican_cache.') self.old_locale = locale.setlocale(locale.LC_ALL) self.maxDiff = None locale.setlocale(locale.LC_ALL, str('C')) def tearDown(self): rmtree(self.temp_path) + rmtree(self.temp_cache) locale.setlocale(locale.LC_ALL, self.old_locale) super(TestPelican, self).tearDown() @@ -77,6 +79,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=None, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, + 'CACHE_DIRECTORY': self.temp_cache, 'LOCALE': locale.normalize('en_US'), }) pelican = Pelican(settings=settings) @@ -92,6 +95,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=SAMPLE_CONFIG, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, + 'CACHE_DIRECTORY': self.temp_cache, 'LOCALE': locale.normalize('en_US'), }) pelican = Pelican(settings=settings) @@ -103,6 +107,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=SAMPLE_CONFIG, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, + 'CACHE_DIRECTORY': self.temp_cache, 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, 'very'), os.path.join(SAMPLES_PATH, 'kinda'), os.path.join(SAMPLES_PATH, 'theme_standard')] @@ -123,6 +128,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=SAMPLE_CONFIG, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, + 'CACHE_DIRECTORY': self.temp_cache, 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, 'theme_standard')] }) diff --git a/pelican/utils.py b/pelican/utils.py index c5aacaa3..8c416921 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -12,6 +12,8 @@ import pytz import re import shutil import traceback +import pickle +import hashlib from collections import Hashable from contextlib import contextmanager @@ -545,3 +547,114 @@ def split_all(path): break path = head return components + + +class FileDataCacher(object): + '''Class that can cache data contained in files''' + + def __init__(self, settings, cache_policy_key, load_policy_key): + '''Load the specified cache within CACHE_DIRECTORY + + only if load_policy_key in setttings is True, + May use gzip if GZIP_CACHE. + Sets caching policy according to *cache_policy_key* + in *settings* + ''' + self.settings = settings + name = self.__class__.__name__ + self._cache_path = os.path.join(self.settings['CACHE_DIRECTORY'], name) + self._cache_data_policy = self.settings[cache_policy_key] + if not self.settings[load_policy_key]: + self._cache = {} + return + if self.settings['GZIP_CACHE']: + import gzip + self._cache_open = gzip.open + else: + self._cache_open = open + try: + with self._cache_open(self._cache_path, 'rb') as f: + self._cache = pickle.load(f) + except Exception as e: + self._cache = {} + + def cache_data(self, filename, data): + '''Cache data for given file''' + if not self._cache_data_policy: + return + self._cache[filename] = data + + def get_cached_data(self, filename, default={}): + '''Get cached data for the given file + + if no data is cached, return the default object + ''' + return self._cache.get(filename, default) + + def save_cache(self): + '''Save the updated cache''' + if not self._cache_data_policy: + return + try: + mkdir_p(self.settings['CACHE_DIRECTORY']) + with self._cache_open(self._cache_path, 'wb') as f: + pickle.dump(self._cache, f) + except Exception as e: + logger.warning('Could not save cache {}\n{}'.format( + self._cache_path, e)) + + +class FileStampDataCacher(FileDataCacher): + '''Subclass that also caches the stamp of the file''' + + def __init__(self, settings, cache_policy_key, load_policy_key): + '''This sublcass additionaly sets filestamp function''' + super(FileStampDataCacher, self).__init__(settings, cache_policy_key, + load_policy_key) + + method = self.settings['CHECK_MODIFIED_METHOD'] + if method == 'mtime': + self._filestamp_func = os.path.getmtime + else: + try: + hash_func = getattr(hashlib, method) + def filestamp_func(buf): + return hash_func(buf).digest() + self._filestamp_func = filestamp_func + except ImportError: + self._filestamp_func = None + + def cache_data(self, filename, data): + '''Cache stamp and data for the given file''' + stamp = self._get_file_stamp(filename) + super(FileStampDataCacher, self).cache_data(filename, (stamp, data)) + + def _get_file_stamp(self, filename): + '''Check if the given file has been modified + since the previous build. + + depending on CHECK_MODIFIED_METHOD + a float may be returned for 'mtime', + a hash for a function name in the hashlib module + or an empty bytes string otherwise + ''' + filename = os.path.join(self.path, filename) + try: + with open(filename, 'rb') as f: + return self._filestamp_func(f.read()) + except Exception: + return b'' + + def get_cached_data(self, filename, default=None): + '''Get the cached data for the given filename + if the file has not been modified. + + If no record exists or file has been modified, return default. + Modification is checked by compaing the cached + and current file stamp. + ''' + stamp, data = super(FileStampDataCacher, self).get_cached_data( + filename, (None, default)) + if stamp != self._get_file_stamp(filename): + return default + return data From 5b4381c19cb372866f5e2343d108c3193206195d Mon Sep 17 00:00:00 2001 From: Federico Ceratto Date: Sun, 9 Mar 2014 22:04:43 +0000 Subject: [PATCH 1124/2344] Add s3cmd MIME type detection --- pelican/tools/templates/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index fe7a60a4..c542e588 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -97,7 +97,7 @@ ftp_upload: publish lftp ftp://$$(FTP_USER)@$$(FTP_HOST) -e "mirror -R $$(OUTPUTDIR) $$(FTP_TARGET_DIR) ; quit" s3_upload: publish - s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed + s3cmd sync $(OUTPUTDIR)/ s3://$(S3_BUCKET) --acl-public --delete-removed --guess-mime-type cf_upload: publish cd $(OUTPUTDIR) && swift -v -A https://auth.api.rackspacecloud.com/v1.0 -U $(CLOUDFILES_USERNAME) -K $(CLOUDFILES_API_KEY) upload -c $(CLOUDFILES_CONTAINER) . From 4cae9ea88f552ec3166629ec1e9f004567245a06 Mon Sep 17 00:00:00 2001 From: Lonewolf Date: Mon, 31 Mar 2014 14:28:46 +0530 Subject: [PATCH 1125/2344] Added new sphinxtheme as requirement for docs Modified docs conf to support the theme update --- dev_requirements.txt | 3 +++ docs/conf.py | 34 +++++++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index c90ac630..01fe2507 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -9,3 +9,6 @@ typogrify # To perform release bumpr==0.2.0 + +# For docs theme +sphinx_rtd_theme diff --git a/docs/conf.py b/docs/conf.py index 6db0f3d1..99acd1b6 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -2,6 +2,8 @@ from __future__ import unicode_literals import sys, os +on_rtd = os.environ.get('READTHEDOCS', None) == 'True' + sys.path.append(os.path.abspath(os.pardir)) from pelican import __version__ @@ -21,29 +23,43 @@ rst_prolog = ''' .. |last_stable| replace:: :pelican-doc:`{0}` '''.format(last_stable) +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + extlinks = { 'pelican-doc': ('http://docs.getpelican.com/%s/', '') } # -- Options for HTML output --------------------------------------------------- -html_theme_path = ['_themes'] -html_theme = 'pelican' - -html_theme_options = { - 'nosidebar': True, - 'index_logo': 'pelican.png', - 'github_fork': 'getpelican/pelican', -} +html_theme = 'default' +if not on_rtd: + try: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + except ImportError: + pass html_static_path = ['_static'] # Output file base name for HTML help builder. htmlhelp_basename = 'Pelicandoc' +html_use_smartypants = True + +# If false, no module index is generated. +html_use_modindex = False + +# If false, no index is generated. +html_use_index = False + +# If true, links to the reST sources are added to the pages. +html_show_sourcelink = False + # -- Options for LaTeX output -------------------------------------------------- latex_documents = [ - ('index', 'Pelican.tex', 'Pelican Documentation', + ('index', 'Pelican.tex', 'Pelican Documentation', 'Alexis Métaireau', 'manual'), ] From e97e9b5ae5fa5494f136521afb3594cf3e65fc83 Mon Sep 17 00:00:00 2001 From: Antoine Brenner Date: Tue, 15 Apr 2014 00:04:40 +0200 Subject: [PATCH 1126/2344] Fix unittest issue related to python2/python3 differences Under python 2, with non-ascii locales, u"{:%b}".format(date) can raise UnicodeDecodeError because u"{:%b}".format(date) will call date.__format__(u"%b"), which will return a byte string and not a unicode string. eg: locale.setlocale(locale.LC_ALL, 'ja_JP.utf8') date.__format__(u"%b") == '12\xe6\x9c\x88' # True This commit catches UnicodeDecodeError and calls date.__format__() with byte strings instead of characters, since it to work with character strings --- pelican/generators.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 7c2dbbf2..1b584d3f 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -309,7 +309,20 @@ class ArticlesGenerator(Generator): # format string syntax can be used for specifying the # period archive dates date = archive[0].date - save_as = save_as_fmt.format(date=date) + # Under python 2, with non-ascii locales, u"{:%b}".format(date) might raise UnicodeDecodeError + # because u"{:%b}".format(date) will call date.__format__(u"%b"), which will return a byte string + # and not a unicode string. + # eg: + # locale.setlocale(locale.LC_ALL, 'ja_JP.utf8') + # date.__format__(u"%b") == '12\xe6\x9c\x88' # True + try: + save_as = save_as_fmt.format(date=date) + except UnicodeDecodeError: + # Python2 only: + # Let date.__format__() work with byte strings instead of characters since it fails to work with characters + bytes_save_as_fmt = save_as_fmt.encode('utf8') + bytes_save_as = bytes_save_as_fmt.format(date=date) + save_as = unicode(bytes_save_as,'utf8') context = self.context.copy() if key == period_date_key['year']: From 7277c95fb588463d035decefcf86f59d41a4e7c0 Mon Sep 17 00:00:00 2001 From: Antoine Brenner Date: Tue, 15 Apr 2014 16:36:29 +0200 Subject: [PATCH 1127/2344] Make sure locale is what we want before/after the tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The locale is a global state, and it was not properly reset to whatever it was before the unitttest possibly changed it. This is now fixed. Not restoring the locale led to weird issues: depending on the order chosen by "python -m unittest discover" to run the unit tests, some tests would apparently randomly fail due to the locale not being what was expected. For example, test_period_in_timeperiod_archive would call mock('posts/1970/ 1月/index.html',...) instead of expected mock('posts/1970/Jan/index.html',...) and fail. --- pelican/tests/test_contents.py | 6 ++++++ pelican/tests/test_generators.py | 11 +++++++++++ pelican/tests/test_importer.py | 11 +++++++++++ pelican/tests/test_paginator.py | 8 +++++++- pelican/tests/test_pelican.py | 2 +- pelican/tests/test_settings.py | 5 +++++ pelican/tests/test_utils.py | 3 +++ 7 files changed, 44 insertions(+), 2 deletions(-) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 27d2a897..3c0f8d75 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals, absolute_import import six from datetime import datetime from sys import platform +import locale from pelican.tests.support import unittest, get_settings @@ -22,6 +23,8 @@ class TestPage(unittest.TestCase): def setUp(self): super(TestPage, self).setUp() + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, str('C')) self.page_kwargs = { 'content': TEST_CONTENT, 'context': { @@ -35,6 +38,9 @@ class TestPage(unittest.TestCase): 'source_path': '/path/to/file/foo.ext' } + def tearDown(self): + locale.setlocale(locale.LC_ALL, self.old_locale) + def test_use_args(self): # Creating a page with arguments passed to the constructor should use # them to initialise object's attributes. diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index a500f87a..ff487c3e 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -14,6 +14,7 @@ from pelican.generators import (Generator, ArticlesGenerator, PagesGenerator, TemplatePagesGenerator) from pelican.writers import Writer from pelican.tests.support import unittest, get_settings +import locale CUR_DIR = os.path.dirname(__file__) CONTENT_DIR = os.path.join(CUR_DIR, 'content') @@ -21,11 +22,17 @@ CONTENT_DIR = os.path.join(CUR_DIR, 'content') class TestGenerator(unittest.TestCase): def setUp(self): + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, str('C')) self.settings = get_settings() self.settings['READERS'] = {'asc': None} self.generator = Generator(self.settings.copy(), self.settings, CUR_DIR, self.settings['THEME'], None) + def tearDown(self): + locale.setlocale(locale.LC_ALL, self.old_locale) + + def test_include_path(self): filename = os.path.join(CUR_DIR, 'content', 'article.rst') include_path = self.generator._include_path @@ -373,10 +380,14 @@ class TestTemplatePagesGenerator(unittest.TestCase): def setUp(self): self.temp_content = mkdtemp(prefix='pelicantests.') self.temp_output = mkdtemp(prefix='pelicantests.') + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, str('C')) + def tearDown(self): rmtree(self.temp_content) rmtree(self.temp_output) + locale.setlocale(locale.LC_ALL, self.old_locale) def test_generate_output(self): diff --git a/pelican/tests/test_importer.py b/pelican/tests/test_importer.py index 8412c75b..65193bf5 100644 --- a/pelican/tests/test_importer.py +++ b/pelican/tests/test_importer.py @@ -4,6 +4,7 @@ from __future__ import unicode_literals, print_function import os import re +import locale from pelican.tools.pelican_import import wp2fields, fields2pelican, decode_wp_content, build_header, build_markdown_header, get_attachments, download_attachments from pelican.tests.support import (unittest, temporary_folder, mute, skipIfNoExecutable) @@ -30,9 +31,14 @@ except ImportError: class TestWordpressXmlImporter(unittest.TestCase): def setUp(self): + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, str('C')) self.posts = list(wp2fields(WORDPRESS_XML_SAMPLE)) self.custposts = list(wp2fields(WORDPRESS_XML_SAMPLE, True)) + def tearDown(self): + locale.setlocale(locale.LC_ALL, self.old_locale) + def test_ignore_empty_posts(self): self.assertTrue(self.posts) for title, content, fname, date, author, categ, tags, kind, format in self.posts: @@ -261,8 +267,13 @@ class TestBuildHeader(unittest.TestCase): @unittest.skipUnless(BeautifulSoup, 'Needs BeautifulSoup module') class TestWordpressXMLAttachements(unittest.TestCase): def setUp(self): + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, str('C')) self.attachments = get_attachments(WORDPRESS_XML_SAMPLE) + def tearDown(self): + locale.setlocale(locale.LC_ALL, self.old_locale) + def test_recognise_attachments(self): self.assertTrue(self.attachments) self.assertTrue(len(self.attachments.keys()) == 3) diff --git a/pelican/tests/test_paginator.py b/pelican/tests/test_paginator.py index f454d47d..108dc791 100644 --- a/pelican/tests/test_paginator.py +++ b/pelican/tests/test_paginator.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals, absolute_import import six +import locale from pelican.tests.support import unittest, get_settings @@ -16,6 +17,8 @@ TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False) class TestPage(unittest.TestCase): def setUp(self): super(TestPage, self).setUp() + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, str('C')) self.page_kwargs = { 'content': TEST_CONTENT, 'context': { @@ -29,6 +32,9 @@ class TestPage(unittest.TestCase): 'source_path': '/path/to/file/foo.ext' } + def tearDown(self): + locale.setlocale(locale.LC_ALL, self.old_locale) + def test_save_as_preservation(self): settings = get_settings() # fix up pagination rules @@ -47,4 +53,4 @@ class TestPage(unittest.TestCase): object_list = [Article(**self.page_kwargs), Article(**self.page_kwargs)] paginator = Paginator('foobar.foo', object_list, settings) page = paginator.page(1) - self.assertEqual(page.save_as, 'foobar.foo') \ No newline at end of file + self.assertEqual(page.save_as, 'foobar.foo') diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index 15876095..974986cd 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -44,8 +44,8 @@ class TestPelican(LoggedTestCase): super(TestPelican, self).setUp() self.temp_path = mkdtemp(prefix='pelicantests.') self.temp_cache = mkdtemp(prefix='pelican_cache.') - self.old_locale = locale.setlocale(locale.LC_ALL) self.maxDiff = None + self.old_locale = locale.setlocale(locale.LC_ALL) locale.setlocale(locale.LC_ALL, str('C')) def tearDown(self): diff --git a/pelican/tests/test_settings.py b/pelican/tests/test_settings.py index 7907a551..930e0fea 100644 --- a/pelican/tests/test_settings.py +++ b/pelican/tests/test_settings.py @@ -16,10 +16,15 @@ class TestSettingsConfiguration(unittest.TestCase): optimizations. """ def setUp(self): + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, str('C')) self.PATH = abspath(dirname(__file__)) default_conf = join(self.PATH, 'default_conf.py') self.settings = read_settings(default_conf) + def tearDown(self): + locale.setlocale(locale.LC_ALL, self.old_locale) + def test_overwrite_existing_settings(self): self.assertEqual(self.settings.get('SITENAME'), "Alexis' log") self.assertEqual(self.settings.get('SITEURL'), diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 9047593f..02398336 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -354,9 +354,12 @@ class TestCopy(unittest.TestCase): def setUp(self): self.root_dir = mkdtemp(prefix='pelicantests.') + self.old_locale = locale.setlocale(locale.LC_ALL) + locale.setlocale(locale.LC_ALL, str('C')) def tearDown(self): shutil.rmtree(self.root_dir) + locale.setlocale(locale.LC_ALL, self.old_locale) def _create_file(self, *path): with open(os.path.join(self.root_dir, *path), 'w') as f: From dd70f1b24ece9bba33fb115336a6e159c867f5b2 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 15 Apr 2014 11:13:10 -0400 Subject: [PATCH 1128/2344] Fix settings table in docs --- docs/settings.rst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index d8690230..9599ee10 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -249,9 +249,9 @@ posts for the month at ``posts/2011/Aug/index.html``. arrive at an appropriate archive of posts, without having to specify a page name. -==================================================== ===================================================== +====================================================== ===================================================== Setting name (default value) What does it do? -==================================================== ===================================================== +====================================================== ===================================================== `ARTICLE_URL` (``'{slug}.html'``) The URL to refer to an article. `ARTICLE_SAVE_AS` (``'{slug}.html'``) The place where we will save an article. `ARTICLE_LANG_URL` (``'{slug}-{lang}.html'``) The URL to refer to an article which doesn't use the @@ -262,7 +262,7 @@ Setting name (default value) What does it do? `DRAFT_SAVE_AS` (``'drafts/{slug}.html'``) The place where we will save an article draft. `DRAFT_LANG_URL` (``'drafts/{slug}-{lang}.html'``) The URL to refer to an article draft which doesn't use the default language. -`DRAFT_LANG_SAVE_AS` (``'drafts/{slug}-{lang}.html'``) The place where we will save an article draft which +`DRAFT_LANG_SAVE_AS` (``'drafts/{slug}-{lang}.html'``) The place where we will save an article draft which doesn't use the default language. `PAGE_URL` (``'pages/{slug}.html'``) The URL we will use to link to a page. `PAGE_SAVE_AS` (``'pages/{slug}.html'``) The location we will save the page. This value has to be @@ -285,7 +285,7 @@ Setting name (default value) What does it do? non-alphanumerics when generating slugs. Specified as a list of 2-tuples of ``(from, to)`` which are applied in order. -==================================================== ===================================================== +====================================================== ===================================================== .. note:: From fd7cb9e2132e0b66adeff40c5d780a842f84fb6c Mon Sep 17 00:00:00 2001 From: Antoine Brenner Date: Tue, 15 Apr 2014 22:01:20 +0200 Subject: [PATCH 1129/2344] Test to reproduce an issue that occurs with python3.3 under macos10 only This test passes fine under linux --- pelican/tests/test_utils.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 02398336..3c12a15b 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -458,6 +458,25 @@ class TestDateFormatter(unittest.TestCase): locale.setlocale(locale.LC_ALL, '') + @unittest.skipUnless(locale_available('fr_FR.UTF-8') or + locale_available('French'), + 'French locale needed') + def test_french_strftime(self): + # This test tries to reproduce an issue that occured with python3.3 under macos10 only + locale.setlocale(locale.LC_ALL, str('fr_FR.UTF-8')) + date = datetime.datetime(2014,8,14) + # we compare the lower() dates since macos10 returns "Jeudi" for %A whereas linux reports "jeudi" + self.assertEqual( u'jeudi, 14 août 2014', utils.strftime(date, date_format="%A, %d %B %Y").lower() ) + df = utils.DateFormatter() + self.assertEqual( u'jeudi, 14 août 2014', df(date, date_format="%A, %d %B %Y").lower() ) + # Let us now set the global locale to C: + locale.setlocale(locale.LC_ALL, str('C')) + # DateFormatter should still work as expected since it is the whole point of DateFormatter + # (This is where pre-2014/4/15 code fails on macos10) + df_date = df(date, date_format="%A, %d %B %Y").lower() + self.assertEqual( u'jeudi, 14 août 2014', df_date ) + + @unittest.skipUnless(locale_available('fr_FR.UTF-8') or locale_available('French'), 'French locale needed') From 6703950abec63a25d412bd96d6aa419c6f449c97 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Thu, 17 Apr 2014 16:28:22 +0200 Subject: [PATCH 1130/2344] enable writing of only selected output paths - add WRITE_SELECTED setting - add --write-selected commandline option --- docs/faq.rst | 5 +++++ docs/settings.rst | 19 +++++++++++++++++++ pelican/__init__.py | 6 ++++++ pelican/settings.py | 7 +++++++ pelican/tests/test_pelican.py | 23 +++++++++++++++++++++++ pelican/utils.py | 14 ++++++++++++++ pelican/writers.py | 9 +++++++-- 7 files changed, 81 insertions(+), 2 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index bb9377e6..bf468c51 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -224,3 +224,8 @@ every time, so a ``rsync`` based upload will transfer them even if their content hasn't changed. A simple solution is to make ``rsync`` use the ``--checksum`` option, which will make it compare the file checksums in a much faster way than Pelican would. + +When only several specific output files are of interest (e.g. when +working on some specific page or the theme templates), the +`WRITE_SELECTED` option may help, see +:ref:`writing_only_selected_content`. diff --git a/docs/settings.rst b/docs/settings.rst index 9599ee10..8d8f9a16 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -179,6 +179,10 @@ Setting name (default value) `CHECK_MODIFIED_METHOD` (``mtime``) Controls how files are checked for modifications. `LOAD_CONTENT_CACHE` (``True``) If ``True``, load unmodified content from cache. `GZIP_CACHE` (``True``) If ``True``, use gzip to (de)compress the cache files. +`WRITE_SELECTED` (``[]``) If this list is not empty, **only** output files with their paths + in this list are written. Paths should be either relative to the current + working directory of Pelican or absolute. For possible use cases see + :ref:`writing_only_selected_content`. =============================================================================== ===================================================================== .. [#] Default is the system locale. @@ -774,6 +778,21 @@ written, so the modification times of the ``*.html`` files always change. Therefore, ``rsync`` based upload may benefit from the ``--checksum`` option. +.. _writing_only_selected_content: + +Writing only selected content +============================= + +When one article or page or the theme is being worked on it is often +desirable to display selected output files as soon as possible. In +such cases generating and writing all output is often unnecessary. +These selected output files can be given as output paths in the +`WRITE_SELECTED` list and **only** those files will be written. This +list can be also specified on the command-line using the +``--write-selected`` option which accepts a comma separated list +of output file paths. By default the list is empty so all output is +written. + Example settings ================ diff --git a/pelican/__init__.py b/pelican/__init__.py index b6bfe326..1ed98fc3 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -264,6 +264,10 @@ def parse_arguments(): parser.add_argument('-f', '--full-rebuild', action='store_true', dest='full_rebuild', help='Rebuild everything by not loading from cache') + parser.add_argument('-w', '--write-selected', type=str, + dest='selected_paths', default=None, + help='Comma separated list of selected paths to write') + return parser.parse_args() @@ -281,6 +285,8 @@ def get_config(args): config['DELETE_OUTPUT_DIRECTORY'] = args.delete_outputdir if args.full_rebuild: config['LOAD_CONTENT_CACHE'] = False + if args.selected_paths: + config['WRITE_SELECTED'] = args.selected_paths.split(',') # argparse returns bytes in Py2. There is no definite answer as to which # encoding argparse (or sys.argv) uses. diff --git a/pelican/settings.py b/pelican/settings.py index baf2a497..7615c25c 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -125,6 +125,7 @@ DEFAULT_CONFIG = { 'GZIP_CACHE': True, 'CHECK_MODIFIED_METHOD': 'mtime', 'LOAD_CONTENT_CACHE': True, + 'WRITE_SELECTED': [], } PYGMENTS_RST_OPTIONS = None @@ -200,6 +201,12 @@ def configure_settings(settings): raise Exception("Could not find the theme %s" % settings['THEME']) + # make paths selected for writing absolute if necessary + settings['WRITE_SELECTED'] = [ + os.path.abspath(path) for path in + settings.get('WRITE_SELECTED', DEFAULT_CONFIG['WRITE_SELECTED']) + ] + # standardize strings to lowercase strings for key in [ 'DEFAULT_LANG', diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index 974986cd..294cf399 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -138,3 +138,26 @@ class TestPelican(LoggedTestCase): for file in ['a_stylesheet', 'a_template']: self.assertTrue(os.path.exists(os.path.join(theme_output, file))) + + def test_write_only_selected(self): + """Test that only the selected files are written""" + settings = read_settings(path=None, override={ + 'PATH': INPUT_PATH, + 'OUTPUT_PATH': self.temp_path, + 'CACHE_DIRECTORY': self.temp_cache, + 'WRITE_SELECTED': [ + os.path.join(self.temp_path, 'oh-yeah.html'), + os.path.join(self.temp_path, 'categories.html'), + ], + 'LOCALE': locale.normalize('en_US'), + }) + pelican = Pelican(settings=settings) + logger = logging.getLogger() + orig_level = logger.getEffectiveLevel() + logger.setLevel(logging.INFO) + mute(True)(pelican.run)() + logger.setLevel(orig_level) + self.assertLogCountEqual( + count=2, + msg="writing .*", + level=logging.INFO) diff --git a/pelican/utils.py b/pelican/utils.py index 8c416921..cd942fd5 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -658,3 +658,17 @@ class FileStampDataCacher(FileDataCacher): if stamp != self._get_file_stamp(filename): return default return data + + +def is_selected_for_writing(settings, path): + '''Check whether path is selected for writing + according to the WRITE_SELECTED list + + If WRITE_SELECTED is an empty list (default), + any path is selected for writing. + ''' + if settings['WRITE_SELECTED']: + return path in settings['WRITE_SELECTED'] + else: + return True + diff --git a/pelican/writers.py b/pelican/writers.py index 19e36e39..a92feee4 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -16,7 +16,8 @@ from feedgenerator import Atom1Feed, Rss201rev2Feed from jinja2 import Markup from pelican.paginator import Paginator -from pelican.utils import get_relative_path, path_to_url, set_date_tzinfo +from pelican.utils import (get_relative_path, path_to_url, set_date_tzinfo, + is_selected_for_writing) from pelican import signals logger = logging.getLogger(__name__) @@ -92,6 +93,8 @@ class Writer(object): :param path: the path to output. :param feed_type: the feed type to use (atom or rss) """ + if not is_selected_for_writing(self.settings, path): + return old_locale = locale.setlocale(locale.LC_ALL) locale.setlocale(locale.LC_ALL, str('C')) try: @@ -140,7 +143,9 @@ class Writer(object): :param **kwargs: additional variables to pass to the templates """ - if name is False or name == "": + if name is False or name == "" or\ + not is_selected_for_writing(self.settings,\ + os.path.join(self.output_path, name)): return elif not name: # other stuff, just return for now From 6972261261a4eed164728943a037e1382d772f21 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Thu, 17 Apr 2014 22:57:26 +0200 Subject: [PATCH 1131/2344] Add python 3.4 to tox config. --- tox.ini | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tox.ini b/tox.ini index a72aea21..5dd36c36 100644 --- a/tox.ini +++ b/tox.ini @@ -2,7 +2,7 @@ # depends on some external libraries that aren't released yet. [tox] -envlist = py27,py33 +envlist = py27,py33,py34 [testenv] commands = From 676981c62110779e3d6adb04d08492f9f32f7af3 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Fri, 18 Apr 2014 06:57:59 +0200 Subject: [PATCH 1132/2344] set _cache_open func even if not loading cache, fixes autoreload The _cache_open attribute of the FileDataCacher class was not set when settings[load_policy_key] was not True, so saving later failed. As a precaution, replaced the `if ...: return` style with a plain if structure to prevent such readability issues and added tests. --- pelican/tests/test_generators.py | 48 ++++++++++++++++++++++++++++++++ pelican/utils.py | 36 +++++++++++------------- 2 files changed, 65 insertions(+), 19 deletions(-) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index ff487c3e..f951f0cb 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -307,6 +307,30 @@ class TestArticlesGenerator(unittest.TestCase): generator.generate_context() generator.readers.read_file.assert_called_count == 0 + def test_full_rebuild(self): + """Test that all the articles are read again when not loading cache + + used in --full-rebuild or autoreload mode""" + settings = get_settings(filenames={}) + settings['CACHE_DIRECTORY'] = self.temp_cache + settings['READERS'] = {'asc': None} + + generator = ArticlesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.readers.read_file = MagicMock() + generator.generate_context() + self.assertTrue(hasattr(generator, '_cache_open')) + orig_call_count = generator.readers.read_file.call_count + + settings['LOAD_CONTENT_CACHE'] = False + generator = ArticlesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.readers.read_file = MagicMock() + generator.generate_context() + generator.readers.read_file.assert_called_count == orig_call_count + class TestPageGenerator(unittest.TestCase): # Note: Every time you want to test for a new field; Make sure the test @@ -372,6 +396,30 @@ class TestPageGenerator(unittest.TestCase): generator.generate_context() generator.readers.read_file.assert_called_count == 0 + def test_full_rebuild(self): + """Test that all the pages are read again when not loading cache + + used in --full-rebuild or autoreload mode""" + settings = get_settings(filenames={}) + settings['CACHE_DIRECTORY'] = self.temp_cache + settings['READERS'] = {'asc': None} + + generator = PagesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.readers.read_file = MagicMock() + generator.generate_context() + self.assertTrue(hasattr(generator, '_cache_open')) + orig_call_count = generator.readers.read_file.call_count + + settings['LOAD_CONTENT_CACHE'] = False + generator = PagesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.readers.read_file = MagicMock() + generator.generate_context() + generator.readers.read_file.assert_called_count == orig_call_count + class TestTemplatePagesGenerator(unittest.TestCase): diff --git a/pelican/utils.py b/pelican/utils.py index 8c416921..e76c559f 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -564,25 +564,24 @@ class FileDataCacher(object): name = self.__class__.__name__ self._cache_path = os.path.join(self.settings['CACHE_DIRECTORY'], name) self._cache_data_policy = self.settings[cache_policy_key] - if not self.settings[load_policy_key]: - self._cache = {} - return if self.settings['GZIP_CACHE']: import gzip self._cache_open = gzip.open else: self._cache_open = open - try: - with self._cache_open(self._cache_path, 'rb') as f: - self._cache = pickle.load(f) - except Exception as e: + if self.settings[load_policy_key]: + try: + with self._cache_open(self._cache_path, 'rb') as f: + self._cache = pickle.load(f) + except Exception as e: + self._cache = {} + else: self._cache = {} def cache_data(self, filename, data): '''Cache data for given file''' - if not self._cache_data_policy: - return - self._cache[filename] = data + if self._cache_data_policy: + self._cache[filename] = data def get_cached_data(self, filename, default={}): '''Get cached data for the given file @@ -593,15 +592,14 @@ class FileDataCacher(object): def save_cache(self): '''Save the updated cache''' - if not self._cache_data_policy: - return - try: - mkdir_p(self.settings['CACHE_DIRECTORY']) - with self._cache_open(self._cache_path, 'wb') as f: - pickle.dump(self._cache, f) - except Exception as e: - logger.warning('Could not save cache {}\n{}'.format( - self._cache_path, e)) + if self._cache_data_policy: + try: + mkdir_p(self.settings['CACHE_DIRECTORY']) + with self._cache_open(self._cache_path, 'wb') as f: + pickle.dump(self._cache, f) + except Exception as e: + logger.warning('Could not save cache {}\n{}'.format( + self._cache_path, e)) class FileStampDataCacher(FileDataCacher): From 22484983e911daec0234e924574e5b2f52683f70 Mon Sep 17 00:00:00 2001 From: James Lee Date: Sat, 19 Apr 2014 03:37:47 +0900 Subject: [PATCH 1133/2344] Handle list metadata as list of string in MarkdownReader --- pelican/readers.py | 6 ++++++ .../tests/content/article_with_markdown_and_footnote.md | 6 ++++++ pelican/tests/test_readers.py | 8 ++++++++ 3 files changed, 20 insertions(+) diff --git a/pelican/readers.py b/pelican/readers.py index 35c38220..3f8a551e 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -204,12 +204,18 @@ class MarkdownReader(BaseReader): for name, value in meta.items(): name = name.lower() if name == "summary": + # handle summary metadata as markdown + # summary metadata is special case and join all list values summary_values = "\n".join(value) # reset the markdown instance to clear any state self._md.reset() summary = self._md.convert(summary_values) output[name] = self.process_metadata(name, summary) + elif len(value) > 1: + # handle list metadata as list of string + output[name] = self.process_metadata(name, value) else: + # otherwise, handle metadata as single string output[name] = self.process_metadata(name, value[0]) return output diff --git a/pelican/tests/content/article_with_markdown_and_footnote.md b/pelican/tests/content/article_with_markdown_and_footnote.md index 332ccea6..6fea2d6e 100644 --- a/pelican/tests/content/article_with_markdown_and_footnote.md +++ b/pelican/tests/content/article_with_markdown_and_footnote.md @@ -2,6 +2,12 @@ Title: Article with markdown containing footnotes Date: 2012-10-31 Modified: 2012-11-01 Summary: Summary with **inline** markup *should* be supported. +Multiline: Line Metadata should be handle properly. + See syntax of Meta-Data extension of Python Markdown package: + If a line is indented by 4 or more spaces, + that line is assumed to be an additional line of the value + for the previous keyword. + A keyword may have as many lines as desired. This is some content[^1] with some footnotes[^footnote] diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index d4201a5e..fd30e9b9 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -214,6 +214,14 @@ class MdReaderTest(ReaderTest): 'date': datetime.datetime(2012, 10, 31), 'modified': datetime.datetime(2012, 11, 1), 'slug': 'article-with-markdown-containing-footnotes', + 'multiline': [ + 'Line Metadata should be handle properly.', + 'See syntax of Meta-Data extension of Python Markdown package:', + 'If a line is indented by 4 or more spaces,', + 'that line is assumed to be an additional line of the value', + 'for the previous keyword.', + 'A keyword may have as many lines as desired.', + ] } self.assertEqual(content, expected_content) for key, value in metadata.items(): From c386e29d0c21e17895eef545e1ba0936ccc9c30a Mon Sep 17 00:00:00 2001 From: Lonewolf Date: Sun, 2 Mar 2014 19:21:22 +0530 Subject: [PATCH 1134/2344] Ability to specify PLUGIN_PATH as list PLUGIN_PATH added to settings table --- docs/plugins.rst | 2 +- pelican/__init__.py | 3 ++- pelican/settings.py | 14 +++++++++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index c03b1251..9dddce70 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -24,7 +24,7 @@ If your plugins are not in an importable path, you can specify a ``PLUGIN_PATH`` in the settings. ``PLUGIN_PATH`` can be an absolute path or a path relative to the settings file:: - PLUGIN_PATH = "plugins" + PLUGIN_PATH = ["list", "of", plugins path"] PLUGINS = ["list", "of", "plugins"] Where to find plugins diff --git a/pelican/__init__.py b/pelican/__init__.py index 1ed98fc3..077859bb 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -65,7 +65,8 @@ class Pelican(object): self.plugins = [] logger.debug('Temporarily adding PLUGIN_PATH to system path') _sys_path = sys.path[:] - sys.path.insert(0, self.settings['PLUGIN_PATH']) + for pluginpath in self.settings['PLUGIN_PATH']: + sys.path.insert(0, pluginpath) for plugin in self.settings['PLUGINS']: # if it's a string, then import it if isinstance(plugin, six.string_types): diff --git a/pelican/settings.py b/pelican/settings.py index 7615c25c..7caffa61 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -112,7 +112,7 @@ DEFAULT_CONFIG = { 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'SUMMARY_MAX_LENGTH': 50, - 'PLUGIN_PATH': '', + 'PLUGIN_PATH': [], 'PLUGINS': [], 'PYGMENTS_RST_OPTIONS': {}, 'TEMPLATE_PAGES': {}, @@ -135,13 +135,21 @@ def read_settings(path=None, override=None): if path: local_settings = get_settings_from_file(path) # Make the paths relative to the settings file - for p in ['PATH', 'OUTPUT_PATH', 'THEME', 'PLUGIN_PATH']: + for p in ['PATH', 'OUTPUT_PATH', 'THEME']: if p in local_settings and local_settings[p] is not None \ and not isabs(local_settings[p]): absp = os.path.abspath(os.path.normpath(os.path.join( os.path.dirname(path), local_settings[p]))) - if p not in ('THEME', 'PLUGIN_PATH') or os.path.exists(absp): + if p not in ('THEME') or os.path.exists(absp): local_settings[p] = absp + + if isinstance(local_settings['PLUGIN_PATH'], six.string_types): + logger.warning("Detected misconfiguration with %s setting ""(must be a list)" % 'PLUGIN_PATH') + local_settings['PLUGIN_PATH'] = [local_settings['PLUGIN_PATH']] + else: + if 'PLUGIN_PATH' in local_settings and local_settings['PLUGIN_PATH'] is not None: + local_settings['PLUGIN_PATH'] = [os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(path), pluginpath))) + if not isabs(pluginpath) else pluginpath for pluginpath in local_settings['PLUGIN_PATH']] else: local_settings = copy.deepcopy(DEFAULT_CONFIG) From f0802e8114b6edf6f239ecfb9ab3cd4db8cc9dfc Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 18 Apr 2014 13:21:06 -0700 Subject: [PATCH 1135/2344] Text tweaks for "PLUGIN_PATH as list" feature --- docs/plugins.rst | 10 +++++----- pelican/settings.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 9dddce70..16d697fa 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -20,12 +20,12 @@ Alternatively, another method is to import them and add them to the list:: from package import myplugin PLUGINS = [myplugin,] -If your plugins are not in an importable path, you can specify a ``PLUGIN_PATH`` -in the settings. ``PLUGIN_PATH`` can be an absolute path or a path relative to -the settings file:: +If your plugins are not in an importable path, you can specify a list of paths +via the ``PLUGIN_PATH`` setting. As shown in the following example, paths in +the ``PLUGIN_PATH`` list can be absolute or relative to the settings file:: - PLUGIN_PATH = ["list", "of", plugins path"] - PLUGINS = ["list", "of", "plugins"] + PLUGIN_PATH = ["plugins", "/srv/pelican/plugins"] + PLUGINS = ["assets", "liquid_tags", "sitemap"] Where to find plugins ===================== diff --git a/pelican/settings.py b/pelican/settings.py index 7caffa61..ee337386 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -144,7 +144,7 @@ def read_settings(path=None, override=None): local_settings[p] = absp if isinstance(local_settings['PLUGIN_PATH'], six.string_types): - logger.warning("Detected misconfiguration with %s setting ""(must be a list)" % 'PLUGIN_PATH') + logger.warning("Defining %s setting as string has been deprecated (should be a list)" % 'PLUGIN_PATH') local_settings['PLUGIN_PATH'] = [local_settings['PLUGIN_PATH']] else: if 'PLUGIN_PATH' in local_settings and local_settings['PLUGIN_PATH'] is not None: From 260953da02bea53a68545060d354b3ed079fc988 Mon Sep 17 00:00:00 2001 From: Tastalian Date: Mon, 10 Mar 2014 04:16:38 +0100 Subject: [PATCH 1136/2344] Make docutils requirement explicit. Fixes #1243. Previously, the error returned by Python when docutils is not installed was not explicit, instead saying that HTMLTranslator is not defined (needed by FeedGenerator and such), forcing the user to go into readers.py to figure out that this happens because "import docutils" failed. This pull request makes the docutils dependency explicit, so that there is an ImportError if doctutils is not found. --- pelican/readers.py | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index 35c38220..43749dce 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -6,16 +6,13 @@ import logging import os import re -try: - import docutils - import docutils.core - import docutils.io - from docutils.writers.html4css1 import HTMLTranslator +import docutils +import docutils.core +import docutils.io +from docutils.writers.html4css1 import HTMLTranslator - # import the directives to have pygments support - from pelican import rstdirectives # NOQA -except ImportError: - docutils = False +# import the directives to have pygments support +from pelican import rstdirectives # NOQA try: from markdown import Markdown except ImportError: From e6be02264afc838276923933c676ef69676c320f Mon Sep 17 00:00:00 2001 From: Shauna Date: Sat, 5 Apr 2014 15:27:03 -0400 Subject: [PATCH 1137/2344] Add feeds for each author --- docs/settings.rst | 2 + pelican/generators.py | 12 ++++ pelican/settings.py | 3 + .../basic/feeds/alexis-metaireau.atom.xml | 20 ++++++ .../basic/feeds/alexis-metaireau.rss.xml | 20 ++++++ .../custom/feeds/alexis-metaireau.atom.xml | 61 +++++++++++++++++++ .../custom/feeds/alexis-metaireau.rss.xml | 61 +++++++++++++++++++ 7 files changed, 179 insertions(+) create mode 100644 pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml create mode 100644 pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml create mode 100644 pelican/tests/output/custom/feeds/alexis-metaireau.atom.xml create mode 100644 pelican/tests/output/custom/feeds/alexis-metaireau.rss.xml diff --git a/docs/settings.rst b/docs/settings.rst index 8d8f9a16..0de811ec 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -474,6 +474,8 @@ Setting name (default value) What does it do? language. `CATEGORY_FEED_ATOM` ('feeds/%s.atom.xml'[2]_) Where to put the category Atom feeds. `CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the category RSS feeds. +`AUTHOR_FEED_ATOM` ('feeds/%s.atom.xml'[2]_) Where to put the author Atom feeds. +`AUTHOR_FEED_RSS` ('feeds/%s.rss.xml'[2]_) Where to put the author RSS feeds. `TAG_FEED_ATOM` (``None``, i.e. no tag feed) Relative URL to output the tag Atom feed. It should be defined using a "%s" match in the tag name. `TAG_FEED_RSS` (``None``, ie no RSS tag feed) Relative URL to output the tag RSS feed diff --git a/pelican/generators.py b/pelican/generators.py index 1b584d3f..a2d7320a 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -239,6 +239,18 @@ class ArticlesGenerator(Generator): self.settings['CATEGORY_FEED_RSS'] % cat.slug, feed_type='rss') + for auth, arts in self.authors: + arts.sort(key=attrgetter('date'), reverse=True) + if self.settings.get('AUTHOR_FEED_ATOM'): + writer.write_feed(arts, self.context, + self.settings['AUTHOR_FEED_ATOM'] + % auth.slug) + + if self.settings.get('AUTHOR_FEED_RSS'): + writer.write_feed(arts, self.context, + self.settings['AUTHOR_FEED_RSS'] + % auth.slug, feed_type='rss') + if (self.settings.get('TAG_FEED_ATOM') or self.settings.get('TAG_FEED_RSS')): for tag, arts in self.tags.items(): diff --git a/pelican/settings.py b/pelican/settings.py index ee337386..1d0ada0c 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -41,6 +41,8 @@ DEFAULT_CONFIG = { 'THEME_STATIC_PATHS': ['static', ], 'FEED_ALL_ATOM': os.path.join('feeds', 'all.atom.xml'), 'CATEGORY_FEED_ATOM': os.path.join('feeds', '%s.atom.xml'), + 'AUTHOR_FEED_ATOM': os.path.join('feeds', '%s.atom.xml'), + 'AUTHOR_FEED_RSS': os.path.join('feeds', '%s.rss.xml'), 'TRANSLATION_FEED_ATOM': os.path.join('feeds', 'all-%s.atom.xml'), 'FEED_MAX_ITEMS': '', 'SITEURL': '', @@ -269,6 +271,7 @@ def configure_settings(settings): 'FEED_ATOM', 'FEED_RSS', 'FEED_ALL_ATOM', 'FEED_ALL_RSS', 'CATEGORY_FEED_ATOM', 'CATEGORY_FEED_RSS', + 'AUTHOR_FEED_ATOM', 'AUTHOR_FEED_RSS', 'TAG_FEED_ATOM', 'TAG_FEED_RSS', 'TRANSLATION_FEED_ATOM', 'TRANSLATION_FEED_RSS', ] diff --git a/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml b/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml new file mode 100644 index 00000000..d87023b5 --- /dev/null +++ b/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml @@ -0,0 +1,20 @@ + +A Pelican Blog/2013-11-17T23:29:00ZThis is a super article !2013-11-17T23:29:00ZAlexis Métaireautag:,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00ZAlexis Métaireautag:,2010-10-20:oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> + \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml b/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml new file mode 100644 index 00000000..09409217 --- /dev/null +++ b/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml @@ -0,0 +1,20 @@ + +A Pelican Blog/Sun, 17 Nov 2013 23:29:00 -0000This is a super article !/this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="|filename|/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Alexis MétaireauSun, 17 Nov 2013 23:29:00 -0000tag:,2010-12-02:this-is-a-super-article.htmlfoobarfoobarOh yeah !/oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="|filename|/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 -0000tag:,2010-10-20:oh-yeah.htmlohbaryeah \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/alexis-metaireau.atom.xml b/pelican/tests/output/custom/feeds/alexis-metaireau.atom.xml new file mode 100644 index 00000000..cb746377 --- /dev/null +++ b/pelican/tests/output/custom/feeds/alexis-metaireau.atom.xml @@ -0,0 +1,61 @@ + +Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:filename_metadata-example.html<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.html<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/unbelievable.html">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:article-3.html<p>Article 3</p> +This is a super article !2013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:unbelievable.html<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> + \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/alexis-metaireau.rss.xml b/pelican/tests/output/custom/feeds/alexis-metaireau.rss.xml new file mode 100644 index 00000000..2c4b1160 --- /dev/null +++ b/pelican/tests/output/custom/feeds/alexis-metaireau.rss.xml @@ -0,0 +1,61 @@ + +Alexis' loghttp://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/filename_metadata-example.html<p>Some cool stuff!</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:filename_metadata-example.htmlSecond articlehttp://blog.notmyidea.org/second-article.html<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article.htmlfoobarbazA markdown powered articlehttp://blog.notmyidea.org/a-markdown-powered-article.html<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/unbelievable.html">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/unbelievable.html">a file-relative link to unbelievable</a></p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:a-markdown-powered-article.htmlArticle 1http://blog.notmyidea.org/article-1.html<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-1.htmlArticle 2http://blog.notmyidea.org/article-2.html<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-2.htmlArticle 3http://blog.notmyidea.org/article-3.html<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:article-3.htmlThis is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Alexis MétaireauSun, 17 Nov 2013 23:29:00 +0100tag:blog.notmyidea.org,2010-12-02:this-is-a-super-article.htmlfoobarfoobarOh yeah !http://blog.notmyidea.org/oh-yeah.html<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:oh-yeah.htmlohbaryeahUnbelievable !http://blog.notmyidea.org/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/a-markdown-powered-article.html">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:unbelievable.htmlThe baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> +Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file From c1324b0206a70b8179689d2305c8de678d5e7b1d Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Sun, 20 Apr 2014 14:34:52 +0200 Subject: [PATCH 1138/2344] split content caching into two layers This is a reworked and improved version of content caching. Notable changes: - by default only raw content and metadata returned by readers are cached which should prevent conficts with plugins, the speed benefit of content objects caching is not very big with a simple setup - renamed --full-rebuild to --ignore-cache - added more elaborate logging to caching code --- README.rst | 1 + docs/index.rst | 1 + docs/settings.rst | 41 +++++++++++++------ pelican/__init__.py | 24 +++++------ pelican/generators.py | 46 ++++++++++++++++----- pelican/readers.py | 20 +++++++-- pelican/settings.py | 10 +++++ pelican/tests/test_generators.py | 67 ++++++++++++++++++++++++++----- pelican/utils.py | 69 ++++++++++++++++++-------------- 9 files changed, 199 insertions(+), 80 deletions(-) diff --git a/README.rst b/README.rst index 20c3f217..bf506c5f 100644 --- a/README.rst +++ b/README.rst @@ -29,6 +29,7 @@ Pelican currently supports: * Code syntax highlighting * Import from WordPress, Dotclear, or RSS feeds * Integration with external tools: Twitter, Google Analytics, etc. (optional) +* Fast rebuild times thanks to content caching and selective output writing. Have a look at the `Pelican documentation`_ for more information. diff --git a/docs/index.rst b/docs/index.rst index 43193e9e..c2deb6de 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -33,6 +33,7 @@ Pelican |version| currently supports: * Code syntax highlighting * Import from WordPress, Dotclear, or RSS feeds * Integration with external tools: Twitter, Google Analytics, etc. (optional) +* Fast rebuild times thanks to content caching and selective output writing. Why the name "Pelican"? ----------------------- diff --git a/docs/settings.rst b/docs/settings.rst index 0de811ec..1b4bae94 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -161,6 +161,7 @@ Setting name (default value) `_ `WITH_FUTURE_DATES` (``True``) If disabled, content with dates in the future will get a default status of ``draft``. + see :ref:`reading_only_modified_content` for details. `INTRASITE_LINK_REGEX` (``'[{|](?P.*?)[|}]'``) Regular expression that is used to parse internal links. Default syntax of links to internal files, tags, etc., is to enclose the identifier, say ``filename``, in ``{}`` or ``||``. @@ -173,12 +174,16 @@ Setting name (default value) `SLUGIFY_SOURCE` (``'input'``) Specifies where you want the slug to be automatically generated from. Can be set to 'title' to use the 'Title:' metadata tag or 'basename' to use the articles basename when creating the slug. -`CACHE_CONTENT` (``True``) If ``True``, save read content in a cache file. +`CACHE_CONTENT` (``True``) If ``True``, save content in a cache file. See :ref:`reading_only_modified_content` for details about caching. +`CONTENT_CACHING_LAYER` (``'reader'``) If set to ``'reader'``, save only the raw content and metadata returned + by readers, if set to ``'generator'``, save processed content objects. `CACHE_DIRECTORY` (``cache``) Directory in which to store cache files. +`GZIP_CACHE` (``True``) If ``True``, use gzip to (de)compress the cache files. `CHECK_MODIFIED_METHOD` (``mtime``) Controls how files are checked for modifications. `LOAD_CONTENT_CACHE` (``True``) If ``True``, load unmodified content from cache. -`GZIP_CACHE` (``True``) If ``True``, use gzip to (de)compress the cache files. +`AUTORELOAD_IGNORE_CACHE` (``False``) If ``True``, do not load content cache in autoreload mode + when the settings file changes. `WRITE_SELECTED` (``[]``) If this list is not empty, **only** output files with their paths in this list are written. Paths should be either relative to the current working directory of Pelican or absolute. For possible use cases see @@ -749,13 +754,21 @@ When Pelican is about to read some content source file: file cannot be found in the cache file, the content is read as usual. -3. If the file is considered unchanged, the content object saved in a +3. If the file is considered unchanged, the content data saved in a previous build corresponding to the file is loaded from the cache and the file is not read. 4. If the file is considered changed, the file is read and the new - modification information and the content object are saved to the + modification information and the content data are saved to the cache if `CACHE_CONTENT` is ``True``. +Depending on `CONTENT_CACHING_LAYER` either the raw content and +metadata returned by a reader are cached if set to ``'reader'``, or +the processed content object is cached if set to ``'generator'``. +Caching the processed content object may conflict with plugins (as +some reading related signals may be skipped) or e.g. the +`WITH_FUTURE_DATES` functionality (as the ``draft`` status of the +cached content objects would not change automatically over time). + Modification time based checking is faster than comparing file hashes, but is not as reliable, because mtime information can be lost when e.g. copying the content sources using the ``cp`` or ``rsync`` @@ -764,16 +777,18 @@ commands without the mtime preservation mode (invoked e.g. by The cache files are Python pickles, so they may not be readable by different versions of Python as the pickle format often changes. If -such an error is encountered, the cache files have to be rebuilt -using the pelican command-line option ``--full-rebuild``. -The cache files also have to be rebuilt when changing the -`GZIP_CACHE` setting for cache file reading to work. +such an error is encountered, the cache files have to be rebuilt by +running pelican after removing them or by using the pelican +command-line option ``--ignore-cache``. The cache files also have to +be rebuilt when changing the `GZIP_CACHE` setting for cache file +reading to work. -The ``--full-rebuild`` command-line option is also useful when the -whole site needs to be regenerated due to e.g. modifications to the -settings file or theme files. When pelican runs in autorealod mode, -modification of the settings file or theme will trigger a full rebuild -automatically. +The ``--ignore-cache`` command-line option is also useful when the +whole cache needs to be regenerated due to e.g. modifications to the +settings file which should change the cached content or just for +debugging purposes. When pelican runs in autoreload mode, modification +of the settings file will make it ignore the cache automatically if +`AUTORELOAD_IGNORE_CACHE` is ``True``. Note that even when using cached content, all output is always written, so the modification times of the ``*.html`` files always diff --git a/pelican/__init__.py b/pelican/__init__.py index 077859bb..8cae468c 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -262,8 +262,9 @@ def parse_arguments(): help='Relaunch pelican each time a modification occurs' ' on the content files.') - parser.add_argument('-f', '--full-rebuild', action='store_true', - dest='full_rebuild', help='Rebuild everything by not loading from cache') + parser.add_argument('-c', '--ignore-cache', action='store_true', + dest='ignore_cache', help='Ignore content cache ' + 'from previous runs by not loading cache files.') parser.add_argument('-w', '--write-selected', type=str, dest='selected_paths', default=None, @@ -284,7 +285,7 @@ def get_config(args): config['THEME'] = abstheme if os.path.exists(abstheme) else args.theme if args.delete_outputdir is not None: config['DELETE_OUTPUT_DIRECTORY'] = args.delete_outputdir - if args.full_rebuild: + if args.ignore_cache: config['LOAD_CONTENT_CACHE'] = False if args.selected_paths: config['WRITE_SELECTED'] = args.selected_paths.split(',') @@ -340,7 +341,10 @@ def main(): print(' --- AutoReload Mode: Monitoring `content`, `theme` and' ' `settings` for changes. ---') - first_run = True # load cache on first run + def _ignore_cache(pelican_obj): + if pelican_obj.settings['AUTORELOAD_IGNORE_CACHE']: + pelican_obj.settings['LOAD_CONTENT_CACHE'] = False + while True: try: # Check source dir for changed files ending with the given @@ -353,10 +357,9 @@ def main(): if modified['settings']: pelican, settings = get_instance(args) - if not first_run: - original_load_cache = settings['LOAD_CONTENT_CACHE'] - # invalidate cache - pelican.settings['LOAD_CONTENT_CACHE'] = False + original_load_cache = settings['LOAD_CONTENT_CACHE'] + print(pelican.settings['AUTORELOAD_IGNORE_CACHE']) + _ignore_cache(pelican) if any(modified.values()): print('\n-> Modified: {}. re-generating...'.format( @@ -368,13 +371,8 @@ def main(): if modified['theme'] is None: logger.warning('Empty theme folder. Using `basic` ' 'theme.') - elif modified['theme']: - # theme modified, needs full rebuild -> no cache - if not first_run: # but not on first run - pelican.settings['LOAD_CONTENT_CACHE'] = False pelican.run() - first_run = False # restore original caching policy pelican.settings['LOAD_CONTENT_CACHE'] = original_load_cache diff --git a/pelican/generators.py b/pelican/generators.py index a2d7320a..3cc84fa8 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -28,10 +28,11 @@ from pelican import signals logger = logging.getLogger(__name__) -class Generator(FileStampDataCacher): +class Generator(object): """Baseclass generator""" - def __init__(self, context, settings, path, theme, output_path, **kwargs): + def __init__(self, context, settings, path, theme, output_path, + readers_cache_name='', **kwargs): self.context = context self.settings = settings self.path = path @@ -41,7 +42,7 @@ class Generator(FileStampDataCacher): for arg, value in kwargs.items(): setattr(self, arg, value) - self.readers = Readers(self.settings) + self.readers = Readers(self.settings, readers_cache_name) # templates cache self._templates = {} @@ -74,10 +75,6 @@ class Generator(FileStampDataCacher): custom_filters = self.settings['JINJA_FILTERS'] self.env.filters.update(custom_filters) - # set up caching - super(Generator, self).__init__(settings, 'CACHE_CONTENT', - 'LOAD_CONTENT_CACHE') - signals.generator_init.send(self) def get_template(self, name): @@ -153,6 +150,35 @@ class Generator(FileStampDataCacher): self.context[item] = value +class CachingGenerator(Generator, FileStampDataCacher): + '''Subclass of Generator and FileStampDataCacher classes + + enables content caching, either at the generator or reader level + ''' + + def __init__(self, *args, **kwargs): + '''Initialize the generator, then set up caching + + note the multiple inheritance structure + ''' + cls_name = self.__class__.__name__ + Generator.__init__(self, *args, + readers_cache_name=(cls_name + '-Readers'), + **kwargs) + + cache_this_level = self.settings['CONTENT_CACHING_LAYER'] == 'generator' + caching_policy = cache_this_level and self.settings['CACHE_CONTENT'] + load_policy = cache_this_level and self.settings['LOAD_CONTENT_CACHE'] + FileStampDataCacher.__init__(self, self.settings, cls_name, + caching_policy, load_policy + ) + + def _get_file_stamp(self, filename): + '''Get filestamp for path relative to generator.path''' + filename = os.path.join(self.path, filename) + return super(Generator, self)._get_file_stamp(filename) + + class _FileLoader(BaseLoader): def __init__(self, path, basedir): @@ -183,7 +209,7 @@ class TemplatePagesGenerator(Generator): del self.env.loader.loaders[0] -class ArticlesGenerator(Generator): +class ArticlesGenerator(CachingGenerator): """Generate blog articles""" def __init__(self, *args, **kwargs): @@ -537,6 +563,7 @@ class ArticlesGenerator(Generator): self._update_context(('articles', 'dates', 'tags', 'categories', 'tag_cloud', 'authors', 'related_posts')) self.save_cache() + self.readers.save_cache() signals.article_generator_finalized.send(self) def generate_output(self, writer): @@ -545,7 +572,7 @@ class ArticlesGenerator(Generator): signals.article_writer_finalized.send(self, writer=writer) -class PagesGenerator(Generator): +class PagesGenerator(CachingGenerator): """Generate pages""" def __init__(self, *args, **kwargs): @@ -599,6 +626,7 @@ class PagesGenerator(Generator): self.context['PAGES'] = self.pages self.save_cache() + self.readers.save_cache() signals.page_generator_finalized.send(self) def generate_output(self, writer): diff --git a/pelican/readers.py b/pelican/readers.py index fa9d92ae..c63b8981 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -33,7 +33,7 @@ except ImportError: from pelican import signals from pelican.contents import Page, Category, Tag, Author -from pelican.utils import get_date, pelican_open +from pelican.utils import get_date, pelican_open, FileStampDataCacher METADATA_PROCESSORS = { @@ -382,7 +382,7 @@ class AsciiDocReader(BaseReader): return content, metadata -class Readers(object): +class Readers(FileStampDataCacher): """Interface for all readers. This class contains a mapping of file extensions / Reader classes, to know @@ -392,7 +392,7 @@ class Readers(object): """ - def __init__(self, settings=None): + def __init__(self, settings=None, cache_name=''): self.settings = settings or {} self.readers = {} self.reader_classes = {} @@ -417,6 +417,15 @@ class Readers(object): self.readers[fmt] = reader_class(self.settings) + # set up caching + cache_this_level = (cache_name != '' and + self.settings['CONTENT_CACHING_LAYER'] == 'reader') + caching_policy = cache_this_level and self.settings['CACHE_CONTENT'] + load_policy = cache_this_level and self.settings['LOAD_CONTENT_CACHE'] + super(Readers, self).__init__(settings, cache_name, + caching_policy, load_policy, + ) + @property def extensions(self): return self.readers.keys() @@ -455,7 +464,10 @@ class Readers(object): source_path=source_path, settings=self.settings, process=reader.process_metadata)) - content, reader_metadata = reader.read(path) + content, reader_metadata = self.get_cached_data(path, (None, None)) + if content is None: + content, reader_metadata = reader.read(path) + self.cache_data(path, (content, reader_metadata)) metadata.update(reader_metadata) if content: diff --git a/pelican/settings.py b/pelican/settings.py index 1d0ada0c..abf16b32 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -123,10 +123,12 @@ DEFAULT_CONFIG = { 'INTRASITE_LINK_REGEX': '[{|](?P.*?)[|}]', 'SLUGIFY_SOURCE': 'title', 'CACHE_CONTENT': True, + 'CONTENT_CACHING_LAYER': 'reader', 'CACHE_DIRECTORY': 'cache', 'GZIP_CACHE': True, 'CHECK_MODIFIED_METHOD': 'mtime', 'LOAD_CONTENT_CACHE': True, + 'AUTORELOAD_IGNORE_CACHE': False, 'WRITE_SELECTED': [], } @@ -266,6 +268,14 @@ def configure_settings(settings): if not 'FEED_DOMAIN' in settings: settings['FEED_DOMAIN'] = settings['SITEURL'] + # check content caching layer and warn of incompatibilities + if (settings.get('CACHE_CONTENT', False) and + settings.get('CONTENT_CACHING_LAYER', '') == 'generator' and + settings.get('WITH_FUTURE_DATES', DEFAULT_CONFIG['WITH_FUTURE_DATES'])): + logger.warning('WITH_FUTURE_DATES conflicts with ' + "CONTENT_CACHING_LAYER set to 'generator', " + "use 'reader' layer instead") + # Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined feed_keys = [ 'FEED_ATOM', 'FEED_RSS', diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index f951f0cb..9463047e 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -288,10 +288,11 @@ class TestArticlesGenerator(unittest.TestCase): authors_expected = ['alexis-metaireau', 'first-author', 'second-author'] self.assertEqual(sorted(authors), sorted(authors_expected)) - def test_content_caching(self): - """Test that the articles are read only once when caching""" + def test_article_object_caching(self): + """Test Article objects caching at the generator level""" settings = get_settings(filenames={}) settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CONTENT_CACHING_LAYER'] = 'generator' settings['READERS'] = {'asc': None} generator = ArticlesGenerator( @@ -307,10 +308,32 @@ class TestArticlesGenerator(unittest.TestCase): generator.generate_context() generator.readers.read_file.assert_called_count == 0 - def test_full_rebuild(self): + def test_reader_content_caching(self): + """Test raw content caching at the reader level""" + settings = get_settings(filenames={}) + settings['CACHE_DIRECTORY'] = self.temp_cache + settings['READERS'] = {'asc': None} + + generator = ArticlesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.generate_context() + self.assertTrue(hasattr(generator.readers, '_cache')) + + generator = ArticlesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + readers = generator.readers.readers + for reader in readers.values(): + reader.read = MagicMock() + generator.generate_context() + for reader in readers.values(): + reader.read.assert_called_count == 0 + + def test_ignore_cache(self): """Test that all the articles are read again when not loading cache - used in --full-rebuild or autoreload mode""" + used in --ignore-cache or autoreload mode""" settings = get_settings(filenames={}) settings['CACHE_DIRECTORY'] = self.temp_cache settings['READERS'] = {'asc': None} @@ -376,30 +399,52 @@ class TestPageGenerator(unittest.TestCase): self.assertEqual(sorted(pages_expected), sorted(pages)) self.assertEqual(sorted(hidden_pages_expected), sorted(hidden_pages)) - def test_content_caching(self): - """Test that the pages are read only once when caching""" + def test_page_object_caching(self): + """Test Page objects caching at the generator level""" settings = get_settings(filenames={}) - settings['CACHE_DIRECTORY'] = 'cache_dir' #TODO settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CONTENT_CACHING_LAYER'] = 'generator' settings['READERS'] = {'asc': None} generator = PagesGenerator( context=settings.copy(), settings=settings, - path=CUR_DIR, theme=settings['THEME'], output_path=None) + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) generator.generate_context() self.assertTrue(hasattr(generator, '_cache')) generator = PagesGenerator( context=settings.copy(), settings=settings, - path=CUR_DIR, theme=settings['THEME'], output_path=None) + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) generator.readers.read_file = MagicMock() generator.generate_context() generator.readers.read_file.assert_called_count == 0 - def test_full_rebuild(self): + def test_reader_content_caching(self): + """Test raw content caching at the reader level""" + settings = get_settings(filenames={}) + settings['CACHE_DIRECTORY'] = self.temp_cache + settings['READERS'] = {'asc': None} + + generator = PagesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.generate_context() + self.assertTrue(hasattr(generator.readers, '_cache')) + + generator = PagesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + readers = generator.readers.readers + for reader in readers.values(): + reader.read = MagicMock() + generator.generate_context() + for reader in readers.values(): + reader.read.assert_called_count == 0 + + def test_ignore_cache(self): """Test that all the pages are read again when not loading cache - used in --full-rebuild or autoreload mode""" + used in --ignore_cache or autoreload mode""" settings = get_settings(filenames={}) settings['CACHE_DIRECTORY'] = self.temp_cache settings['READERS'] = {'asc': None} diff --git a/pelican/utils.py b/pelican/utils.py index cda3108e..7b58a231 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -552,28 +552,30 @@ def split_all(path): class FileDataCacher(object): '''Class that can cache data contained in files''' - def __init__(self, settings, cache_policy_key, load_policy_key): - '''Load the specified cache within CACHE_DIRECTORY + def __init__(self, settings, cache_name, caching_policy, load_policy): + '''Load the specified cache within CACHE_DIRECTORY in settings - only if load_policy_key in setttings is True, - May use gzip if GZIP_CACHE. - Sets caching policy according to *cache_policy_key* - in *settings* + only if *load_policy* is True, + May use gzip if GZIP_CACHE ins settings is True. + Sets caching policy according to *caching_policy*. ''' self.settings = settings - name = self.__class__.__name__ - self._cache_path = os.path.join(self.settings['CACHE_DIRECTORY'], name) - self._cache_data_policy = self.settings[cache_policy_key] + self._cache_path = os.path.join(self.settings['CACHE_DIRECTORY'], + cache_name) + self._cache_data_policy = caching_policy if self.settings['GZIP_CACHE']: import gzip self._cache_open = gzip.open else: self._cache_open = open - if self.settings[load_policy_key]: + if load_policy: try: - with self._cache_open(self._cache_path, 'rb') as f: - self._cache = pickle.load(f) - except Exception as e: + with self._cache_open(self._cache_path, 'rb') as fhandle: + self._cache = pickle.load(fhandle) + except (IOError, OSError, pickle.UnpicklingError) as err: + logger.warning(('Cannot load cache {}, ' + 'proceeding with empty cache.\n{}').format( + self._cache_path, err)) self._cache = {} else: self._cache = {} @@ -583,7 +585,7 @@ class FileDataCacher(object): if self._cache_data_policy: self._cache[filename] = data - def get_cached_data(self, filename, default={}): + def get_cached_data(self, filename, default=None): '''Get cached data for the given file if no data is cached, return the default object @@ -595,20 +597,23 @@ class FileDataCacher(object): if self._cache_data_policy: try: mkdir_p(self.settings['CACHE_DIRECTORY']) - with self._cache_open(self._cache_path, 'wb') as f: - pickle.dump(self._cache, f) - except Exception as e: + with self._cache_open(self._cache_path, 'wb') as fhandle: + pickle.dump(self._cache, fhandle) + except (IOError, OSError, pickle.PicklingError) as err: logger.warning('Could not save cache {}\n{}'.format( - self._cache_path, e)) + self._cache_path, err)) class FileStampDataCacher(FileDataCacher): '''Subclass that also caches the stamp of the file''' - def __init__(self, settings, cache_policy_key, load_policy_key): - '''This sublcass additionaly sets filestamp function''' - super(FileStampDataCacher, self).__init__(settings, cache_policy_key, - load_policy_key) + def __init__(self, settings, cache_name, caching_policy, load_policy): + '''This sublcass additionaly sets filestamp function + and base path for filestamping operations + ''' + super(FileStampDataCacher, self).__init__(settings, cache_name, + caching_policy, + load_policy) method = self.settings['CHECK_MODIFIED_METHOD'] if method == 'mtime': @@ -616,10 +621,14 @@ class FileStampDataCacher(FileDataCacher): else: try: hash_func = getattr(hashlib, method) - def filestamp_func(buf): - return hash_func(buf).digest() + def filestamp_func(filename): + '''return hash of file contents''' + with open(filename, 'rb') as fhandle: + return hash_func(fhandle.read()).digest() self._filestamp_func = filestamp_func - except ImportError: + except AttributeError as err: + logger.warning('Could not get hashing function\n{}'.format( + err)) self._filestamp_func = None def cache_data(self, filename, data): @@ -636,11 +645,11 @@ class FileStampDataCacher(FileDataCacher): a hash for a function name in the hashlib module or an empty bytes string otherwise ''' - filename = os.path.join(self.path, filename) try: - with open(filename, 'rb') as f: - return self._filestamp_func(f.read()) - except Exception: + return self._filestamp_func(filename) + except (IOError, OSError, TypeError) as err: + logger.warning('Cannot get modification stamp for {}\n{}'.format( + filename, err)) return b'' def get_cached_data(self, filename, default=None): @@ -648,7 +657,7 @@ class FileStampDataCacher(FileDataCacher): if the file has not been modified. If no record exists or file has been modified, return default. - Modification is checked by compaing the cached + Modification is checked by comparing the cached and current file stamp. ''' stamp, data = super(FileStampDataCacher, self).get_cached_data( From 30e2cac7539630ba7ad69c548f3551e5a2390721 Mon Sep 17 00:00:00 2001 From: Bernhard Scheirle Date: Thu, 24 Apr 2014 15:30:34 +0200 Subject: [PATCH 1139/2344] send the static_generator_{init, finalized} signals. Note: The two signals were already present but were never sent. --- docs/plugins.rst | 8 ++++++++ pelican/generators.py | 5 +++++ 2 files changed, 13 insertions(+) diff --git a/docs/plugins.rst b/docs/plugins.rst index c03b1251..4e0bdb26 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -87,8 +87,16 @@ get_generators generators invoked in Pe can return a Generator, or several generator in a tuple or in a list. page_generator_context page_generator, metadata +page_generator_preread page_generator invoked before a page is read in PageGenerator.generate_context; + use if code needs to do something before every page is parsed. page_generator_init page_generator invoked in the PagesGenerator.__init__ page_generator_finalized page_generator invoked at the end of PagesGenerator.generate_context +static_generator_context static_generator, metadata +static_generator_preread static_generator invoked before a static file is read in StaticGenerator.generate_context; + use if code needs to do something before every static file is added to the + staticfiles list. +static_generator_init static_generator invoked in the StaticGenerator.__init__ +static_generator_finalized static_generator invoked at the end of StaticGenerator.generate_context content_object_init content_object invoked at the end of Content.__init__ (see note below) content_written path, context invoked each time a content file is written. ================================= ============================ =========================================================================== diff --git a/pelican/generators.py b/pelican/generators.py index bfdac1a5..01f7db8f 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -576,6 +576,10 @@ class StaticGenerator(Generator): """copy static paths (what you want to copy, like images, medias etc. to output""" + def __init__(self, *args, **kwargs): + super(StaticGenerator, self).__init__(*args, **kwargs) + signals.static_generator_init.send(self) + def _copy_paths(self, paths, source, destination, output_path, final_path=None): """Copy all the paths from source to destination""" @@ -604,6 +608,7 @@ class StaticGenerator(Generator): self.staticfiles.append(static) self.add_source_path(static) self._update_context(('staticfiles',)) + signals.static_generator_finalized.send(self) def generate_output(self, writer): self._copy_paths(self.settings['THEME_STATIC_PATHS'], self.theme, From ad6dc3f8ba6c63820869cdf7fa34110ad0fe0e5d Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Fri, 25 Apr 2014 19:44:26 +0200 Subject: [PATCH 1140/2344] use correct CachingGenerator class in super() call This was a leftover from code moving in c1324b0. Detected by pylint. --- pelican/generators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/generators.py b/pelican/generators.py index 3cc84fa8..45447183 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -176,7 +176,7 @@ class CachingGenerator(Generator, FileStampDataCacher): def _get_file_stamp(self, filename): '''Get filestamp for path relative to generator.path''' filename = os.path.join(self.path, filename) - return super(Generator, self)._get_file_stamp(filename) + return super(CachingGenerator, self)._get_file_stamp(filename) class _FileLoader(BaseLoader): From 5a3daae72f78334e9994d527fc09452de75b3474 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Sun, 27 Apr 2014 14:25:08 +0200 Subject: [PATCH 1141/2344] add get_writer signal and unify with get_generators Fix outdated docs of get_generators to unify. --- docs/plugins.rst | 10 ++++++---- pelican/__init__.py | 15 ++++++++++++++- pelican/signals.py | 1 + 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 7fe497e6..717019a8 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -83,9 +83,11 @@ article_generator_finalized article_generator invoked at th article_generator_write_article article_generator, content invoked before writing each article, the article is passed as content article_writer_finalized article_generator, writer invoked after all articles and related pages have been written, but before the article generator is closed. -get_generators generators invoked in Pelican.get_generator_classes, +get_generators pelican object invoked in Pelican.get_generator_classes, can return a Generator, or several - generator in a tuple or in a list. + generators in a tuple or in a list. +get_writer pelican object invoked in Pelican.get_writer, + can return a custom Writer. page_generator_context page_generator, metadata page_generator_preread page_generator invoked before a page is read in PageGenerator.generate_context; use if code needs to do something before every page is parsed. @@ -200,8 +202,8 @@ Adding a new generator is also really easy. You might want to have a look at :: - def get_generators(generators): + def get_generators(pelican_object): # define a new generator here if you need to - return generators + return MyGenerator signals.get_generators.connect(get_generators) diff --git a/pelican/__init__.py b/pelican/__init__.py index 8cae468c..5208c317 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -209,7 +209,20 @@ class Pelican(object): return generators def get_writer(self): - return Writer(self.output_path, settings=self.settings) + writers = [ w for w in signals.get_writer.send(self) + if isinstance(w, type) ] + writers_found = len(writers) + if writers_found == 0: + return Writer(self.output_path, settings=self.settings) + else: + _, writer = writers[0] + if writers_found == 1: + logger.debug('Found writer: {}'.format(writer)) + else: + logger.warning( + '{} writers found, using only first one: {}'.format( + writers_found, writer)) + return writer(self.output_path, settings=self.settings) def parse_arguments(): diff --git a/pelican/signals.py b/pelican/signals.py index 9eb907dc..e06b89ac 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -6,6 +6,7 @@ from blinker import signal initialized = signal('pelican_initialized') get_generators = signal('get_generators') +get_writer = signal('get_writer') finalized = signal('pelican_finalized') # Reader-level signals From 00a5a0f0dfed1e9f65101e81a72ca37c12b6faa8 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Mon, 28 Apr 2014 20:37:49 +0200 Subject: [PATCH 1142/2344] Fix #1311 wide tables in RTD theme, remove old theme files This works by adding a CSS overrides file to the Sphinx app stylesheets. --- docs/_static/pelican.gif | Bin 16941 -> 0 bytes docs/_static/pelican.png | Bin 6441 -> 0 bytes docs/_static/theme_overrides.css | 12 + docs/_themes/.gitignore | 3 - docs/_themes/pelican/layout.html | 22 -- docs/_themes/pelican/static/pelican.css_t | 254 ---------------------- docs/_themes/pelican/theme.conf | 10 - docs/conf.py | 6 + 8 files changed, 18 insertions(+), 289 deletions(-) delete mode 100644 docs/_static/pelican.gif delete mode 100644 docs/_static/pelican.png create mode 100644 docs/_static/theme_overrides.css delete mode 100644 docs/_themes/.gitignore delete mode 100644 docs/_themes/pelican/layout.html delete mode 100644 docs/_themes/pelican/static/pelican.css_t delete mode 100644 docs/_themes/pelican/theme.conf diff --git a/docs/_static/pelican.gif b/docs/_static/pelican.gif deleted file mode 100644 index d9208590b7cce4c7f9284dfc4686b940eb1912bd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 16941 zcmWh!c~}$Y)}PFteb@s82zwBaVKoTKBrFC*jfxr-H7sgW)Sy&xsm^303ToW3#WpC~ z)KVL*ZE0)0lf(tB+PJi(*4qZPEn3?ft+%DEw|x2X$*x1z6)ZE;>bm`J%%a$!)zFe=@ zuUN5S<;s<-R;_AjX<5B`^_n$n)~;P^Fc?}}Ti2~yw|@QlwzjrcUU_B1h7B7xZftLF z-?VAd=FOY8Y}vAP>(*CaeRbQmZQHkRr)ipD7^Bf>GMUU~v&CYuTCE)&9X6Y7$BrF4 zckb-$?Ck35+O=!f?%lih?Ac?t+xPC>yKmpV{rmSHIB?+L!Gnhm9XfpYaCdk2kt0W5 zd+oK?Uw^%)r|0O=qi?+N#+z@x>2NrDdwY)^J9hl|@xH#k6DLlbJbCi1x88C(oo~PW z_Nh~+-g)Pp{{H@V-+lM=>C^AM_nyn;I&{)|=bwLm{rdGAH*Va#dGm`ezVP{cw{G3Kef##EJ9qBhz5C^tUw-w~S6_eq z_0Z7JH{X17@7}#{zy0?9{rms^_rJgU?z`{5|K9KS4-XGNc<|ui!-tO^J^JB?AAbDt z$De-sX=G&N@#Du&o;>;a=bxWGefrBUzx?{^umAbae*%HPvuDqqKY#w)Z@;~G@#4S# z{qOI;|Nh4xe~gZf{`u#hfBp5>-+%x8^5x6_{qKMO{PWM)*jU#8-+=$W3jjU_jB%xE zm&0ws!^YJQx_Z4GL~>1!`pmIQos#^O_Xp1$zp_VGzEfI#w(shG`Rr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|MxauuGARI& zUH=zI0k{4_i!lQ)_(Lv8f;6*!sOce4KYK8OhPn(hbO?pI$VM|V8b_9 zLm!+&JYfGpEXczw#P>hM!z-wRGjIYvWWpO9LOm?QCY(Z*f;;IjLn0IdEjWWBtU@U0 zgE$a5DDXox(1AF#10N&Ba=SJLLmIYNq9rgqr@$=0Vr&CON4_TbVJu~RX=nCG4%0DPy!XW zK`zk!N_@kizdbUkd`j%YEx a=5G={=Xbv6e?I7kzUYrW>Hkqc0028+la#Cg diff --git a/docs/_static/pelican.png b/docs/_static/pelican.png deleted file mode 100644 index c2d61c88997a3b853a1afec2aa2e2ce84102fbf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6441 zcmai3Wmr^Cyaptf6qE+(7Li7f22rGuSQ-goL1K|^>6DgMDfzRzEFiFyq_VU~cL>rg z4RXi(;eNgIJSX-%yJyasdFPGa#_DQ6A%`$RaBy(QpK7S;gX0?542ki;{sdc(00&&S z{u5;!)FAT)_(0;WVG75=A*K1Z;o{`v(SwUbUQe~uh^8SdxV%Eau60e|5`&kTiI<9- ztE>HMFB}z5dmAr%J2oFDuUBkOo@(hDhf&bs;LvA2RaG+do!+tVF}yQzT4?HHFMb(bI@oFXYKIj31a+GGfJJ}K0SN(O!D=t@8&2!B_$=&s81xJsHmu+ zp#khOGBWhb)1Q?X{cp?6%mhdM@;j)NxiBcQ4vqG8%;m))f>xg4cbe+!Q!_C5{qD~W z565fC$jQ#`S@nd$U~u@+d`kck5s}aC?9|xU@tmJ)qPm#V&tlCiVN)oy&UwuF@71|Q zqu1@2%lXjZ=&T1;!X{`%x5v1+xJ**7ueK^%tE;P%SY*d5ty+H%uqmm7ZKUtYrP4M??NJxjD_WrXzj4mDi;xzK^ z-Mg83H!F<$#}^ew+sDhx%Yw$Jv&+lN^Yh1khxoITSZ`LX5pQqry!fGl$28;fH{p~@ zLgQ|zsi`UcI}j62yGpOE@%v(8V*LEE25k5556sNSa&RaY4U1PRKOOm!k#T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KfPyGF$?Qf0$SdiYnHzGcb^tCj3}NrUCFVrpN-sjZr~D>+$e2YYJEjNo|S@ zk}uzDQ$j)lm=pImZ^kOplkX|826o^y6zuE0^YYkVRI+>QIGD#Cf!{{*Lx~&k!je$v z%F^3K^p&dz+59ehH8rR}U>y*J*G{aTIV z_N5x#U<}Hvo`T`}4h_vnjiZh{+0p*Kw8wJ9e6bJwcmEPxuGnd$6ihHz@d%TgugI>Y zo12?tk!V75bF&0&{CSQz3I51!obLPv45p1`k_`b;1kIp`Eh8%^fAyyGtII+_*_2RR zZ;-xi!EL%0Mz=N$o;b`@(}V_4INg1yovJLzUX-kI#M`ClPRFg*Qa4?;RX`JJYQ$oyME%{E{Wx!?CsP5Zg9gIjDJW`%+(004!Ufd0ENlPFMOQ^=RQF{s6!)H}sxlohm5HEYXd4t4 j4}To;|DHdOxViP7=V+AmQfdJFje+x2O - {% endif %} -{% endblock %} -{% block footer %} - {% if pagename == 'index' %} - - {% endif %} -{% endblock %} -{# do not display relbars #} -{% block relbar1 %}{% endblock %} -{% block relbar2 %} - {% if theme_github_fork %} - Fork me on GitHub - {% endif %} -{% endblock %} -{% block sidebar1 %}{% endblock %} -{% block sidebar2 %}{% endblock %} diff --git a/docs/_themes/pelican/static/pelican.css_t b/docs/_themes/pelican/static/pelican.css_t deleted file mode 100644 index 3cb2a3c1..00000000 --- a/docs/_themes/pelican/static/pelican.css_t +++ /dev/null @@ -1,254 +0,0 @@ -/* - * pelican.css_t - * ~~~~~~~~~~~~ - * - * Sphinx stylesheet -- pelican theme, based on the nature theme - * - * :copyright: Copyright 2011 by Alexis Metaireau. - */ - -@import url("basic.css"); - -/* -- page layout ----------------------------------------------------------- */ - -body { - font-family: Arial, sans-serif; - font-size: 100%; - background-color: white; - color: #555; - margin: 0; - padding: 0; -} - -div.documentwrapper { - width: 70%; - margin: auto; -} - -div.bodywrapper { - margin: 0 0 0 230px; -} - -hr { - border: 1px solid #B1B4B6; -} - -div.document { -} - -div.body { - background-color: #ffffff; - color: #3E4349; - padding: 0 30px 30px 30px; - font-size: 0.9em; -} - -div.footer { - color: #555; - width: 100%; - padding: 13px 0; - text-align: center; - font-size: 75%; -} - -div.footer a { - color: #444; - text-decoration: underline; -} - -div.related { - background-color: #6BA81E; - line-height: 32px; - color: #fff; - text-shadow: 0px 1px 0 #444; - font-size: 0.9em; -} - -div.related a { - color: #E2F3CC; -} - -div.sphinxsidebar { - font-size: 0.75em; - line-height: 1.5em; -} - -div.sphinxsidebarwrapper{ - padding: 20px 0; -} - -div.sphinxsidebar h3, -div.sphinxsidebar h4 { - font-family: Arial, sans-serif; - color: #222; - font-size: 1.2em; - font-weight: normal; - margin: 0; - padding: 5px 10px; - background-color: #ddd; - text-shadow: 1px 1px 0 white -} - -div.sphinxsidebar h4{ - font-size: 1.1em; -} - -div.sphinxsidebar h3 a { - color: #444; -} - - -div.sphinxsidebar p { - color: #888; - padding: 5px 20px; -} - -div.sphinxsidebar p.topless { -} - -div.sphinxsidebar ul { - margin: 10px 20px; - padding: 0; - color: #000; -} - -div.sphinxsidebar a { - color: #444; -} - -div.sphinxsidebar input { - border: 1px solid #ccc; - font-family: sans-serif; - font-size: 1em; -} - -div.sphinxsidebar input[type=text]{ - margin-left: 20px; -} - -/* -- body styles ----------------------------------------------------------- */ - -a { - color: #005B81; - text-decoration: none; -} - -a:hover { - color: #E32E00; - text-decoration: underline; -} - -div.body h1, -div.body h2, -div.body h3, -div.body h4, -div.body h5, -div.body h6 { - font-family: Arial, sans-serif; - font-weight: normal; - color: #212224; - margin: 30px 0px 10px 0px; - padding: 5px 0 5px 10px; - text-shadow: 0px 1px 0 white -} - -{% if theme_index_logo %} -div.indexwrapper h1 { - text-indent: -999999px; - background: url({{ theme_index_logo }}) no-repeat center center; - height: {{ theme_index_logo_height }}; -} -{% endif %} -div.body h1 { - border-top: 20px solid white; - margin-top: 0; - font-size: 250%; - text-align: center; -} - -div.body h2 { font-size: 150%; background-color: #C8D5E3; } -div.body h3 { font-size: 120%; background-color: #D8DEE3; } -div.body h4 { font-size: 110%; background-color: #D8DEE3; } -div.body h5 { font-size: 100%; background-color: #D8DEE3; } -div.body h6 { font-size: 100%; background-color: #D8DEE3; } - -a.headerlink { - color: #c60f0f; - font-size: 0.8em; - padding: 0 4px 0 4px; - text-decoration: none; -} - -a.headerlink:hover { - background-color: #c60f0f; - color: white; -} - -div.body p, div.body dd, div.body li { - line-height: 1.5em; -} - -div.admonition p.admonition-title + p { - display: inline; -} - -div.highlight{ - background-color: #111; -} - -div.note { - background-color: #eee; - border: 1px solid #ccc; -} - -div.seealso { - background-color: #ffc; - border: 1px solid #ff6; -} - -div.topic { - background-color: #eee; -} - -div.warning { - background-color: #ffe4e4; - border: 1px solid #f66; -} - -p.admonition-title { - display: inline; -} - -p.admonition-title:after { - content: ":"; -} - -pre { - padding: 10px; - background-color: #111; - color: #fff; - line-height: 1.2em; - border: 1px solid #C6C9CB; - font-size: 1.1em; - margin: 1.5em 0 1.5em 0; - -webkit-box-shadow: 1px 1px 1px #d8d8d8; - -moz-box-shadow: 1px 1px 1px #d8d8d8; -} - -tt { - background-color: #ecf0f3; - color: #222; - /* padding: 1px 2px; */ - font-size: 1.1em; - font-family: monospace; -} - -.viewcode-back { - font-family: Arial, sans-serif; -} - -div.viewcode-block:target { - background-color: #f4debf; - border-top: 1px solid #ac9; - border-bottom: 1px solid #ac9; -} diff --git a/docs/_themes/pelican/theme.conf b/docs/_themes/pelican/theme.conf deleted file mode 100644 index ffbb7945..00000000 --- a/docs/_themes/pelican/theme.conf +++ /dev/null @@ -1,10 +0,0 @@ -[theme] -inherit = basic -stylesheet = pelican.css -nosidebar = true -pygments_style = fruity - -[options] -index_logo_height = 120px -index_logo = -github_fork = diff --git a/docs/conf.py b/docs/conf.py index 99acd1b6..d4efcb38 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -57,6 +57,12 @@ html_use_index = False # If true, links to the reST sources are added to the pages. html_show_sourcelink = False + +def setup(app): + # overrides for wide tables in RTD theme + app.add_stylesheet('theme_overrides.css') # path relative to _static + + # -- Options for LaTeX output -------------------------------------------------- latex_documents = [ ('index', 'Pelican.tex', 'Pelican Documentation', From 46c865f295d9bbb1230e763ad5ed69777a477b43 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Mon, 28 Apr 2014 21:39:20 +0200 Subject: [PATCH 1143/2344] Really fix #1311 by declaring CSS overrides as !important this is needed because on RTD the common hosted theme stylesheets get added after the overrides. --- docs/_static/theme_overrides.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/_static/theme_overrides.css b/docs/_static/theme_overrides.css index d4b31645..83afc78e 100644 --- a/docs/_static/theme_overrides.css +++ b/docs/_static/theme_overrides.css @@ -1,12 +1,12 @@ /* override table width restrictions */ .wy-table-responsive table td, .wy-table-responsive table th { - white-space: normal; + /* !important prevents the common CSS stylesheets from + overriding this as on RTD they are loaded after this stylesheet */ + white-space: normal !important; } .wy-table-responsive { - margin-bottom: 24px; - max-width: 100%; - overflow: visible; + overflow: visible !important; } From b0e388747c5f5667dc38030f6b20fada49627e61 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Mon, 28 Apr 2014 21:47:18 +0200 Subject: [PATCH 1144/2344] Fix #1277 use rsync -c option as all output is rewritten Because Pelican always rewrites all output, the mtimes always change, so rsync would always transfer all the files which defeats the purpose of rsync. The '-c' option (--checksum) compares the checksums rather than mtimes. --- pelican/tools/templates/Makefile.in | 2 +- pelican/tools/templates/fabfile.py.in | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index c542e588..6bfa7b0c 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -88,7 +88,7 @@ ssh_upload: publish scp -P $$(SSH_PORT) -r $$(OUTPUTDIR)/* $$(SSH_USER)@$$(SSH_HOST):$$(SSH_TARGET_DIR) rsync_upload: publish - rsync -e "ssh -p $(SSH_PORT)" -P -rvz --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude + rsync -e "ssh -p $(SSH_PORT)" -P -rvzc --delete $(OUTPUTDIR)/ $(SSH_USER)@$(SSH_HOST):$(SSH_TARGET_DIR) --cvs-exclude dropbox_upload: publish cp -r $$(OUTPUTDIR)/* $$(DROPBOX_DIR) diff --git a/pelican/tools/templates/fabfile.py.in b/pelican/tools/templates/fabfile.py.in index fb56ae85..fbd03e2c 100644 --- a/pelican/tools/templates/fabfile.py.in +++ b/pelican/tools/templates/fabfile.py.in @@ -68,5 +68,6 @@ def publish(): remote_dir=dest_path, exclude=".DS_Store", local_dir=DEPLOY_PATH.rstrip('/') + '/', - delete=True + delete=True, + extra_opts='-c', ) From 3d53b4ca17d298e7147403d176c566eec9d30d79 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 30 Apr 2014 06:44:55 -0700 Subject: [PATCH 1145/2344] Add Python 3.4 to Travic CI configuration --- .travis.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.travis.yml b/.travis.yml index 93a7ab54..41ad82b2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,6 +2,7 @@ language: python python: - "2.7" - "3.3" + - "3.4" before_install: - sudo apt-get update -qq - sudo apt-get install -qq --no-install-recommends asciidoc From 81cd781c455f9e1e3e09dfc4ccfdac5f96e60742 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 30 Apr 2014 12:35:13 -0700 Subject: [PATCH 1146/2344] Show setting defaults as actual code MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit For some reason, setting names on the Settings page have long been wrapped in single back-ticks (usually meant for linking in reST) instead of double back-ticks (meant for denoting code). This seems to be widespread throughout the docs, and it's not clear if this is intentional or simply a reST formatting error that got propagated by others in order to stay consistent. This commit applies double back-ticks in any case where something resembling code is shown, with the idea that single back-ticks should only be used when linking. More importantly, the settings denoted their default values in parentheses, which hapless users often included when copying and pasting these values into their config files. As one can imagine, confusion — not hilarity — ensued. Setting defaults are now shown as they would actually appear in one's settings file, with an equal sign and without parentheses. During this spelunking expedition, many other minor improvements were concurrently conducted. --- docs/settings.rst | 422 +++++++++++++++++++++++----------------------- 1 file changed, 210 insertions(+), 212 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 1b4bae94..c9eddfba 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -6,8 +6,8 @@ the command line:: $ pelican content -s path/to/your/settingsfile.py -(If you used the `pelican-quickstart` command, your primary settings file will -be named `pelicanconf.py` by default.) +(If you used the ``pelican-quickstart`` command, your primary settings file will +be named ``pelicanconf.py`` by default.) Settings are configured in the form of a Python module (a file). There is an `example settings file @@ -32,33 +32,33 @@ Basic settings ============== =============================================================================== ===================================================================== -Setting name (default value) What does it do? +Setting name (followed by default value, if any) What does it do? =============================================================================== ===================================================================== -`AUTHOR` Default author (put your name) -`DATE_FORMATS` (``{}``) If you manage multiple languages, you can set the date formatting +``AUTHOR`` Default author (put your name) +``DATE_FORMATS = {}`` If you manage multiple languages, you can set the date formatting here. See the "Date format and locale" section below for details. -`USE_FOLDER_AS_CATEGORY` (``True``) When you don't specify a category in your post metadata, set this +``USE_FOLDER_AS_CATEGORY = True`` When you don't specify a category in your post metadata, set this setting to ``True``, and organize your articles in subfolders, the subfolder will become the category of your post. If set to ``False``, ``DEFAULT_CATEGORY`` will be used as a fallback. -`DEFAULT_CATEGORY` (``'misc'``) The default category to fall back on. -`DEFAULT_DATE_FORMAT` (``'%a %d %B %Y'``) The default date format you want to use. -`DISPLAY_PAGES_ON_MENU` (``True``) Whether to display pages on the menu of the +``DEFAULT_CATEGORY = 'misc'`` The default category to fall back on. +``DEFAULT_DATE_FORMAT = '%a %d %B %Y'`` The default date format you want to use. +``DISPLAY_PAGES_ON_MENU = True`` Whether to display pages on the menu of the template. Templates may or may not honor this setting. -`DISPLAY_CATEGORIES_ON_MENU` (``True``) Whether to display categories on the menu of the +``DISPLAY_CATEGORIES_ON_MENU = True`` Whether to display categories on the menu of the template. Templates may or not honor this setting. -`DEFAULT_DATE` (``None``) The default date you want to use. +``DEFAULT_DATE = None`` The default date you want to use. If ``fs``, Pelican will use the file system timestamp information (mtime) if it can't get date information from the metadata. If set to a tuple object, the default datetime object will instead be generated by passing the tuple to the ``datetime.datetime`` constructor. -`DEFAULT_METADATA` (``()``) The default metadata you want to use for all articles +``DEFAULT_METADATA = ()`` The default metadata you want to use for all articles and pages. -`FILENAME_METADATA` (``'(?P\d{4}-\d{2}-\d{2}).*'``) The regexp that will be used to extract any metadata +``FILENAME_METADATA =`` ``'(?P\d{4}-\d{2}-\d{2}).*'`` The regexp that will be used to extract any metadata from the filename. All named groups that are matched will be set in the metadata object. The default value will only extract the date from @@ -67,38 +67,38 @@ Setting name (default value) date and the slug, you could set something like: ``'(?P\d{4}-\d{2}-\d{2})_(?P.*)'``. See :ref:`path_metadata`. -`PATH_METADATA` (``''``) Like ``FILENAME_METADATA``, but parsed from a page's +``PATH_METADATA = ''`` Like ``FILENAME_METADATA``, but parsed from a page's full path relative to the content source directory. See :ref:`path_metadata`. -`EXTRA_PATH_METADATA` (``{}``) Extra metadata dictionaries keyed by relative path. +``EXTRA_PATH_METADATA = {}`` Extra metadata dictionaries keyed by relative path. See :ref:`path_metadata`. -`DELETE_OUTPUT_DIRECTORY` (``False``) Delete the output directory, and **all** of its contents, before +``DELETE_OUTPUT_DIRECTORY = False`` Delete the output directory, and **all** of its contents, before generating new files. This can be useful in preventing older, unnecessary files from persisting in your output. However, **this is a destructive setting and should be handled with extreme care.** -`OUTPUT_RETENTION` (``()``) A tuple of filenames that should be retained and not deleted from the +``OUTPUT_RETENTION = ()`` A tuple of filenames that should be retained and not deleted from the output directory. One use case would be the preservation of version control data. For example: ``(".hg", ".git", ".bzr")`` -`JINJA_EXTENSIONS` (``[]``) A list of any Jinja2 extensions you want to use. -`JINJA_FILTERS` (``{}``) A list of custom Jinja2 filters you want to use. +``JINJA_EXTENSIONS = []`` A list of any Jinja2 extensions you want to use. +``JINJA_FILTERS = {}`` A list of custom Jinja2 filters you want to use. The dictionary should map the filtername to the filter function. For example: ``{'urlencode': urlencode_filter}`` See `Jinja custom filters documentation`_. -`LOCALE` (''[#]_) Change the locale. A list of locales can be provided +``LOCALE`` [#]_ Change the locale. A list of locales can be provided here or a single string representing one locale. When providing a list, all the locales will be tried until one works. -`LOG_FILTER` (``[]``) A list of tuples containing the logging level (up to ``warning``) +``LOG_FILTER = []`` A list of tuples containing the logging level (up to ``warning``) and the message to be ignored. For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]`` -`READERS` (``{}``) A dictionary of file extensions / Reader classes for Pelican to +``READERS = {}`` A dictionary of file extensions / Reader classes for Pelican to process or ignore. For example, to avoid processing .html files, set: ``READERS = {'html': None}``. To add a custom reader for the `foo` extension, set: ``READERS = {'foo': FooReader}`` -`IGNORE_FILES` (``['.#*']``) A list of file globbing patterns to match against the +``IGNORE_FILES = ['.#*']`` A list of file globbing patterns to match against the source files to be ignored by the processor. For example, the default ``['.#*']`` will ignore emacs lock files. -`MD_EXTENSIONS` (``['codehilite(css_class=highlight)','extra']``) A list of the extensions that the Markdown processor +``MD_EXTENSIONS =`` ``['codehilite(css_class=highlight)','extra']`` A list of the extensions that the Markdown processor will use. Refer to the Python Markdown documentation's `Extensions section `_ for a complete list of supported extensions. (Note that @@ -107,87 +107,87 @@ Setting name (default value) to the default values for this setting, you'll need to include them explicitly and enumerate the full list of desired Markdown extensions.) -`OUTPUT_PATH` (``'output/'``) Where to output the generated files. -`PATH` (``None``) Path to content directory to be processed by Pelican. -`PAGE_DIR` (``'pages'``) Directory to look at for pages, relative to `PATH`. -`PAGE_EXCLUDES` (``()``) A list of directories to exclude when looking for pages. -`ARTICLE_DIR` (``''``) Directory to look at for articles, relative to `PATH`. -`ARTICLE_EXCLUDES`: (``('pages',)``) A list of directories to exclude when looking for articles. -`OUTPUT_SOURCES` (``False``) Set to True if you want to copy the articles and pages in their +``OUTPUT_PATH = 'output/'`` Where to output the generated files. +``PATH = None`` Path to content directory to be processed by Pelican. +``PAGE_DIR = 'pages'`` Directory to look at for pages, relative to `PATH`. +``PAGE_EXCLUDES = ()`` A list of directories to exclude when looking for pages. +``ARTICLE_DIR = ''`` Directory to look at for articles, relative to `PATH`. +``ARTICLE_EXCLUDES` = ('pages',)`` A list of directories to exclude when looking for articles. +``OUTPUT_SOURCES = False`` Set to True if you want to copy the articles and pages in their original format (e.g. Markdown or reStructuredText) to the specified ``OUTPUT_PATH``. -`OUTPUT_SOURCES_EXTENSION` (``.text``) Controls the extension that will be used by the SourcesGenerator. +``OUTPUT_SOURCES_EXTENSION = '.text'`` Controls the extension that will be used by the SourcesGenerator. Defaults to ``.text``. If not a valid string the default value will be used. -`RELATIVE_URLS` (``False``) Defines whether Pelican should use document-relative URLs or +``RELATIVE_URLS = False`` Defines whether Pelican should use document-relative URLs or not. Only set this to ``True`` when developing/testing and only if you fully understand the effect it can have on links/feeds. -`PLUGINS` (``[]``) The list of plugins to load. See :ref:`plugins`. -`SITENAME` (``'A Pelican Blog'``) Your site name -`SITEURL` Base URL of your website. Not defined by default, +``PLUGINS = []`` The list of plugins to load. See :ref:`plugins`. +``SITENAME = 'A Pelican Blog'`` Your site name +``SITEURL`` Base URL of your website. Not defined by default, so it is best to specify your SITEURL; if you do not, feeds will not be generated with properly-formed URLs. You should include ``http://`` and your domain, with no trailing slash at the end. Example: ``SITEURL = 'http://mydomain.com'`` -`TEMPLATE_PAGES` (``None``) A mapping containing template pages that will be rendered with +``TEMPLATE_PAGES = None`` A mapping containing template pages that will be rendered with the blog entries. See :ref:`template_pages`. -`STATIC_PATHS` (``['images']``) The static paths you want to have accessible +``STATIC_PATHS = ['images']`` The static paths you want to have accessible on the output path "static". By default, Pelican will copy the "images" folder to the output folder. -`TIMEZONE` The timezone used in the date information, to +``TIMEZONE`` The timezone used in the date information, to generate Atom and RSS feeds. See the *Timezone* section below for more info. -`TYPOGRIFY` (``False``) If set to True, several typographical improvements will be +``TYPOGRIFY = False`` If set to True, several typographical improvements will be incorporated into the generated HTML via the `Typogrify `_ library, which can be installed via: ``pip install typogrify`` -`DIRECT_TEMPLATES` (``('index', 'tags', 'categories', 'authors', 'archives')``) List of templates that are used directly to render +``DIRECT_TEMPLATES =`` ``('index', 'categories', 'authors', 'archives')`` List of templates that are used directly to render content. Typically direct templates are used to generate index pages for collections of content (e.g., tags and category index pages). If the tag and category collections are not needed, set ``DIRECT_TEMPLATES = ('index', 'archives')`` -`PAGINATED_DIRECT_TEMPLATES` (``('index',)``) Provides the direct templates that should be paginated. -`SUMMARY_MAX_LENGTH` (``50``) When creating a short summary of an article, this will +``PAGINATED_DIRECT_TEMPLATES = ('index',)`` Provides the direct templates that should be paginated. +``SUMMARY_MAX_LENGTH = 50`` When creating a short summary of an article, this will be the default length (measured in words) of the text created. This only applies if your content does not otherwise specify a summary. Setting to ``None`` will cause the summary to be a copy of the original content. -`EXTRA_TEMPLATES_PATHS` (``[]``) A list of paths you want Jinja2 to search for templates. +``EXTRA_TEMPLATES_PATHS = []`` A list of paths you want Jinja2 to search for templates. Can be used to separate templates from the theme. Example: projects, resume, profile ... These templates need to use ``DIRECT_TEMPLATES`` setting. -`ASCIIDOC_OPTIONS` (``[]``) A list of options to pass to AsciiDoc. See the `manpage - `_ -`WITH_FUTURE_DATES` (``True``) If disabled, content with dates in the future will get a - default status of ``draft``. - see :ref:`reading_only_modified_content` for details. -`INTRASITE_LINK_REGEX` (``'[{|](?P.*?)[|}]'``) Regular expression that is used to parse internal links. - Default syntax of links to internal files, tags, etc., is - to enclose the identifier, say ``filename``, in ``{}`` or ``||``. - Identifier between ``{`` and ``}`` goes into the ``what`` capturing group. +``ASCIIDOC_OPTIONS = []`` A list of options to pass to AsciiDoc. See the `manpage + `_. +``WITH_FUTURE_DATES = True`` If disabled, content with dates in the future will get a default + status of ``draft``. See :ref:`reading_only_modified_content` + for caveats. +``INTRASITE_LINK_REGEX = '[{|](?P.*?)[|}]'`` Regular expression that is used to parse internal links. Default + syntax when linking to internal files, tags, etc., is to enclose + the identifier, say ``filename``, in ``{}`` or ``||``. Identifier + between ``{`` and ``}`` goes into the ``what`` capturing group. For details see :ref:`ref-linking-to-internal-content`. -`PYGMENTS_RST_OPTIONS` (``[]``) A list of default Pygments settings for your reStructuredText +``PYGMENTS_RST_OPTIONS = []`` A list of default Pygments settings for your reStructuredText code blocks. See :ref:`internal_pygments_options` for a list of supported options. - -`SLUGIFY_SOURCE` (``'input'``) Specifies where you want the slug to be automatically generated - from. Can be set to 'title' to use the 'Title:' metadata tag or - 'basename' to use the articles basename when creating the slug. -`CACHE_CONTENT` (``True``) If ``True``, save content in a cache file. +``SLUGIFY_SOURCE = 'input'`` Specifies where you want the slug to be automatically generated + from. Can be set to ``title`` to use the 'Title:' metadata tag or + ``basename`` to use the article's basename when creating the slug. +``CACHE_CONTENT = True`` If ``True``, save content in a cache file. See :ref:`reading_only_modified_content` for details about caching. -`CONTENT_CACHING_LAYER` (``'reader'``) If set to ``'reader'``, save only the raw content and metadata returned - by readers, if set to ``'generator'``, save processed content objects. -`CACHE_DIRECTORY` (``cache``) Directory in which to store cache files. -`GZIP_CACHE` (``True``) If ``True``, use gzip to (de)compress the cache files. -`CHECK_MODIFIED_METHOD` (``mtime``) Controls how files are checked for modifications. -`LOAD_CONTENT_CACHE` (``True``) If ``True``, load unmodified content from cache. -`AUTORELOAD_IGNORE_CACHE` (``False``) If ``True``, do not load content cache in autoreload mode +``CONTENT_CACHING_LAYER = 'reader'`` If set to ``'reader'``, save only the raw content and metadata + returned by readers. If set to ``'generator'``, save processed + content objects. +``CACHE_DIRECTORY = 'cache'`` Directory in which to store cache files. +``GZIP_CACHE = True`` If ``True``, use gzip to (de)compress the cache files. +``CHECK_MODIFIED_METHOD = 'mtime'`` Controls how files are checked for modifications. +``LOAD_CONTENT_CACHE = True`` If ``True``, load unmodified content from cache. +``AUTORELOAD_IGNORE_CACHE = False`` If ``True``, do not load content cache in autoreload mode when the settings file changes. -`WRITE_SELECTED` (``[]``) If this list is not empty, **only** output files with their paths - in this list are written. Paths should be either relative to the current - working directory of Pelican or absolute. For possible use cases see - :ref:`writing_only_selected_content`. +``WRITE_SELECTED = []`` If this list is not empty, **only** output files with their paths + in this list are written. Paths should be either absolute or relative + to the current Pelican working directory. For possible use cases see + :ref:`writing_only_selected_content`. =============================================================================== ===================================================================== .. [#] Default is the system locale. @@ -231,8 +231,8 @@ Also, you can use other file metadata attributes as well: Example usage: -* ARTICLE_URL = ``'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/'`` -* ARTICLE_SAVE_AS = ``'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html'`` +* ``ARTICLE_URL = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/'`` +* ``ARTICLE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/{date:%d}/{slug}/index.html'`` This would save your articles in something like ``/posts/2011/Aug/07/sample-post/index.html``, and the URL to this would be ``/posts/2011/Aug/07/sample-post/``. @@ -245,8 +245,8 @@ make it easier for readers to navigate through the posts you've written over tim Example usage: -* YEAR_ARCHIVE_SAVE_AS = ``'posts/{date:%Y}/index.html'`` -* MONTH_ARCHIVE_SAVE_AS = ``'posts/{date:%Y}/{date:%b}/index.html'`` +* ``YEAR_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/index.html'`` +* ``MONTH_ARCHIVE_SAVE_AS = 'posts/{date:%Y}/{date:%b}/index.html'`` With these settings, Pelican will create an archive of all your posts for the year at (for instance) ``posts/2011/index.html`` and an archive of all your @@ -258,43 +258,43 @@ posts for the month at ``posts/2011/Aug/index.html``. arrive at an appropriate archive of posts, without having to specify a page name. -====================================================== ===================================================== -Setting name (default value) What does it do? -====================================================== ===================================================== -`ARTICLE_URL` (``'{slug}.html'``) The URL to refer to an article. -`ARTICLE_SAVE_AS` (``'{slug}.html'``) The place where we will save an article. -`ARTICLE_LANG_URL` (``'{slug}-{lang}.html'``) The URL to refer to an article which doesn't use the +====================================================== ======================================================== +Setting name (followed by default value, if any) What does it do? +====================================================== ======================================================== +``ARTICLE_URL = '{slug}.html'`` The URL to refer to an article. +``ARTICLE_SAVE_AS = '{slug}.html'`` The place where we will save an article. +``ARTICLE_LANG_URL = '{slug}-{lang}.html'`` The URL to refer to an article which doesn't use the default language. -`ARTICLE_LANG_SAVE_AS` (``'{slug}-{lang}.html'``) The place where we will save an article which +``ARTICLE_LANG_SAVE_AS = '{slug}-{lang}.html'`` The place where we will save an article which doesn't use the default language. -`DRAFT_URL` (``'drafts/{slug}.html'``) The URL to refer to an article draft. -`DRAFT_SAVE_AS` (``'drafts/{slug}.html'``) The place where we will save an article draft. -`DRAFT_LANG_URL` (``'drafts/{slug}-{lang}.html'``) The URL to refer to an article draft which doesn't +``DRAFT_URL = 'drafts/{slug}.html'`` The URL to refer to an article draft. +``DRAFT_SAVE_AS = 'drafts/{slug}.html'`` The place where we will save an article draft. +``DRAFT_LANG_URL = 'drafts/{slug}-{lang}.html'`` The URL to refer to an article draft which doesn't use the default language. -`DRAFT_LANG_SAVE_AS` (``'drafts/{slug}-{lang}.html'``) The place where we will save an article draft which +``DRAFT_LANG_SAVE_AS = 'drafts/{slug}-{lang}.html'`` The place where we will save an article draft which doesn't use the default language. -`PAGE_URL` (``'pages/{slug}.html'``) The URL we will use to link to a page. -`PAGE_SAVE_AS` (``'pages/{slug}.html'``) The location we will save the page. This value has to be +``PAGE_URL = 'pages/{slug}.html'`` The URL we will use to link to a page. +``PAGE_SAVE_AS = 'pages/{slug}.html'`` The location we will save the page. This value has to be the same as PAGE_URL or you need to use a rewrite in your server config. -`PAGE_LANG_URL` (``'pages/{slug}-{lang}.html'``) The URL we will use to link to a page which doesn't +``PAGE_LANG_URL = 'pages/{slug}-{lang}.html'`` The URL we will use to link to a page which doesn't use the default language. -`PAGE_LANG_SAVE_AS` (``'pages/{slug}-{lang}.html'``) The location we will save the page which doesn't +``PAGE_LANG_SAVE_AS = 'pages/{slug}-{lang}.html'`` The location we will save the page which doesn't use the default language. -`CATEGORY_URL` (``'category/{slug}.html'``) The URL to use for a category. -`CATEGORY_SAVE_AS` (``'category/{slug}.html'``) The location to save a category. -`TAG_URL` (``'tag/{slug}.html'``) The URL to use for a tag. -`TAG_SAVE_AS` (``'tag/{slug}.html'``) The location to save the tag page. -`AUTHOR_URL` (``'author/{slug}.html'``) The URL to use for an author. -`AUTHOR_SAVE_AS` (``'author/{slug}.html'``) The location to save an author. -`YEAR_ARCHIVE_SAVE_AS` (``''``) The location to save per-year archives of your posts. -`MONTH_ARCHIVE_SAVE_AS` (``''``) The location to save per-month archives of your posts. -`DAY_ARCHIVE_SAVE_AS` (``''``) The location to save per-day archives of your posts. -`SLUG_SUBSTITUTIONS` (``()``) Substitutions to make prior to stripping out +``CATEGORY_URL = 'category/{slug}.html'`` The URL to use for a category. +``CATEGORY_SAVE_AS = 'category/{slug}.html'`` The location to save a category. +``TAG_URL = 'tag/{slug}.html'`` The URL to use for a tag. +``TAG_SAVE_AS = 'tag/{slug}.html'`` The location to save the tag page. +``AUTHOR_URL = 'author/{slug}.html'`` The URL to use for an author. +``AUTHOR_SAVE_AS = 'author/{slug}.html'`` The location to save an author. +``YEAR_ARCHIVE_SAVE_AS = ''`` The location to save per-year archives of your posts. +``MONTH_ARCHIVE_SAVE_AS = ''`` The location to save per-month archives of your posts. +``DAY_ARCHIVE_SAVE_AS = ''`` The location to save per-day archives of your posts. +``SLUG_SUBSTITUTIONS` = ()`` Substitutions to make prior to stripping out non-alphanumerics when generating slugs. Specified as a list of 2-tuples of ``(from, to)`` which are applied in order. -====================================================== ===================================================== +====================================================== ======================================================== .. note:: @@ -303,23 +303,21 @@ Setting name (default value) What does it do? set the corresponding ``*_SAVE_AS`` setting to ``''`` to prevent the relevant page from being generated. -`DIRECT_TEMPLATES` -~~~~~~~~~~~~~~~~~~ - -These templates (``('index', 'tags', 'categories', 'archives')`` by default) -works a bit differently than above. Only the ``_SAVE_AS`` setting is available: +``DIRECT_TEMPLATES``, which are ``('index', 'tags', 'categories', 'archives')`` +by default, work a bit differently than noted above. Only the ``_SAVE_AS`` +settings are available: ============================================= =============================================== -Setting name (default value) What does it do? +Setting name (followed by default value) What does it do? ============================================= =============================================== -`ARCHIVES_SAVE_AS` (``'archives.html'``) The location to save the article archives page. -`AUTHORS_SAVE_AS` (``'authors.html'``) The location to save the author list. -`CATEGORIES_SAVE_AS` (``'categories.html'``) The location to save the category list. -`TAGS_SAVE_AS` (``'tags.html'``) The location to save the tag list. +``ARCHIVES_SAVE_AS = 'archives.html'`` The location to save the article archives page. +``AUTHORS_SAVE_AS = 'authors.html'`` The location to save the author list. +``CATEGORIES_SAVE_AS = 'categories.html'`` The location to save the category list. +``TAGS_SAVE_AS = 'tags.html'`` The location to save the tag list. ============================================= =============================================== -The corresponding urls are hard-coded in the themes: ``'archives.html'``, -``'authors.html'``, ``'categories.html'``, ``'tags.html'``. +URLs for direct template pages are theme-dependent. Some themes hard-code them: +``'archives.html'``, ``'authors.html'``, ``'categories.html'``, ``'tags.html'``. Timezone -------- @@ -460,33 +458,33 @@ Pelican generates category feeds as well as feeds for all your articles. It does not generate feeds for tags by default, but it is possible to do so using the ``TAG_FEED_ATOM`` and ``TAG_FEED_RSS`` settings: -================================================ ===================================================== -Setting name (default value) What does it do? -================================================ ===================================================== -`FEED_DOMAIN` (``None``, i.e. base URL is "/") The domain prepended to feed URLs. Since feed URLs +================================================= ===================================================== +Setting name (followed by default value, if any) What does it do? +================================================= ===================================================== +``FEED_DOMAIN = None``, i.e. base URL is "/" The domain prepended to feed URLs. Since feed URLs should always be absolute, it is highly recommended to define this (e.g., "http://feeds.example.com"). If you have already explicitly defined SITEURL (see above) and want to use the same domain for your feeds, you can just set: ``FEED_DOMAIN = SITEURL``. -`FEED_ATOM` (``None``, i.e. no Atom feed) Relative URL to output the Atom feed. -`FEED_RSS` (``None``, i.e. no RSS) Relative URL to output the RSS feed. -`FEED_ALL_ATOM` (``'feeds/all.atom.xml'``) Relative URL to output the all posts Atom feed: +``FEED_ATOM = None``, i.e. no Atom feed Relative URL to output the Atom feed. +``FEED_RSS = None``, i.e. no RSS Relative URL to output the RSS feed. +``FEED_ALL_ATOM = 'feeds/all.atom.xml'`` Relative URL to output the all-posts Atom feed: this feed will contain all posts regardless of their language. -`FEED_ALL_RSS` (``None``, i.e. no all RSS) Relative URL to output the all posts RSS feed: +``FEED_ALL_RSS = None``, i.e. no all-posts RSS Relative URL to output the all-posts RSS feed: this feed will contain all posts regardless of their language. -`CATEGORY_FEED_ATOM` ('feeds/%s.atom.xml'[2]_) Where to put the category Atom feeds. -`CATEGORY_FEED_RSS` (``None``, i.e. no RSS) Where to put the category RSS feeds. -`AUTHOR_FEED_ATOM` ('feeds/%s.atom.xml'[2]_) Where to put the author Atom feeds. -`AUTHOR_FEED_RSS` ('feeds/%s.rss.xml'[2]_) Where to put the author RSS feeds. -`TAG_FEED_ATOM` (``None``, i.e. no tag feed) Relative URL to output the tag Atom feed. It should +``CATEGORY_FEED_ATOM = 'feeds/%s.atom.xml'`` [2]_ Where to put the category Atom feeds. +``CATEGORY_FEED_RSS = None``, i.e. no RSS Where to put the category RSS feeds. +``AUTHOR_FEED_ATOM = 'feeds/%s.atom.xml'`` [2]_ Where to put the author Atom feeds. +``AUTHOR_FEED_RSS = 'feeds/%s.rss.xml'`` [2]_ Where to put the author RSS feeds. +``TAG_FEED_ATOM = None``, i.e. no tag feed Relative URL to output the tag Atom feed. It should be defined using a "%s" match in the tag name. -`TAG_FEED_RSS` (``None``, ie no RSS tag feed) Relative URL to output the tag RSS feed -`FEED_MAX_ITEMS` Maximum number of items allowed in a feed. Feed item +``TAG_FEED_RSS = None``, i.e. no RSS tag feed Relative URL to output the tag RSS feed +``FEED_MAX_ITEMS`` Maximum number of items allowed in a feed. Feed item quantity is unrestricted by default. -================================================ ===================================================== +================================================= ===================================================== If you don't want to generate some or any of these feeds, set the above variables to ``None``. @@ -499,17 +497,17 @@ If you want to use FeedBurner for your feed, you will likely need to decide upon a unique identifier. For example, if your site were called "Thyme" and hosted on the www.example.com domain, you might use "thymefeeds" as your unique identifier, which we'll use throughout this section for illustrative -purposes. In your Pelican settings, set the `FEED_ATOM` attribute to -"thymefeeds/main.xml" to create an Atom feed with an original address of -`http://www.example.com/thymefeeds/main.xml`. Set the `FEED_DOMAIN` attribute -to `http://feeds.feedburner.com`, or `http://feeds.example.com` if you are -using a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature). +purposes. In your Pelican settings, set the ``FEED_ATOM`` attribute to +``thymefeeds/main.xml`` to create an Atom feed with an original address of +``http://www.example.com/thymefeeds/main.xml``. Set the ``FEED_DOMAIN`` +attribute to ``http://feeds.feedburner.com``, or ``http://feeds.example.com`` if +you are using a CNAME on your own domain (i.e., FeedBurner's "MyBrand" feature). There are two fields to configure in the `FeedBurner `_ interface: "Original Feed" and "Feed Address". In this example, the "Original Feed" would be -`http://www.example.com/thymefeeds/main.xml` and the "Feed Address" suffix -would be `thymefeeds/main.xml`. +``http://www.example.com/thymefeeds/main.xml`` and the "Feed Address" suffix +would be ``thymefeeds/main.xml``. Pagination ========== @@ -522,15 +520,15 @@ benefit from paginating this list. You can use the following settings to configure the pagination. ================================================ ===================================================== -Setting name (default value) What does it do? +Setting name (followed by default value, if any) What does it do? ================================================ ===================================================== -`DEFAULT_ORPHANS` (``0``) The minimum number of articles allowed on the +``DEFAULT_ORPHANS = 0`` The minimum number of articles allowed on the last page. Use this when you don't want the last page to only contain a handful of articles. -`DEFAULT_PAGINATION` (``False``) The maximum number of articles to include on a +``DEFAULT_PAGINATION = False`` The maximum number of articles to include on a page, not including orphans. False to disable pagination. -`PAGINATION_PATTERNS` A set of patterns that are used to determine advanced +``PAGINATION_PATTERNS`` A set of patterns that are used to determine advanced pagination output. ================================================ ===================================================== @@ -563,11 +561,11 @@ If you want to generate a tag cloud with all your tags, you can do so using the following settings. ================================================ ===================================================== -Setting name (default value) What does it do? +Setting name (followed by default value) What does it do? ================================================ ===================================================== -`TAG_CLOUD_STEPS` (``4``) Count of different font sizes in the tag +``TAG_CLOUD_STEPS = 4`` Count of different font sizes in the tag cloud. -`TAG_CLOUD_MAX_ITEMS` (``100``) Maximum number of tags in the cloud. +``TAG_CLOUD_MAX_ITEMS = 100`` Maximum number of tags in the cloud. ================================================ ===================================================== The default theme does not include a tag cloud, but it is pretty easy to add one:: @@ -608,13 +606,13 @@ Translations Pelican offers a way to translate articles. See the :doc:`Getting Started ` section for more information. -===================================================== ===================================================== -Setting name (default value) What does it do? -===================================================== ===================================================== -`DEFAULT_LANG` (``'en'``) The default language to use. -`TRANSLATION_FEED_ATOM` ('feeds/all-%s.atom.xml'[3]_) Where to put the Atom feed for translations. -`TRANSLATION_FEED_RSS` (``None``, i.e. no RSS) Where to put the RSS feed for translations. -===================================================== ===================================================== +======================================================== ===================================================== +Setting name (followed by default value, if any) What does it do? +======================================================== ===================================================== +``DEFAULT_LANG = 'en'`` The default language to use. +``TRANSLATION_FEED_ATOM = 'feeds/all-%s.atom.xml'`` [3]_ Where to put the Atom feed for translations. +``TRANSLATION_FEED_RSS = None``, i.e. no RSS Where to put the RSS feed for translations. +======================================================== ===================================================== .. [3] %s is the language @@ -622,11 +620,11 @@ Ordering content ================ ================================================ ===================================================== -Setting name (default value) What does it do? +Setting name (followed by default value) What does it do? ================================================ ===================================================== -`NEWEST_FIRST_ARCHIVES` (``True``) Order archives by newest first by date. (False: +``NEWEST_FIRST_ARCHIVES = True`` Order archives by newest first by date. (False: orders by date with older articles first.) -`REVERSE_CATEGORY_ORDER` (``False``) Reverse the category order. (True: lists by reverse +``REVERSE_CATEGORY_ORDER = False`` Reverse the category order. (True: lists by reverse alphabetical order; default lists alphabetically.) ================================================ ===================================================== @@ -637,32 +635,32 @@ Creating Pelican themes is addressed in a dedicated section (see :ref:`theming-p However, here are the settings that are related to themes. ================================================ ===================================================== -Setting name (default value) What does it do? +Setting name (followed by default value, if any) What does it do? ================================================ ===================================================== -`THEME` Theme to use to produce the output. Can be a relative +``THEME`` Theme to use to produce the output. Can be a relative or absolute path to a theme folder, or the name of a default theme or a theme installed via ``pelican-themes`` (see below). -`THEME_STATIC_DIR` (``'theme'``) Destination directory in the output path where +``THEME_STATIC_DIR = 'theme'`` Destination directory in the output path where Pelican will place the files collected from `THEME_STATIC_PATHS`. Default is `theme`. -`THEME_STATIC_PATHS` (``['static']``) Static theme paths you want to copy. Default +``THEME_STATIC_PATHS = ['static']`` Static theme paths you want to copy. Default value is `static`, but if your theme has other static paths, you can put them here. If files or directories with the same names are included in the paths defined in this settings, they will be progressively overwritten. -`CSS_FILE` (``'main.css'``) Specify the CSS file you want to load. +``CSS_FILE = 'main.css'`` Specify the CSS file you want to load. ================================================ ===================================================== -By default, two themes are available. You can specify them using the `THEME` setting or by passing the -``-t`` option to the ``pelican`` command: +By default, two themes are available. You can specify them using the ``THEME`` +setting or by passing the ``-t`` option to the ``pelican`` command: * notmyidea * simple (a synonym for "plain text" :) -There are a number of other themes available at http://github.com/getpelican/pelican-themes. +There are a number of other themes available at https://github.com/getpelican/pelican-themes. Pelican comes with :doc:`pelican-themes`, a small script for managing themes. You can define your own theme, either by starting from scratch or by duplicating @@ -677,34 +675,34 @@ Following are example ways to specify your preferred theme:: # Specify a customized theme, via path relative to the settings file THEME = "themes/mycustomtheme" # Specify a customized theme, via absolute path - THEME = "~/projects/mysite/themes/mycustomtheme" + THEME = "/home/myuser/projects/mysite/themes/mycustomtheme" The built-in ``notmyidea`` theme can make good use of the following settings. Feel free to use them in your themes as well. ======================= ======================================================= -Setting name What does it do ? +Setting name What does it do? ======================= ======================================================= -`SITESUBTITLE` A subtitle to appear in the header. -`DISQUS_SITENAME` Pelican can handle Disqus comments. Specify the +``SITESUBTITLE`` A subtitle to appear in the header. +``DISQUS_SITENAME`` Pelican can handle Disqus comments. Specify the Disqus sitename identifier here. -`GITHUB_URL` Your GitHub URL (if you have one). It will then +``GITHUB_URL`` Your GitHub URL (if you have one). It will then use this information to create a GitHub ribbon. -`GOOGLE_ANALYTICS` 'UA-XXXX-YYYY' to activate Google Analytics. -`GOSQUARED_SITENAME` 'XXX-YYYYYY-X' to activate GoSquared. -`MENUITEMS` A list of tuples (Title, URL) for additional menu +``GOOGLE_ANALYTICS`` Set to 'UA-XXXX-YYYY' to activate Google Analytics. +``GOSQUARED_SITENAME`` Set to 'XXX-YYYYYY-X' to activate GoSquared. +``MENUITEMS`` A list of tuples (Title, URL) for additional menu items to appear at the beginning of the main menu. -`PIWIK_URL` URL to your Piwik server - without 'http://' at the +``PIWIK_URL`` URL to your Piwik server - without 'http://' at the beginning. -`PIWIK_SSL_URL` If the SSL-URL differs from the normal Piwik-URL +``PIWIK_SSL_URL`` If the SSL-URL differs from the normal Piwik-URL you have to include this setting too. (optional) -`PIWIK_SITE_ID` ID for the monitored website. You can find the ID - in the Piwik admin interface > settings > websites. -`LINKS` A list of tuples (Title, URL) for links to appear on +``PIWIK_SITE_ID`` ID for the monitored website. You can find the ID + in the Piwik admin interface > Settings > Websites. +``LINKS`` A list of tuples (Title, URL) for links to appear on the header. -`SOCIAL` A list of tuples (Title, URL) to appear in the +``SOCIAL`` A list of tuples (Title, URL) to appear in the "social" section. -`TWITTER_USERNAME` Allows for adding a button to articles to encourage +``TWITTER_USERNAME`` Allows for adding a button to articles to encourage others to tweet about them. Add your Twitter username if you want this button to appear. ======================= ======================================================= @@ -734,17 +732,17 @@ For example: ``[(logging.WARN, 'TAG_SAVE_AS is set to False')]`` Reading only modified content ============================= -To speed up the build process, pelican can optionally read only articles +To speed up the build process, Pelican can optionally read only articles and pages with modified content. When Pelican is about to read some content source file: 1. The hash or modification time information for the file from a - previous build are loaded from a cache file if `LOAD_CONTENT_CACHE` - is ``True``. These files are stored in the `CACHE_DIRECTORY` + previous build are loaded from a cache file if ``LOAD_CONTENT_CACHE`` + is ``True``. These files are stored in the ``CACHE_DIRECTORY`` directory. If the file has no record in the cache file, it is read as usual. -2. The file is checked according to `CHECK_MODIFIED_METHOD`: +2. The file is checked according to ``CHECK_MODIFIED_METHOD``: - If set to ``'mtime'``, the modification time of the file is checked. @@ -755,60 +753,60 @@ When Pelican is about to read some content source file: usual. 3. If the file is considered unchanged, the content data saved in a - previous build corresponding to the file is loaded from the cache + previous build corresponding to the file is loaded from the cache, and the file is not read. 4. If the file is considered changed, the file is read and the new modification information and the content data are saved to the - cache if `CACHE_CONTENT` is ``True``. + cache if ``CACHE_CONTENT`` is ``True``. -Depending on `CONTENT_CACHING_LAYER` either the raw content and -metadata returned by a reader are cached if set to ``'reader'``, or -the processed content object is cached if set to ``'generator'``. -Caching the processed content object may conflict with plugins (as -some reading related signals may be skipped) or e.g. the -`WITH_FUTURE_DATES` functionality (as the ``draft`` status of the +If ``CONTENT_CACHING_LAYER`` is set to ``'reader'`` (the default), +the raw content and metadata returned by a reader are cached. If this +setting is instead set to ``'generator'``, the processed content +object is cached. Caching the processed content object may conflict +with plugins (as some reading related signals may be skipped) and the +``WITH_FUTURE_DATES`` functionality (as the ``draft`` status of the cached content objects would not change automatically over time). -Modification time based checking is faster than comparing file hashes, -but is not as reliable, because mtime information can be lost when -e.g. copying the content sources using the ``cp`` or ``rsync`` -commands without the mtime preservation mode (invoked e.g. by -``--archive``). +Checking modification times is faster than comparing file hashes, +but it is not as reliable because ``mtime`` information can be lost, +e.g., when copying content source files using the ``cp`` or ``rsync`` +commands without the ``mtime`` preservation mode (which for ``rsync`` +can be invoked by passing the ``--archive`` flag). The cache files are Python pickles, so they may not be readable by different versions of Python as the pickle format often changes. If such an error is encountered, the cache files have to be rebuilt by -running pelican after removing them or by using the pelican -command-line option ``--ignore-cache``. The cache files also have to -be rebuilt when changing the `GZIP_CACHE` setting for cache file -reading to work. +removing them and re-running Pelican, or by using the Pelican +command-line option ``--ignore-cache``. The cache files also have to +be rebuilt when changing the ``GZIP_CACHE`` setting for cache file +reading to work properly. The ``--ignore-cache`` command-line option is also useful when the -whole cache needs to be regenerated due to e.g. modifications to the -settings file which should change the cached content or just for -debugging purposes. When pelican runs in autoreload mode, modification +whole cache needs to be regenerated, such as when making modifications +to the settings file that will affect the cached content, or just for +debugging purposes. When Pelican runs in autoreload mode, modification of the settings file will make it ignore the cache automatically if -`AUTORELOAD_IGNORE_CACHE` is ``True``. +``AUTORELOAD_IGNORE_CACHE`` is ``True``. Note that even when using cached content, all output is always -written, so the modification times of the ``*.html`` files always -change. Therefore, ``rsync`` based upload may benefit from the -``--checksum`` option. +written, so the modification times of the generated ``*.html`` files +will always change. Therefore, ``rsync``-based uploading may benefit +from the ``--checksum`` option. .. _writing_only_selected_content: Writing only selected content ============================= -When one article or page or the theme is being worked on it is often -desirable to display selected output files as soon as possible. In -such cases generating and writing all output is often unnecessary. -These selected output files can be given as output paths in the -`WRITE_SELECTED` list and **only** those files will be written. This -list can be also specified on the command-line using the -``--write-selected`` option which accepts a comma separated list -of output file paths. By default the list is empty so all output is -written. +When only working on a single article or page, or making tweaks to +your theme, it is often desirable to generate and review your work +as quickly as possible. In such cases, generating and writing the +entire site output is often unnecessary. By specifying only the +desired files as output paths in the ``WRITE_SELECTED`` list, +**only** those files will be written. This list can be also specified +on the command line using the ``--write-selected`` option, which +accepts a comma-separated list of output file paths. By default this +list is empty, so all output is written. Example settings ================ From fd231b6ce2692fc186080a472876687018eff772 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 30 Apr 2014 13:35:10 -0700 Subject: [PATCH 1147/2344] Remove errant leading spaces from fabfile.py.in --- pelican/tools/templates/fabfile.py.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/tools/templates/fabfile.py.in b/pelican/tools/templates/fabfile.py.in index fbd03e2c..e693bb48 100644 --- a/pelican/tools/templates/fabfile.py.in +++ b/pelican/tools/templates/fabfile.py.in @@ -36,13 +36,13 @@ def regenerate(): def serve(): os.chdir(env.deploy_path) - + PORT = 8000 class AddressReuseTCPServer(SocketServer.TCPServer): allow_reuse_address = True - + server = AddressReuseTCPServer(('', PORT), SimpleHTTPServer.SimpleHTTPRequestHandler) - + sys.stderr.write('Serving on port {0} ...\n'.format(PORT)) server.serve_forever() From f00fc944fb310f1a6531b0a68ed9bda23c40fb2c Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Thu, 1 May 2014 10:39:07 +0200 Subject: [PATCH 1148/2344] Fix get_writer signal received result unpacking --- pelican/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 5208c317..74f55c46 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -209,13 +209,13 @@ class Pelican(object): return generators def get_writer(self): - writers = [ w for w in signals.get_writer.send(self) + writers = [ w for (_, w) in signals.get_writer.send(self) if isinstance(w, type) ] writers_found = len(writers) if writers_found == 0: return Writer(self.output_path, settings=self.settings) else: - _, writer = writers[0] + writer = writers[0] if writers_found == 1: logger.debug('Found writer: {}'.format(writer)) else: From f2549650e6b2154d3484a72ee19732a75e3d4fe8 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 2 May 2014 07:34:27 -0700 Subject: [PATCH 1149/2344] Remove errant backtick --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index c9eddfba..d5802d1d 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -112,7 +112,7 @@ Setting name (followed by default value, if any) ``PAGE_DIR = 'pages'`` Directory to look at for pages, relative to `PATH`. ``PAGE_EXCLUDES = ()`` A list of directories to exclude when looking for pages. ``ARTICLE_DIR = ''`` Directory to look at for articles, relative to `PATH`. -``ARTICLE_EXCLUDES` = ('pages',)`` A list of directories to exclude when looking for articles. +``ARTICLE_EXCLUDES = ('pages',)`` A list of directories to exclude when looking for articles. ``OUTPUT_SOURCES = False`` Set to True if you want to copy the articles and pages in their original format (e.g. Markdown or reStructuredText) to the specified ``OUTPUT_PATH``. From 5bad061c19947fde41a98bccb56a9a00ef46a40a Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Sun, 27 Apr 2014 08:53:56 +0200 Subject: [PATCH 1150/2344] rename CACHE_DIR -> CACHE_PATH to unify with rest of Pelican CACHE_PATH can now be relative to settings file like OUTPUT_PATH. Also add --cache-path commandline option. Change cache loading warning to a less scary and more helpful message. --- docs/settings.rst | 4 ++-- pelican/__init__.py | 8 +++++++- pelican/settings.py | 4 ++-- pelican/tests/test_generators.py | 26 +++++++++++++------------- pelican/tests/test_pelican.py | 10 +++++----- pelican/utils.py | 18 ++++++++++++------ 6 files changed, 41 insertions(+), 29 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index d5802d1d..2782977c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -178,7 +178,7 @@ Setting name (followed by default value, if any) ``CONTENT_CACHING_LAYER = 'reader'`` If set to ``'reader'``, save only the raw content and metadata returned by readers. If set to ``'generator'``, save processed content objects. -``CACHE_DIRECTORY = 'cache'`` Directory in which to store cache files. +``CACHE_PATH = 'cache'`` Directory in which to store cache files. ``GZIP_CACHE = True`` If ``True``, use gzip to (de)compress the cache files. ``CHECK_MODIFIED_METHOD = 'mtime'`` Controls how files are checked for modifications. ``LOAD_CONTENT_CACHE = True`` If ``True``, load unmodified content from cache. @@ -739,7 +739,7 @@ When Pelican is about to read some content source file: 1. The hash or modification time information for the file from a previous build are loaded from a cache file if ``LOAD_CONTENT_CACHE`` - is ``True``. These files are stored in the ``CACHE_DIRECTORY`` + is ``True``. These files are stored in the ``CACHE_PATH`` directory. If the file has no record in the cache file, it is read as usual. 2. The file is checked according to ``CHECK_MODIFIED_METHOD``: diff --git a/pelican/__init__.py b/pelican/__init__.py index 74f55c46..d6417391 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -275,7 +275,11 @@ def parse_arguments(): help='Relaunch pelican each time a modification occurs' ' on the content files.') - parser.add_argument('-c', '--ignore-cache', action='store_true', + parser.add_argument('--cache-path', dest='cache_path', + help=('Directory in which to store cache files. ' + 'If not specified, defaults to "cache".')) + + parser.add_argument('--ignore-cache', action='store_true', dest='ignore_cache', help='Ignore content cache ' 'from previous runs by not loading cache files.') @@ -300,6 +304,8 @@ def get_config(args): config['DELETE_OUTPUT_DIRECTORY'] = args.delete_outputdir if args.ignore_cache: config['LOAD_CONTENT_CACHE'] = False + if args.cache_path: + config['CACHE_PATH'] = args.cache_path if args.selected_paths: config['WRITE_SELECTED'] = args.selected_paths.split(',') diff --git a/pelican/settings.py b/pelican/settings.py index abf16b32..f759ff9e 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -124,7 +124,7 @@ DEFAULT_CONFIG = { 'SLUGIFY_SOURCE': 'title', 'CACHE_CONTENT': True, 'CONTENT_CACHING_LAYER': 'reader', - 'CACHE_DIRECTORY': 'cache', + 'CACHE_PATH': 'cache', 'GZIP_CACHE': True, 'CHECK_MODIFIED_METHOD': 'mtime', 'LOAD_CONTENT_CACHE': True, @@ -139,7 +139,7 @@ def read_settings(path=None, override=None): if path: local_settings = get_settings_from_file(path) # Make the paths relative to the settings file - for p in ['PATH', 'OUTPUT_PATH', 'THEME']: + for p in ['PATH', 'OUTPUT_PATH', 'THEME', 'CACHE_PATH']: if p in local_settings and local_settings[p] is not None \ and not isabs(local_settings[p]): absp = os.path.abspath(os.path.normpath(os.path.join( diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 9463047e..7b79e8f3 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -66,7 +66,7 @@ class TestArticlesGenerator(unittest.TestCase): def test_generate_feeds(self): settings = get_settings() - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=None, theme=settings['THEME'], output_path=None) @@ -142,7 +142,7 @@ class TestArticlesGenerator(unittest.TestCase): settings['DEFAULT_CATEGORY'] = 'Default' settings['DEFAULT_DATE'] = (1970, 1, 1) settings['USE_FOLDER_AS_CATEGORY'] = False - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache settings['READERS'] = {'asc': None} settings['filenames'] = {} generator = ArticlesGenerator( @@ -167,7 +167,7 @@ class TestArticlesGenerator(unittest.TestCase): def test_direct_templates_save_as_default(self): settings = get_settings(filenames={}) - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=None, theme=settings['THEME'], output_path=None) @@ -182,7 +182,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings() settings['DIRECT_TEMPLATES'] = ['archives'] settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=None, theme=settings['THEME'], output_path=None) @@ -198,7 +198,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings() settings['DIRECT_TEMPLATES'] = ['archives'] settings['ARCHIVES_SAVE_AS'] = 'archives/index.html' - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=None, theme=settings['THEME'], output_path=None) @@ -225,7 +225,7 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings(filenames={}) settings['YEAR_ARCHIVE_SAVE_AS'] = 'posts/{date:%Y}/index.html' - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache generator = ArticlesGenerator( context=settings, settings=settings, path=CONTENT_DIR, theme=settings['THEME'], output_path=None) @@ -291,7 +291,7 @@ class TestArticlesGenerator(unittest.TestCase): def test_article_object_caching(self): """Test Article objects caching at the generator level""" settings = get_settings(filenames={}) - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache settings['CONTENT_CACHING_LAYER'] = 'generator' settings['READERS'] = {'asc': None} @@ -311,7 +311,7 @@ class TestArticlesGenerator(unittest.TestCase): def test_reader_content_caching(self): """Test raw content caching at the reader level""" settings = get_settings(filenames={}) - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache settings['READERS'] = {'asc': None} generator = ArticlesGenerator( @@ -335,7 +335,7 @@ class TestArticlesGenerator(unittest.TestCase): used in --ignore-cache or autoreload mode""" settings = get_settings(filenames={}) - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache settings['READERS'] = {'asc': None} generator = ArticlesGenerator( @@ -373,7 +373,7 @@ class TestPageGenerator(unittest.TestCase): def test_generate_context(self): settings = get_settings(filenames={}) settings['PAGE_DIR'] = 'TestPages' # relative to CUR_DIR - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache settings['DEFAULT_DATE'] = (1970, 1, 1) generator = PagesGenerator( @@ -402,7 +402,7 @@ class TestPageGenerator(unittest.TestCase): def test_page_object_caching(self): """Test Page objects caching at the generator level""" settings = get_settings(filenames={}) - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache settings['CONTENT_CACHING_LAYER'] = 'generator' settings['READERS'] = {'asc': None} @@ -422,7 +422,7 @@ class TestPageGenerator(unittest.TestCase): def test_reader_content_caching(self): """Test raw content caching at the reader level""" settings = get_settings(filenames={}) - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache settings['READERS'] = {'asc': None} generator = PagesGenerator( @@ -446,7 +446,7 @@ class TestPageGenerator(unittest.TestCase): used in --ignore_cache or autoreload mode""" settings = get_settings(filenames={}) - settings['CACHE_DIRECTORY'] = self.temp_cache + settings['CACHE_PATH'] = self.temp_cache settings['READERS'] = {'asc': None} generator = PagesGenerator( diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index 294cf399..411fb7da 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -79,7 +79,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=None, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, - 'CACHE_DIRECTORY': self.temp_cache, + 'CACHE_PATH': self.temp_cache, 'LOCALE': locale.normalize('en_US'), }) pelican = Pelican(settings=settings) @@ -95,7 +95,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=SAMPLE_CONFIG, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, - 'CACHE_DIRECTORY': self.temp_cache, + 'CACHE_PATH': self.temp_cache, 'LOCALE': locale.normalize('en_US'), }) pelican = Pelican(settings=settings) @@ -107,7 +107,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=SAMPLE_CONFIG, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, - 'CACHE_DIRECTORY': self.temp_cache, + 'CACHE_PATH': self.temp_cache, 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, 'very'), os.path.join(SAMPLES_PATH, 'kinda'), os.path.join(SAMPLES_PATH, 'theme_standard')] @@ -128,7 +128,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=SAMPLE_CONFIG, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, - 'CACHE_DIRECTORY': self.temp_cache, + 'CACHE_PATH': self.temp_cache, 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, 'theme_standard')] }) @@ -144,7 +144,7 @@ class TestPelican(LoggedTestCase): settings = read_settings(path=None, override={ 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, - 'CACHE_DIRECTORY': self.temp_cache, + 'CACHE_PATH': self.temp_cache, 'WRITE_SELECTED': [ os.path.join(self.temp_path, 'oh-yeah.html'), os.path.join(self.temp_path, 'categories.html'), diff --git a/pelican/utils.py b/pelican/utils.py index 7b58a231..2af34ecf 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -553,14 +553,14 @@ class FileDataCacher(object): '''Class that can cache data contained in files''' def __init__(self, settings, cache_name, caching_policy, load_policy): - '''Load the specified cache within CACHE_DIRECTORY in settings + '''Load the specified cache within CACHE_PATH in settings only if *load_policy* is True, May use gzip if GZIP_CACHE ins settings is True. Sets caching policy according to *caching_policy*. ''' self.settings = settings - self._cache_path = os.path.join(self.settings['CACHE_DIRECTORY'], + self._cache_path = os.path.join(self.settings['CACHE_PATH'], cache_name) self._cache_data_policy = caching_policy if self.settings['GZIP_CACHE']: @@ -572,9 +572,15 @@ class FileDataCacher(object): try: with self._cache_open(self._cache_path, 'rb') as fhandle: self._cache = pickle.load(fhandle) - except (IOError, OSError, pickle.UnpicklingError) as err: - logger.warning(('Cannot load cache {}, ' - 'proceeding with empty cache.\n{}').format( + except (IOError, OSError) as err: + logger.debug(('Cannot load cache {} (this is normal on first ' + 'run). Proceeding with empty cache.\n{}').format( + self._cache_path, err)) + self._cache = {} + except pickle.UnpicklingError as err: + logger.warning(('Cannot unpickle cache {}, cache may be using ' + 'an incompatible protocol (see pelican caching docs). ' + 'Proceeding with empty cache.\n{}').format( self._cache_path, err)) self._cache = {} else: @@ -596,7 +602,7 @@ class FileDataCacher(object): '''Save the updated cache''' if self._cache_data_policy: try: - mkdir_p(self.settings['CACHE_DIRECTORY']) + mkdir_p(self.settings['CACHE_PATH']) with self._cache_open(self._cache_path, 'wb') as fhandle: pickle.dump(self._cache, fhandle) except (IOError, OSError, pickle.PicklingError) as err: From cd40105c40285d0faec7c63200df86bf4d609cc7 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Mon, 28 Apr 2014 20:43:19 +0200 Subject: [PATCH 1151/2344] Fix #1335 remove old and unmaintained French docs Unfortunately nobody keeps them up to date, they would just spread confusion. --- docs/fr/astuces.rst | 20 ---- docs/fr/bases.rst | 58 ----------- docs/fr/configuration.rst | 165 ------------------------------- docs/fr/conventions.rst | 18 ---- docs/fr/faq.rst | 40 -------- docs/fr/index.rst | 57 ----------- docs/fr/installation.rst | 67 ------------- docs/fr/parametres_article.rst | 106 -------------------- docs/fr/pelican-themes.rst | 172 --------------------------------- docs/fr/themes.rst | 171 -------------------------------- docs/index.rst | 2 - 11 files changed, 876 deletions(-) delete mode 100644 docs/fr/astuces.rst delete mode 100644 docs/fr/bases.rst delete mode 100644 docs/fr/configuration.rst delete mode 100644 docs/fr/conventions.rst delete mode 100644 docs/fr/faq.rst delete mode 100644 docs/fr/index.rst delete mode 100644 docs/fr/installation.rst delete mode 100644 docs/fr/parametres_article.rst delete mode 100644 docs/fr/pelican-themes.rst delete mode 100644 docs/fr/themes.rst diff --git a/docs/fr/astuces.rst b/docs/fr/astuces.rst deleted file mode 100644 index 3f9a3987..00000000 --- a/docs/fr/astuces.rst +++ /dev/null @@ -1,20 +0,0 @@ -Trucs et astuces pour Pelican -############################# - -Personnaliser l'url d'un article pour Pelican -============================================= - -Par défaut, quand vous créez un article ayant pour titre *Mon article pour Pelican*, -l'url par défaut devient *mon-article-pour-pelican.html*. Cependant, il est possible -de modifier cela en utilisant la technique utilisée pour les traductions d'article, -c'est à dire le paramètre *:slug:* :: - - Mon article pour Pelican - ######################## - - :date: 2011-01-31 11:05 - :slug: super-article-pour-pelican - - bla, bla, bla … - -En prenant cet exemple ci dessus, votre url deviendra *super-article-pour-pelican.html* diff --git a/docs/fr/bases.rst b/docs/fr/bases.rst deleted file mode 100644 index 7a6fd118..00000000 --- a/docs/fr/bases.rst +++ /dev/null @@ -1,58 +0,0 @@ -Les bases de Pelican -#################### - -Créer son premier article -========================= - -Pour créer notre premier article, nous allons éditer un fichier, par exemple premier_article.rst :: - - Premier article pour Pelican - ############################ - :author: Guillaume - :date: 2011-01-08 10:20 - :category: GNU-Linux - :tags: tutoriel, git - Ceci est un tutoriel pour configurer git. - Bla, bla, bla .... - -Maintenant que ce fichier est créé, on va lancer la création du blog :: - - pelican . - -Vous aller obtenir une sortie comme celle ci — $PATH représente le dossier où vous -avez créé votre article :: - - [ok] writing $PATH/output/feeds/all.atom.xml - [ok] writing $PATH/output/feeds/GNU/Linux.atom.xml - [ok] writing $PATH/output/feeds/all-en.atom.xml - [ok] writing $PATH/output/premier-article-pour-pelican.html - [ok] writing $PATH/output/index.html - [ok] writing $PATH/output/tags.html - [ok] writing $PATH/output/categories.html - [ok] writing $PATH/output/archives.html - [ok] writing $PATH/output/tag/tutoriel.html - [ok] writing $PATH/output/tag/git.html - [ok] writing $PATH/output/category/GNU-Linux.html - - -Première analyse -================ - -Nous allons décortiquer un peu tout ça ensemble. - -* Un dossier output/ a été créé pour y mettre le fichiers xml et html du blog. -* Dans le dossier feeds/, nous retrouvons les différents flux de syndication. -* Le fichier de l’article et la page principale du blog a été généré. -* Le répertoire tag/ propose une page par tag. -* La page correspondant à la catégorie est générée dans le répertoire category/ - -Si vous ouvrez le fichier index.html — ou un autre — avec votre navigateur, vous -remarquerez que : - -* Le thème utilisé par défaut est notmyidea -* Le nom du blog est A Pelican Blog. - -Bien évidemment, il y a des paramètres de base que l’on peut modifier pour mettre -un peu tout ça à sa sauce. C’est ce que nous allons voir au travers du fichier de configuration. - - diff --git a/docs/fr/configuration.rst b/docs/fr/configuration.rst deleted file mode 100644 index 5388dae3..00000000 --- a/docs/fr/configuration.rst +++ /dev/null @@ -1,165 +0,0 @@ -Fichier de configuration -************************ - -On va créer un fichier de configuration que l’on va appeler **settings.py**. On peut -utiliser Pelican sans faire ce fichier, mais il faudrait à chaque fois passer les paramètres -en ligne de commande. Et comme il va nous servir à faire d’autres choses bien utile, -autant l’appréhender de suite. Cependant, nous n’allons voir que la base pour l’instant. - -Paramètres de base -================== - -AUTHOR : - Désigne l’auteur par défaut ; - -DEFAULT_CATEGORY : - La catégorie par défaut des articles. Si ce paramètre n’est - pas documenté, il prendra la valeur misc — pour miscellaneous (divers en français) ; - -SITENAME : - Le nom de votre site ; - -OUTPUT_PATH : - Le répertoire de sortie du blog. - -Quand je dis qu’on va faire simple, on fait simple ! -Passons donc à ce quoi doit ressembler le fichier de configuration :: - - # -*- coding: utf-8 -*- - AUTHOR = "Guillaume" - DEFAULT_CATEGORY = "GNU-Linux" - SITENAME = "Free Culture" - - -Si vous avez un serveur comme Apache de configuré pour votre machine, vous -pouvez paramétrer le répertoire de sortie vers **/var/www/blog** par exemple :: - - OUTPUT_PATH = "/var/www/blog" - -Une remarque importante. Si vous avez besoin de passer un caractère accentué, il -faut le préciser que la chaine est en unicode en faisant par exemple -*AUTHOR = u"Guillaume LAMÉ"* - -Pour bien vérifier que les paramètres sont bien pris en compte, nous allons enlever les lignes *:author: Guillaume* et *:category: GNU-Linux* de notre fichier -**premier_article.rst** et regénérer le blog. - -Rafraichissez votre page, ce devrait être bon. - -Nous allons maintenant passer en revue les différents paramètres de Pelican. Je les -ai regroupé par thème. Cependant, c’est surtout un listing avant de rentrer dans les -détails au prochain chapitre. - -Flux de syndication -=================== - -CATEGORY_FEED_ATOM : - Chemin d’écriture des flux Atom liés aux catégories ; - -CATEGORY_FEED_RSS : - Idem pour les flux rss (Optionnel); - -FEED_ATOM : - Chemin du flux Atom global; - -FEED_RSS : - Chemin du flux Rss global (Optionnel); - -FEED_ALL_ATOM : - Chemin du flux Atom global qui inclut la totalité des posts, indépendamment de la langue; - -FEED_ALL_RSS : - Chemin du flux Rss global qui inclut la totalité des posts, indépendamment de la langue (Optionnel); - -TAG_FEED_ATOM : - Chemin des flux Atom pour les tags (Optionnel); - -TAG_FEED_RSS : - Chemin des flux Rss pour les tags (Optionnel). - - -Traductions -=========== - -DEFAULT_LANG : - Le langage par défaut à utiliser. «*en*» par défaut ; - -TRANSLATION_FEED_ATOM : - Chemin du flux Atom pour les traductions. - -TRANSLATION_FEED_RSS : - Chemin du flux RSS pour les traductions. - - -Thèmes -====== - -CSS_FILE : - Fichier css à utiliser si celui-ci est différent du fichier par défaut (*main.css*) ; - -DISPLAY_PAGES_ON_MENU : - Affiche ou non les pages statiques sur le menu du thème ; - -DISQUS_SITENAME : - Indiquer le nom du site spécifié sur Disqus ; - -GITHUB_URL : - Indiquez votre url Github ; - -GOOGLE_ANALYTICS : - 'UA-XXXX-YYYY' pour activer Google analytics ; - -GOSQUARED_SITENAME : - 'XXX-YYYYYY-X' pour activer GoSquared ; - -JINJA_EXTENSIONS : - Liste d'extension Jinja2 que vous souhaitez utiliser ; - -LINKS : - Une liste de tuples (Titre, url) pour afficher la liste de lien ; - -PDF_PROCESSOR : - Génère ou non les articles et pages au format pdf ; - -NEWEST_FIRST_ARCHIVES : - Met les articles plus récent en tête de l'archive ; - -SOCIAL : - Une liste de tuples (Titre, url) pour afficher la liste de lien dans la section "Social" ; - -STATIC_THEME_PATHS : - Répertoire du thème que vous souhaitez importer dans l'arborescence finale ; - -THEME : - Thème à utiliser: - -TWITTER_USERNAME : - Permet d'afficher un bouton permettant le tweet des articles. - -Pelican est fournit avec :doc:`pelican-themes`, un script permettant de gérer les thèmes - - - -Paramètres divers -================= - -DEFAULT_DATE: - Date par défaut à utiliser si l'information de date n'est pas spécifiée - dans les metadonnées de l'article. - Si 'fs', Pelican se basera sur le *mtime* du fichier. - Si c'est un tuple, il sera passé au constructeur datetime.datetime pour - générer l'objet datetime utilisé par défaut. - -KEEP_OUTPUT DIRECTORY : - Ne génère que les fichiers modifiés et n'efface pas le repertoire de sortie ; - -MARKUP : - Langage de balisage à utiliser ; - -PATH : - Répertoire à suivre pour les fichiers inclus ; - -SITEURL : - URL de base de votre site ; - -STATIC_PATHS : - Les chemins statiques que vous voulez avoir accès sur le chemin de sortie "statique" ; diff --git a/docs/fr/conventions.rst b/docs/fr/conventions.rst deleted file mode 100644 index bf88c07e..00000000 --- a/docs/fr/conventions.rst +++ /dev/null @@ -1,18 +0,0 @@ -Conventions -########### - -Environnement de test -===================== - -Les exemples sont basées sur une distribution Debian. Pour les autres distributions, -il y aura des ajustements à faire, notamment pour l’installation de Pelican. Les -noms des paquets peuvent changer. - -Conventions typographiques -========================== - -Un petit rappel concernant les codes sources. - - * $ correspond à une ligne à exécuter en tant qu’utilisateur courant du systême ; - * # correspond à une ligne à exécuter en tant que root ; - * **settings.py** : Les noms des répertoires et fichiers sont en gras. diff --git a/docs/fr/faq.rst b/docs/fr/faq.rst deleted file mode 100644 index d945f447..00000000 --- a/docs/fr/faq.rst +++ /dev/null @@ -1,40 +0,0 @@ -Foire aux questions (FAQ) -######################### - -Voici un résumé des questions fréquemment posées pour pelican. - -Est-il obligatoire d'avoir un fichier de configuration ? -======================================================== - -Non. Les fichiers de configuration sont juste un moyen facile de configurer -pelican. Pour les opérations de base, il est possible de spécifier des -options -en invoquant pelican avec la ligne de commande (voir pelican --help pour -plus -d'informations à ce sujet) - -Je crée mon propre thème, comment utiliser pygments? -==================================================== - -Pygment ajoute quelques classes au contenu généré, de sorte qua colorisation -de votre thème se fait grâce à un fichier css. Vous pouvez jeter un oeil à -celui proposé par`sur le site du projet `_ - -Comment puis-je créer mon propre thèm -===================================== - -Vueillez vous référer à :ref:`theming-pelican-fr`. - -Comment puis-je aider? -====================== - -Vous avez plusieurs options pour aider. Tout d'abord, vous pouvez utiliser -le -pélican, et signaler toute idée ou problème que vous avez sur le bugtracker -. - -Si vous voulez contribuer, jeter un oeil au dépôt git , ajoutez vos -modifications et faites une demande, je les regarderai dès que possible - -Vous pouvez aussi contribuer en créant des thèmes, et/ou compléter la -documentation. diff --git a/docs/fr/index.rst b/docs/fr/index.rst deleted file mode 100644 index 2deb5050..00000000 --- a/docs/fr/index.rst +++ /dev/null @@ -1,57 +0,0 @@ -Pelican -####### - -Pelican est un generateur de blog simple codé en python - -* Écrivez vos articles directement dans votre éditeur favori (vim !) et - directement en syntaxe reStructuredText ou Markdown ; -* Un outil simple en ligne de conmmande pour (re)générer le blog ; -* Sortie complètement statique, facile pour l'héberger n'importe où ; - -Fonctionnalités -=============== - -Pelican supporte actuellement : - -* des articles de blog ; -* des pages statiques ; -* les commentaires via un service externe (`disqus `_) - Notez qu'étant bien un service externe assez pratique, vous ne gérez pas - vous même les commentaires. Ce qui pourrait occasionner une perte de vos données; -* support de template (les templates sont crées avec `jinja2 `_) ; -* génération optionnelle de vos pages et articles en pdf. - -Pourquoi le nom "Pelican" ? -============================ - -Vous n'avez pas remarqué ? "Pelican" est un anagramme pour "Calepin" ;) - -Code source -=========== - -Vous pouvez accéder au code source via git à l'adresse -http://github.com/getpelican/pelican/ - -Feedback ! -========== - -Si vous voulez de nouvelles fonctionnalitées pour Pelican, n'hésitez pas à nous le dire, -à cloner le dépôt, etc … C'est open source !!! - -Contactez Alexis à "alexis at notmyidea dot org" pour quelques requêtes ou retour d'expérience que ce soi ! - -Documentation -============= - -.. toctree:: - :maxdepth: 2 - - conventions - installation - bases - configuration - themes - parametres_article - astuces - faq - pelican-themes diff --git a/docs/fr/installation.rst b/docs/fr/installation.rst deleted file mode 100644 index da327725..00000000 --- a/docs/fr/installation.rst +++ /dev/null @@ -1,67 +0,0 @@ -Installation et mise à jour de Pelican -###################################### - -Installation -============ - -Il y a deux façons d’installer Pelican sur son système. La première est via l’utilitaire -pip, l’autre façon est de télécharger Pelican via Github. Ici nous allons voir les deux -façons de procéder. - -Via pip -------- - -Pour installer Pelican via pip, vous aurez besoin du paquet python-pip. puis installez Pelican :: - - # apt-get install python-pip - # pip install pelican - - -Via Github ----------- - -Pour installer Pelican en reprenant le code via Github, nous aurons besoin du paquet -git-core pour récupérez les sources de Pelican. Puis nous procédons à l’installation :: - - # apt-get install git-core - $ git clone https://github.com/getpelican/pelican.git - $ cd pelican - # python setup.py install - -Mises à jour -============ - -Via pip -------- - -Rien de bien compliqué pour mettre à jour via pip :: - - $ cd votreRepertoireSource - $ pip install --upgrade pelican - - -Via Github ----------- - -C'est un peu plus long avec Github par contre :: - - $ cd votreRepertoireSource - $ git pull origin master - $ cd pelican - # python setup.py install - -Vous aurez un message d’erreur si le module setuptools de python n’est pas installé. -La manipulation est la suivante :: - - # apt-get install python-setuptools - -Alors, quelle méthode choisir ? -=============================== - -Vous avez le choix entre deux méthodes, mais aussi entre deux concepts. La méthode -de Github est la version de développement, où les modifications arrivent assez -fréquemment sans être testées à fond. La version de pip est une version arrêtée avec un -numéro de version dans laquelle vous aurez moins de bug. N’oubliez cependant pas -que le projet est très jeune et manque donc de maturité. Si vous aimez avoir les toutes -dernières versions utilisez Github, sinon penchez vous sur pip. - diff --git a/docs/fr/parametres_article.rst b/docs/fr/parametres_article.rst deleted file mode 100644 index a3d25b55..00000000 --- a/docs/fr/parametres_article.rst +++ /dev/null @@ -1,106 +0,0 @@ -Les paramètres des articles dans Pelican -######################################## - -Les catégories -============== - -Nous avons vu que pour affecter un article à une catégorie, nous avions le paramètre *:category:*. -Il y a cependant plus simple, affecter un répertoire à une catégorie. - -Dans le répertoire ou vous avez vos articles, créez le repertoire **GNU-Linux** et déplacez y le fichier -**premier_article.rst**. Bien évidemment nous ne verront pas la différence, car jusqu'ici *GNU-Linux* -est notre catégorie par défaut. - -Nous allons faire un autre exemple d'article avec la catégorie Pelican. Créez le répertoire **Pelican** -et collez cette exemple d'article :: - - Préparation de la documentation - ############################### - - :date: 2011-01-27 15:28 - :tags: documentation - - Il y a quand même pas mal de boulot pour faire une documentation ! - -Et lancez la compilation du blog. Vous voyez que la catégorie est affectée automatiquement. - -Les tags -======== - -Pour les tags, il n'y a rien de compliqué. il suffit de mettre le(s) tags séparés si besoin d'une virgule. :: - - Préparation de la documentation - ############################### - - :date: 2011-01-27 15:28 - :tags: documentation, pelican - -Par contre, par soucis de clarté au niveau des url je vous conseille de mettre les expression de plusieurs -mots séparées par des tirets :: - - :tags: mise-a-jour - -et non :: - - :tags: mise a jour - - -Les auteurs -=========== - -Par défaut, vous pouvez indiqué votre nom en tant qu'auteur dans le fichier de configuration. -S'il y a plusieurs auteurs pour le site, vous pouvez le définir manuellement dans -l'article avec la méta-donnée :: - - :author: Guillaume - -La date -======= - -La date se met au format anglophone : **YYYY-MM-DD hh:mm** :: - - :date: 2011-01-31 14:12 - - -Les traductions -=============== - -Pelican permet de générer un blog multilingue assez facilement. Pour cela nous devons : - -* Définir la langue de base du blog ; -* Donner une référence à l'article initial ; -* Définir la langue du fichier traduit et y reporter la référence. - -Pour définir la langue de base nous allons modifier le fichier **settings.py** et y rajouter la ligne suivante :: - - DEFAULT_LANG = "fr" - -Puis ajouter la référence dans notre article d'origine qui deviendra :: - - Préparation de la documentation - ############################### - - :date: 2011-01-27 15:28 - :tags: documentation - :slug: preparation-de-la-documentation - - Il y a quand même pas mal de boulot pour faire une documentation ! - -Nous n'avons plus qu'à créer l'article en anglais :: - - Start of documentation - ###################### - - :slug: preparation-de-la-documention - :lang: en - - There are still a lot of work to documentation ! - -**Il est important de comprendre que la valeur de :slug: deviendra votre url. Ne mettez donc pas un diminutif pour -identifier l'article** - -Rien de plus à savoir pour traduire efficacement des articles. - - -Maintenant que vous avez toutes les clés en main pour créer un article, nous allons passer à la personnalisation -du fichier de configuration. diff --git a/docs/fr/pelican-themes.rst b/docs/fr/pelican-themes.rst deleted file mode 100644 index 810fa785..00000000 --- a/docs/fr/pelican-themes.rst +++ /dev/null @@ -1,172 +0,0 @@ -pelican-themes -############## - - - -Description -=========== - -``pelican-themes`` est un outil en lignes de commandes pour gérer les thèmes de Pelican. - - -Utilisation: -"""""""""""" - -| pelican-themes [-h] [-l] [-i *chemin d'un thème* [*chemin d'un thème* ...]] -| [-r *nom d'un thème* [*nom d'un thème* ...]] -| [-s *chemin d'un thème* [*chemin d'un thème* ...]] [-v] [--version] - -Arguments: -"""""""""" - - --h, --help Afficher l'aide et quitter - --l, --list Montrer les thèmes installés - --i chemin, --install chemin Chemin(s) d'accès d'un ou plusieurs thème à installer - --r nom, --remove nom Noms d'un ou plusieurs thèmes à installer - --s chemin, --symlink chemin Fonctionne de la même façon que l'option ``--install``, mais crée un lien symbolique au lieu d'effectuer une copie du thème vers le répertoire des thèmes. - Utile pour le développement de thèmes. - --v, --verbose Sortie détaillée - ---version Affiche la version du script et quitte - - - -Exemples -======== - - -Lister les thèmes installés -""""""""""""""""""""""""""" - -``pelican-themes`` peut afficher les thèmes disponibles. - -Pour cela, vous pouvez utiliser l'option ``-l`` ou ``--list``, comme ceci: - -.. code-block:: console - - $ pelican-themes -l - notmyidea - two-column@ - simple - $ pelican-themes --list - notmyidea - two-column@ - simple - -Dans cet exemple, nous voyons qu'il y a trois thèmes d'installés: ``notmyidea``, ``simple`` and ``two-column``. - -``two-column`` est suivi d'un ``@`` par ce que c'est un lien symbolique (voir `Créer des liens symboliques`_). - -Notez que vous pouvez combiner l'option ``--list`` avec l'option ``--verbose``, pour afficher plus de détails: - -.. code-block:: console - - $ pelican-themes -v -l - /usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/notmyidea - /usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/two-column (symbolic link to `/home/skami/Dev/Python/pelican-themes/two-column') - /usr/local/lib/python2.6/dist-packages/pelican-2.6.0-py2.6.egg/pelican/themes/simple - - -Installer des thèmes -"""""""""""""""""""" - -Vous pouvez installer un ou plusieurs thèmes en utilisant l'option ``-i`` ou ``--install``. - -Cette option prends en argument le(s) chemin(s) d'accès du ou des thème(s) que vous voulez installer, et peut se combiner avec l'option ``--verbose``: - -.. code-block:: console - - # pelican-themes --install ~/Dev/Python/pelican-themes/notmyidea-cms --verbose - -.. code-block:: console - - # pelican-themes --install ~/Dev/Python/pelican-themes/notmyidea-cms\ - ~/Dev/Python/pelican-themes/martyalchin \ - --verbose - -.. code-block:: console - - # pelican-themes -vi ~/Dev/Python/pelican-themes/two-column - - -Supprimer des thèmes -"""""""""""""""""""" - -``pelican-themes`` peut aussi supprimer des thèmes précédemment installés grâce à l'option ``-r`` ou ``--remove``. - -Cette option prends en argument le ou les nom(s) des thèmes que vous voulez installer, et peux se combiner avec l'option ``--verbose``: - -.. code-block:: console - - # pelican-themes --remove two-column - -.. code-block:: console - - # pelican-themes -r martyachin notmyidea-cmd -v - - - - - -Créer des liens symboliques -""""""""""""""""""""""""""" - - -L'option ``-s`` ou ``--symlink`` de ``pelican-themes`` permet de lier symboliquement un thème. - -Cette option s'utilise exactement comme l'option ``--install``: - -.. code-block:: console - - # pelican-themes --symlink ~/Dev/Python/pelican-themes/two-column - -Dans l'exemple ci dessus, un lien symbolique pointant vers le thème ``two-column`` a été installé dans le répertoire des thèmes de Pelican, toute modification sur le thème ``two-column`` prendra donc effet immédiatement. - -Cela peut être pratique pour le développement de thèmes - -.. code-block:: console - - $ sudo pelican-themes -s ~/Dev/Python/pelican-themes/two-column - $ pelican ~/Blog/content -o /tmp/out -t two-column - $ firefox /tmp/out/index.html - $ vim ~/Dev/Pelican/pelican-themes/two-coumn/static/css/main.css - $ pelican ~/Blog/content -o /tmp/out -t two-column - $ cp /tmp/bg.png ~/Dev/Pelican/pelican-themes/two-coumn/static/img/bg.png - $ pelican ~/Blog/content -o /tmp/out -t two-column - $ vim ~/Dev/Pelican/pelican-themes/two-coumn/templates/index.html - $ pelican ~/Blog/content -o /tmp/out -t two-column - - -Notez que cette fonctionnalité nécessite d'avoir un système d'exploitation et un système de fichiers supportant les liens symboliques, elle n'est donc pas disponible sous Micro$oft®©™ Fenêtre®©™. - -Faire plusieurs choses à la fois -"""""""""""""""""""""""""""""""" - - -Les options ``--install``, ``--remove`` et ``--symlink`` peuvent être employées en même temps, ce qui permets de réaliser plusieurs opérations en même temps: - -.. code-block:: console - - # pelican-themes --remove notmyidea-cms two-column \ - --install ~/Dev/Python/pelican-themes/notmyidea-cms-fr \ - --symlink ~/Dev/Python/pelican-themes/two-column \ - --verbose - -Dans cette exemple, le thème ``notmyidea-cms`` sera remplacé par le thème ``notmyidea-cms-fr`` et le thème ``two-column`` sera lié symboliquement... - - - -À voir également -================ - -- http://docs.notmyidea.org/alexis/pelican/ -- ``/usr/share/doc/pelican/`` si vous avez installé Pelican par le `dépôt APT `_ - - - diff --git a/docs/fr/themes.rst b/docs/fr/themes.rst deleted file mode 100644 index 20d9d41f..00000000 --- a/docs/fr/themes.rst +++ /dev/null @@ -1,171 +0,0 @@ -.. _theming-pelican: - -Cette page est une traduction de la documentation originale, en anglais et -disponible `ici <../themes.html>`_. - -Comment créer des thèmes pour Pelican -##################################### - -Pelican utlise le très bon moteur de template `jinja2 `_ -pour produire de l'HTML. La syntaxe de jinja2 est vraiment très simple. Si vous -voulez créer votre propre thème, soyez libre de prendre inspiration sur le theme -"simple" qui est disponible `ici -`_ - -Structure -========= - -Pour réaliser votre propre thème vous devez respecter la structure suivante :: - - ├── static - │   ├── css - │   └── images - └── templates - ├── archives.html // pour afficher les archives - ├── article.html // généré pour chaque article - ├── categories.html // doit lister toutes les catégories - ├── category.html // généré pour chaque catégorie - ├── index.html // la page d'index, affiche tous les articles - ├── page.html // généré pour chaque page - ├── tag.html // généré pour chaque tag - └── tags.html // doit lister tous les tags. Peut être un nuage de tag. - - -* `static` contient tout le contenu statique. Il sera copié dans le dossier - `theme/static`. J'ai mis un dossier css et un image, mais ce sont juste des - exemples. Mettez ce dont vous avez besoin ici. - -* `templates` contient tous les templates qui vont être utiliser pour générer les - pages. J'ai juste mis les templates obligatoires ici, vous pouvez définir les - vôtres si cela vous aide à vous organiser pendant que vous réaliser le thème. - Vous pouvez par exemple utiliser les directives {% include %} et {% extends %} - de jinja2. - -Templates et variables -====================== - -Cela utilise une syntaxe simple, que vous pouvez insérer dans vos pages HTML. -Ce document décrit les templates qui doivent exister dans un thème, et quelles -variables seront passées à chaque template, au moment de le générer. - -Tous les templates recevront les variables définies dans votre fichier de -configuration, si elles sont en capitales. Vous pouvez y accéder directement. - -Variables communes ------------------- - -Toutes ces variables seront passées à chaque template. - -============= =================================================== -Variable Description -============= =================================================== -articles C'est la liste des articles, ordonnée décroissante - par date. Tous les éléments de la liste sont des - objets `Article`, vous pouvez donc accéder à leurs - propriétés (exemple : title, summary, author, etc). -dates La même liste d'articles, ordonnée croissante par - date. -tags Un dictionnaire contenant tous les tags (clés), et - la liste des articles correspondants à chacun - d'entre eux (valeur). -categories Un dictionnaire contenant toutes les catégories - (clés), et la liste des articles correspondants à - chacune d'entre elles (valeur). -pages La liste des pages. -============= =================================================== - -index.html ----------- - -La page d'accueil de votre blog, sera générée dans output/index.html. - -Si la pagination est activée, les pages suivantes seront à l'adresse -output/index`n`.html. - -=================== =================================================== -Variable Description -=================== =================================================== -articles_paginator Un objet paginator de la liste d'articles. -articles_page La page actuelle d'articles. -dates_paginator Un objet paginator de la liste d'articles, ordonné - par date croissante. -dates_pages La page actuelle d'articles, ordonnée par date - croissante. -page_name 'index'. -=================== =================================================== - -category.html -------------- - -Ce template sera généré pour chaque catégorie existante, et se retrouvera -finalement à output/category/`nom de la catégorie`.html. - -Si la pagination est activée, les pages suivantes seront disponibles à -l'adresse output/category/`nom de la catégorie``n`.html. - -=================== =================================================== -Variable Description -=================== =================================================== -category La catégorie qui est en train d'être générée. -articles Les articles dans cette catégorie. -dates Les articles dans cette catégorie, ordonnés par - date croissante. -articles_paginator Un objet paginator de la liste d'articles. -articles_page La page actuelle d'articles. -dates_paginator Un objet paginator de la liste d'articles, ordonné - par date croissante. -dates_pages La page actuelle d'articles, ordonnée par date - croissante. -page_name 'category/`nom de la catégorie`'. -=================== =================================================== - -article.html -------------- - -Ce template sera généré pour chaque article. Les fichiers .html seront -disponibles à output/`nom de l'article`.html. - -============= =================================================== -Variable Description -============= =================================================== -article L'objet article à afficher. -category Le nom de la catégorie de l'article actuel. -============= =================================================== - -page.html ---------- - -Pour chaque page ce template sera généré à l'adresse -output/`nom de la page`.html - -============= =================================================== -Variable Description -============= =================================================== -page L'objet page à afficher. Vous pouvez accéder à son - titre (title), slug, et son contenu (content). -============= =================================================== - -tag.html --------- - -Ce template sera généré pour chaque tag. Cela créera des fichiers .html à -l'adresse output/tag/`nom du tag`.html. - -Si la pagination est activée, les pages suivantes seront disponibles à -l'adresse output/tag/`nom du tag``n`.html - -=================== =================================================== -Variable Description -=================== =================================================== -tag Nom du tag à afficher. -articles Une liste des articles contenant ce tag. -dates Une liste des articles contenant ce tag, ordonnée - par date croissante. -articles_paginator Un objet paginator de la liste d'articles. -articles_page La page actuelle d'articles. -dates_paginator Un objet paginator de la liste d'articles, ordonné - par date croissante. -dates_pages La page actuelle d'articles, ordonnée par date - croissante. -page_name 'tag/`nom du tag`'. -=================== =================================================== diff --git a/docs/index.rst b/docs/index.rst index c2deb6de..aa30b1f0 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -63,8 +63,6 @@ someone will almost always respond to your inquiry. Documentation ------------- -A French version of the documentation is available at :doc:`fr/index`. - .. toctree:: :maxdepth: 2 From 9a753f4fa97c6b086ba8129043b00d1fba55290e Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Fri, 9 May 2014 18:14:24 +0200 Subject: [PATCH 1152/2344] Fix intrasite links substitions in content The Content.__eq__ method would indirectly call _update_content too soon, resulting in failed intrasite links substitution This effectively reverts fd779267000ac539ee0a9ba5856d103fbbc7cd7c for pelican/contents.py, it was unnecessary anyways. Thanks to Strom for finding this. --- pelican/contents.py | 7 ------- 1 file changed, 7 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index c02047b8..615a7fd8 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -325,13 +325,6 @@ class Content(object): os.path.abspath(self.settings['PATH'])) ) - def __eq__(self, other): - """Compare with metadata and content of other Content object""" - return other and self.metadata == other.metadata and self.content == other.content - - # keep basic hashing functionality for caching to work - __hash__ = object.__hash__ - class Page(Content): mandatory_properties = ('title',) From 7cbf750329b6b6d42cfcca12449d6e6419fbf2fa Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Sat, 10 May 2014 17:38:58 +0200 Subject: [PATCH 1153/2344] Fix typo in command-line option description. --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index d6417391..e9fef163 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -265,7 +265,7 @@ def parse_arguments(): parser.add_argument('-D', '--debug', action='store_const', const=logging.DEBUG, dest='verbosity', - help='Show all message, including debug messages.') + help='Show all messages, including debug messages.') parser.add_argument('--version', action='version', version=__version__, help='Print the pelican version and exit.') From 7313d327fb21fbdaa4c39819db6297f4cd635b2c Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 11 May 2014 18:14:58 -0700 Subject: [PATCH 1154/2344] Prepare for splitting up Getting Started docs --- docs/{getting_started.rst => content.rst} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename docs/{getting_started.rst => content.rst} (100%) diff --git a/docs/getting_started.rst b/docs/content.rst similarity index 100% rename from docs/getting_started.rst rename to docs/content.rst From 86e11c619d0208d9bc8418821c2e2a31e6f991ea Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 12 May 2014 07:48:37 -0700 Subject: [PATCH 1155/2344] Split Getting Started docs into separate sections The "Getting Started" docs became overly long and unwieldy over time. This splits it into separate sections, including: * Quickstart * Installation * Writing content * Publish your site --- docs/content.rst | 307 ++-------------------------------------- docs/faq.rst | 12 +- docs/importer.rst | 6 +- docs/index.rst | 22 +-- docs/install.rst | 122 ++++++++++++++++ docs/pelican-themes.rst | 9 -- docs/publish.rst | 174 +++++++++++++++++++++++ docs/quickstart.rst | 73 ++++++++++ docs/settings.rst | 10 +- docs/themes.rst | 18 ++- 10 files changed, 420 insertions(+), 333 deletions(-) create mode 100644 docs/install.rst create mode 100644 docs/publish.rst create mode 100644 docs/quickstart.rst diff --git a/docs/content.rst b/docs/content.rst index 8ee37162..24fc6e9b 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -1,289 +1,8 @@ -Getting started +Writing content ############### -Installing Pelican -================== - -Pelican currently runs best on Python 2.7.x; earlier versions of Python are -not supported. There is provisional support for Python 3.3, although there may -be rough edges, particularly with regards to optional 3rd-party components. - -You can install Pelican via several different methods. The simplest is via -`pip `_:: - - $ pip install pelican - -If you don't have ``pip`` installed, an alternative method is -``easy_install``:: - - $ easy_install pelican - -(Keep in mind that operating systems will often require you to prefix the above -commands with ``sudo`` in order to install Pelican system-wide.) - -While the above is the simplest method, the recommended approach is to create -a virtual environment for Pelican via virtualenv_ before installing Pelican. -Assuming you have virtualenv_ installed, you can then open a new terminal -session and create a new virtual environment for Pelican:: - - $ virtualenv ~/virtualenvs/pelican - $ cd ~/virtualenvs/pelican - $ . bin/activate - -Once the virtual environment has been created and activated, Pelican can be -be installed via ``pip install pelican`` as noted above. Alternatively, if -you have the project source, you can install Pelican using the distutils -method:: - - $ cd path-to-Pelican-source - $ python setup.py install - -If you have Git installed and prefer to install the latest bleeding-edge -version of Pelican rather than a stable release, use the following command:: - - $ pip install -e git+https://github.com/getpelican/pelican.git#egg=pelican - -If you plan on using Markdown as a markup format, you'll need to install the -Markdown library as well:: - - $ pip install Markdown - -If you want to use AsciiDoc_ you need to install it from `source -`_ or use your operating -system's package manager. - -Basic usage ------------ - -Once Pelican is installed, you can use it to convert your Markdown or reST -content into HTML via the ``pelican`` command, specifying the path to your -content and (optionally) the path to your settings file:: - -$ pelican /path/to/your/content/ [-s path/to/your/settings.py] - -The above command will generate your site and save it in the ``output/`` -folder, using the default theme to produce a simple site. The default theme -consists of very simple HTML without styling and is provided so folks may use -it as a basis for creating their own themes. - -You can also tell Pelican to watch for your modifications, instead of -manually re-running it every time you want to see your changes. To enable this, -run the ``pelican`` command with the ``-r`` or ``--autoreload`` option. - -Pelican has other command-line switches available. Have a look at the help to -see all the options you can use:: - - $ pelican --help - -Continue reading below for more detail, and check out the Pelican wiki's -`Tutorials `_ page for -links to community-published tutorials. - -Viewing the generated files ---------------------------- - -The files generated by Pelican are static files, so you don't actually need -anything special to view them. You can use your browser to open the generated -HTML files directly:: - - firefox output/index.html - -Because the above method may have trouble locating your CSS and other linked -assets, running a simple web server using Python will often provide a more -reliable previewing experience:: - - cd output && python -m SimpleHTTPServer - -Once the ``SimpleHTTPServer`` has been started, you can preview your site at -http://localhost:8000/ - -Upgrading ---------- - -If you installed a stable Pelican release via ``pip`` or ``easy_install`` and -wish to upgrade to the latest stable release, you can do so by adding -``--upgrade`` to the relevant command. For pip, that would be:: - - $ pip install --upgrade pelican - -If you installed Pelican via distutils or the bleeding-edge method, simply -perform the same step to install the most recent version. - -Dependencies ------------- - -When Pelican is installed, the following dependent Python packages should be -automatically installed without any action on your part: - -* `feedgenerator `_, to generate the - Atom feeds -* `jinja2 `_, for templating support -* `pygments `_, for syntax highlighting -* `docutils `_, for supporting - reStructuredText as an input format -* `pytz `_, for timezone definitions -* `blinker `_, an object-to-object and - broadcast signaling system -* `unidecode `_, for ASCII - transliterations of Unicode text -* `six `_, for Python 2 and 3 compatibility - utilities -* `MarkupSafe `_, for a markup safe - string implementation -* `python-dateutil `_, to read - the date metadata - -If you want the following optional packages, you will need to install them -manually via ``pip``: - -* `markdown `_, for supporting Markdown as - an input format -* `typogrify `_, for - typographical enhancements - -Kickstart your site -=================== - -Once Pelican has been installed, you can create a skeleton project via the -``pelican-quickstart`` command, which begins by asking some questions about -your site:: - - $ pelican-quickstart - -Once you finish answering all the questions, your project will consist of the -following hierarchy (except for "pages", which you can optionally add yourself -if you plan to create non-chronological content):: - - yourproject/ - ├── content - │   └── (pages) - ├── output - ├── develop_server.sh - ├── fabfile.py - ├── Makefile - ├── pelicanconf.py # Main settings file - └── publishconf.py # Settings to use when ready to publish - -The next step is to begin to adding content to the *content* folder that has -been created for you. (See the **Writing content using Pelican** section below -for more information about how to format your content.) - -Once you have written some content to generate, you can use the ``pelican`` -command to generate your site, which will be placed in the output folder. - -Automation tools -================ - -While the ``pelican`` command is the canonical way to generate your site, -automation tools can be used to streamline the generation and publication -flow. One of the questions asked during the ``pelican-quickstart`` process -described above pertains to whether you want to automate site generation and -publication. If you answered "yes" to that question, a ``fabfile.py`` and -``Makefile`` will be generated in the root of your project. These files, -pre-populated with certain information gleaned from other answers provided -during the ``pelican-quickstart`` process, are meant as a starting point and -should be customized to fit your particular needs and usage patterns. If you -find one or both of these automation tools to be of limited utility, these -files can deleted at any time and will not affect usage of the canonical -``pelican`` command. - -Following are automation tools that "wrap" the ``pelican`` command and can -simplify the process of generating, previewing, and uploading your site. - -Fabric ------- - -The advantage of Fabric_ is that it is written in Python and thus can be used -in a wide range of environments. The downside is that it must be installed -separately. Use the following command to install Fabric, prefixing with -``sudo`` if your environment requires it:: - - $ pip install Fabric - -Take a moment to open the ``fabfile.py`` file that was generated in your -project root. You will see a number of commands, any one of which can be -renamed, removed, and/or customized to your liking. Using the out-of-the-box -configuration, you can generate your site via:: - - $ fab build - -If you'd prefer to have Pelican automatically regenerate your site every time a -change is detected (which is handy when testing locally), use the following -command instead:: - - $ fab regenerate - -To serve the generated site so it can be previewed in your browser at -http://localhost:8000/:: - - $ fab serve - -If during the ``pelican-quickstart`` process you answered "yes" when asked -whether you want to upload your site via SSH, you can use the following command -to publish your site via rsync over SSH:: - - $ fab publish - -These are just a few of the commands available by default, so feel free to -explore ``fabfile.py`` and see what other commands are available. More -importantly, don't hesitate to customize ``fabfile.py`` to suit your specific -needs and preferences. - -Make ----- - -A ``Makefile`` is also automatically created for you when you say "yes" to -the relevant question during the ``pelican-quickstart`` process. The advantage -of this method is that the ``make`` command is built into most POSIX systems -and thus doesn't require installing anything else in order to use it. The -downside is that non-POSIX systems (e.g., Windows) do not include ``make``, -and installing it on those systems can be a non-trivial task. - -If you want to use ``make`` to generate your site, run:: - - $ make html - -If you'd prefer to have Pelican automatically regenerate your site every time a -change is detected (which is handy when testing locally), use the following -command instead:: - - $ make regenerate - -To serve the generated site so it can be previewed in your browser at -http://localhost:8000/:: - - $ make serve - -Normally you would need to run ``make regenerate`` and ``make serve`` in two -separate terminal sessions, but you can run both at once via:: - - $ make devserver - -The above command will simultaneously run Pelican in regeneration mode as well -as serve the output at http://localhost:8000. Once you are done testing your -changes, you should stop the development server via:: - - $ ./develop_server.sh stop - -When you're ready to publish your site, you can upload it via the method(s) you -chose during the ``pelican-quickstart`` questionnaire. For this example, we'll -use rsync over ssh:: - - $ make rsync_upload - -That's it! Your site should now be live. - -(The default ``Makefile`` and ``devserver.sh`` scripts use the ``python`` and -``pelican`` executables to complete its tasks. If you want to use different -executables, such as ``python3``, you can set the ``PY`` and ``PELICAN`` -environment variables, respectively, to override the default executable names.) - - -Writing content using Pelican -============================= - Articles and pages ------------------- +================== Pelican considers "articles" to be chronological content, such as posts on a blog, and thus associated with a date. @@ -295,7 +14,7 @@ pages). .. _internal_metadata: File metadata -------------- +============= Pelican tries to be smart enough to get the information it needs from the file system (for instance, about the category of your articles), but some @@ -400,7 +119,7 @@ Please note that the metadata available inside your files takes precedence over the metadata extracted from the filename. Pages ------ +===== If you create a folder named ``pages`` inside the content folder, all the files in it will be used to generate static pages, such as **About** or @@ -416,7 +135,7 @@ things like making error pages that fit the generated theme of your site. .. _ref-linking-to-internal-content: Linking to internal content ---------------------------- +=========================== From Pelican 3.1 onwards, it is now possible to specify intra-site links to files in the *source content* hierarchy instead of files in the *generated* @@ -494,14 +213,14 @@ curly braces (``{}``). For example: ``|filename|an_article.rst``, ``|tag|tagname``, ``|category|foobar``. The syntax was changed from ``||`` to ``{}`` to avoid collision with Markdown extensions or reST directives. -Importing an existing blog --------------------------- +Importing an existing site +========================== -It is possible to import your blog from Dotclear, WordPress, and RSS feeds using -a simple script. See :ref:`import`. +It is possible to import your site from WordPress, Tumblr, Dotclear, and RSS +feeds using a simple script. See :ref:`import`. Translations ------------- +============ It is possible to translate articles. To do so, you need to add a ``lang`` meta attribute to your articles/pages and set a ``DEFAULT_LANG`` setting (which is @@ -559,7 +278,7 @@ which posts are translations:: .. _internal_pygments_options: Syntax highlighting -------------------- +=================== Pelican is able to provide colorized syntax highlighting for your code blocks. To do so, you have to use the following conventions inside your content files. @@ -641,14 +360,12 @@ If specified, settings for individual code blocks will override the defaults in your settings file. Publishing drafts ------------------ +================= If you want to publish an article as a draft (for friends to review before publishing, for example), you can add a ``Status: draft`` attribute to its metadata. That article will then be output to the ``drafts`` folder and not listed on the index page nor on any category or tag page. -.. _virtualenv: http://www.virtualenv.org/ .. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime -.. _Fabric: http://fabfile.org/ .. _AsciiDoc: http://www.methods.co.nz/asciidoc/ diff --git a/docs/faq.rst b/docs/faq.rst index bf468c51..3a5cfec5 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -65,9 +65,11 @@ How do I create my own theme? Please refer to :ref:`theming-pelican`. -I'm using Markdown and getting ``No valid files found in content`` errors. +I want to use Markdown, but I got an error. ========================================================================== +If you try to generate Markdown content without first installing the Markdown +library, may see a message that says ``No valid files found in content``. Markdown is not a hard dependency for Pelican, so if you have content in Markdown format, you will need to explicitly install the Markdown library. You can do so by typing the following command, prepending ``sudo`` if @@ -75,10 +77,6 @@ permissions require it:: pip install markdown -If you don't have ``pip`` installed, consider installing it via:: - - easy_install pip - Can I use arbitrary metadata in my templates? ============================================== @@ -157,8 +155,8 @@ disable all feed generation, you only need to specify the following settings:: CATEGORY_FEED_ATOM = None TRANSLATION_FEED_ATOM = None -Please note that ``None`` and ``''`` are not the same thing. The word ``None`` -should not be surrounded by quotes. +The word ``None`` should not be surrounded by quotes. Please note that ``None`` +and ``''`` are not the same thing. I'm getting a warning about feeds generated without SITEURL being set properly ============================================================================== diff --git a/docs/importer.rst b/docs/importer.rst index b1d1b926..309ca144 100644 --- a/docs/importer.rst +++ b/docs/importer.rst @@ -1,9 +1,7 @@ .. _import: -================================= - Import from other blog software -================================= - +Importing an existing site +########################## Description =========== diff --git a/docs/index.rst b/docs/index.rst index aa30b1f0..36a3282b 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -10,30 +10,32 @@ Pelican |release| Were you looking for version |last_stable| documentation? -Pelican is a static site generator, written in Python_. +Pelican is a static site generator, written in Python_. Highlights include: -* Write your content directly with your editor of choice (vim!) +* Write your content directly with your editor of choice in reStructuredText_, Markdown_, or AsciiDoc_ formats * Includes a simple CLI tool to (re)generate your site * Easy to interface with distributed version control systems and web hooks * Completely static output is easy to host anywhere +Ready to get started? Check out the :doc:`Quickstart` guide. + Features -------- Pelican |version| currently supports: * Articles (e.g., blog posts) and pages (e.g., "About", "Projects", "Contact") -* Comments, via an external service (Disqus). (Please note that while - useful, Disqus is an external service, and thus the comment data will be - somewhat outside of your control and potentially subject to data loss.) +* Comments, via an external service (Disqus). If you prefer to have more + control over your comment data, self-hosted comments are another option. + Check out the `Pelican Plugins`_ repository for more details. * Theming support (themes are created using Jinja2_ templates) * Publication of articles in multiple languages * Atom/RSS feeds * Code syntax highlighting * Import from WordPress, Dotclear, or RSS feeds * Integration with external tools: Twitter, Google Analytics, etc. (optional) -* Fast rebuild times thanks to content caching and selective output writing. +* Fast rebuild times thanks to content caching and selective output writing Why the name "Pelican"? ----------------------- @@ -66,16 +68,19 @@ Documentation .. toctree:: :maxdepth: 2 - getting_started + quickstart + install + content + publish settings themes plugins - internals pelican-themes importer faq tips contribute + internals report changelog @@ -88,5 +93,6 @@ Documentation .. _Jinja2: http://jinja.pocoo.org/ .. _`Pelican documentation`: http://docs.getpelican.com/latest/ .. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html +.. _`Pelican plugins`: https://github.com/getpelican/pelican-plugins .. _`#pelican on Freenode`: irc://irc.freenode.net/pelican .. _webchat: http://webchat.freenode.net/?channels=pelican&uio=d4 diff --git a/docs/install.rst b/docs/install.rst new file mode 100644 index 00000000..34cd33ea --- /dev/null +++ b/docs/install.rst @@ -0,0 +1,122 @@ +Installing Pelican +################## + +Pelican currently runs best on Python 2.7.x; earlier versions of Python are +not supported. There is provisional support for Python 3.3+, although there may +be rough edges, particularly with regards to optional 3rd-party components. + +You can install Pelican via several different methods. The simplest is via +`pip `_:: + + pip install pelican + +(Keep in mind that operating systems will often require you to prefix the above +command with ``sudo`` in order to install Pelican system-wide.) + +While the above is the simplest method, the recommended approach is to create +a virtual environment for Pelican via virtualenv_ before installing Pelican. +Assuming you have virtualenv_ installed, you can then open a new terminal +session and create a new virtual environment for Pelican:: + + virtualenv ~/virtualenvs/pelican + cd ~/virtualenvs/pelican + source bin/activate + +Once the virtual environment has been created and activated, Pelican can be +be installed via ``pip install pelican`` as noted above. Alternatively, if +you have the project source, you can install Pelican using the distutils +method:: + + cd path-to-Pelican-source + python setup.py install + +If you have Git installed and prefer to install the latest bleeding-edge +version of Pelican rather than a stable release, use the following command:: + + pip install -e "git+https://github.com/getpelican/pelican.git#egg=pelican" + +Once Pelican is installed, you can run ``pelican --help`` to see basic usage +options. For more detail, refer to the :doc:`Publish` section. + +Optional packages +----------------- + +If you plan on using `Markdown `_ as a +markup format, you'll need to install the Markdown library:: + + pip install Markdown + +Typographical enhancements can be enabled in your settings file, but first the +requisite `Typogrify `_ library must be +installed:: + + pip install typogrify + +If you want to use AsciiDoc_ you need to install it from `source +`_ or use your operating +system's package manager. + +Dependencies +------------ + +When Pelican is installed, the following dependent Python packages should be +automatically installed without any action on your part: + +* `feedgenerator `_, to generate the + Atom feeds +* `jinja2 `_, for templating support +* `pygments `_, for syntax highlighting +* `docutils `_, for supporting + reStructuredText as an input format +* `pytz `_, for timezone definitions +* `blinker `_, an object-to-object and + broadcast signaling system +* `unidecode `_, for ASCII + transliterations of Unicode text +* `six `_, for Python 2 and 3 compatibility + utilities +* `MarkupSafe `_, for a markup safe + string implementation +* `python-dateutil `_, to read + the date metadata + +Upgrading +--------- + +If you installed a stable Pelican release via ``pip`` or ``easy_install`` and +wish to upgrade to the latest stable release, you can do so by adding +``--upgrade`` to the relevant command. For pip, that would be:: + + pip install --upgrade pelican + +If you installed Pelican via distutils or the bleeding-edge method, simply +perform the same step to install the most recent version. + +Kickstart your site +=================== + +Once Pelican has been installed, you can create a skeleton project via the +``pelican-quickstart`` command, which begins by asking some questions about +your site:: + + pelican-quickstart + +Once you finish answering all the questions, your project will consist of the +following hierarchy (except for *pages* — shown in parentheses below — which you +can optionally add yourself if you plan to create non-chronological content):: + + yourproject/ + ├── content + │   └── (pages) + ├── output + ├── develop_server.sh + ├── fabfile.py + ├── Makefile + ├── pelicanconf.py # Main settings file + └── publishconf.py # Settings to use when ready to publish + +The next step is to begin to adding content to the *content* folder that has +been created for you. + +.. _virtualenv: http://www.virtualenv.org/ +.. _AsciiDoc: http://www.methods.co.nz/asciidoc/ diff --git a/docs/pelican-themes.rst b/docs/pelican-themes.rst index 23be8355..7090c648 100644 --- a/docs/pelican-themes.rst +++ b/docs/pelican-themes.rst @@ -153,12 +153,3 @@ The ``--install``, ``--remove`` and ``--symlink`` option are not mutually exclus --verbose In this example, the theme ``notmyidea-cms`` is replaced by the theme ``notmyidea-cms-fr`` - - - - -See also -======== - -- http://docs.notmyidea.org/alexis/pelican/ -- ``/usr/share/doc/pelican/`` if you have installed Pelican using the `APT repository `_ diff --git a/docs/publish.rst b/docs/publish.rst new file mode 100644 index 00000000..266009e4 --- /dev/null +++ b/docs/publish.rst @@ -0,0 +1,174 @@ +Publish your site +################# + +Site generation +=============== + +Once Pelican is installed and you have some content (e.g., in Markdown or reST +format), you can convert your content into HTML via the ``pelican`` command, +specifying the path to your content and (optionally) the path to your +:doc:`settings` file:: + + pelican /path/to/your/content/ [-s path/to/your/settings.py] + +The above command will generate your site and save it in the ``output/`` +folder, using the default theme to produce a simple site. The default theme +consists of very simple HTML without styling and is provided so folks may use +it as a basis for creating their own themes. + +You can also tell Pelican to watch for your modifications, instead of +manually re-running it every time you want to see your changes. To enable this, +run the ``pelican`` command with the ``-r`` or ``--autoreload`` option. + +Pelican has other command-line switches available. Have a look at the help to +see all the options you can use:: + + pelican --help + +Viewing the generated files +--------------------------- + +The files generated by Pelican are static files, so you don't actually need +anything special to view them. You can use your browser to open the generated +HTML files directly:: + + firefox output/index.html + +Because the above method may have trouble locating your CSS and other linked +assets, running a simple web server using Python will often provide a more +reliable previewing experience:: + + cd output + python -m SimpleHTTPServer + +Once the ``SimpleHTTPServer`` has been started, you can preview your site at +http://localhost:8000/ + +Deployment +========== + +After you have generated your site, previewed it in your local development +environment, and are ready to deploy it to production, you might first +re-generate your site with any production-specific settings (e.g., analytics +feeds, etc.) that you may have defined:: + + pelican content -s publishconf.py + +The steps for deploying your site will depend on where it will be hosted. +If you have SSH access to a server running Nginx or Apache, you might use the +``rsync`` tool to transmit your site files:: + + rsync --avc --delete output/ host.example.com:/var/www/your-site/ + +There are many other deployment options, some of which can be configured when +first setting up your site via the ``pelican-quickstart`` command. See the +:doc:`Tips` page for detail on publishing via GitHub Pages. + +Automation +========== + +While the ``pelican`` command is the canonical way to generate your site, +automation tools can be used to streamline the generation and publication +flow. One of the questions asked during the ``pelican-quickstart`` process +pertains to whether you want to automate site generation and publication. +If you answered "yes" to that question, a ``fabfile.py`` and +``Makefile`` will be generated in the root of your project. These files, +pre-populated with certain information gleaned from other answers provided +during the ``pelican-quickstart`` process, are meant as a starting point and +should be customized to fit your particular needs and usage patterns. If you +find one or both of these automation tools to be of limited utility, these +files can deleted at any time and will not affect usage of the canonical +``pelican`` command. + +Following are automation tools that "wrap" the ``pelican`` command and can +simplify the process of generating, previewing, and uploading your site. + +Fabric +------ + +The advantage of Fabric_ is that it is written in Python and thus can be used +in a wide range of environments. The downside is that it must be installed +separately. Use the following command to install Fabric, prefixing with +``sudo`` if your environment requires it:: + + pip install Fabric + +Take a moment to open the ``fabfile.py`` file that was generated in your +project root. You will see a number of commands, any one of which can be +renamed, removed, and/or customized to your liking. Using the out-of-the-box +configuration, you can generate your site via:: + + fab build + +If you'd prefer to have Pelican automatically regenerate your site every time a +change is detected (which is handy when testing locally), use the following +command instead:: + + fab regenerate + +To serve the generated site so it can be previewed in your browser at +http://localhost:8000/:: + + fab serve + +If during the ``pelican-quickstart`` process you answered "yes" when asked +whether you want to upload your site via SSH, you can use the following command +to publish your site via rsync over SSH:: + + fab publish + +These are just a few of the commands available by default, so feel free to +explore ``fabfile.py`` and see what other commands are available. More +importantly, don't hesitate to customize ``fabfile.py`` to suit your specific +needs and preferences. + +Make +---- + +A ``Makefile`` is also automatically created for you when you say "yes" to +the relevant question during the ``pelican-quickstart`` process. The advantage +of this method is that the ``make`` command is built into most POSIX systems +and thus doesn't require installing anything else in order to use it. The +downside is that non-POSIX systems (e.g., Windows) do not include ``make``, +and installing it on those systems can be a non-trivial task. + +If you want to use ``make`` to generate your site, run:: + + make html + +If you'd prefer to have Pelican automatically regenerate your site every time a +change is detected (which is handy when testing locally), use the following +command instead:: + + make regenerate + +To serve the generated site so it can be previewed in your browser at +http://localhost:8000/:: + + make serve + +Normally you would need to run ``make regenerate`` and ``make serve`` in two +separate terminal sessions, but you can run both at once via:: + + make devserver + +The above command will simultaneously run Pelican in regeneration mode as well +as serve the output at http://localhost:8000. Once you are done testing your +changes, you should stop the development server via:: + + ./develop_server.sh stop + +When you're ready to publish your site, you can upload it via the method(s) you +chose during the ``pelican-quickstart`` questionnaire. For this example, we'll +use rsync over ssh:: + + make rsync_upload + +That's it! Your site should now be live. + +(The default ``Makefile`` and ``devserver.sh`` scripts use the ``python`` and +``pelican`` executables to complete its tasks. If you want to use different +executables, such as ``python3``, you can set the ``PY`` and ``PELICAN`` +environment variables, respectively, to override the default executable names.) + +.. _Fabric: http://fabfile.org/ diff --git a/docs/quickstart.rst b/docs/quickstart.rst new file mode 100644 index 00000000..44f99dd2 --- /dev/null +++ b/docs/quickstart.rst @@ -0,0 +1,73 @@ +Quickstart +########## + +Reading through all the documentation is highly recommended, but for the truly +impatient, following are some quick steps to get started. + +Installation +------------ + +Install Pelican on Python 2.7.x or Python 3.3+ by running the following command +in your preferred terminal, prefixing with ``sudo`` if permissions warrant:: + + pip install pelican markdown + +Create a project +---------------- + +First, choose a name for your project, create an appropriately-named directory +for your it, and switch to that directory:: + + mkdir -p ~/projects/yoursite + cd ~/projects/yoursite + +Create a skeleton project via the ``pelican-quickstart`` command, which begins +by asking some questions about your site:: + + pelican-quickstart + +For questions that have default values denoted in brackets, feel free to use +the Return key to accept those default values. When asked for your URL prefix, +enter your domain name as indicated (e.g., ``http://example.com``). + +Create an article +----------------- + +You cannot run Pelican until you have created some content. Use your preferred +text editor to create your first article with the following content:: + + Title: My First Review + Date: 2010-12-03 10:20 + Category: Review + + Following is a review of my favorite mechanical keyboard. + +Given that this example article is in Markdown format, save it as +``~/projects/yoursite/content/keyboard-review.md``. + +Generate your site +------------------ + +From your project directory, run the ``pelican`` command to generate your site:: + + pelican content + +Your site has now been generated inside the ``output`` directory. (You may see a +warning related to feeds, but that is normal when developing locally and can be +ignored for now.) + +Preview your site +----------------- + +Open a new terminal session and run the following commands to switch to your +``output`` directory and launch Python's built-in web server:: + + cd ~/projects/yoursite/output + python -m SimpleHTTPServer + +Preview your site by navigating to http://localhost:8000/ in your browser. + +Continue reading the other documentation sections for more detail, and check out +the Pelican wiki's Tutorials_ page for links to community-published tutorials. + +.. _Tutorials: https://github.com/getpelican/pelican/wiki/Tutorials diff --git a/docs/settings.rst b/docs/settings.rst index 2782977c..7a69784e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -1,10 +1,10 @@ Settings ######## -Pelican is configurable thanks to a configuration file you can pass to +Pelican is configurable thanks to a settings file you can pass to the command line:: - $ pelican content -s path/to/your/settingsfile.py + pelican content -s path/to/your/settingsfile.py (If you used the ``pelican-quickstart`` command, your primary settings file will be named ``pelicanconf.py`` by default.) @@ -201,8 +201,8 @@ for URL formation: *relative* and *absolute*. Relative URLs are useful when testing locally, and absolute URLs are reliable and most useful when publishing. One method of supporting both is to have one Pelican configuration file for local development and another for publishing. To see an example of this -type of setup, use the ``pelican-quickstart`` script as described at the top of -the :doc:`Getting Started ` page, which will produce two separate +type of setup, use the ``pelican-quickstart`` script as described in the +:doc:`Installation ` section, which will produce two separate configuration files for local development and publishing, respectively. You can customize the URLs and locations where files will be saved. The @@ -603,7 +603,7 @@ For example:: Translations ============ -Pelican offers a way to translate articles. See the :doc:`Getting Started ` section for +Pelican offers a way to translate articles. See the :doc:`Content ` section for more information. ======================================================== ===================================================== diff --git a/docs/themes.rst b/docs/themes.rst index b029e816..7fcba671 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -1,13 +1,21 @@ .. _theming-pelican: -How to create themes for Pelican -################################ +Creating themes +############### -Pelican uses the great `Jinja2 `_ templating engine to -generate its HTML output. Jinja2 syntax is really simple. If you want to -create your own theme, feel free to take inspiration from the `"simple" theme +To generate its HTML output, Pelican uses the `Jinja `_ +templating engine due to its flexibility and straightforward syntax. If you want +to create your own theme, feel free to take inspiration from the `"simple" theme `_. +To generate your site using a theme you have created (or downloaded manually and +then modified), you can specify that theme via the ``-t`` flag:: + + pelican content -s pelicanconf.py -t /projects/your-site/themes/your-theme + +If you'd rather not specify the theme on every invocation, you can define +``THEME`` in your settings to point to the location of your preferred theme. + Structure ========= From 9d2a129832174c8a65c615148cfbc0a650ecb85c Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 13 May 2014 07:18:33 -0700 Subject: [PATCH 1156/2344] If PATH is undefined, Pelican uses PWD as content --- docs/settings.rst | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 7a69784e..4701e92d 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -94,7 +94,7 @@ Setting name (followed by default value, if any) ``READERS = {}`` A dictionary of file extensions / Reader classes for Pelican to process or ignore. For example, to avoid processing .html files, set: ``READERS = {'html': None}``. To add a custom reader for the - `foo` extension, set: ``READERS = {'foo': FooReader}`` + ``foo`` extension, set: ``READERS = {'foo': FooReader}`` ``IGNORE_FILES = ['.#*']`` A list of file globbing patterns to match against the source files to be ignored by the processor. For example, the default ``['.#*']`` will ignore emacs lock files. @@ -108,10 +108,12 @@ Setting name (followed by default value, if any) include them explicitly and enumerate the full list of desired Markdown extensions.) ``OUTPUT_PATH = 'output/'`` Where to output the generated files. -``PATH = None`` Path to content directory to be processed by Pelican. -``PAGE_DIR = 'pages'`` Directory to look at for pages, relative to `PATH`. +``PATH`` Path to content directory to be processed by Pelican. If undefined, + and content path is not specified via an argument to the ``pelican`` + command, Pelican will use the current working directory. +``PAGE_DIR = 'pages'`` Directory to look at for pages, relative to ``PATH``. ``PAGE_EXCLUDES = ()`` A list of directories to exclude when looking for pages. -``ARTICLE_DIR = ''`` Directory to look at for articles, relative to `PATH`. +``ARTICLE_DIR = ''`` Directory to look at for articles, relative to ``PATH``. ``ARTICLE_EXCLUDES = ('pages',)`` A list of directories to exclude when looking for articles. ``OUTPUT_SOURCES = False`` Set to True if you want to copy the articles and pages in their original format (e.g. Markdown or reStructuredText) to the From bf6a4ad74741a954fecefa4536637190ef23fb5e Mon Sep 17 00:00:00 2001 From: Vincent Jousse Date: Wed, 14 May 2014 11:11:58 +0200 Subject: [PATCH 1157/2344] Add missing methods --- pelican/tests/test_generators.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 659383ac..07871cef 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -58,6 +58,12 @@ class TestArticlesGenerator(unittest.TestCase): cls.generator.generate_context() cls.articles = cls.distill_articles(cls.generator.articles) + def setUp(self): + self.temp_cache = mkdtemp(prefix='pelican_cache.') + + def tearDown(self): + rmtree(self.temp_cache) + @staticmethod def distill_articles(articles): return [[article.title, article.status, article.category.name, From d635a347d1a5bb7336edb712356237b141efb4d1 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Mon, 21 Apr 2014 11:36:17 +0200 Subject: [PATCH 1158/2344] move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS Instead of one path a list can be given. This is due to popular request. Should help people not wanting to use Pelican for blogging. Maintain backward compatibility though. Thanks to @ingwinlu for pointing out the change in StaticGenerator. --- docs/settings.rst | 4 +-- pelican/generators.py | 60 +++++++++++++++----------------- pelican/settings.py | 26 ++++++++++---- pelican/tests/test_generators.py | 2 +- 4 files changed, 51 insertions(+), 41 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 4701e92d..33117a7f 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -111,9 +111,9 @@ Setting name (followed by default value, if any) ``PATH`` Path to content directory to be processed by Pelican. If undefined, and content path is not specified via an argument to the ``pelican`` command, Pelican will use the current working directory. -``PAGE_DIR = 'pages'`` Directory to look at for pages, relative to ``PATH``. +``PAGE_PATHS = ['pages']`` A list of directories to look at for pages, relative to ``PATH``. ``PAGE_EXCLUDES = ()`` A list of directories to exclude when looking for pages. -``ARTICLE_DIR = ''`` Directory to look at for articles, relative to ``PATH``. +``ARTICLE_PATHS = ['']`` A list of directories to look at for articles, relative to ``PATH``. ``ARTICLE_EXCLUDES = ('pages',)`` A list of directories to exclude when looking for articles. ``OUTPUT_SOURCES = False`` Set to True if you want to copy the articles and pages in their original format (e.g. Markdown or reStructuredText) to the diff --git a/pelican/generators.py b/pelican/generators.py index 7c6ba66b..deb237a2 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -110,29 +110,30 @@ class Generator(object): return True return False - def get_files(self, path, exclude=[], extensions=None): + def get_files(self, paths, exclude=[], extensions=None): """Return a list of files to use, based on rules - :param path: the path to search (relative to self.path) + :param paths: the list pf paths to search (relative to self.path) :param exclude: the list of path to exclude :param extensions: the list of allowed extensions (if False, all extensions are allowed) """ files = [] - root = os.path.join(self.path, path) + for path in paths: + root = os.path.join(self.path, path) - if os.path.isdir(root): - for dirpath, dirs, temp_files in os.walk(root, followlinks=True): - for e in exclude: - if e in dirs: - dirs.remove(e) - reldir = os.path.relpath(dirpath, self.path) - for f in temp_files: - fp = os.path.join(reldir, f) - if self._include_path(fp, extensions): - files.append(fp) - elif os.path.exists(root) and self._include_path(path, extensions): - files.append(path) # can't walk non-directories + if os.path.isdir(root): + for dirpath, dirs, temp_files in os.walk(root, followlinks=True): + for e in exclude: + if e in dirs: + dirs.remove(e) + reldir = os.path.relpath(dirpath, self.path) + for f in temp_files: + fp = os.path.join(reldir, f) + if self._include_path(fp, extensions): + files.append(fp) + elif os.path.exists(root) and self._include_path(path, extensions): + files.append(path) # can't walk non-directories return files def add_source_path(self, content): @@ -462,7 +463,7 @@ class ArticlesGenerator(CachingGenerator): all_articles = [] all_drafts = [] for f in self.get_files( - self.settings['ARTICLE_DIR'], + self.settings['ARTICLE_PATHS'], exclude=self.settings['ARTICLE_EXCLUDES']): article = self.get_cached_data(f, None) if article is None: @@ -586,7 +587,7 @@ class PagesGenerator(CachingGenerator): all_pages = [] hidden_pages = [] for f in self.get_files( - self.settings['PAGE_DIR'], + self.settings['PAGE_PATHS'], exclude=self.settings['PAGE_EXCLUDES']): page = self.get_cached_data(f, None) if page is None: @@ -660,20 +661,17 @@ class StaticGenerator(Generator): def generate_context(self): self.staticfiles = [] - - # walk static paths - for static_path in self.settings['STATIC_PATHS']: - for f in self.get_files( - static_path, extensions=False): - static = self.readers.read_file( - base_path=self.path, path=f, content_class=Static, - fmt='static', context=self.context, - preread_signal=signals.static_generator_preread, - preread_sender=self, - context_signal=signals.static_generator_context, - context_sender=self) - self.staticfiles.append(static) - self.add_source_path(static) + for f in self.get_files(self.settings['STATIC_PATHS'], + extensions=False): + static = self.readers.read_file( + base_path=self.path, path=f, content_class=Static, + fmt='static', context=self.context, + preread_signal=signals.static_generator_preread, + preread_sender=self, + context_signal=signals.static_generator_context, + context_sender=self) + self.staticfiles.append(static) + self.add_source_path(static) self._update_context(('staticfiles',)) signals.static_generator_finalized.send(self) diff --git a/pelican/settings.py b/pelican/settings.py index f759ff9e..219ebbd0 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -29,9 +29,9 @@ DEFAULT_THEME = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'themes', 'notmyidea') DEFAULT_CONFIG = { 'PATH': os.curdir, - 'ARTICLE_DIR': '', + 'ARTICLE_PATHS': [''], 'ARTICLE_EXCLUDES': ('pages',), - 'PAGE_DIR': 'pages', + 'PAGE_PATHS': ['pages'], 'PAGE_EXCLUDES': (), 'THEME': DEFAULT_THEME, 'OUTPUT_PATH': 'output', @@ -311,6 +311,16 @@ def configure_settings(settings): key=lambda r: r[0], ) + # move {ARTICLE,PAGE}_DIR -> {ARTICLE,PAGE}_PATHS + for key in ['ARTICLE', 'PAGE']: + old_key = key + '_DIR' + new_key = key + '_PATHS' + if old_key in settings: + logger.warning('Deprecated setting {}, moving it to {} list'.format( + old_key, new_key)) + settings[new_key] = [settings[old_key]] # also make a list + del settings[old_key] + # Save people from accidentally setting a string rather than a list path_keys = ( 'ARTICLE_EXCLUDES', @@ -324,13 +334,15 @@ def configure_settings(settings): 'PLUGINS', 'STATIC_PATHS', 'THEME_STATIC_PATHS', + 'ARTICLE_PATHS', + 'PAGE_PATHS', ) for PATH_KEY in filter(lambda k: k in settings, path_keys): - if isinstance(settings[PATH_KEY], six.string_types): - logger.warning("Detected misconfiguration with %s setting " - "(must be a list), falling back to the default" - % PATH_KEY) - settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY] + if isinstance(settings[PATH_KEY], six.string_types): + logger.warning("Detected misconfiguration with %s setting " + "(must be a list), falling back to the default" + % PATH_KEY) + settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY] for old, new, doc in [ ('LESS_GENERATOR', 'the Webassets plugin', None), diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 7b79e8f3..668a0093 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -372,8 +372,8 @@ class TestPageGenerator(unittest.TestCase): def test_generate_context(self): settings = get_settings(filenames={}) - settings['PAGE_DIR'] = 'TestPages' # relative to CUR_DIR settings['CACHE_PATH'] = self.temp_cache + settings['PAGE_PATHS'] = ['TestPages'] # relative to CUR_DIR settings['DEFAULT_DATE'] = (1970, 1, 1) generator = PagesGenerator( From 21882fd4a00ffdcee7029d7d5ee5ed355ef34a94 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Wed, 14 May 2014 14:06:58 +0200 Subject: [PATCH 1159/2344] Fix #1344 move PLUGIN_PATH -> PLUGIN_PATHS Pelican uses *_PATHS names for settings that represent a list of paths. --- docs/plugins.rst | 6 +++--- docs/settings.rst | 1 + pelican/__init__.py | 4 ++-- pelican/settings.py | 20 ++++++++++++-------- 4 files changed, 18 insertions(+), 13 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 717019a8..a13d9dce 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -21,10 +21,10 @@ Alternatively, another method is to import them and add them to the list:: PLUGINS = [myplugin,] If your plugins are not in an importable path, you can specify a list of paths -via the ``PLUGIN_PATH`` setting. As shown in the following example, paths in -the ``PLUGIN_PATH`` list can be absolute or relative to the settings file:: +via the ``PLUGIN_PATHS`` setting. As shown in the following example, paths in +the ``PLUGIN_PATHS`` list can be absolute or relative to the settings file:: - PLUGIN_PATH = ["plugins", "/srv/pelican/plugins"] + PLUGIN_PATHS = ["plugins", "/srv/pelican/plugins"] PLUGINS = ["assets", "liquid_tags", "sitemap"] Where to find plugins diff --git a/docs/settings.rst b/docs/settings.rst index 33117a7f..34245ff4 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -125,6 +125,7 @@ Setting name (followed by default value, if any) not. Only set this to ``True`` when developing/testing and only if you fully understand the effect it can have on links/feeds. ``PLUGINS = []`` The list of plugins to load. See :ref:`plugins`. +``PLUGIN_PATHS = []`` A list of directories where to look for plugins. See :ref:`plugins`. ``SITENAME = 'A Pelican Blog'`` Your site name ``SITEURL`` Base URL of your website. Not defined by default, so it is best to specify your SITEURL; if you do not, feeds diff --git a/pelican/__init__.py b/pelican/__init__.py index e9fef163..082e5a58 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -63,9 +63,9 @@ class Pelican(object): def init_plugins(self): self.plugins = [] - logger.debug('Temporarily adding PLUGIN_PATH to system path') + logger.debug('Temporarily adding PLUGIN_PATHS to system path') _sys_path = sys.path[:] - for pluginpath in self.settings['PLUGIN_PATH']: + for pluginpath in self.settings['PLUGIN_PATHS']: sys.path.insert(0, pluginpath) for plugin in self.settings['PLUGINS']: # if it's a string, then import it diff --git a/pelican/settings.py b/pelican/settings.py index 219ebbd0..c93050ad 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -114,7 +114,7 @@ DEFAULT_CONFIG = { 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'SUMMARY_MAX_LENGTH': 50, - 'PLUGIN_PATH': [], + 'PLUGIN_PATHS': [], 'PLUGINS': [], 'PYGMENTS_RST_OPTIONS': {}, 'TEMPLATE_PAGES': {}, @@ -147,13 +147,17 @@ def read_settings(path=None, override=None): if p not in ('THEME') or os.path.exists(absp): local_settings[p] = absp - if isinstance(local_settings['PLUGIN_PATH'], six.string_types): - logger.warning("Defining %s setting as string has been deprecated (should be a list)" % 'PLUGIN_PATH') - local_settings['PLUGIN_PATH'] = [local_settings['PLUGIN_PATH']] - else: - if 'PLUGIN_PATH' in local_settings and local_settings['PLUGIN_PATH'] is not None: - local_settings['PLUGIN_PATH'] = [os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(path), pluginpath))) - if not isabs(pluginpath) else pluginpath for pluginpath in local_settings['PLUGIN_PATH']] + if 'PLUGIN_PATH' in local_settings: + logger.warning('PLUGIN_PATH setting has been replaced by ' + 'PLUGIN_PATHS, moving it to the new setting name.') + local_settings['PLUGIN_PATHS'] = local_settings['PLUGIN_PATH'] + del local_settings['PLUGIN_PATH'] + if isinstance(local_settings['PLUGIN_PATHS'], six.string_types): + logger.warning("Defining %s setting as string has been deprecated (should be a list)" % 'PLUGIN_PATHS') + local_settings['PLUGIN_PATHS'] = [local_settings['PLUGIN_PATHS']] + elif local_settings['PLUGIN_PATHS'] is not None: + local_settings['PLUGIN_PATHS'] = [os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(path), pluginpath))) + if not isabs(pluginpath) else pluginpath for pluginpath in local_settings['PLUGIN_PATHS']] else: local_settings = copy.deepcopy(DEFAULT_CONFIG) From 6aa0e4346de498ada234f772163579e677cfd10b Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Wed, 14 May 2014 14:30:21 +0200 Subject: [PATCH 1160/2344] Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES automatically This makes it easier for someone to change PAGE_PATHS without the need to change ARTICLE_EXCLUDES accordingly. --- docs/settings.rst | 6 ++++-- pelican/settings.py | 16 ++++++++++++++-- pelican/tests/test_settings.py | 5 ++++- 3 files changed, 22 insertions(+), 5 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 34245ff4..fd5f488b 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -112,9 +112,11 @@ Setting name (followed by default value, if any) and content path is not specified via an argument to the ``pelican`` command, Pelican will use the current working directory. ``PAGE_PATHS = ['pages']`` A list of directories to look at for pages, relative to ``PATH``. -``PAGE_EXCLUDES = ()`` A list of directories to exclude when looking for pages. +``PAGE_EXCLUDES = []`` A list of directories to exclude when looking for pages in addition + to ``ARTICLE_PATHS``. ``ARTICLE_PATHS = ['']`` A list of directories to look at for articles, relative to ``PATH``. -``ARTICLE_EXCLUDES = ('pages',)`` A list of directories to exclude when looking for articles. +``ARTICLE_EXCLUDES = []`` A list of directories to exclude when looking for articles in addition + to ``PAGE_PATHS``. ``OUTPUT_SOURCES = False`` Set to True if you want to copy the articles and pages in their original format (e.g. Markdown or reStructuredText) to the specified ``OUTPUT_PATH``. diff --git a/pelican/settings.py b/pelican/settings.py index c93050ad..69ade05f 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -30,9 +30,9 @@ DEFAULT_THEME = os.path.join(os.path.dirname(os.path.abspath(__file__)), DEFAULT_CONFIG = { 'PATH': os.curdir, 'ARTICLE_PATHS': [''], - 'ARTICLE_EXCLUDES': ('pages',), + 'ARTICLE_EXCLUDES': [], 'PAGE_PATHS': ['pages'], - 'PAGE_EXCLUDES': (), + 'PAGE_EXCLUDES': [], 'THEME': DEFAULT_THEME, 'OUTPUT_PATH': 'output', 'READERS': {}, @@ -348,6 +348,18 @@ def configure_settings(settings): % PATH_KEY) settings[PATH_KEY] = DEFAULT_CONFIG[PATH_KEY] + # Add {PAGE,ARTICLE}_PATHS to {ARTICLE,PAGE}_EXCLUDES + mutually_exclusive = ('ARTICLE', 'PAGE') + for type_1, type_2 in [mutually_exclusive, mutually_exclusive[::-1]]: + try: + includes = settings[type_1 + '_PATHS'] + excludes = settings[type_2 + '_EXCLUDES'] + for path in includes: + if path not in excludes: + excludes.append(path) + except KeyError: + continue # setting not specified, nothing to do + for old, new, doc in [ ('LESS_GENERATOR', 'the Webassets plugin', None), ('FILES_TO_COPY', 'STATIC_PATHS and EXTRA_PATH_METADATA', diff --git a/pelican/tests/test_settings.py b/pelican/tests/test_settings.py index 930e0fea..260eff05 100644 --- a/pelican/tests/test_settings.py +++ b/pelican/tests/test_settings.py @@ -43,7 +43,10 @@ class TestSettingsConfiguration(unittest.TestCase): # Providing no file should return the default values. settings = read_settings(None) expected = copy.deepcopy(DEFAULT_CONFIG) - expected['FEED_DOMAIN'] = '' # Added by configure settings + # Added by configure settings + expected['FEED_DOMAIN'] = '' + expected['ARTICLE_EXCLUDES'] = ['pages'] + expected['PAGE_EXCLUDES'] = [''] self.maxDiff = None self.assertDictEqual(settings, expected) From 144cddaf39ad6577cfa4a11ef003f6fa44c81d58 Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Tue, 20 May 2014 13:53:02 -0700 Subject: [PATCH 1161/2344] Address code review comments from PR getpelican/pelican#1348 The text about the sort-by-key function comes from: https://docs.python.org/2/library/stdtypes.html#sequence-types-str-unicode-list-tuple-bytearray-buffer-xrange Minor style cleanup as well. --- docs/settings.rst | 36 +++++++++++++++++++++--------------- pelican/utils.py | 14 +++++--------- 2 files changed, 26 insertions(+), 24 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 55740296..0c804f1c 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -260,16 +260,19 @@ posts for the month at ``posts/2011/Aug/index.html``. arrive at an appropriate archive of posts, without having to specify a page name. -====================================================== ======================================================== +====================================================== ============================================================== Setting name (followed by default value, if any) What does it do? -====================================================== ======================================================== +====================================================== ============================================================== ``ARTICLE_URL = '{slug}.html'`` The URL to refer to an article. ``ARTICLE_SAVE_AS = '{slug}.html'`` The place where we will save an article. -``ARTICLE_ORDER_BY = 'slug'`` The metadata attribute used to sort articles. By default - the articles_page.object_list template variable is - ordered by slug. If you modify this, make sure all - articles contain the attribute you specify. You can - also specify a sorting function. +``ARTICLE_ORDER_BY = 'slug'`` The metadata attribute used to sort articles. By default, + the ``articles_page.object_list`` template variable is + ordered by slug. If you modify this, make sure all + articles contain the attribute you specify. You can also + specify a "sorting" function of one argument that is used + to extract a comparison key from each article. For example, + sorting by title without using the built-in functionality + would use the function ``operator.attrgetter('title')``. ``ARTICLE_LANG_URL = '{slug}-{lang}.html'`` The URL to refer to an article which doesn't use the default language. ``ARTICLE_LANG_SAVE_AS = '{slug}-{lang}.html'`` The place where we will save an article which @@ -285,13 +288,16 @@ Setting name (followed by default value, if any) What does it do? the same as PAGE_URL or you need to use a rewrite in your server config. -``PAGE_ORDER_BY = 'filename'`` The metadata attribute used to sort pages. By default - the PAGES template variable is ordered by filename - (path not included). Note that the option 'filename' - is a special option supported in the source code. If - you modify this settings, make sure all pages contain - the attribute you specify. You can also specify a - sorting function. +``PAGE_ORDER_BY = 'basename'`` The metadata attribute used to sort pages. By default + the ``PAGES`` template variable is ordered by basename + (i.e., path not included). Note that the option ``'basename'`` + is a special option supported in the source code. If + you modify this setting, make sure all pages contain + the attribute you specify. You can also specify a "sorting" + function of one argument that is used to extract a comparison + key from each page. For example, the basename function looks + similar to + ``lambda x: os.path.basename(getattr(x, 'source_path', ''))``. ``PAGE_LANG_URL = 'pages/{slug}-{lang}.html'`` The URL we will use to link to a page which doesn't use the default language. ``PAGE_LANG_SAVE_AS = 'pages/{slug}-{lang}.html'`` The location we will save the page which doesn't @@ -309,7 +315,7 @@ Setting name (followed by default value, if any) What does it do? non-alphanumerics when generating slugs. Specified as a list of 2-tuples of ``(from, to)`` which are applied in order. -====================================================== ======================================================== +====================================================== ============================================================== .. note:: diff --git a/pelican/utils.py b/pelican/utils.py index ecdf5e0d..076c41ea 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -465,17 +465,13 @@ def process_translations(content_list, order_by=None): a.translations = [x for x in items if x != a] if order_by: - if hasattr(order_by, '__call__'): + if callable(order_by): try: index.sort(key=order_by) - except: - if hasattr(order_by, 'func_name'): - logger.error("Error sorting with function %s" % order_by.func_name) - else: - logger.error("Error sorting with function %r" % order_by) - elif order_by == 'filename': - index.sort(key=lambda x:os.path.basename( - x.source_path or '')) + except Exception: + logger.error('Error sorting with function {}'.format(order_by)) + elif order_by == 'basename': + index.sort(key=lambda x: os.path.basename(x.source_path or '')) elif order_by != 'slug': index.sort(key=attrgetter(order_by)) From b8db970455100b3b9393fcb20cc1b7fd9c3730f4 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Sun, 25 May 2014 09:12:35 +0200 Subject: [PATCH 1162/2344] Fix RstReader authors metadata processing The reader would return a list of authors already, but METADATA_PROCESSORS['authors'] expects a string. Added a test case for this (only the HTMLReader had it). --- pelican/readers.py | 1 + pelican/tests/test_generators.py | 1 + pelican/tests/test_readers.py | 9 +++++++++ 3 files changed, 11 insertions(+) diff --git a/pelican/readers.py b/pelican/readers.py index c63b8981..60df8551 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -145,6 +145,7 @@ class RstReader(BaseReader): elif element.tagname == 'authors': # author list name = element.tagname value = [element.astext() for element in element.children] + value = ','.join(value) # METADATA_PROCESSORS expects a string else: # standard fields (e.g. address) name = element.tagname value = element.astext() diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 7b79e8f3..156f7b50 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -109,6 +109,7 @@ class TestArticlesGenerator(unittest.TestCase): ['This is an article with category !', 'published', 'yeah', 'article'], ['This is an article with multiple authors!', 'published', 'Default', 'article'], + ['This is an article with multiple authors!', 'published', 'Default', 'article'], ['This is an article without category !', 'published', 'Default', 'article'], ['This is an article without category !', 'published', diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index fd30e9b9..3533cd31 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -150,6 +150,15 @@ class RstReaderTest(ReaderTest): except ImportError: return unittest.skip('need the typogrify distribution') + def test_article_with_multiple_authors(self): + page = self.read_file(path='article_with_multiple_authors.rst') + expected = { + 'authors': ['First Author', 'Second Author'] + } + + for key, value in expected.items(): + self.assertEqual(value, page.metadata[key], key) + class MdReaderTest(ReaderTest): From 43701cae7c0c7fc4617374eab13695da8372e104 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Tue, 27 May 2014 12:15:50 -0400 Subject: [PATCH 1163/2344] Docs update for *_{previous|next}_page variables --- docs/themes.rst | 56 ++++++++++++++++++++++++++++++++++++++----------- 1 file changed, 44 insertions(+), 12 deletions(-) diff --git a/docs/themes.rst b/docs/themes.rst index 7fcba671..4be9a8e5 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -119,17 +119,25 @@ This is the home page of your blog, generated at output/index.html. If pagination is active, subsequent pages will reside in output/index`n`.html. -=================== =================================================== +====================== =================================================== Variable Description -=================== =================================================== +====================== =================================================== articles_paginator A paginator object for the list of articles articles_page The current page of articles +articles_previous_page The previous page of articles (``None`` if page does + not exist) +articles_next_page The next page of articles (``None`` if page does + not exist) dates_paginator A paginator object for the article list, ordered by date, ascending. dates_page The current page of articles, ordered by date, ascending. +dates_previous_page The previous page of articles, ordered by date, + ascending (``None`` if page does not exist) +dates_next_page The next page of articles, ordered by date, + ascending (``None`` if page does not exist) page_name 'index' -- useful for pagination links -=================== =================================================== +====================== =================================================== author.html ------------- @@ -140,22 +148,30 @@ output generated at output/author/`author_name`.html. If pagination is active, subsequent pages will reside as defined by setting AUTHOR_SAVE_AS (`Default:` output/author/`author_name'n'`.html). -=================== =================================================== +====================== =================================================== Variable Description -=================== =================================================== +====================== =================================================== author The name of the author being processed articles Articles by this author dates Articles by this author, but ordered by date, ascending articles_paginator A paginator object for the list of articles articles_page The current page of articles +articles_previous_page The previous page of articles (``None`` if page does + not exist) +articles_next_page The next page of articles (``None`` if page does + not exist) dates_paginator A paginator object for the article list, ordered by date, ascending. dates_page The current page of articles, ordered by date, ascending. +dates_previous_page The previous page of articles, ordered by date, + ascending (``None`` if page does not exist) +dates_next_page The next page of articles, ordered by date, + ascending (``None`` if page does not exist) page_name AUTHOR_URL where everything after `{slug}` is removed -- useful for pagination links -=================== =================================================== +====================== =================================================== category.html ------------- @@ -166,22 +182,30 @@ output generated at output/category/`category_name`.html. If pagination is active, subsequent pages will reside as defined by setting CATEGORY_SAVE_AS (`Default:` output/category/`category_name'n'`.html). -=================== =================================================== +====================== =================================================== Variable Description -=================== =================================================== +====================== =================================================== category The name of the category being processed articles Articles for this category dates Articles for this category, but ordered by date, ascending articles_paginator A paginator object for the list of articles articles_page The current page of articles +articles_previous_page The previous page of articles (``None`` if page does + not exist) +articles_next_page The next page of articles (``None`` if page does + not exist) dates_paginator A paginator object for the list of articles, ordered by date, ascending dates_page The current page of articles, ordered by date, ascending +dates_previous_page The previous page of articles, ordered by date, + ascending (``None`` if page does not exist) +dates_next_page The next page of articles, ordered by date, + ascending (``None`` if page does not exist) page_name CATEGORY_URL where everything after `{slug}` is removed -- useful for pagination links -=================== =================================================== +====================== =================================================== article.html ------------- @@ -244,22 +268,30 @@ saved as output/tag/`tag_name`.html. If pagination is active, subsequent pages will reside as defined in setting TAG_SAVE_AS (`Default:` output/tag/`tag_name'n'`.html). -=================== =================================================== +====================== =================================================== Variable Description -=================== =================================================== +====================== =================================================== tag The name of the tag being processed articles Articles related to this tag dates Articles related to this tag, but ordered by date, ascending articles_paginator A paginator object for the list of articles articles_page The current page of articles +articles_previous_page The previous page of articles (``None`` if page does + not exist) +articles_next_page The next page of articles (``None`` if page does + not exist) dates_paginator A paginator object for the list of articles, ordered by date, ascending dates_page The current page of articles, ordered by date, ascending +dates_previous_page The previous page of articles, ordered by date, + ascending (``None`` if page does not exist) +dates_next_page The next page of articles, ordered by date, + ascending (``None`` if page does not exist) page_name TAG_URL where everything after `{slug}` is removed -- useful for pagination links -=================== =================================================== +====================== =================================================== period_archives.html -------------------- From b572cbeef15ac2e4fe6107110f52fbdc212cd52a Mon Sep 17 00:00:00 2001 From: Mark Lee Date: Tue, 27 May 2014 11:42:37 -0700 Subject: [PATCH 1164/2344] Addressed comments from @avaris in PR getpelican/pelican#1348 --- pelican/settings.py | 2 +- pelican/utils.py | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/pelican/settings.py b/pelican/settings.py index f49d3bd4..6845b830 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -70,7 +70,7 @@ DEFAULT_CONFIG = { 'DRAFT_LANG_SAVE_AS': os.path.join('drafts', '{slug}-{lang}.html'), 'PAGE_URL': 'pages/{slug}.html', 'PAGE_SAVE_AS': os.path.join('pages', '{slug}.html'), - 'PAGE_ORDER_BY': 'filename', + 'PAGE_ORDER_BY': 'basename', 'PAGE_LANG_URL': 'pages/{slug}-{lang}.html', 'PAGE_LANG_SAVE_AS': os.path.join('pages', '{slug}-{lang}.html'), 'STATIC_URL': '{path}', diff --git a/pelican/utils.py b/pelican/utils.py index 076c41ea..c2d6ca22 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -473,7 +473,12 @@ def process_translations(content_list, order_by=None): elif order_by == 'basename': index.sort(key=lambda x: os.path.basename(x.source_path or '')) elif order_by != 'slug': - index.sort(key=attrgetter(order_by)) + try: + index.sort(key=attrgetter(order_by)) + except AttributeError: + error_msg = ('There is no "{}" attribute in the item metadata.' + 'Defaulting to slug order.') + logger.warning(error_msg.format(order_by)) return index, translations From ef967056778a6610fe7b61c349acec0990073dd7 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Sun, 8 Jun 2014 11:32:10 +0200 Subject: [PATCH 1165/2344] catch arbitrary exceptions during cache unpickling It is hard to forsee what could be raised. --- pelican/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/utils.py b/pelican/utils.py index 2af34ecf..84b3a41e 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -577,7 +577,7 @@ class FileDataCacher(object): 'run). Proceeding with empty cache.\n{}').format( self._cache_path, err)) self._cache = {} - except pickle.UnpicklingError as err: + except Exception as err: logger.warning(('Cannot unpickle cache {}, cache may be using ' 'an incompatible protocol (see pelican caching docs). ' 'Proceeding with empty cache.\n{}').format( From def654434c49a9a17c31ba4b6d970a517e5af320 Mon Sep 17 00:00:00 2001 From: OGINO Masanori Date: Tue, 10 Jun 2014 08:28:10 +0900 Subject: [PATCH 1166/2344] Require six version 1.4.0 or later. six.moves.urllib.parse is available since version 1.4.0. Signed-off-by: OGINO Masanori --- setup.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index e989d549..a2bcaeaa 100755 --- a/setup.py +++ b/setup.py @@ -2,7 +2,8 @@ from setuptools import setup requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils', - 'pytz >= 0a', 'blinker', 'unidecode', 'six', 'python-dateutil'] + 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', + 'python-dateutil'] entry_points = { 'console_scripts': [ From ca3aa1e75fac0b54feb7170e6a5f1c03c1097145 Mon Sep 17 00:00:00 2001 From: OGINO Masanori Date: Tue, 10 Jun 2014 17:30:17 +0900 Subject: [PATCH 1167/2344] Use six.moves.urllib. Signed-off-by: OGINO Masanori --- pelican/contents.py | 8 +------- pelican/tools/pelican_import.py | 9 +++------ pelican/writers.py | 4 +--- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 615a7fd8..220db611 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import six -from six.moves.urllib.parse import unquote +from six.moves.urllib.parse import (unquote, urlparse, urlunparse) import copy import locale @@ -11,14 +11,8 @@ import os import re import sys -try: - from urlparse import urlparse, urlunparse -except ImportError: - from urllib.parse import urlparse, urlunparse - from datetime import datetime - from pelican import signals from pelican.settings import DEFAULT_CONFIG from pelican.utils import (slugify, truncate_html_words, memoized, strftime, diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 27e47754..7c8662c9 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -6,15 +6,9 @@ import argparse try: # py3k import from html.parser import HTMLParser - from urllib.request import urlretrieve - from urllib.parse import urlparse - from urllib.error import URLError except ImportError: # py2 import from HTMLParser import HTMLParser # NOQA - from urllib import urlretrieve - from urlparse import urlparse - from urllib2 import URLError import os import re import subprocess @@ -23,6 +17,9 @@ import time import logging from codecs import open +from six.moves.urllib.error import URLError +from six.moves.urllib.parse import urlparse +from six.moves.urllib.request import urlretrieve from pelican.utils import slugify from pelican.log import init diff --git a/pelican/writers.py b/pelican/writers.py index a92feee4..3e01ee6c 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -8,12 +8,10 @@ import logging if not six.PY3: from codecs import open - from urlparse import urlparse -else: - from urllib.parse import urlparse from feedgenerator import Atom1Feed, Rss201rev2Feed from jinja2 import Markup +from six.moves.urllib.parse import urlparse from pelican.paginator import Paginator from pelican.utils import (get_relative_path, path_to_url, set_date_tzinfo, From bf9316bb7e4a7aa2a6e335c681d4255d1deed23e Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Tue, 10 Jun 2014 18:05:29 -0400 Subject: [PATCH 1168/2344] Remove AsciiDocReader from core. Fixes #1355 --- .travis.yml | 2 - docs/content.rst | 5 ++- docs/index.rst | 3 +- docs/install.rst | 5 --- docs/internals.rst | 4 +- docs/settings.rst | 2 - pelican/readers.py | 39 ------------------- pelican/settings.py | 1 - .../content/article_with_asc_extension.asc | 12 ------ .../content/article_with_asc_options.asc | 9 ----- pelican/tests/test_readers.py | 36 ----------------- 11 files changed, 6 insertions(+), 112 deletions(-) delete mode 100644 pelican/tests/content/article_with_asc_extension.asc delete mode 100644 pelican/tests/content/article_with_asc_options.asc diff --git a/.travis.yml b/.travis.yml index 41ad82b2..54dcf0ea 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,10 +5,8 @@ python: - "3.4" before_install: - sudo apt-get update -qq - - sudo apt-get install -qq --no-install-recommends asciidoc - sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 install: - - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi - pip install . - pip install -r dev_requirements.txt - pip install nose-cov diff --git a/docs/content.rst b/docs/content.rst index 24fc6e9b..ad81bed1 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -57,8 +57,8 @@ pattern:: This is the content of my super blog post. -Conventions for AsciiDoc_ posts, which should have an ``.asc`` extension, can -be found on the AsciiDoc_ site. +Readers for additional formats (such as AsciiDoc_) are available via plugins. +Refer to `pelican-plugins`_ repository for those. Pelican can also process HTML files ending in ``.html`` and ``.htm``. Pelican interprets the HTML in a very straightforward manner, reading metadata from @@ -369,3 +369,4 @@ listed on the index page nor on any category or tag page. .. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime .. _AsciiDoc: http://www.methods.co.nz/asciidoc/ +.. _pelican-plugins: http://github.com/getpelican/pelican-plugins diff --git a/docs/index.rst b/docs/index.rst index 36a3282b..2beb8b20 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -13,7 +13,7 @@ Pelican |release| Pelican is a static site generator, written in Python_. Highlights include: * Write your content directly with your editor of choice - in reStructuredText_, Markdown_, or AsciiDoc_ formats + in reStructuredText_ or Markdown_ formats * Includes a simple CLI tool to (re)generate your site * Easy to interface with distributed version control systems and web hooks * Completely static output is easy to host anywhere @@ -89,7 +89,6 @@ Documentation .. _Python: http://www.python.org/ .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Markdown: http://daringfireball.net/projects/markdown/ -.. _AsciiDoc: http://www.methods.co.nz/asciidoc/index.html .. _Jinja2: http://jinja.pocoo.org/ .. _`Pelican documentation`: http://docs.getpelican.com/latest/ .. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html diff --git a/docs/install.rst b/docs/install.rst index 34cd33ea..418c8ca6 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -52,10 +52,6 @@ installed:: pip install typogrify -If you want to use AsciiDoc_ you need to install it from `source -`_ or use your operating -system's package manager. - Dependencies ------------ @@ -119,4 +115,3 @@ The next step is to begin to adding content to the *content* folder that has been created for you. .. _virtualenv: http://www.virtualenv.org/ -.. _AsciiDoc: http://www.methods.co.nz/asciidoc/ diff --git a/docs/internals.rst b/docs/internals.rst index f69a9bb8..303a327f 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -13,7 +13,7 @@ Overall structure ================= What Pelican does is take a list of files and process them into some sort of -output. Usually, the input files are reStructuredText, Markdown and AsciiDoc +output. Usually, the input files are reStructuredText and Markdown files, and the output is a blog, but both input and output can be anything you want. @@ -23,7 +23,7 @@ The logic is separated into different classes and concepts: on. Since those operations are commonly used, the object is created once and then passed to the generators. -* **Readers** are used to read from various formats (AsciiDoc, HTML, Markdown and +* **Readers** are used to read from various formats (HTML, Markdown and reStructuredText for now, but the system is extensible). Given a file, they return metadata (author, tags, category, etc.) and content (HTML-formatted). diff --git a/docs/settings.rst b/docs/settings.rst index 4701e92d..5d9c574f 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -159,8 +159,6 @@ Setting name (followed by default value, if any) Can be used to separate templates from the theme. Example: projects, resume, profile ... These templates need to use ``DIRECT_TEMPLATES`` setting. -``ASCIIDOC_OPTIONS = []`` A list of options to pass to AsciiDoc. See the `manpage - `_. ``WITH_FUTURE_DATES = True`` If disabled, content with dates in the future will get a default status of ``draft``. See :ref:`reading_only_modified_content` for caveats. diff --git a/pelican/readers.py b/pelican/readers.py index 60df8551..431e6937 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -17,11 +17,6 @@ try: from markdown import Markdown except ImportError: Markdown = False # NOQA -try: - from asciidocapi import AsciiDocAPI - asciidoc = True -except ImportError: - asciidoc = False try: from html import escape except ImportError: @@ -349,40 +344,6 @@ class HTMLReader(BaseReader): return parser.body, metadata -class AsciiDocReader(BaseReader): - """Reader for AsciiDoc files""" - - enabled = bool(asciidoc) - file_extensions = ['asc', 'adoc', 'asciidoc'] - default_options = ["--no-header-footer", "-a newline=\\n"] - - def read(self, source_path): - """Parse content and metadata of asciidoc files""" - from cStringIO import StringIO - with pelican_open(source_path) as source: - text = StringIO(source) - content = StringIO() - ad = AsciiDocAPI() - - options = self.settings['ASCIIDOC_OPTIONS'] - if isinstance(options, (str, unicode)): - options = [m.strip() for m in options.split(',')] - options = self.default_options + options - for o in options: - ad.options(*o.split()) - - ad.execute(text, content, backend="html4") - content = content.getvalue() - - metadata = {} - for name, value in ad.asciidoc.document.attributes.items(): - name = name.lower() - metadata[name] = self.process_metadata(name, value) - if 'doctitle' in metadata: - metadata['title'] = metadata['doctitle'] - return content, metadata - - class Readers(FileStampDataCacher): """Interface for all readers. diff --git a/pelican/settings.py b/pelican/settings.py index f759ff9e..a94e4bf2 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -98,7 +98,6 @@ DEFAULT_CONFIG = { 'PELICAN_CLASS': 'pelican.Pelican', 'DEFAULT_DATE_FORMAT': '%a %d %B %Y', 'DATE_FORMATS': {}, - 'ASCIIDOC_OPTIONS': [], 'MD_EXTENSIONS': ['codehilite(css_class=highlight)', 'extra'], 'JINJA_EXTENSIONS': [], 'JINJA_FILTERS': {}, diff --git a/pelican/tests/content/article_with_asc_extension.asc b/pelican/tests/content/article_with_asc_extension.asc deleted file mode 100644 index 9ce2166c..00000000 --- a/pelican/tests/content/article_with_asc_extension.asc +++ /dev/null @@ -1,12 +0,0 @@ -Test AsciiDoc File Header -========================= -:Author: Author O. Article -:Email: -:Date: 2011-09-15 09:05 -:Category: Blog -:Tags: Linux, Python, Pelican - -Used for pelican test ---------------------- - -The quick brown fox jumped over the lazy dog's back. diff --git a/pelican/tests/content/article_with_asc_options.asc b/pelican/tests/content/article_with_asc_options.asc deleted file mode 100644 index bafb3a4a..00000000 --- a/pelican/tests/content/article_with_asc_options.asc +++ /dev/null @@ -1,9 +0,0 @@ -Test AsciiDoc File Header -========================= - -Used for pelican test ---------------------- - -version {revision} - -The quick brown fox jumped over the lazy dog's back. diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 3533cd31..6228989b 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -333,42 +333,6 @@ class MdReaderTest(ReaderTest): self.assertEqual(value, page.metadata[key], key) -class AdReaderTest(ReaderTest): - - @unittest.skipUnless(readers.asciidoc, "asciidoc isn't installed") - def test_article_with_asc_extension(self): - # Ensure the asc extension is being processed by the correct reader - page = self.read_file( - path='article_with_asc_extension.asc') - expected = ('
    \n

    ' - 'Used for pelican test

    \n' - '

    The quick brown fox jumped over' - ' the lazy dog’s back.

    \n') - self.assertEqual(page.content, expected) - expected = { - 'category': 'Blog', - 'author': 'Author O. Article', - 'title': 'Test AsciiDoc File Header', - 'date': datetime.datetime(2011, 9, 15, 9, 5), - 'tags': ['Linux', 'Python', 'Pelican'], - } - - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) - - @unittest.skipUnless(readers.asciidoc, "asciidoc isn't installed") - def test_article_with_asc_options(self): - # test to ensure the ASCIIDOC_OPTIONS is being used - reader = readers.AsciiDocReader( - dict(ASCIIDOC_OPTIONS=["-a revision=1.0.42"])) - content, metadata = reader.read(_path('article_with_asc_options.asc')) - expected = ('
    \n

    Used for' - ' pelican test

    \n

    version 1.0.42

    \n' - '

    The quick brown fox jumped over the lazy' - ' dog’s back.

    \n') - self.assertEqual(content, expected) - - class HTMLReaderTest(ReaderTest): def test_article_with_comments(self): page = self.read_file(path='article_with_comments.html') From 24106081b5bbb110eed16d2714f65aa1ea2a9fc2 Mon Sep 17 00:00:00 2001 From: Kyle Fuller Date: Tue, 24 Jun 2014 22:29:36 +0100 Subject: [PATCH 1169/2344] [coveralls] Exclude tests from coverage --- .coveragerc | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..2cb24879 --- /dev/null +++ b/.coveragerc @@ -0,0 +1,3 @@ +[report] +omit = pelican/tests/* + From 3f6b130d6ed427f19e444057958661ee00875ca0 Mon Sep 17 00:00:00 2001 From: Ondrej Grover Date: Sun, 27 Apr 2014 10:25:57 +0200 Subject: [PATCH 1170/2344] Fix #1198, enable custom locale in template rendering, fixes links reverts getpelican/pelican@ddcccfeaa952d2e1e24ceac94e5d66c73b57c01b If one used a locale that made use of unicode characters (like fr_FR.UTF-8) the files on disk would be in correct locale while links would be to C. Uses a SafeDatetime class that works with unicode format strigns by using custom strftime to prevent ascii decoding errors with Python2. Also added unicode decoding for the calendar module to fix period archives. --- docs/contribute.rst | 2 + pelican/contents.py | 7 +- pelican/generators.py | 32 +- pelican/readers.py | 9 +- .../tests/output/custom_locale/archives.html | 100 ++++ .../author/alexis-metaireau.html | 173 +++++++ .../author/alexis-metaireau2.html | 187 ++++++++ .../author/alexis-metaireau3.html | 138 ++++++ .../tests/output/custom_locale/authors.html | 82 ++++ .../output/custom_locale/categories.html | 80 ++++ .../output/custom_locale/category/bar.html | 101 ++++ .../output/custom_locale/category/cat1.html | 170 +++++++ .../output/custom_locale/category/misc.html | 181 +++++++ .../output/custom_locale/category/yeah.html | 109 +++++ .../custom_locale/drafts/a-draft-article.html | 100 ++++ .../feeds/alexis-metaireau.atom.xml | 61 +++ .../feeds/alexis-metaireau.rss.xml | 61 +++ .../custom_locale/feeds/all-en.atom.xml | 61 +++ .../custom_locale/feeds/all-fr.atom.xml | 4 + .../output/custom_locale/feeds/all.atom.xml | 63 +++ .../output/custom_locale/feeds/all.rss.xml | 63 +++ .../output/custom_locale/feeds/bar.atom.xml | 8 + .../output/custom_locale/feeds/bar.rss.xml | 8 + .../output/custom_locale/feeds/cat1.atom.xml | 7 + .../output/custom_locale/feeds/cat1.rss.xml | 7 + .../output/custom_locale/feeds/misc.atom.xml | 38 ++ .../output/custom_locale/feeds/misc.rss.xml | 38 ++ .../output/custom_locale/feeds/yeah.atom.xml | 14 + .../output/custom_locale/feeds/yeah.rss.xml | 14 + pelican/tests/output/custom_locale/index.html | 173 +++++++ .../tests/output/custom_locale/index2.html | 187 ++++++++ .../tests/output/custom_locale/index3.html | 138 ++++++ .../output/custom_locale/jinja2_template.html | 77 +++ .../output/custom_locale/oh-yeah-fr.html | 116 +++++ .../output/custom_locale/override/index.html | 81 ++++ .../pages/this-is-a-test-hidden-page.html | 81 ++++ .../pages/this-is-a-test-page.html | 81 ++++ .../output/custom_locale/pictures/Fat_Cat.jpg | Bin 0 -> 62675 bytes .../output/custom_locale/pictures/Sushi.jpg | Bin 0 -> 28992 bytes .../custom_locale/pictures/Sushi_Macro.jpg | Bin 0 -> 38594 bytes .../02/this-is-a-super-article/index.html | 129 +++++ .../2010/octobre/15/unbelievable/index.html | 146 ++++++ .../posts/2010/octobre/20/oh-yeah/index.html | 121 +++++ .../20/a-markdown-powered-article/index.html | 115 +++++ .../2011/février/17/article-1/index.html | 114 +++++ .../2011/février/17/article-2/index.html | 114 +++++ .../2011/février/17/article-3/index.html | 114 +++++ .../2012/février/29/second-article/index.html | 116 +++++ .../30/filename_metadata-example/index.html | 114 +++++ pelican/tests/output/custom_locale/robots.txt | 2 + .../custom_locale/second-article-fr.html | 116 +++++ .../tests/output/custom_locale/tag/bar.html | 160 +++++++ .../tests/output/custom_locale/tag/baz.html | 114 +++++ .../tests/output/custom_locale/tag/foo.html | 130 +++++ .../output/custom_locale/tag/foobar.html | 109 +++++ .../tests/output/custom_locale/tag/oh.html | 80 ++++ .../tests/output/custom_locale/tag/yeah.html | 101 ++++ pelican/tests/output/custom_locale/tags.html | 87 ++++ .../output/custom_locale/theme/css/main.css | 451 ++++++++++++++++++ .../custom_locale/theme/css/pygment.css | 205 ++++++++ .../output/custom_locale/theme/css/reset.css | 52 ++ .../custom_locale/theme/css/typogrify.css | 3 + .../output/custom_locale/theme/css/wide.css | 48 ++ .../theme/images/icons/aboutme.png | Bin 0 -> 751 bytes .../theme/images/icons/bitbucket.png | Bin 0 -> 3714 bytes .../theme/images/icons/delicious.png | Bin 0 -> 958 bytes .../theme/images/icons/facebook.png | Bin 0 -> 202 bytes .../theme/images/icons/github.png | Bin 0 -> 1714 bytes .../theme/images/icons/gitorious.png | Bin 0 -> 227 bytes .../theme/images/icons/gittip.png | Bin 0 -> 487 bytes .../theme/images/icons/google-groups.png | Bin 0 -> 803 bytes .../theme/images/icons/google-plus.png | Bin 0 -> 527 bytes .../theme/images/icons/hackernews.png | Bin 0 -> 3273 bytes .../theme/images/icons/lastfm.png | Bin 0 -> 975 bytes .../theme/images/icons/linkedin.png | Bin 0 -> 896 bytes .../theme/images/icons/reddit.png | Bin 0 -> 693 bytes .../custom_locale/theme/images/icons/rss.png | Bin 0 -> 879 bytes .../theme/images/icons/slideshare.png | Bin 0 -> 535 bytes .../theme/images/icons/speakerdeck.png | Bin 0 -> 1049 bytes .../theme/images/icons/stackoverflow.png | Bin 0 -> 916 bytes .../theme/images/icons/twitter.png | Bin 0 -> 830 bytes .../theme/images/icons/vimeo.png | Bin 0 -> 544 bytes .../theme/images/icons/youtube.png | Bin 0 -> 458 bytes pelican/tests/test_contents.py | 5 +- pelican/tests/test_pelican.py | 25 +- pelican/tests/test_readers.py | 30 +- pelican/tests/test_utils.py | 35 +- pelican/tools/pelican_import.py | 6 +- pelican/utils.py | 21 +- pelican/writers.py | 7 +- samples/pelican_FR.conf.py | 59 +++ 91 files changed, 5704 insertions(+), 77 deletions(-) create mode 100644 pelican/tests/output/custom_locale/archives.html create mode 100644 pelican/tests/output/custom_locale/author/alexis-metaireau.html create mode 100644 pelican/tests/output/custom_locale/author/alexis-metaireau2.html create mode 100644 pelican/tests/output/custom_locale/author/alexis-metaireau3.html create mode 100644 pelican/tests/output/custom_locale/authors.html create mode 100644 pelican/tests/output/custom_locale/categories.html create mode 100644 pelican/tests/output/custom_locale/category/bar.html create mode 100644 pelican/tests/output/custom_locale/category/cat1.html create mode 100644 pelican/tests/output/custom_locale/category/misc.html create mode 100644 pelican/tests/output/custom_locale/category/yeah.html create mode 100644 pelican/tests/output/custom_locale/drafts/a-draft-article.html create mode 100644 pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml create mode 100644 pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml create mode 100644 pelican/tests/output/custom_locale/feeds/all-en.atom.xml create mode 100644 pelican/tests/output/custom_locale/feeds/all-fr.atom.xml create mode 100644 pelican/tests/output/custom_locale/feeds/all.atom.xml create mode 100644 pelican/tests/output/custom_locale/feeds/all.rss.xml create mode 100644 pelican/tests/output/custom_locale/feeds/bar.atom.xml create mode 100644 pelican/tests/output/custom_locale/feeds/bar.rss.xml create mode 100644 pelican/tests/output/custom_locale/feeds/cat1.atom.xml create mode 100644 pelican/tests/output/custom_locale/feeds/cat1.rss.xml create mode 100644 pelican/tests/output/custom_locale/feeds/misc.atom.xml create mode 100644 pelican/tests/output/custom_locale/feeds/misc.rss.xml create mode 100644 pelican/tests/output/custom_locale/feeds/yeah.atom.xml create mode 100644 pelican/tests/output/custom_locale/feeds/yeah.rss.xml create mode 100644 pelican/tests/output/custom_locale/index.html create mode 100644 pelican/tests/output/custom_locale/index2.html create mode 100644 pelican/tests/output/custom_locale/index3.html create mode 100644 pelican/tests/output/custom_locale/jinja2_template.html create mode 100644 pelican/tests/output/custom_locale/oh-yeah-fr.html create mode 100644 pelican/tests/output/custom_locale/override/index.html create mode 100644 pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html create mode 100644 pelican/tests/output/custom_locale/pages/this-is-a-test-page.html create mode 100644 pelican/tests/output/custom_locale/pictures/Fat_Cat.jpg create mode 100644 pelican/tests/output/custom_locale/pictures/Sushi.jpg create mode 100644 pelican/tests/output/custom_locale/pictures/Sushi_Macro.jpg create mode 100644 pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html create mode 100644 pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html create mode 100644 pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html create mode 100644 pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html create mode 100644 pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html create mode 100644 pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html create mode 100644 pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html create mode 100644 pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html create mode 100644 pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html create mode 100644 pelican/tests/output/custom_locale/robots.txt create mode 100644 pelican/tests/output/custom_locale/second-article-fr.html create mode 100644 pelican/tests/output/custom_locale/tag/bar.html create mode 100644 pelican/tests/output/custom_locale/tag/baz.html create mode 100644 pelican/tests/output/custom_locale/tag/foo.html create mode 100644 pelican/tests/output/custom_locale/tag/foobar.html create mode 100644 pelican/tests/output/custom_locale/tag/oh.html create mode 100644 pelican/tests/output/custom_locale/tag/yeah.html create mode 100644 pelican/tests/output/custom_locale/tags.html create mode 100644 pelican/tests/output/custom_locale/theme/css/main.css create mode 100644 pelican/tests/output/custom_locale/theme/css/pygment.css create mode 100644 pelican/tests/output/custom_locale/theme/css/reset.css create mode 100644 pelican/tests/output/custom_locale/theme/css/typogrify.css create mode 100644 pelican/tests/output/custom_locale/theme/css/wide.css create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/aboutme.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/bitbucket.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/delicious.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/facebook.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/github.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/gitorious.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/gittip.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/google-groups.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/google-plus.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/hackernews.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/lastfm.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/linkedin.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/reddit.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/rss.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/slideshare.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/speakerdeck.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/stackoverflow.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/twitter.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/vimeo.png create mode 100644 pelican/tests/output/custom_locale/theme/images/icons/youtube.png create mode 100644 samples/pelican_FR.conf.py diff --git a/docs/contribute.rst b/docs/contribute.rst index 57349156..044ef924 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -90,6 +90,8 @@ functional tests. To do so, you can use the following two commands:: $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \ -s samples/pelican.conf.py samples/content/ + $ LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ \ + -s samples/pelican_FR.conf.py samples/content/ $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ samples/content/ diff --git a/pelican/contents.py b/pelican/contents.py index 220db611..297a537b 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -11,13 +11,12 @@ import os import re import sys -from datetime import datetime from pelican import signals from pelican.settings import DEFAULT_CONFIG from pelican.utils import (slugify, truncate_html_words, memoized, strftime, python_2_unicode_compatible, deprecated_attribute, - path_to_url) + path_to_url, SafeDatetime) # Import these so that they're avalaible when you import from pelican.contents. from pelican.urlwrappers import (URLWrapper, Author, Category, Tag) # NOQA @@ -127,7 +126,7 @@ class Content(object): if not hasattr(self, 'status'): self.status = settings['DEFAULT_STATUS'] if not settings['WITH_FUTURE_DATES']: - if hasattr(self, 'date') and self.date > datetime.now(): + if hasattr(self, 'date') and self.date > SafeDatetime.now(): self.status = 'draft' # store the summary metadata if it is set @@ -161,7 +160,7 @@ class Content(object): 'path': path_to_url(path), 'slug': getattr(self, 'slug', ''), 'lang': getattr(self, 'lang', 'en'), - 'date': getattr(self, 'date', datetime.now()), + 'date': getattr(self, 'date', SafeDatetime.now()), 'author': slugify( getattr(self, 'author', ''), slug_substitutions diff --git a/pelican/generators.py b/pelican/generators.py index deb237a2..865cc6f8 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -2,6 +2,7 @@ from __future__ import unicode_literals, print_function import os +import six import math import random import logging @@ -348,31 +349,22 @@ class ArticlesGenerator(CachingGenerator): # format string syntax can be used for specifying the # period archive dates date = archive[0].date - # Under python 2, with non-ascii locales, u"{:%b}".format(date) might raise UnicodeDecodeError - # because u"{:%b}".format(date) will call date.__format__(u"%b"), which will return a byte string - # and not a unicode string. - # eg: - # locale.setlocale(locale.LC_ALL, 'ja_JP.utf8') - # date.__format__(u"%b") == '12\xe6\x9c\x88' # True - try: - save_as = save_as_fmt.format(date=date) - except UnicodeDecodeError: - # Python2 only: - # Let date.__format__() work with byte strings instead of characters since it fails to work with characters - bytes_save_as_fmt = save_as_fmt.encode('utf8') - bytes_save_as = bytes_save_as_fmt.format(date=date) - save_as = unicode(bytes_save_as,'utf8') + save_as = save_as_fmt.format(date=date) context = self.context.copy() if key == period_date_key['year']: context["period"] = (_period,) - elif key == period_date_key['month']: - context["period"] = (_period[0], - calendar.month_name[_period[1]]) else: - context["period"] = (_period[0], - calendar.month_name[_period[1]], - _period[2]) + month_name = calendar.month_name[_period[1]] + if not six.PY3: + month_name = month_name.decode('utf-8') + if key == period_date_key['month']: + context["period"] = (_period[0], + month_name) + else: + context["period"] = (_period[0], + month_name, + _period[2]) write(save_as, template, context, dates=archive, blog=True) diff --git a/pelican/readers.py b/pelican/readers.py index 431e6937..e977b349 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function -import datetime import logging import os import re @@ -28,7 +27,7 @@ except ImportError: from pelican import signals from pelican.contents import Page, Category, Tag, Author -from pelican.utils import get_date, pelican_open, FileStampDataCacher +from pelican.utils import get_date, pelican_open, FileStampDataCacher, SafeDatetime METADATA_PROCESSORS = { @@ -494,7 +493,7 @@ def default_metadata(settings=None, process=None): value = process('category', value) metadata['category'] = value if settings.get('DEFAULT_DATE', None) and settings['DEFAULT_DATE'] != 'fs': - metadata['date'] = datetime.datetime(*settings['DEFAULT_DATE']) + metadata['date'] = SafeDatetime(*settings['DEFAULT_DATE']) return metadata @@ -502,7 +501,7 @@ def path_metadata(full_path, source_path, settings=None): metadata = {} if settings: if settings.get('DEFAULT_DATE', None) == 'fs': - metadata['date'] = datetime.datetime.fromtimestamp( + metadata['date'] = SafeDatetime.fromtimestamp( os.stat(full_path).st_ctime) metadata.update(settings.get('EXTRA_PATH_METADATA', {}).get( source_path, {})) @@ -525,7 +524,7 @@ def parse_path_metadata(source_path, settings=None, process=None): ... process=reader.process_metadata) >>> pprint.pprint(metadata) # doctest: +ELLIPSIS {'category': , - 'date': datetime.datetime(2013, 1, 1, 0, 0), + 'date': SafeDatetime(2013, 1, 1, 0, 0), 'slug': 'my-slug'} """ metadata = {} diff --git a/pelican/tests/output/custom_locale/archives.html b/pelican/tests/output/custom_locale/archives.html new file mode 100644 index 00000000..a7b96336 --- /dev/null +++ b/pelican/tests/output/custom_locale/archives.html @@ -0,0 +1,100 @@ + + + + + Alexis' log + + + + + + + + + +Fork me on GitHub + + +
    +

    Archives for Alexis' log

    + +
    +
    ven. 30 novembre 2012
    +
    FILENAME_METADATA example
    +
    mer. 29 février 2012
    +
    Second article
    +
    mer. 20 avril 2011
    +
    A markdown powered article
    +
    jeu. 17 février 2011
    +
    Article 1
    +
    jeu. 17 février 2011
    +
    Article 2
    +
    jeu. 17 février 2011
    +
    Article 3
    +
    jeu. 02 décembre 2010
    +
    This is a super article !
    +
    mer. 20 octobre 2010
    +
    Oh yeah !
    +
    ven. 15 octobre 2010
    +
    Unbelievable !
    +
    dim. 14 mars 2010
    +
    The baz tag
    +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau.html b/pelican/tests/output/custom_locale/author/alexis-metaireau.html new file mode 100644 index 00000000..b54446c8 --- /dev/null +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau.html @@ -0,0 +1,173 @@ + + + + + Alexis' log - Alexis Métaireau + + + + + + + + + +Fork me on GitHub + + + + +
    +

    Other articles

    +
    +
      + +
    1. + +
    2. + +
    3. +
    +

    + Page 1 / 3 + » +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau2.html b/pelican/tests/output/custom_locale/author/alexis-metaireau2.html new file mode 100644 index 00000000..07020512 --- /dev/null +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau2.html @@ -0,0 +1,187 @@ + + + + + Alexis' log - Alexis Métaireau + + + + + + + + + +Fork me on GitHub + + + +
    +
      +
    1. + +
    2. + +
    3. + +
    4. +
      +

      Oh yeah !

      +
      + +
      +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more +

      There are comments.

      +
    5. +
    +

    + « + Page 2 / 3 + » +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau3.html b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html new file mode 100644 index 00000000..9578e3d6 --- /dev/null +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html @@ -0,0 +1,138 @@ + + + + + Alexis' log - Alexis Métaireau + + + + + + + + + +Fork me on GitHub + + + +
    +
      +
    1. + +
    2. +
    +

    + « + Page 3 / 3 +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/authors.html b/pelican/tests/output/custom_locale/authors.html new file mode 100644 index 00000000..2558c4d8 --- /dev/null +++ b/pelican/tests/output/custom_locale/authors.html @@ -0,0 +1,82 @@ + + + + + Alexis' log - Authors + + + + + + + + + +Fork me on GitHub + + + +
    +

    Authors on Alexis' log

    + +
    + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/categories.html b/pelican/tests/output/custom_locale/categories.html new file mode 100644 index 00000000..17d9de76 --- /dev/null +++ b/pelican/tests/output/custom_locale/categories.html @@ -0,0 +1,80 @@ + + + + + Alexis' log + + + + + + + + + +Fork me on GitHub + + + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/category/bar.html b/pelican/tests/output/custom_locale/category/bar.html new file mode 100644 index 00000000..d9fc6acb --- /dev/null +++ b/pelican/tests/output/custom_locale/category/bar.html @@ -0,0 +1,101 @@ + + + + + Alexis' log - bar + + + + + + + + + +Fork me on GitHub + + + + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/category/cat1.html b/pelican/tests/output/custom_locale/category/cat1.html new file mode 100644 index 00000000..1b09acfe --- /dev/null +++ b/pelican/tests/output/custom_locale/category/cat1.html @@ -0,0 +1,170 @@ + + + + + Alexis' log - cat1 + + + + + + + + + +Fork me on GitHub + + + + +
    +

    Other articles

    +
    +
      + +
    1. + +
    2. + +
    3. +
    +

    + Page 1 / 1 +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/category/misc.html b/pelican/tests/output/custom_locale/category/misc.html new file mode 100644 index 00000000..bcaec248 --- /dev/null +++ b/pelican/tests/output/custom_locale/category/misc.html @@ -0,0 +1,181 @@ + + + + + Alexis' log - misc + + + + + + + + + +Fork me on GitHub + + + + +
    +

    Other articles

    +
    +
      + +
    1. + +
    2. + +
    3. +
    +

    + Page 1 / 1 +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/category/yeah.html b/pelican/tests/output/custom_locale/category/yeah.html new file mode 100644 index 00000000..7f881612 --- /dev/null +++ b/pelican/tests/output/custom_locale/category/yeah.html @@ -0,0 +1,109 @@ + + + + + Alexis' log - yeah + + + + + + + + + +Fork me on GitHub + + + + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/drafts/a-draft-article.html b/pelican/tests/output/custom_locale/drafts/a-draft-article.html new file mode 100644 index 00000000..82fb057b --- /dev/null +++ b/pelican/tests/output/custom_locale/drafts/a-draft-article.html @@ -0,0 +1,100 @@ + + + + + A draft article + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + A draft article

    +
    + +
    +

    This is a draft article, it should live under the /drafts/ folder and not be +listed anywhere else.

    + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml new file mode 100644 index 00000000..202b9f71 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml @@ -0,0 +1,61 @@ + +Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/<p>Article 3</p> +This is a super article !2013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml new file mode 100644 index 00000000..dfb83630 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml @@ -0,0 +1,61 @@ + +Alexis' loghttp://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/Second articlehttp://blog.notmyidea.org/posts/2012/February/29/second-article/<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/foobarbazA markdown powered articlehttp://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/Article 1http://blog.notmyidea.org/posts/2011/February/17/article-1/<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/Article 2http://blog.notmyidea.org/posts/2011/February/17/article-2/<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/Article 3http://blog.notmyidea.org/posts/2011/February/17/article-3/<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/This is a super article !http://blog.notmyidea.org/posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Alexis MétaireauSun, 17 Nov 2013 23:29:00 +0100tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/foobarfoobarOh yeah !http://blog.notmyidea.org/posts/2010/October/20/oh-yeah/<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ohbaryeahUnbelievable !http://blog.notmyidea.org/posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/The baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> +Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/all-en.atom.xml b/pelican/tests/output/custom_locale/feeds/all-en.atom.xml new file mode 100644 index 00000000..3bb10e38 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/all-en.atom.xml @@ -0,0 +1,61 @@ + +Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/<p>Article 3</p> +This is a super article !2013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/all-fr.atom.xml b/pelican/tests/output/custom_locale/feeds/all-fr.atom.xml new file mode 100644 index 00000000..5d58742c --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/all-fr.atom.xml @@ -0,0 +1,4 @@ + +Alexis' loghttp://blog.notmyidea.org/2012-03-02T14:01:01+01:00Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireautag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +Deuxième article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/all.atom.xml b/pelican/tests/output/custom_locale/feeds/all.atom.xml new file mode 100644 index 00000000..f709f2b1 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/all.atom.xml @@ -0,0 +1,63 @@ + +Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p> +Trop bien !2012-03-02T14:01:01+01:00Alexis Métaireautag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.html<p>Et voila du contenu en français</p> +Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/<p>This is some article, in english</p> +Deuxième article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:second-article-fr.html<p>Ceci est un article, en français.</p> +A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/<p>Article 3</p> +This is a super article !2013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/all.rss.xml b/pelican/tests/output/custom_locale/feeds/all.rss.xml new file mode 100644 index 00000000..39fbc240 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/all.rss.xml @@ -0,0 +1,63 @@ + +Alexis' loghttp://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/Trop bien !http://blog.notmyidea.org/oh-yeah-fr.html<p>Et voila du contenu en français</p> +Alexis MétaireauFri, 02 Mar 2012 14:01:01 +0100tag:blog.notmyidea.org,2012-03-02:oh-yeah-fr.htmlSecond articlehttp://blog.notmyidea.org/posts/2012/February/29/second-article/<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/foobarbazDeuxième articlehttp://blog.notmyidea.org/second-article-fr.html<p>Ceci est un article, en français.</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:second-article-fr.htmlfoobarbazA markdown powered articlehttp://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/Article 1http://blog.notmyidea.org/posts/2011/February/17/article-1/<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/Article 2http://blog.notmyidea.org/posts/2011/February/17/article-2/<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/Article 3http://blog.notmyidea.org/posts/2011/February/17/article-3/<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/This is a super article !http://blog.notmyidea.org/posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Alexis MétaireauSun, 17 Nov 2013 23:29:00 +0100tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/foobarfoobarOh yeah !http://blog.notmyidea.org/posts/2010/October/20/oh-yeah/<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ohbaryeahUnbelievable !http://blog.notmyidea.org/posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/The baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> +Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/bar.atom.xml b/pelican/tests/output/custom_locale/feeds/bar.atom.xml new file mode 100644 index 00000000..13a5cde2 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/bar.atom.xml @@ -0,0 +1,8 @@ + +Alexis' loghttp://blog.notmyidea.org/2010-10-20T10:14:00+02:00Oh yeah !2010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/bar.rss.xml b/pelican/tests/output/custom_locale/feeds/bar.rss.xml new file mode 100644 index 00000000..4426eb6a --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/bar.rss.xml @@ -0,0 +1,8 @@ + +Alexis' loghttp://blog.notmyidea.org/Wed, 20 Oct 2010 10:14:00 +0200Oh yeah !http://blog.notmyidea.org/posts/2010/October/20/oh-yeah/<div class="section" id="why-not"> +<h2>Why not ?</h2> +<p>After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +</div> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:posts/2010/October/20/oh-yeah/ohbaryeah \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/cat1.atom.xml b/pelican/tests/output/custom_locale/feeds/cat1.atom.xml new file mode 100644 index 00000000..54d382c4 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/cat1.atom.xml @@ -0,0 +1,7 @@ + +Alexis' loghttp://blog.notmyidea.org/2011-04-20T00:00:00+02:00A markdown powered article2011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/<p>Article 1</p> +Article 22011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/<p>Article 2</p> +Article 32011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/<p>Article 3</p> + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/cat1.rss.xml b/pelican/tests/output/custom_locale/feeds/cat1.rss.xml new file mode 100644 index 00000000..4f3b12f5 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/cat1.rss.xml @@ -0,0 +1,7 @@ + +Alexis' loghttp://blog.notmyidea.org/Wed, 20 Apr 2011 00:00:00 +0200A markdown powered articlehttp://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +<p><a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a root-relative link to unbelievable</a> +<a href="http://blog.notmyidea.org/posts/2010/October/15/unbelievable/">a file-relative link to unbelievable</a></p>Alexis MétaireauWed, 20 Apr 2011 00:00:00 +0200tag:blog.notmyidea.org,2011-04-20:posts/2011/April/20/a-markdown-powered-article/Article 1http://blog.notmyidea.org/posts/2011/February/17/article-1/<p>Article 1</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-1/Article 2http://blog.notmyidea.org/posts/2011/February/17/article-2/<p>Article 2</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-2/Article 3http://blog.notmyidea.org/posts/2011/February/17/article-3/<p>Article 3</p> +Alexis MétaireauThu, 17 Feb 2011 00:00:00 +0100tag:blog.notmyidea.org,2011-02-17:posts/2011/February/17/article-3/ \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/misc.atom.xml b/pelican/tests/output/custom_locale/feeds/misc.atom.xml new file mode 100644 index 00000000..18800485 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/misc.atom.xml @@ -0,0 +1,38 @@ + +Alexis' loghttp://blog.notmyidea.org/2012-11-30T00:00:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p> +Second article2012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +The baz tag2010-03-14T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-03-14:tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/misc.rss.xml b/pelican/tests/output/custom_locale/feeds/misc.rss.xml new file mode 100644 index 00000000..0be49f79 --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/misc.rss.xml @@ -0,0 +1,38 @@ + +Alexis' loghttp://blog.notmyidea.org/Fri, 30 Nov 2012 00:00:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/posts/2012/November/30/filename_metadata-example/<p>Some cool stuff!</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:posts/2012/November/30/filename_metadata-example/Second articlehttp://blog.notmyidea.org/posts/2012/February/29/second-article/<p>This is some article, in english</p> +Alexis MétaireauWed, 29 Feb 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-02-29:posts/2012/February/29/second-article/foobarbazUnbelievable !http://blog.notmyidea.org/posts/2010/October/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +<p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> +<a class="reference external" href="http://blog.notmyidea.org/posts/2011/April/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> +<div class="section" id="testing-sourcecode-directive"> +<h2>Testing sourcecode directive</h2> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table></div> +<div class="section" id="testing-another-case"> +<h2>Testing another case</h2> +<p>This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.</p> +<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre>1</pre></div></td><td class="code"><div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +</td></tr></table><p>Lovely.</p> +</div> +<div class="section" id="testing-more-sourcecode-directives"> +<h2>Testing more sourcecode directives</h2> +<div class="highlight"><pre><span id="foo-8"><a name="foo-8"></a><span class="lineno special"> 8</span> <span class="testingk">def</span> <span class="testingnf">run</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingp">):</span><br></span><span id="foo-9"><a name="foo-9"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">assert_has_content</span><span class="testingp">()</span><br></span><span id="foo-10"><a name="foo-10"></a><span class="lineno special">10</span> <span class="testingk">try</span><span class="testingp">:</span><br></span><span id="foo-11"><a name="foo-11"></a><span class="lineno"> </span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">get_lexer_by_name</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">arguments</span><span class="testingp">[</span><span class="testingmi">0</span><span class="testingp">])</span><br></span><span id="foo-12"><a name="foo-12"></a><span class="lineno special">12</span> <span class="testingk">except</span> <span class="testingne">ValueError</span><span class="testingp">:</span><br></span><span id="foo-13"><a name="foo-13"></a><span class="lineno"> </span> <span class="testingc"># no lexer found - use the text one instead of an exception</span><br></span><span id="foo-14"><a name="foo-14"></a><span class="lineno special">14</span> <span class="testingn">lexer</span> <span class="testingo">=</span> <span class="testingn">TextLexer</span><span class="testingp">()</span><br></span><span id="foo-15"><a name="foo-15"></a><span class="lineno"> </span> <br></span><span id="foo-16"><a name="foo-16"></a><span class="lineno special">16</span> <span class="testingk">if</span> <span class="testingp">(</span><span class="testings">&#39;linenos&#39;</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span> <span class="testingow">and</span><br></span><span id="foo-17"><a name="foo-17"></a><span class="lineno"> </span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingow">not</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;table&#39;</span><span class="testingp">,</span> <span class="testings">&#39;inline&#39;</span><span class="testingp">)):</span><br></span><span id="foo-18"><a name="foo-18"></a><span class="lineno special">18</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testings">&#39;linenos&#39;</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testings">&#39;table&#39;</span><br></span><span id="foo-19"><a name="foo-19"></a><span class="lineno"> </span> <br></span><span id="foo-20"><a name="foo-20"></a><span class="lineno special">20</span> <span class="testingk">for</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingp">(</span><span class="testings">&#39;nowrap&#39;</span><span class="testingp">,</span> <span class="testings">&#39;nobackground&#39;</span><span class="testingp">,</span> <span class="testings">&#39;anchorlinenos&#39;</span><span class="testingp">):</span><br></span><span id="foo-21"><a name="foo-21"></a><span class="lineno"> </span> <span class="testingk">if</span> <span class="testingn">flag</span> <span class="testingow">in</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">:</span><br></span><span id="foo-22"><a name="foo-22"></a><span class="lineno special">22</span> <span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">[</span><span class="testingn">flag</span><span class="testingp">]</span> <span class="testingo">=</span> <span class="testingbp">True</span><br></span><span id="foo-23"><a name="foo-23"></a><span class="lineno"> </span> <br></span><span id="foo-24"><a name="foo-24"></a><span class="lineno special">24</span> <span class="testingc"># noclasses should already default to False, but just in case...</span><br></span><span id="foo-25"><a name="foo-25"></a><span class="lineno"> </span> <span class="testingn">formatter</span> <span class="testingo">=</span> <span class="testingn">HtmlFormatter</span><span class="testingp">(</span><span class="testingn">noclasses</span><span class="testingo">=</span><span class="testingbp">False</span><span class="testingp">,</span> <span class="testingo">**</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">options</span><span class="testingp">)</span><br></span><span id="foo-26"><a name="foo-26"></a><span class="lineno special">26</span> <span class="testingn">parsed</span> <span class="testingo">=</span> <span class="testingn">highlight</span><span class="testingp">(</span><span class="testings">&#39;</span><span class="testingse">\n</span><span class="testings">&#39;</span><span class="testingo">.</span><span class="testingn">join</span><span class="testingp">(</span><span class="testingbp">self</span><span class="testingo">.</span><span class="testingn">content</span><span class="testingp">),</span> <span class="testingn">lexer</span><span class="testingp">,</span> <span class="testingn">formatter</span><span class="testingp">)</span><br></span><span id="foo-27"><a name="foo-27"></a><span class="lineno"> </span> <span class="testingk">return</span> <span class="testingp">[</span><span class="testingn">nodes</span><span class="testingo">.</span><span class="testingn">raw</span><span class="testingp">(</span><span class="testings">&#39;&#39;</span><span class="testingp">,</span> <span class="testingn">parsed</span><span class="testingp">,</span> <span class="testingn">format</span><span class="testingo">=</span><span class="testings">&#39;html&#39;</span><span class="testingp">)]</span><br></span></pre></div> +<p>Lovely.</p> +</div> +<div class="section" id="testing-even-more-sourcecode-directives"> +<h2>Testing even more sourcecode directives</h2> +<span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +<p>Lovely.</p> +</div> +<div class="section" id="testing-overriding-config-defaults"> +<h2>Testing overriding config defaults</h2> +<p>Even if the default is line numbers, we can override it here</p> +<div class="highlight"><pre><span class="n">formatter</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">options</span> <span class="ow">and</span> <span class="n">VARIANTS</span><span class="p">[</span><span class="bp">self</span><span class="o">.</span><span class="n">options</span><span class="o">.</span><span class="n">keys</span><span class="p">()[</span><span class="mi">0</span><span class="p">]]</span> +</pre></div> +<p>Lovely.</p> +</div> +Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:posts/2010/October/15/unbelievable/The baz taghttp://blog.notmyidea.org/tag/baz.html<p>This article overrides the listening of the articles under the <em>baz</em> tag.</p> +Alexis MétaireauSun, 14 Mar 2010 00:00:00 +0100tag:blog.notmyidea.org,2010-03-14:tag/baz.html \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/yeah.atom.xml b/pelican/tests/output/custom_locale/feeds/yeah.atom.xml new file mode 100644 index 00000000..5f7d8c4f --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/yeah.atom.xml @@ -0,0 +1,14 @@ + +Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00This is a super article !2013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/feeds/yeah.rss.xml b/pelican/tests/output/custom_locale/feeds/yeah.rss.xml new file mode 100644 index 00000000..50c5803c --- /dev/null +++ b/pelican/tests/output/custom_locale/feeds/yeah.rss.xml @@ -0,0 +1,14 @@ + +Alexis' loghttp://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100This is a super article !http://blog.notmyidea.org/posts/2010/December/02/this-is-a-super-article/<p>Some content here !</p> +<div class="section" id="this-is-a-simple-title"> +<h2>This is a simple title</h2> +<p>And here comes the cool <a class="reference external" href="http://books.couchdb.org/relax/design-documents/views">stuff</a>.</p> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> +<img alt="alternate text" src="http://blog.notmyidea.org/pictures/Sushi_Macro.jpg" style="width: 600px; height: 450px;" /> +<pre class="literal-block"> +&gt;&gt;&gt; from ipdb import set_trace +&gt;&gt;&gt; set_trace() +</pre> +<p>→ And now try with some utf8 hell: ééé</p> +</div> +Alexis MétaireauSun, 17 Nov 2013 23:29:00 +0100tag:blog.notmyidea.org,2010-12-02:posts/2010/December/02/this-is-a-super-article/foobarfoobar \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/index.html b/pelican/tests/output/custom_locale/index.html new file mode 100644 index 00000000..fd9a82b4 --- /dev/null +++ b/pelican/tests/output/custom_locale/index.html @@ -0,0 +1,173 @@ + + + + + Alexis' log + + + + + + + + + +Fork me on GitHub + + + + +
    +

    Other articles

    +
    +
      + +
    1. + +
    2. + +
    3. +
    +

    + Page 1 / 3 + » +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/index2.html b/pelican/tests/output/custom_locale/index2.html new file mode 100644 index 00000000..f02ba27c --- /dev/null +++ b/pelican/tests/output/custom_locale/index2.html @@ -0,0 +1,187 @@ + + + + + Alexis' log + + + + + + + + + +Fork me on GitHub + + + +
    +
      +
    1. + +
    2. + +
    3. + +
    4. +
      +

      Oh yeah !

      +
      + +
      +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more +

      There are comments.

      +
    5. +
    +

    + « + Page 2 / 3 + » +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/index3.html b/pelican/tests/output/custom_locale/index3.html new file mode 100644 index 00000000..9c7416b6 --- /dev/null +++ b/pelican/tests/output/custom_locale/index3.html @@ -0,0 +1,138 @@ + + + + + Alexis' log + + + + + + + + + +Fork me on GitHub + + + +
    +
      +
    1. + +
    2. +
    +

    + « + Page 3 / 3 +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/jinja2_template.html b/pelican/tests/output/custom_locale/jinja2_template.html new file mode 100644 index 00000000..0eafa913 --- /dev/null +++ b/pelican/tests/output/custom_locale/jinja2_template.html @@ -0,0 +1,77 @@ + + + + + Alexis' log + + + + + + + + + +Fork me on GitHub + + + +Some text + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/oh-yeah-fr.html b/pelican/tests/output/custom_locale/oh-yeah-fr.html new file mode 100644 index 00000000..cdda855d --- /dev/null +++ b/pelican/tests/output/custom_locale/oh-yeah-fr.html @@ -0,0 +1,116 @@ + + + + + Trop bien ! + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + Trop bien !

    +
    + +
    +

    Et voila du contenu en français

    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/override/index.html b/pelican/tests/output/custom_locale/override/index.html new file mode 100644 index 00000000..e84d79fe --- /dev/null +++ b/pelican/tests/output/custom_locale/override/index.html @@ -0,0 +1,81 @@ + + + + + Override url/save_as + + + + + + + + + +Fork me on GitHub + + +
    +

    Override url/save_as

    + +

    Test page which overrides save_as and url so that this page will be generated +at a custom location.

    + +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html b/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html new file mode 100644 index 00000000..dced8107 --- /dev/null +++ b/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html @@ -0,0 +1,81 @@ + + + + + This is a test hidden page + + + + + + + + + +Fork me on GitHub + + +
    +

    This is a test hidden page

    + +

    This is great for things like error(404) pages +Anyone can see this page but it's not linked to anywhere!

    + +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html b/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html new file mode 100644 index 00000000..46ea4fef --- /dev/null +++ b/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html @@ -0,0 +1,81 @@ + + + + + This is a test page + + + + + + + + + +Fork me on GitHub + + +
    +

    This is a test page

    + +

    Just an image.

    +alternate text + +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/pictures/Fat_Cat.jpg b/pelican/tests/output/custom_locale/pictures/Fat_Cat.jpg new file mode 100644 index 0000000000000000000000000000000000000000..d8a96d356be94e782aaf36ba4e47168435b56338 GIT binary patch literal 62675 zcmbTdbwE_j`|y31rMnv>mJVU*QgZ29I;BfMLK-9#1f+Ipq`L)_RwS2_?odDwq@^UR zclGxBeDB};zJEN=GrPll&Tvg!bFP^^d(G^x#b4_HsRm3P27o{yKn?u@er+)6ssy?^ z0f4$XFMtaG03kpE!T|8ll#h<2XeLIdmFP$g0s|m)`a9Btu>PbiXlD4!U1;Y1D}#Y% zVRTtSbc#YpD4HqJ=`=c0VEj|hZ<(wp3;+wAZlj~?Q_Meg;-VWU>&F2Y(Rl~xIFAVc zFe43hn7WoWnp`~{^;`p441~pngnp~=r_6s+RdsDW7O0@Ops)}C6%rPf7DB(pScFBS zMTDiHQUD7&0Dzv4tLH;?Z9oVrCIkQ&=+_^;e*Xa=Ku**@x^`aXl9H3Z@;*Lg18t^c+XaWB%ojXa*tvkpZD~$3Xm3|JUF7Nc=x-|3ote@}GQc zFaUu6<`bhC^Dk4Q8SAeMGn#Rb|Mchg_~HKL-`&Cc%j#&x|0~almJdbZ0KsS-1hRtANk)R82@7MzZm;pjQ=kt{1^W&kB^SZ=*E8c+X2n!doT3o z-b=9vi%N@$NsIomhyPFBZ=3vGRtH`7ce($R=lFY#&ia!N`&%z5TF>8d|FOs4_DzqD z{~1jYAyTw8-9qPR{8o_^k-RV<-@$q4_8q5qNx$o@O}pnowy{@;Ake=$Ju-+a)&7~@}zOZm?@ z7@(~R?_Z2h`A^y3mI^5Rx1QgZVp33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PY&TP`t)&2B+1uRXzufUIlI?iv`(TieZjGeX)>64h{htxNzm(ZK1uvQi)kk zVnzZT3zucUQZzPq0|Nsi1n=#Lyh^&XR_ZvTiU^>Xh?+3DQmj~!zH_-f__J)SmeWNH e6s_{nM>|BT5C{M{2e-KI=yG_A9_Ux}fB)G)VA)at literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/pictures/Sushi.jpg b/pelican/tests/output/custom_locale/pictures/Sushi.jpg new file mode 100644 index 0000000000000000000000000000000000000000..e49e5f0ab53461187c2cf61ebc1f3befdc937aed GIT binary patch literal 28992 zcmbTdbzB@v_u$>Qy99T);1Jwla0YiLxCD0z?j9s)a18`^NbmqbgS!*lg74(s`@GNn zy`TMKcWb7)zFmE)x=wY~>8{f=FY_16bVnP@ll9oXtHWUm11xf!zA}F}O(k2KK|HEAnX81=28p0fqvZ#=B z01`PNj0;JpAQ1=p?|S~oWQ0HiaFBEt5^W-2|Ed!aa)RP-2mlEr?-wMFzyg4braVXn zq^JZT8%Il38!rlV4qkTlKPvoH=0B+{NJ*7~lZ}^+gB{>x=im@vhkSV`IJgA3An*pD zfCKM*i#E&k%-A{yQHYQYXwm z`REXa{fF@(4EK)=8H5p%|8CEp{zLqSAqXJ-!vqjU{zsk;BJY=s060Q)WP>n}|4*Aa z*x8}-|9f4b^Z&jEi4ZxMf0zZraQ|=>L{ap@zuWl{!WjQ>5ri=d|E}jx^{@V6h*|*f z3E?jt|Kvmc!+*LOs_1X|KO)foVwit1{J$9aUyS-M{!<Y4M&;Hl7 ze?!5+4Y}|F?EL@Rygy^|Pua46${j%(_NTndKPd$N+L!rf{~Kg7{5k%g@%U$a6GGyD zdXtMC6Ed2}Avq#{RK$e-Yfc$K7z*>hy#xIZLnHvqf8}Fg{yiG3Ao3LdlA-(;Q~kq# zs;7qVpC0~!unfokFBy)1G3USJ0j&S_IMlxw!2WMOfb(C5`WHk0ixF}E)>j=edXWCb z$hd!({WBtI|6vFMfcSsw{IkpRhEs}*n~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tuYu4 zT!O)X_aB}EsUTeTVSn?731bp42KLkj*l%PKI^Vb>3gRdQOqy&*-u1v!8!063=x}qy V9RVclK)_SR8Zrq#de{_0|JgZd7T*8> literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html b/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html new file mode 100644 index 00000000..ec1007f3 --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html @@ -0,0 +1,129 @@ + + + + + This is a super article ! + + + + + + + + + +Fork me on GitHub + +

    +
    +
    +
    +

    + This is a super article !

    +
    + +
    +

    Some content here !

    +
    +

    This is a simple title

    +

    And here comes the cool stuff.

    +alternate text +alternate text +
    +>>> from ipdb import set_trace
    +>>> set_trace()
    +
    +

    → And now try with some utf8 hell: ééé

    +
    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html b/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html new file mode 100644 index 00000000..cb8ccef5 --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html @@ -0,0 +1,146 @@ + + + + + Unbelievable ! + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + Unbelievable !

    +
    + +
    +

    Or completely awesome. Depends the needs.

    +

    a root-relative link to markdown-article +a file-relative link to markdown-article

    +
    +

    Testing sourcecode directive

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +
    +
    +

    Testing another case

    +

    This will now have a line number in 'custom' since it's the default in +pelican.conf, it will have nothing in default.

    +
    1
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    +
    +
    +

    Testing more sourcecode directives

    +
     8 def run(self):
    self.assert_has_content()
    10 try:
    lexer = get_lexer_by_name(self.arguments[0])
    12 except ValueError:
    # no lexer found - use the text one instead of an exception
    14 lexer = TextLexer()

    16 if ('linenos' in self.options and
    self.options['linenos'] not in ('table', 'inline')):
    18 self.options['linenos'] = 'table'

    20 for flag in ('nowrap', 'nobackground', 'anchorlinenos'):
    if flag in self.options:
    22 self.options[flag] = True

    24 # noclasses should already default to False, but just in case...
    formatter = HtmlFormatter(noclasses=False, **self.options)
    26 parsed = highlight('\n'.join(self.content), lexer, formatter)
    return [nodes.raw('', parsed, format='html')]
    +

    Lovely.

    +
    +
    +

    Testing even more sourcecode directives

    +formatter = self.options and VARIANTS[self.options.keys()[0]] +

    Lovely.

    +
    +
    +

    Testing overriding config defaults

    +

    Even if the default is line numbers, we can override it here

    +
    formatter = self.options and VARIANTS[self.options.keys()[0]]
    +
    +

    Lovely.

    +
    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html b/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html new file mode 100644 index 00000000..c42bce5d --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html @@ -0,0 +1,121 @@ + + + + + Oh yeah ! + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + Oh yeah !

    +
    + +
    +
    +

    Why not ?

    +

    After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

    +alternate text +
    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html b/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html new file mode 100644 index 00000000..49cc6078 --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html @@ -0,0 +1,115 @@ + + + + + A markdown powered article + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + A markdown powered article

    +
    + +
    +

    You're mutually oblivious.

    +

    a root-relative link to unbelievable +a file-relative link to unbelievable

    +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html new file mode 100644 index 00000000..8029e585 --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html @@ -0,0 +1,114 @@ + + + + + Article 1 + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + Article 1

    +
    + +
    +

    Article 1

    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html new file mode 100644 index 00000000..ca6aaaf3 --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html @@ -0,0 +1,114 @@ + + + + + Article 2 + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + Article 2

    +
    + +
    +

    Article 2

    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html new file mode 100644 index 00000000..4f255f4f --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html @@ -0,0 +1,114 @@ + + + + + Article 3 + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + Article 3

    +
    + +
    +

    Article 3

    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html b/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html new file mode 100644 index 00000000..46b07717 --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html @@ -0,0 +1,116 @@ + + + + + Second article + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + Second article

    +
    + +
    +

    This is some article, in english

    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html b/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html new file mode 100644 index 00000000..0d021cde --- /dev/null +++ b/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html @@ -0,0 +1,114 @@ + + + + + FILENAME_METADATA example + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + FILENAME_METADATA example

    +
    + +
    +

    Some cool stuff!

    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/robots.txt b/pelican/tests/output/custom_locale/robots.txt new file mode 100644 index 00000000..19a6e299 --- /dev/null +++ b/pelican/tests/output/custom_locale/robots.txt @@ -0,0 +1,2 @@ +User-agent: * +Disallow: /pictures diff --git a/pelican/tests/output/custom_locale/second-article-fr.html b/pelican/tests/output/custom_locale/second-article-fr.html new file mode 100644 index 00000000..2798c94b --- /dev/null +++ b/pelican/tests/output/custom_locale/second-article-fr.html @@ -0,0 +1,116 @@ + + + + + Deuxième article + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + Deuxième article

    +
    + +
    +

    Ceci est un article, en français.

    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/tag/bar.html b/pelican/tests/output/custom_locale/tag/bar.html new file mode 100644 index 00000000..8a65a834 --- /dev/null +++ b/pelican/tests/output/custom_locale/tag/bar.html @@ -0,0 +1,160 @@ + + + + + Alexis' log - bar + + + + + + + + + +Fork me on GitHub + + + + +
    +

    Other articles

    +
    +
      + +
    1. + +
    2. +
      +

      Oh yeah !

      +
      + +
      +
      +

      Why not ?

      +

      After all, why not ? It's pretty simple to do it, and it will allow me to write my blogposts in rst ! +YEAH !

      +alternate text +
      + + read more +

      There are comments.

      +
    3. +
    +

    + Page 1 / 1 +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/tag/baz.html b/pelican/tests/output/custom_locale/tag/baz.html new file mode 100644 index 00000000..52467abb --- /dev/null +++ b/pelican/tests/output/custom_locale/tag/baz.html @@ -0,0 +1,114 @@ + + + + + The baz tag + + + + + + + + + +Fork me on GitHub + + +
    +
    +
    +

    + The baz tag

    +
    + +
    +

    This article overrides the listening of the articles under the baz tag.

    + +
    +
    +

    Comments !

    +
    + + +
    + +
    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/tag/foo.html b/pelican/tests/output/custom_locale/tag/foo.html new file mode 100644 index 00000000..87cb4ec5 --- /dev/null +++ b/pelican/tests/output/custom_locale/tag/foo.html @@ -0,0 +1,130 @@ + + + + + Alexis' log - foo + + + + + + + + + +Fork me on GitHub + + + + +
    +

    Other articles

    +
    +
      + +
    1. +
    +

    + Page 1 / 1 +

    +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/tag/foobar.html b/pelican/tests/output/custom_locale/tag/foobar.html new file mode 100644 index 00000000..0e5414b0 --- /dev/null +++ b/pelican/tests/output/custom_locale/tag/foobar.html @@ -0,0 +1,109 @@ + + + + + Alexis' log - foobar + + + + + + + + + +Fork me on GitHub + + + + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/tag/oh.html b/pelican/tests/output/custom_locale/tag/oh.html new file mode 100644 index 00000000..21c8e352 --- /dev/null +++ b/pelican/tests/output/custom_locale/tag/oh.html @@ -0,0 +1,80 @@ + + + + + Oh Oh Oh + + + + + + + + + +Fork me on GitHub + + +
    +

    Oh Oh Oh

    + +

    This page overrides the listening of the articles under the oh tag.

    + +
    +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/tag/yeah.html b/pelican/tests/output/custom_locale/tag/yeah.html new file mode 100644 index 00000000..a8fe6f51 --- /dev/null +++ b/pelican/tests/output/custom_locale/tag/yeah.html @@ -0,0 +1,101 @@ + + + + + Alexis' log - yeah + + + + + + + + + +Fork me on GitHub + + + + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/tags.html b/pelican/tests/output/custom_locale/tags.html new file mode 100644 index 00000000..0da0d291 --- /dev/null +++ b/pelican/tests/output/custom_locale/tags.html @@ -0,0 +1,87 @@ + + + + + Alexis' log - Tags + + + + + + + + + +Fork me on GitHub + + + +
    +

    Tags for Alexis' log

    + +
    + +
    +
    +

    blogroll

    + +
    + +
    + + + + + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/theme/css/main.css b/pelican/tests/output/custom_locale/theme/css/main.css new file mode 100644 index 00000000..2efb518d --- /dev/null +++ b/pelican/tests/output/custom_locale/theme/css/main.css @@ -0,0 +1,451 @@ +/* + Name: Smashing HTML5 + Date: July 2009 + Description: Sample layout for HTML5 and CSS3 goodness. + Version: 1.0 + License: MIT + Licensed by: Smashing Media GmbH + Original author: Enrique Ramírez +*/ + +/* Imports */ +@import url("reset.css"); +@import url("pygment.css"); +@import url("typogrify.css"); +@import url(//fonts.googleapis.com/css?family=Yanone+Kaffeesatz&subset=latin); + +/***** Global *****/ +/* Body */ +body { + background: #F5F4EF; + color: #000305; + font-size: 87.5%; /* Base font size: 14px */ + font-family: 'Trebuchet MS', Trebuchet, 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif; + line-height: 1.429; + margin: 0; + padding: 0; + text-align: left; +} + +/* Headings */ +h1 {font-size: 2em } +h2 {font-size: 1.571em} /* 22px */ +h3 {font-size: 1.429em} /* 20px */ +h4 {font-size: 1.286em} /* 18px */ +h5 {font-size: 1.143em} /* 16px */ +h6 {font-size: 1em} /* 14px */ + +h1, h2, h3, h4, h5, h6 { + font-weight: 400; + line-height: 1.1; + margin-bottom: .8em; + font-family: 'Yanone Kaffeesatz', arial, serif; +} + +h3, h4, h5, h6 { margin-top: .8em; } + +hr { border: 2px solid #EEEEEE; } + +/* Anchors */ +a {outline: 0;} +a img {border: 0px; text-decoration: none;} +a:link, a:visited { + color: #C74350; + padding: 0 1px; + text-decoration: underline; +} +a:hover, a:active { + background-color: #C74350; + color: #fff; + text-decoration: none; + text-shadow: 1px 1px 1px #333; +} + +h1 a:hover { + background-color: inherit +} + +/* Paragraphs */ +div.line-block, +p { margin-top: 1em; + margin-bottom: 1em;} + +strong, b {font-weight: bold;} +em, i {font-style: italic;} + +/* Lists */ +ul { + list-style: outside disc; + margin: 0em 0 0 1.5em; +} + +ol { + list-style: outside decimal; + margin: 0em 0 0 1.5em; +} + +li { margin-top: 0.5em;} + +.post-info { + float:right; + margin:10px; + padding:5px; +} + +.post-info p{ + margin-top: 1px; + margin-bottom: 1px; +} + +.readmore { float: right } + +dl {margin: 0 0 1.5em 0;} +dt {font-weight: bold;} +dd {margin-left: 1.5em;} + +pre{background-color: rgb(238, 238, 238); padding: 10px; margin: 10px; overflow: auto;} + +/* Quotes */ +blockquote { + margin: 20px; + font-style: italic; +} +cite {} + +q {} + +div.note { + float: right; + margin: 5px; + font-size: 85%; + max-width: 300px; +} + +/* Tables */ +table {margin: .5em auto 1.5em auto; width: 98%;} + + /* Thead */ + thead th {padding: .5em .4em; text-align: left;} + thead td {} + + /* Tbody */ + tbody td {padding: .5em .4em;} + tbody th {} + + tbody .alt td {} + tbody .alt th {} + + /* Tfoot */ + tfoot th {} + tfoot td {} + +/* HTML5 tags */ +header, section, footer, +aside, nav, article, figure { + display: block; +} + +/***** Layout *****/ +.body {clear: both; margin: 0 auto; width: 800px;} +img.right, figure.right {float: right; margin: 0 0 2em 2em;} +img.left, figure.left {float: left; margin: 0 2em 2em 0;} + +/* + Header +*****************/ +#banner { + margin: 0 auto; + padding: 2.5em 0 0 0; +} + + /* Banner */ + #banner h1 {font-size: 3.571em; line-height: 0;} + #banner h1 a:link, #banner h1 a:visited { + color: #000305; + display: block; + font-weight: bold; + margin: 0 0 .6em .2em; + text-decoration: none; + } + #banner h1 a:hover, #banner h1 a:active { + background: none; + color: #C74350; + text-shadow: none; + } + + #banner h1 strong {font-size: 0.36em; font-weight: normal;} + + /* Main Nav */ + #banner nav { + background: #000305; + font-size: 1.143em; + height: 40px; + line-height: 30px; + margin: 0 auto 2em auto; + padding: 0; + text-align: center; + width: 800px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + + #banner nav ul {list-style: none; margin: 0 auto; width: 800px;} + #banner nav li {float: left; display: inline; margin: 0;} + + #banner nav a:link, #banner nav a:visited { + color: #fff; + display: inline-block; + height: 30px; + padding: 5px 1.5em; + text-decoration: none; + } + #banner nav a:hover, #banner nav a:active, + #banner nav .active a:link, #banner nav .active a:visited { + background: #C74451; + color: #fff; + text-shadow: none !important; + } + + #banner nav li:first-child a { + border-top-left-radius: 5px; + -moz-border-radius-topleft: 5px; + -webkit-border-top-left-radius: 5px; + + border-bottom-left-radius: 5px; + -moz-border-radius-bottomleft: 5px; + -webkit-border-bottom-left-radius: 5px; + } + +/* + Featured +*****************/ +#featured { + background: #fff; + margin-bottom: 2em; + overflow: hidden; + padding: 20px; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +#featured figure { + border: 2px solid #eee; + float: right; + margin: 0.786em 2em 0 5em; + width: 248px; +} +#featured figure img {display: block; float: right;} + +#featured h2 {color: #C74451; font-size: 1.714em; margin-bottom: 0.333em;} +#featured h3 {font-size: 1.429em; margin-bottom: .5em;} + +#featured h3 a:link, #featured h3 a:visited {color: #000305; text-decoration: none;} +#featured h3 a:hover, #featured h3 a:active {color: #fff;} + +/* + Body +*****************/ +#content { + background: #fff; + margin-bottom: 2em; + overflow: hidden; + padding: 20px 20px; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +/* + Extras +*****************/ +#extras {margin: 0 auto 3em auto; overflow: hidden;} + +#extras ul {list-style: none; margin: 0;} +#extras li {border-bottom: 1px solid #fff;} +#extras h2 { + color: #C74350; + font-size: 1.429em; + margin-bottom: .25em; + padding: 0 3px; +} + +#extras a:link, #extras a:visited { + color: #444; + display: block; + border-bottom: 1px solid #F4E3E3; + text-decoration: none; + padding: .3em .25em; +} + +#extras a:hover, #extras a:active {color: #fff;} + + /* Blogroll */ + #extras .blogroll { + float: left; + width: 615px; + } + + #extras .blogroll li {float: left; margin: 0 20px 0 0; width: 185px;} + + /* Social */ + #extras .social { + float: right; + width: 175px; + } + + #extras div[class='social'] a { + background-repeat: no-repeat; + background-position: 3px 6px; + padding-left: 25px; + } + + /* Icons */ + .social a[href*='about.me'] {background-image: url('../images/icons/aboutme.png');} + .social a[href*='bitbucket.org'] {background-image: url('../images/icons/bitbucket.png');} + .social a[href*='delicious.com'] {background-image: url('../images/icons/delicious.png');} + .social a[href*='digg.com'] {background-image: url('../images/icons/digg.png');} + .social a[href*='facebook.com'] {background-image: url('../images/icons/facebook.png');} + .social a[href*='gitorious.org'] {background-image: url('../images/icons/gitorious.png');} + .social a[href*='github.com'], + .social a[href*='git.io'] { + background-image: url('../images/icons/github.png'); + background-size: 16px 16px; + } + .social a[href*='gittip.com'] {background-image: url('../images/icons/gittip.png');} + .social a[href*='plus.google.com'] {background-image: url('../images/icons/google-plus.png');} + .social a[href*='groups.google.com'] {background-image: url('../images/icons/google-groups.png');} + .social a[href*='news.ycombinator.com'], + .social a[href*='hackernewsers.com'] {background-image: url('../images/icons/hackernews.png');} + .social a[href*='last.fm'], .social a[href*='lastfm.'] {background-image: url('../images/icons/lastfm.png');} + .social a[href*='linkedin.com'] {background-image: url('../images/icons/linkedin.png');} + .social a[href*='reddit.com'] {background-image: url('../images/icons/reddit.png');} + .social a[type$='atom+xml'], .social a[type$='rss+xml'] {background-image: url('../images/icons/rss.png');} + .social a[href*='slideshare.net'] {background-image: url('../images/icons/slideshare.png');} + .social a[href*='speakerdeck.com'] {background-image: url('../images/icons/speakerdeck.png');} + .social a[href*='stackoverflow.com'] {background-image: url('../images/icons/stackoverflow.png');} + .social a[href*='twitter.com'] {background-image: url('../images/icons/twitter.png');} + .social a[href*='vimeo.com'] {background-image: url('../images/icons/vimeo.png');} + .social a[href*='youtube.com'] {background-image: url('../images/icons/youtube.png');} + +/* + About +*****************/ +#about { + background: #fff; + font-style: normal; + margin-bottom: 2em; + overflow: hidden; + padding: 20px; + text-align: left; + width: 760px; + + border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; +} + +#about .primary {float: left; width: 165px;} +#about .primary strong {color: #C64350; display: block; font-size: 1.286em;} +#about .photo {float: left; margin: 5px 20px;} + +#about .url:link, #about .url:visited {text-decoration: none;} + +#about .bio {float: right; width: 500px;} + +/* + Footer +*****************/ +#contentinfo {padding-bottom: 2em; text-align: right;} + +/***** Sections *****/ +/* Blog */ +.hentry { + display: block; + clear: both; + border-bottom: 1px solid #eee; + padding: 1.5em 0; +} +li:last-child .hentry, #content > .hentry {border: 0; margin: 0;} +#content > .hentry {padding: 1em 0;} +.hentry img{display : none ;} +.entry-title {font-size: 3em; margin-bottom: 10px; margin-top: 0;} +.entry-title a:link, .entry-title a:visited {text-decoration: none; color: #333;} +.entry-title a:visited {background-color: #fff;} + +.hentry .post-info * {font-style: normal;} + + /* Content */ + .hentry footer {margin-bottom: 2em;} + .hentry footer address {display: inline;} + #posts-list footer address {display: block;} + + /* Blog Index */ + #posts-list {list-style: none; margin: 0;} + #posts-list .hentry {padding-left: 10px; position: relative;} + + #posts-list footer { + left: 10px; + position: relative; + float: left; + top: 0.5em; + width: 190px; + } + + /* About the Author */ + #about-author { + background: #f9f9f9; + clear: both; + font-style: normal; + margin: 2em 0; + padding: 10px 20px 15px 20px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + + #about-author strong { + color: #C64350; + clear: both; + display: block; + font-size: 1.429em; + } + + #about-author .photo {border: 1px solid #ddd; float: left; margin: 5px 1em 0 0;} + + /* Comments */ + #comments-list {list-style: none; margin: 0 1em;} + #comments-list blockquote { + background: #f8f8f8; + clear: both; + font-style: normal; + margin: 0; + padding: 15px 20px; + + border-radius: 5px; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; + } + #comments-list footer {color: #888; padding: .5em 1em 0 0; text-align: right;} + + #comments-list li:nth-child(2n) blockquote {background: #F5f5f5;} + + /* Add a Comment */ + #add-comment label {clear: left; float: left; text-align: left; width: 150px;} + #add-comment input[type='text'], + #add-comment input[type='email'], + #add-comment input[type='url'] {float: left; width: 200px;} + + #add-comment textarea {float: left; height: 150px; width: 495px;} + + #add-comment p.req {clear: both; margin: 0 .5em 1em 0; text-align: right;} + + #add-comment input[type='submit'] {float: right; margin: 0 .5em;} + #add-comment * {margin-bottom: .5em;} diff --git a/pelican/tests/output/custom_locale/theme/css/pygment.css b/pelican/tests/output/custom_locale/theme/css/pygment.css new file mode 100644 index 00000000..fdd056f6 --- /dev/null +++ b/pelican/tests/output/custom_locale/theme/css/pygment.css @@ -0,0 +1,205 @@ +.hll { +background-color:#eee; +} +.c { +color:#408090; +font-style:italic; +} +.err { +border:1px solid #FF0000; +} +.k { +color:#007020; +font-weight:bold; +} +.o { +color:#666666; +} +.cm { +color:#408090; +font-style:italic; +} +.cp { +color:#007020; +} +.c1 { +color:#408090; +font-style:italic; +} +.cs { +background-color:#FFF0F0; +color:#408090; +} +.gd { +color:#A00000; +} +.ge { +font-style:italic; +} +.gr { +color:#FF0000; +} +.gh { +color:#000080; +font-weight:bold; +} +.gi { +color:#00A000; +} +.go { +color:#303030; +} +.gp { +color:#C65D09; +font-weight:bold; +} +.gs { +font-weight:bold; +} +.gu { +color:#800080; +font-weight:bold; +} +.gt { +color:#0040D0; +} +.kc { +color:#007020; +font-weight:bold; +} +.kd { +color:#007020; +font-weight:bold; +} +.kn { +color:#007020; +font-weight:bold; +} +.kp { +color:#007020; +} +.kr { +color:#007020; +font-weight:bold; +} +.kt { +color:#902000; +} +.m { +color:#208050; +} +.s { +color:#4070A0; +} +.na { +color:#4070A0; +} +.nb { +color:#007020; +} +.nc { +color:#0E84B5; +font-weight:bold; +} +.no { +color:#60ADD5; +} +.nd { +color:#555555; +font-weight:bold; +} +.ni { +color:#D55537; +font-weight:bold; +} +.ne { +color:#007020; +} +.nf { +color:#06287E; +} +.nl { +color:#002070; +font-weight:bold; +} +.nn { +color:#0E84B5; +font-weight:bold; +} +.nt { +color:#062873; +font-weight:bold; +} +.nv { +color:#BB60D5; +} +.ow { +color:#007020; +font-weight:bold; +} +.w { +color:#BBBBBB; +} +.mf { +color:#208050; +} +.mh { +color:#208050; +} +.mi { +color:#208050; +} +.mo { +color:#208050; +} +.sb { +color:#4070A0; +} +.sc { +color:#4070A0; +} +.sd { +color:#4070A0; +font-style:italic; +} +.s2 { +color:#4070A0; +} +.se { +color:#4070A0; +font-weight:bold; +} +.sh { +color:#4070A0; +} +.si { +color:#70A0D0; +font-style:italic; +} +.sx { +color:#C65D09; +} +.sr { +color:#235388; +} +.s1 { +color:#4070A0; +} +.ss { +color:#517918; +} +.bp { +color:#007020; +} +.vc { +color:#BB60D5; +} +.vg { +color:#BB60D5; +} +.vi { +color:#BB60D5; +} +.il { +color:#208050; +} diff --git a/pelican/tests/output/custom_locale/theme/css/reset.css b/pelican/tests/output/custom_locale/theme/css/reset.css new file mode 100644 index 00000000..1e217566 --- /dev/null +++ b/pelican/tests/output/custom_locale/theme/css/reset.css @@ -0,0 +1,52 @@ +/* + Name: Reset Stylesheet + Description: Resets browser's default CSS + Author: Eric Meyer + Author URI: http://meyerweb.com/eric/tools/css/reset/ +*/ + +/* v1.0 | 20080212 */ +html, body, div, span, applet, object, iframe, +h1, h2, h3, h4, h5, h6, p, blockquote, pre, +a, abbr, acronym, address, big, cite, code, +del, dfn, em, font, img, ins, kbd, q, s, samp, +small, strike, strong, sub, sup, tt, var, +b, u, i, center, +dl, dt, dd, ol, ul, li, +fieldset, form, label, legend, +table, caption, tbody, tfoot, thead, tr, th, td { + background: transparent; + border: 0; + font-size: 100%; + margin: 0; + outline: 0; + padding: 0; + vertical-align: baseline; +} + +body {line-height: 1;} + +ol, ul {list-style: none;} + +blockquote, q {quotes: none;} + +blockquote:before, blockquote:after, +q:before, q:after { + content: ''; + content: none; +} + +/* remember to define focus styles! */ +:focus { + outline: 0; +} + +/* remember to highlight inserts somehow! */ +ins {text-decoration: none;} +del {text-decoration: line-through;} + +/* tables still need 'cellspacing="0"' in the markup */ +table { + border-collapse: collapse; + border-spacing: 0; +} \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/theme/css/typogrify.css b/pelican/tests/output/custom_locale/theme/css/typogrify.css new file mode 100644 index 00000000..c9b34dc8 --- /dev/null +++ b/pelican/tests/output/custom_locale/theme/css/typogrify.css @@ -0,0 +1,3 @@ +.caps {font-size:.92em;} +.amp {color:#666; font-size:1.05em;font-family:"Warnock Pro", "Goudy Old Style","Palatino","Book Antiqua",serif; font-style:italic;} +.dquo {margin-left:-.38em;} diff --git a/pelican/tests/output/custom_locale/theme/css/wide.css b/pelican/tests/output/custom_locale/theme/css/wide.css new file mode 100644 index 00000000..88fd59ce --- /dev/null +++ b/pelican/tests/output/custom_locale/theme/css/wide.css @@ -0,0 +1,48 @@ +@import url("main.css"); + +body { + font:1.3em/1.3 "Hoefler Text","Georgia",Georgia,serif,sans-serif; +} + +.post-info{ + display: none; +} + +#banner nav { + display: none; + -moz-border-radius: 0px; + margin-bottom: 20px; + overflow: hidden; + font-size: 1em; + background: #F5F4EF; +} + +#banner nav ul{ + padding-right: 50px; +} + +#banner nav li{ + float: right; + color: #000; +} + +#banner nav li a { + color: #000; +} + +#banner h1 { + margin-bottom: -18px; +} + +#featured, #extras { + padding: 50px; +} + +#featured { + padding-top: 20px; +} + +#extras { + padding-top: 0px; + padding-bottom: 0px; +} diff --git a/pelican/tests/output/custom_locale/theme/images/icons/aboutme.png b/pelican/tests/output/custom_locale/theme/images/icons/aboutme.png new file mode 100644 index 0000000000000000000000000000000000000000..9609df3bd9d766cd4b827fb0a8339b700c1abf24 GIT binary patch literal 751 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%9|WRD45bDP46hOx7_4S6Fo+k-*%fF5)Ta>O z6XFU~z-^brZ51PwI9(_Kh^7g}PZf%vA`~}SFm|F~be~{E7r$Q>mqnyt>;%CWAnF&0 z>J^CU7KrHN4{PNQZsheU=5fy8Gz;Yisssv#ckqX`@rAbXg*5X8HSz`4@%dHr`jqpy z=5RZtaF_)12GsKU*YNsP@%UEo0L8sad4MK(6mq-eal2-7IizygC9)g&bNiP6KWohG zS-|Cz#pRUFX_v@p6U%1c!{t%H>ygjnp2z8w&f}cUVI9k18Od!O&8Fwc>5|Q96~*D0 z#%UhPVH?k3;LWPz#^I34reVi!8_%X{#by@DrewmR<-%&@&nzOxqVB+|@6E{0!>ne@ zqU+A2Y{jhQ!lY=;OkH}&m?E%Ja zC$sHaw(BO9N_QK10Mpk${dC;$Iv-Sgs1 z>}GlM0tE(@$Z4WS9~SJov+DT=kEZa@(E0WcEcx0FsV`5Db6NC!V}woNM4#AY#y4|V zcGfJc2;H@B=ic4*7ff{9i&|5ruCcY7__a#1S1tN{P32SRuV!D_tlt0mk+S{xzkezF zn-7Y&EBC3-DcWUz;LL;X@g_ZzKBs5>H{b4a!=6dHduc-B)u;`Jo`r8<+{W~Vq2`0N zaE8$A3qX&kmbgZgq$HN4S|t~y0x1R~14Cn717lr7(-1=oD?>9YBLiInb1MS_`T5Fb hC>nC}Q!>*kF*O*PK{PbaT?tCT44$rjF6*2UngApI;B){0 literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/bitbucket.png b/pelican/tests/output/custom_locale/theme/images/icons/bitbucket.png new file mode 100644 index 0000000000000000000000000000000000000000..d05ba1610eab6ec3f9a4dcae689d4d88bda5433f GIT binary patch literal 3714 zcmZWr2T&8t)=eNvZ_=a)7$GPn0YsGE2?3PQlwJa%HzATJhF%1MbZG)oL=h=U6a+(& zE=cHzNRuvIddbI+e*bgc%-fl}d-u+{=bpQ>JF_v!TW}_NUU~okz=Y7%GCo~de;X~; z>71D4DhB}2tGj7xA`zOJLP$R!XE#qY0HDj1^8{;ZGRhTACS51>o&yVsZ1X;#6Y5vg z;tus0tY*%hOnKlC9(O^ey4u8spVsdn$dSujP9Y0bFKpuyIK4Hv(A+q`A9Ba!>*5}x}TK1^UvjUmTfsND7&LH@{ z7S-S}NjWp~rEXi*?iw`2scuZ70SWORJ_$|&U)K~q3!v8?l2ZzTaL-YtnpCy&$ee&a zZ>L?6iISG#%BL%M4W4PK@Z5bdFJ9M~kq(*7=e6kJ`6!!9s6$R5}gB2zAf z4{6XOQ$!YEZtwEI!2VMMfD}ijUH1Yc-!n!=n}cU9<`)%!Hnm0mqaSnJfxK%j09WiX z8w-j-po-Z>GTi1CJDd+Ut4t11(&DMjH>V%r49MF=#>Z0JAr(GPw1FZPUYV{*t7ZJF zs}{rat_KaHlLA2|6y=TwM`oLl6>_dRA=hHkbLBOR#0A(Dw#>dzRi9=CAbOouo11=Z zxGn_vbp}A3c)BGJG(;t}U0To}oev}vH^SL2PelN3Y?dY~*F}G^y zB?RYHwDw%_i(-AP?ruirbg~m=kM(4xQQq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3K#P z{X@0zRuQsy$+N ziSCoLJU{Z$nQy4A4Y5UJ07$5FA~qL2%Q+cLaqDU?Lz3?=BC5;Nk6BbTmmceEaM>-Z zi>O&-dSE=%ex;vcvCOk{*JQ5^_4M z4lW7%l9IqY(z7pV(?I@@8=KPFO82)O{VDI18-*d-k$YmI^XiuPs_LuFw<^ZcD}yP5 c*NrbeloN*74g`U%%F6r~k%+>C^#XapzmV0H-2eap literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/gitorious.png b/pelican/tests/output/custom_locale/theme/images/icons/gitorious.png new file mode 100644 index 0000000000000000000000000000000000000000..3eeb3ecec36a73ff505e04ecdecbcc4792ef6786 GIT binary patch literal 227 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!O@L2`D?^o)dRwqYcev@q#DMvQ z*(*AHH`kW0om8=NO8&uVRmbKn*uQ@5(H+Zf?%R0x*ww37FTJ_{>eZ{eAD{pK|9`68 zWgnn9NuDl_ArhBs&l(CfDDW^GWLD*36#n?Xe(OZZj60uZDW6tS-s!tZ;qA;Vf>oNe zoO+M!7w(Q%nqK|iN%H(B6U8~-_(gR#lieQ**`4zb(6ROF5mHl4iMd b=se=)bK`s~y3?}Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyq( z0|^AkZL;YA00C!7L_t(I%VS`Gf&_0HFrDaQqmtllJp)MJ0^(m#dOmnQe`Ts~~BcM&z2u(nCq_gq= z7&lY6AuyMK{funGm2)TmfBF3B|J(^}V8h})E&un_7XJV6?(P5kw{QH<2ysPrkqQGe zaQ=a8*|2Qhe-QZh?;n_+)zkF9r6dC`2Exbo?ff4HG!&|51_Ly-!Oq;YV!?kH04e_c z`xn?|n1LYr#DU#F11w-JxWxdCCa^$xYWRObptr6V*$cl=42W?z`+xTMA)r;58bP){ zesK4Hl#4Nj0k@C?G1=e#|F54v;Lb)4le}mj^k}^W4@6{%>dY9FfCGV^+9H&wMGiz2 zjKtz?1=auqi>CG<2OMfNq9-I62F3rB_Uiwu=1l{q2lUhkPe>?9*&EFzURJO;$Dfob d%1o4IX8>>N|HqM7x0V0^002ovPDHLkV1m@;(I5Z- literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/google-groups.png b/pelican/tests/output/custom_locale/theme/images/icons/google-groups.png new file mode 100644 index 0000000000000000000000000000000000000000..5de15e68f4d1e4176b46fe6346d42f53e3296b21 GIT binary patch literal 803 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%9|WRD45bDP46hOx7_4S6Fo+k-*%fF5)Mpyt z6XFU~@c;jRouXIDNvA)3c>3}ElMnA6zkmDa-J1t*U*CKC>h7DDcV4}?_43)x7td}y ze|qiNlPk|2Uv}&NGS4Ioi}&t+__Wd%$cHF^5*9C6Zh|& zS-fcGqD3=xieDc*uvxqCB`~XH4>TcVYa`q+>QZfU%sx2Z(n*wUnoNHS?EYjGdv*%IzuiFv_(s)h|m2&VRzopr01MEB^#A|> literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/google-plus.png b/pelican/tests/output/custom_locale/theme/images/icons/google-plus.png new file mode 100644 index 0000000000000000000000000000000000000000..3c6b74324031611f20c0a3810131aa74fd0a5a9f GIT binary patch literal 527 zcmV+q0`UEbP)ZK z>upIAVz}dFal_O6CT?`r$qOAn;FBaOK-k!D!Jidayc;Y>7GYGxnGBxue+IChM|)V`ar=`j`~3M zC07%M|NqZF^fS8TVssIRJYwIy1j>GXU1E8{UJs6dLU1-v!-3nb2Irih=+?6PKKJ@8lF5#&^v9fcghZg&b90USur#Ch_yBx0YzYJ9ftpZ|9@Mbb;3sH7#Llc zapC{3OLv2zTp&7Rr3KUgB!TRsHrfndzX7?Q-YzOS8|-?va>A!K_nuYT9<U;^giL<|Q^RJR%`Z!y$8yYa>Upa1{=xci{g2`qvgF`RFk`e^@wXB(G2 zShMW$$p`;HLHGV;SLhaf#f_+F1DIs^y0_<$oBBFk`Sl>Ab*Ovm_g^4AcawG2Lj|D- zqK4swiTo;US!A@iaP1FZz%33(6Ney%eY$dMwPn_zpvZ?`|G(*ST!StSLI9gPlb*yp RBR2p5002ovPDHLkV1g3B{|5j7 literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/hackernews.png b/pelican/tests/output/custom_locale/theme/images/icons/hackernews.png new file mode 100644 index 0000000000000000000000000000000000000000..fc7a82d4d68068d5fb032885b93e670c385ae1b4 GIT binary patch literal 3273 zcmZWrXHXN`5>6oWu5?f$LJ)-nX$lfLgeVF~ksvLhcccYGs+0=^=>||hdXu7{)X=MN ziAYxgBZS^TI`Yu_o^xm3nb~vp?0oy}w>#&@iPF7?V4~-x2LJ#}NG)~eW;A{f`Xfb6x#~SEQa7GddHwYik34(=pcpuY&Ki$&e z0O>^`gLNq)!XQ5CRGRE;qDIyREkH!1pp^zY!_!dA7~K}DZda?Gx(0a?=R~(&CbK=2 ze$tJao|vy0o3L9C7^?^99*2V3yo`at(%HuBYs;;s=g#+a>``#D0-240EhJl85Mp1Q zV)&QZ;mZg9ckSd=YEbg?Nsh1|MNr=Slz zDWZ}Q*Cjc#>2h8R&U92b?-tHoYv@hILuRviQ3E`U(wVph-Klh8QZ5dZZJH|l%`W!| zjSay7nGPWDT^SnMf2j?SU{AB?pNC{SM@ee1^Q=W}Q2=O@JLDQYm}3s)>@xwr1$ML1 zpeQ7!fNd<*fxOUTd$?Jpe}K7uExG+J=`UYx;!ZW=GYPKX3b*GPKw*?intj4*8UN}k zYIM&2pm}2YVxayByyx+e;U;8-n5lxxL`^%dyoM1t0lPvbFD_Iyr5FOLU8t4Gq}Mv@ zV89j?pnB@%_QeQi^Tdwtj3Nv%D=W^Pz$_=|wS^l;S)pzpnj_@)()!kpjBXWhDTQ1{ za!A=|kP8Y6?x^?oGcx0e)+c+cr!y^b4uAKyi@nTh;o1yeFw|Q}rVER*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QG=Lp9j(e8PO;*NYb67@&>iH0$UqG1z?{ngiMDyDO8Wue8LszWEjmj z4n4V{V$!c6D}J?xzJb12kT^y|U9F=*E3W5L4HqiawG?G zhC)Z>-8b*I7F!{+#mVu>xuR0VgT;S4gjMfX52*^HqbskONx?-3uy*NO3AOqU4kK%Z z=W~i z4A$GO$>(RpajVRl6LVSkXu0W^x_el&)_T&9rsX&nu#48jMxSP1tPS6^YxLBx-YdPz zCQJLO^|>z9I#oRqL44pLvva32hx6*BZB?1$7rdbP;15jS_vr6B!e0}Yr%?e94kr6| z!&V9TyZJ}hZ$7lxuak@Q+s0`al=;NR@^5BkOkt(t}hD@{h|hmR~-9OA6wswIow z5^h&GB1Q_A@|Hq)$e(u>n4JGkAn^r{bbcZdlC94}wUWnlxiRJ+1AW1_esqGd$|$capXv+2 zSD0_sc@%#k9330tOYO?#%x(o_1Q1puPGUzdHe^1xSP67ke7EjGSah#Cc|KG2tcfaM z{?P0QHnm$HKz??b!ABWGeYgf~@;^2I3SSJEIvJ!XW-(Xle|+=A{={l!CP#!`=W1q& zQrXGK{+MksVQ1ylm?g35FT1#iS~b{d%0Y!rI~B2*culifa|uy~AmR>ilaJr*bZ+$F z@Iy1<&7wcw@1+cuW(8u82zHp>jt!^5os_ItCF~Qr<1Jr^i|yR>UfA}Lq&zC{>`zJOu7&ah02t2yG9V!R zB{u*7bagN=_A*i;@j`=rU7TG#<$d9TzY+3h z{;x1h5d0hBF4T&_7!*ay!;Qz|9I4GJgqz&+`Sy!T*1G1 z(HJ*xFSwxKuR?#;KRT_g{?u{z_Hh1P#o7vH<80$%%ScCdei6=465R)GCd^e=_~wEsJL*1saX0_@K$73s-JOe$yNtwyS= z7~EvDI)2f*krhJGq8?&iX|%-GB7LGnNqefR;?1YcZ0yLt7|L$GDP_9z}>S$m>={Aqte!UN*#y$0NRm;%-072gR!vFvP literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/lastfm.png b/pelican/tests/output/custom_locale/theme/images/icons/lastfm.png new file mode 100644 index 0000000000000000000000000000000000000000..3a6c6262b644dadbcf6cce5dfe4fed9740a9ec1f GIT binary patch literal 975 zcmV;=12FuFP)6?8>dbVG7wVRUJ4ZXi@?ZDjy5FfTVRFgbe517iRH11L#E zK~y*q1;I~j6jdC+@$Y-{cJ_af?v|Cd&=58%RRW19jgdqNQ4(W7BPZ0vgC6ith#oz2 zwmQaM~wsz^Z-QCXa%DC5DyB?4oI zHSqw7c|gHN7dAskEJO*20zV5*!N7txD5W7|ke~#<+t+u*fj>r ztH?8TXslr8?-TWV6(gOX%;6VdsD%CI2XwQA8l*5f0`DG!`c7!JVEYK^^e^` zcD=D}N`gz%A|jG3Hzk<+OHvW}@9ocI<-{ifWL)N6Op zl_6x*$4|GSoI{~dSr4lfE@RM%BU`HwdyYXEVvL7at4)4lw9&i$@PL;@=v)?SEfh1D zasgHF@wCQe1o1p1(b(1+x;KE@R@B7!CDScsKTn?9J!|Sao$80mhEYbMc$-A=FpjF~ xhgEG<4rh((w99I&de5(oe5r7A)lWa1`5&mym2=&ymqP#m002ovPDHLkV1nRSx}g97 literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/linkedin.png b/pelican/tests/output/custom_locale/theme/images/icons/linkedin.png new file mode 100644 index 0000000000000000000000000000000000000000..d29c1201bcb0c278d49f573f9ef95ebfe932fb5b GIT binary patch literal 896 zcmV-`1AqL9P)O?w*+yx0CTqhbhrm|xBzvz1a!FqcDf06xd(T; z33s;)cDV|7y9#-^3VFK@c)AREx(#`{5P7-@d%OyJybgN24|=>3db|^QyApf54}859 zd%O~SycB-F6oS7Mg1{Mpz#M|W8-~Ilg~A_(!XJpjA&SHzio+v{!z7EtC5yx+i^M05 z#Vn4-Esn-Ak;gHT$1;-0GLy(NlgLGp$T^kDI+e;fmdQGn$vT$GJeSHnm&-hv%0ZaR zL72=xnae?$%tn~XLYmA%o6JO<%t)NhPo2(7pw3U9&{Ck$Q=!sTqR>>M(N?3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M@uVg*vhOFU0uh<$nLJ5E*>6kZeE_w z@6YbYrl_AUA8-G^q2YkS{Raa2iEI-uZ1~V|V#SLYH+KAJIie!ScJaxSD_g$woLSTJ zX3mv6DTZtx_xx!(wCK^KNtZT#>iXkV$kw^))vQ~)ezhH2w(HijX zzH8ggT|2ifER${KyLs>Ky?eLs-#^Y;;oZMeB%i4H&a+A767ZjEQ~Byi<|iJmuFL6X zSeha?J1&`I)ZEpyYSye-Rssx~p{$||UzYnt>3Jf6C64!{5l*E!$tK_0oAjM#0 zU}&ssV61Cs8e(W+WoT$+XryakZe?KbBv`K%MMG|WN@iLmrUnB`h=%CJhhl*m7(8A5 KT-G@yGywnx3UT@X literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/stackoverflow.png b/pelican/tests/output/custom_locale/theme/images/icons/stackoverflow.png new file mode 100644 index 0000000000000000000000000000000000000000..f5b65e9990dbf423ff652b297f1d0172c8c1cf27 GIT binary patch literal 916 zcmeAS@N?(olHy`uVBq!ia0vp^0w65F1|7sn8f<3~fRJ+vJ~_8MEyP6_>_pwTJhc%)&)Mu9Ed(YG|jmTlZ9 z@KIPeZ^FK^-?9GB|W>{Q7m)EC+@8;a3mYxk}1?tCE&x6kxKjd-nU)D+_Cb1MZtP zf6ioHdF7Ur;v^T%WC`(qYnHY?KFysk()nSxK=;)vJ-w30K5t&s)3ykMV9;LODnQ81ohPJtCw>uw6%3rniLY9y-{G%>&K7poH)Ybf9hcZ zPx7%K&0{68BG<3+JpQ`j393DPNr7J)G`t`kgi;Fv5%&IGQ?s!oY8v6HF>egkKm6gM^6?fU09+hB7{`$2g z!Dr>|-0l5+On2^2_f4p`m-+THD#}N=VM2Fz(!8K!0$xisQhfv_dG-h{GMTvHCdbLN z^XFvvX21P9HE8+fMNXk>uPs~lGBfn^9g#*-%#3?x$4 ze30#20|W~;m8*zxxBvb3Dl3rX#Piv+IUiP)6?8>dbVG7wVRUJ4ZXi@?ZDjy5FfTVRFgbe517iRH0+&fd zK~y*q1;I;eT~!#z;orN~+WXwn#6*y$w(*h*ilq*eIv-e)>{rfz2>o|YjIakM#%UhMb+@bNp@nA+}SPdDo7O9oA zGH1DQ=3VCA#gT5=SO4a&tyI0gXBT8cdC;FG`L+ZpV~z_2(k zy27+~*2T$!9(dBjs?l*Gs@^i^ycrPqX$n7{!nGav4CBKp&|ow~joLoVsusArMnnq)x&OT0jOD0^FU!r)xMV z@T`Lg@WUazJu+?=Xo^@Bc7w?~m$5A3q=>T&2}l_pF5!6#!NjS=iGu;#28{!#P2-AU z0h%HbP#g*{cet?yAML`kY`i-ZA56r3H`W4*h|+12)Ju^?5tk}wyNb*^F%HHT7vW$4 z0AT#-;$9CI5)714(INy>lS^h8jI9{BG64bGL3}rZ+e`R_3xqi;MG7(3u z(Kz(IvnufS+IiH% z|H$#?(3yDKFI$%htO#ZKU{k0-ZZa!IYoMLFnl`;oUNO7#KQyI_l_SgjkN^Mx07*qo IM6N<$g7S@P4*&oF literal 0 HcmV?d00001 diff --git a/pelican/tests/output/custom_locale/theme/images/icons/vimeo.png b/pelican/tests/output/custom_locale/theme/images/icons/vimeo.png new file mode 100644 index 0000000000000000000000000000000000000000..dba472022f0fcf7ecdd8f4847a8a3bde90789bc7 GIT binary patch literal 544 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6e(pbstUx|vage(c z!@6@aFM%9|WRD45bDP46hOx7_4S6Fo+k-*%fF5l;{oc z32_C|+_Uys@43gj_L}zg+illgm0x@zv+3s4+i(B>|Nr6VAFo3XmfU;0&*Mqkod+xp6y#3gPyN@QHxXzy0-n4wn!XxLor|jgco@-h?@!*{&Jj>5-y7s_z z@+$6G2Ohk5z2Vroh5JukeEmths6S=tPM4Z~$^H#Vee))+-^JCwnxk~8b9t9&bn*5L zvT{HNF_r}R1v5B2yO9RsBze2LaDKeG^bL^H>FMGaB5^si|EAa>1s)gXg^zYT($l&Y zn|<~Fe;e+k=x2)RJNb=;l_qw0c;tC<3C(%IzGPL~DJ!ccy{fL?3~Y=q61VnM+{k& zPwWILICuW)Iw1Sxx96+>e|Uf6_up&l^DbVzD4uS~541_8B*-rqWG?~05TV1%3sir^ z)5S5Q;#N{XT0%k!1BU`zox({D0S6wQ93LMAIc5h2!;S_HIkiHz2^JA8f(i{15>tM# zJZaz(V9+^u@ZiYinline' ' markup and stuff to "typogrify' '"...

    \n', - 'date': datetime.datetime(2010, 12, 2, 10, 14), - 'modified': datetime.datetime(2010, 12, 2, 10, 20), + 'date': SafeDatetime(2010, 12, 2, 10, 14), + 'modified': SafeDatetime(2010, 12, 2, 10, 20), 'tags': ['foo', 'bar', 'foobar'], 'custom_field': 'http://notmyidea.org', } @@ -70,7 +70,7 @@ class RstReaderTest(ReaderTest): 'category': 'yeah', 'author': 'Alexis Métaireau', 'title': 'Rst with filename metadata', - 'date': datetime.datetime(2012, 11, 29), + 'date': SafeDatetime(2012, 11, 29), } for key, value in page.metadata.items(): self.assertEqual(value, expected[key], key) @@ -85,7 +85,7 @@ class RstReaderTest(ReaderTest): 'category': 'yeah', 'author': 'Alexis Métaireau', 'title': 'Rst with filename metadata', - 'date': datetime.datetime(2012, 11, 29), + 'date': SafeDatetime(2012, 11, 29), 'slug': 'article_with_filename_metadata', 'mymeta': 'foo', } @@ -171,8 +171,8 @@ class MdReaderTest(ReaderTest): 'category': 'test', 'title': 'Test md File', 'summary': '

    I have a lot to test

    ', - 'date': datetime.datetime(2010, 12, 2, 10, 14), - 'modified': datetime.datetime(2010, 12, 2, 10, 20), + 'date': SafeDatetime(2010, 12, 2, 10, 14), + 'modified': SafeDatetime(2010, 12, 2, 10, 20), 'tags': ['foo', 'bar', 'foobar'], } for key, value in metadata.items(): @@ -184,8 +184,8 @@ class MdReaderTest(ReaderTest): 'title': 'マックOS X 10.8でパイソンとVirtualenvをインストールと設定', 'summary': '

    パイソンとVirtualenvをまっくでインストールする方法について明確に説明します。

    ', 'category': '指導書', - 'date': datetime.datetime(2012, 12, 20), - 'modified': datetime.datetime(2012, 12, 22), + 'date': SafeDatetime(2012, 12, 20), + 'modified': SafeDatetime(2012, 12, 22), 'tags': ['パイソン', 'マック'], 'slug': 'python-virtualenv-on-mac-osx-mountain-lion-10.8', } @@ -220,8 +220,8 @@ class MdReaderTest(ReaderTest): 'summary': ( '

    Summary with inline markup ' 'should be supported.

    '), - 'date': datetime.datetime(2012, 10, 31), - 'modified': datetime.datetime(2012, 11, 1), + 'date': SafeDatetime(2012, 10, 31), + 'modified': SafeDatetime(2012, 11, 1), 'slug': 'article-with-markdown-containing-footnotes', 'multiline': [ 'Line Metadata should be handle properly.', @@ -311,7 +311,7 @@ class MdReaderTest(ReaderTest): expected = { 'category': 'yeah', 'author': 'Alexis Métaireau', - 'date': datetime.datetime(2012, 11, 30), + 'date': SafeDatetime(2012, 11, 30), } for key, value in expected.items(): self.assertEqual(value, page.metadata[key], key) @@ -325,7 +325,7 @@ class MdReaderTest(ReaderTest): expected = { 'category': 'yeah', 'author': 'Alexis Métaireau', - 'date': datetime.datetime(2012, 11, 30), + 'date': SafeDatetime(2012, 11, 30), 'slug': 'md_w_filename_meta', 'mymeta': 'foo', } @@ -358,7 +358,7 @@ class HTMLReaderTest(ReaderTest): 'author': 'Alexis Métaireau', 'title': 'This is a super article !', 'summary': 'Summary and stuff', - 'date': datetime.datetime(2010, 12, 2, 10, 14), + 'date': SafeDatetime(2010, 12, 2, 10, 14), 'tags': ['foo', 'bar', 'foobar'], 'custom_field': 'http://notmyidea.org', } @@ -382,7 +382,7 @@ class HTMLReaderTest(ReaderTest): 'author': 'Alexis Métaireau', 'title': 'This is a super article !', 'summary': 'Summary and stuff', - 'date': datetime.datetime(2010, 12, 2, 10, 14), + 'date': SafeDatetime(2010, 12, 2, 10, 14), 'tags': ['foo', 'bar', 'foobar'], 'custom_field': 'http://notmyidea.org', } diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 3c12a15b..df1918b5 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -3,7 +3,6 @@ from __future__ import unicode_literals, print_function, absolute_import import logging import shutil import os -import datetime import time import locale from sys import platform, version_info @@ -38,24 +37,24 @@ class TestUtils(LoggedTestCase): def test_get_date(self): # valid ones - date = datetime.datetime(year=2012, month=11, day=22) - date_hour = datetime.datetime( + date = utils.SafeDatetime(year=2012, month=11, day=22) + date_hour = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11) - date_hour_z = datetime.datetime( + date_hour_z = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, tzinfo=pytz.timezone('UTC')) - date_hour_est = datetime.datetime( + date_hour_est = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, tzinfo=pytz.timezone('EST')) - date_hour_sec = datetime.datetime( + date_hour_sec = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, second=10) - date_hour_sec_z = datetime.datetime( + date_hour_sec_z = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, second=10, tzinfo=pytz.timezone('UTC')) - date_hour_sec_est = datetime.datetime( + date_hour_sec_est = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, second=10, tzinfo=pytz.timezone('EST')) - date_hour_sec_frac_z = datetime.datetime( + date_hour_sec_frac_z = utils.SafeDatetime( year=2012, month=11, day=22, hour=22, minute=11, second=10, microsecond=123000, tzinfo=pytz.timezone('UTC')) dates = { @@ -76,14 +75,14 @@ class TestUtils(LoggedTestCase): } # examples from http://www.w3.org/TR/NOTE-datetime - iso_8601_date = datetime.datetime(year=1997, month=7, day=16) - iso_8601_date_hour_tz = datetime.datetime( + iso_8601_date = utils.SafeDatetime(year=1997, month=7, day=16) + iso_8601_date_hour_tz = utils.SafeDatetime( year=1997, month=7, day=16, hour=19, minute=20, tzinfo=pytz.timezone('CET')) - iso_8601_date_hour_sec_tz = datetime.datetime( + iso_8601_date_hour_sec_tz = utils.SafeDatetime( year=1997, month=7, day=16, hour=19, minute=20, second=30, tzinfo=pytz.timezone('CET')) - iso_8601_date_hour_sec_ms_tz = datetime.datetime( + iso_8601_date_hour_sec_ms_tz = utils.SafeDatetime( year=1997, month=7, day=16, hour=19, minute=20, second=30, microsecond=450000, tzinfo=pytz.timezone('CET')) iso_8601 = { @@ -258,7 +257,7 @@ class TestUtils(LoggedTestCase): self.assertFalse(os.path.exists(test_directory)) def test_strftime(self): - d = datetime.date(2012, 8, 29) + d = utils.SafeDatetime(2012, 8, 29) # simple formatting self.assertEqual(utils.strftime(d, '%d/%m/%y'), '29/08/12') @@ -296,7 +295,7 @@ class TestUtils(LoggedTestCase): else: locale.setlocale(locale.LC_TIME, str('tr_TR.UTF-8')) - d = datetime.date(2012, 8, 29) + d = utils.SafeDatetime(2012, 8, 29) # simple self.assertEqual(utils.strftime(d, '%d %B %Y'), '29 Ağustos 2012') @@ -329,7 +328,7 @@ class TestUtils(LoggedTestCase): else: locale.setlocale(locale.LC_TIME, str('fr_FR.UTF-8')) - d = datetime.date(2012, 8, 29) + d = utils.SafeDatetime(2012, 8, 29) # simple self.assertEqual(utils.strftime(d, '%d %B %Y'), '29 août 2012') @@ -448,7 +447,7 @@ class TestDateFormatter(unittest.TestCase): os.makedirs(template_dir) with open(template_path, 'w') as template_file: template_file.write('date = {{ date|strftime("%A, %d %B %Y") }}') - self.date = datetime.date(2012, 8, 29) + self.date = utils.SafeDatetime(2012, 8, 29) def tearDown(self): @@ -464,7 +463,7 @@ class TestDateFormatter(unittest.TestCase): def test_french_strftime(self): # This test tries to reproduce an issue that occured with python3.3 under macos10 only locale.setlocale(locale.LC_ALL, str('fr_FR.UTF-8')) - date = datetime.datetime(2014,8,14) + date = utils.SafeDatetime(2014,8,14) # we compare the lower() dates since macos10 returns "Jeudi" for %A whereas linux reports "jeudi" self.assertEqual( u'jeudi, 14 août 2014', utils.strftime(date, date_format="%A, %d %B %Y").lower() ) df = utils.DateFormatter() diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 7c8662c9..b6078201 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -21,7 +21,7 @@ from six.moves.urllib.error import URLError from six.moves.urllib.parse import urlparse from six.moves.urllib.request import urlretrieve -from pelican.utils import slugify +from pelican.utils import slugify, SafeDatetime from pelican.log import init logger = logging.getLogger(__name__) @@ -303,7 +303,7 @@ def dc2fields(file): def posterous2fields(api_token, email, password): """Imports posterous posts""" import base64 - from datetime import datetime, timedelta + from datetime import timedelta try: # py3k import import json @@ -340,7 +340,7 @@ def posterous2fields(api_token, email, password): slug = slugify(post.get('title')) tags = [tag.get('name') for tag in post.get('tags')] raw_date = post.get('display_date') - date_object = datetime.strptime(raw_date[:-6], "%Y/%m/%d %H:%M:%S") + date_object = SafeDatetime.strptime(raw_date[:-6], "%Y/%m/%d %H:%M:%S") offset = int(raw_date[-5:]) delta = timedelta(hours = offset / 100) date_object -= delta diff --git a/pelican/utils.py b/pelican/utils.py index 84b3a41e..586d85ff 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -14,6 +14,7 @@ import shutil import traceback import pickle import hashlib +import datetime from collections import Hashable from contextlib import contextmanager @@ -56,7 +57,10 @@ def strftime(date, date_format): for candidate in candidates: # test for valid C89 directives only if candidate[1] in 'aAbBcdfHIjmMpSUwWxXyYzZ%': - formatted = date.strftime(candidate) + if isinstance(date, SafeDatetime): + formatted = date.strftime(candidate, safe=False) + else: + formatted = date.strftime(candidate) # convert Py2 result to unicode if not six.PY3 and enc is not None: formatted = formatted.decode(enc) @@ -68,6 +72,17 @@ def strftime(date, date_format): return template % tuple(formatted_candidates) +class SafeDatetime(datetime.datetime): + '''Subclass of datetime that works with utf-8 format strings on PY2''' + + def strftime(self, fmt, safe=True): + '''Uses our custom strftime if supposed to be *safe*''' + if safe: + return strftime(self, fmt) + else: + return super(SafeDatetime, self).strftime(fmt) + + class DateFormatter(object): '''A date formatter object used as a jinja filter @@ -183,8 +198,10 @@ def get_date(string): If no format matches the given date, raise a ValueError. """ string = re.sub(' +', ' ', string) + default = SafeDatetime.now().replace(hour=0, minute=0, + second=0, microsecond=0) try: - return dateutil.parser.parse(string) + return dateutil.parser.parse(string, default=default) except (TypeError, ValueError): raise ValueError('{0!r} is not a valid date'.format(string)) diff --git a/pelican/writers.py b/pelican/writers.py index 3e01ee6c..61acdadd 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -151,12 +151,7 @@ class Writer(object): def _write_file(template, localcontext, output_path, name, override): """Render the template write the file.""" - old_locale = locale.setlocale(locale.LC_ALL) - locale.setlocale(locale.LC_ALL, str('C')) - try: - output = template.render(localcontext) - finally: - locale.setlocale(locale.LC_ALL, old_locale) + output = template.render(localcontext) path = os.path.join(output_path, name) try: os.makedirs(os.path.dirname(path)) diff --git a/samples/pelican_FR.conf.py b/samples/pelican_FR.conf.py new file mode 100644 index 00000000..1f6aaaa1 --- /dev/null +++ b/samples/pelican_FR.conf.py @@ -0,0 +1,59 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +AUTHOR = 'Alexis Métaireau' +SITENAME = "Alexis' log" +SITEURL = 'http://blog.notmyidea.org' +TIMEZONE = "Europe/Paris" + +# can be useful in development, but set to False when you're ready to publish +RELATIVE_URLS = True + +GITHUB_URL = 'http://github.com/ametaireau/' +DISQUS_SITENAME = "blog-notmyidea" +PDF_GENERATOR = False +REVERSE_CATEGORY_ORDER = True +LOCALE = "fr_FR.UTF-8" +DEFAULT_PAGINATION = 4 +DEFAULT_DATE = (2012, 3, 2, 14, 1, 1) + +ARTICLE_URL = 'posts/{date:%Y}/{date:%B}/{date:%d}/{slug}/' +ARTICLE_SAVE_AS = ARTICLE_URL + 'index.html' + +FEED_ALL_RSS = 'feeds/all.rss.xml' +CATEGORY_FEED_RSS = 'feeds/%s.rss.xml' + +LINKS = (('Biologeek', 'http://biologeek.org'), + ('Filyb', "http://filyb.info/"), + ('Libert-fr', "http://www.libert-fr.com"), + ('N1k0', "http://prendreuncafe.com/blog/"), + ('Tarek Ziadé', "http://ziade.org/blog"), + ('Zubin Mithra', "http://zubin71.wordpress.com/"),) + +SOCIAL = (('twitter', 'http://twitter.com/ametaireau'), + ('lastfm', 'http://lastfm.com/user/akounet'), + ('github', 'http://github.com/ametaireau'),) + +# global metadata to all the contents +DEFAULT_METADATA = (('yeah', 'it is'),) + +# path-specific metadata +EXTRA_PATH_METADATA = { + 'extra/robots.txt': {'path': 'robots.txt'}, + } + +# static paths will be copied without parsing their contents +STATIC_PATHS = [ + 'pictures', + 'extra/robots.txt', + ] + +# custom page generated with a jinja2 template +TEMPLATE_PAGES = {'pages/jinja2_template.html': 'jinja2_template.html'} + +# code blocks with line numbers +PYGMENTS_RST_OPTIONS = {'linenos': 'table'} + +# foobar will not be used, because it's not in caps. All configuration keys +# have to be in caps +foobar = "barbaz" From 009543b7e476d3bcaca3dd8576a47631c06de1e7 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Thu, 26 Jun 2014 00:51:45 -0400 Subject: [PATCH 1171/2344] Fix test errors on OSX On OSX, if LC_TIME and LC_CTYPE differs the output of strftime is not properly decoded in Python 3. This makes sure that the 'utils.DateFormatter' and the related Jinja filter 'strftime' set the same value for LC_TIME and LC_CTYPE while formatting. Also, '%a' is removed from DEFAULT_DATE_FORMAT in 'custom_locale' tests. OSX and *nix have different conversions for '%a' ('Jeu' vs 'jeu.') and there is not a feasible way to handle the difference for tests. --- docs/contribute.rst | 2 +- .../tests/output/custom_locale/archives.html | 20 +++++++++---------- .../author/alexis-metaireau.html | 8 ++++---- .../author/alexis-metaireau2.html | 10 +++++----- .../author/alexis-metaireau3.html | 4 ++-- .../output/custom_locale/category/bar.html | 2 +- .../output/custom_locale/category/cat1.html | 8 ++++---- .../output/custom_locale/category/misc.html | 8 ++++---- .../output/custom_locale/category/yeah.html | 4 ++-- .../custom_locale/drafts/a-draft-article.html | 2 +- pelican/tests/output/custom_locale/index.html | 8 ++++---- .../tests/output/custom_locale/index2.html | 10 +++++----- .../tests/output/custom_locale/index3.html | 4 ++-- .../output/custom_locale/oh-yeah-fr.html | 2 +- .../02/this-is-a-super-article/index.html | 4 ++-- .../2010/octobre/15/unbelievable/index.html | 2 +- .../posts/2010/octobre/20/oh-yeah/index.html | 2 +- .../20/a-markdown-powered-article/index.html | 2 +- .../2011/février/17/article-1/index.html | 2 +- .../2011/février/17/article-2/index.html | 2 +- .../2011/février/17/article-3/index.html | 2 +- .../2012/février/29/second-article/index.html | 2 +- .../30/filename_metadata-example/index.html | 2 +- .../custom_locale/second-article-fr.html | 2 +- .../tests/output/custom_locale/tag/bar.html | 8 ++++---- .../tests/output/custom_locale/tag/baz.html | 2 +- .../tests/output/custom_locale/tag/foo.html | 6 +++--- .../output/custom_locale/tag/foobar.html | 4 ++-- .../tests/output/custom_locale/tag/yeah.html | 2 +- pelican/tests/test_pelican.py | 2 +- pelican/utils.py | 10 ++++++++-- ...{pelican_FR.conf.py => pelican.conf_FR.py} | 1 + 32 files changed, 78 insertions(+), 71 deletions(-) rename samples/{pelican_FR.conf.py => pelican.conf_FR.py} (98%) diff --git a/docs/contribute.rst b/docs/contribute.rst index 044ef924..19604da0 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -91,7 +91,7 @@ functional tests. To do so, you can use the following two commands:: $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \ -s samples/pelican.conf.py samples/content/ $ LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ \ - -s samples/pelican_FR.conf.py samples/content/ + -s samples/pelican.conf_FR.py samples/content/ $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ samples/content/ diff --git a/pelican/tests/output/custom_locale/archives.html b/pelican/tests/output/custom_locale/archives.html index a7b96336..1336b487 100644 --- a/pelican/tests/output/custom_locale/archives.html +++ b/pelican/tests/output/custom_locale/archives.html @@ -32,25 +32,25 @@

    Archives for Alexis' log

    -
    ven. 30 novembre 2012
    +
    30 novembre 2012
    FILENAME_METADATA example
    -
    mer. 29 février 2012
    +
    29 février 2012
    Second article
    -
    mer. 20 avril 2011
    +
    20 avril 2011
    A markdown powered article
    -
    jeu. 17 février 2011
    +
    17 février 2011
    Article 1
    -
    jeu. 17 février 2011
    +
    17 février 2011
    Article 2
    -
    jeu. 17 février 2011
    +
    17 février 2011
    Article 3
    -
    jeu. 02 décembre 2010
    +
    02 décembre 2010
    This is a super article !
    -
    mer. 20 octobre 2010
    +
    20 octobre 2010
    Oh yeah !
    -
    ven. 15 octobre 2010
    +
    15 octobre 2010
    Unbelievable !
    -
    dim. 14 mars 2010
    +
    14 mars 2010
    The baz tag
    diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau.html b/pelican/tests/output/custom_locale/author/alexis-metaireau.html index b54446c8..7c2fa448 100644 --- a/pelican/tests/output/custom_locale/author/alexis-metaireau.html +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau.html @@ -34,7 +34,7 @@

    FILENAME_METADATA example

    {% endblock %} diff --git a/pelican/themes/notmyidea/templates/taglist.html b/pelican/themes/notmyidea/templates/taglist.html index 1e0b95a7..58f35576 100644 --- a/pelican/themes/notmyidea/templates/taglist.html +++ b/pelican/themes/notmyidea/templates/taglist.html @@ -1,2 +1 @@ {% if article.tags %}

    tags: {% for tag in article.tags %}{{ tag | escape }} {% endfor %}

    {% endif %} -{% if PDF_PROCESSOR %}

    get the pdf

    {% endif %} From 87d86d724c6ae01adf1488b2f65dd0ff1e48ca46 Mon Sep 17 00:00:00 2001 From: Kevin Yap Date: Sat, 28 Feb 2015 15:33:54 -0800 Subject: [PATCH 1285/2344] Change phrasing and formatting of README Made a few changes to the README to emphasize Pelican's position as a general-purpose static site generator, and not just a blogging tool. See #1645 for more details. --- README.rst | 59 +++++++++++++++++++++++++++--------------------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/README.rst b/README.rst index 564cc77c..a5643514 100644 --- a/README.rst +++ b/README.rst @@ -3,57 +3,58 @@ Pelican |build-status| |coverage-status| Pelican is a static site generator, written in Python_. -* Write your weblog entries directly with your editor of choice (vim!) - in reStructuredText_ or Markdown_ -* Includes a simple CLI tool to (re)generate the weblog -* Easy to interface with DVCSes and web hooks -* Completely static output is easy to host anywhere +* Write content in reStructuredText_ or Markdown_ using your editor of choice. +* Includes a simple command line tool to (re)generate site files. +* Easy to interface with version control systems and web hooks. +* Completely static output is simple to host anywhere. + Features -------- Pelican currently supports: -* Blog articles and pages -* Comments, via an external service (Disqus). (Please note that while - useful, Disqus is an external service, and thus the comment data will be - somewhat outside of your control and potentially subject to data loss.) -* Theming support (themes are created using Jinja2_ templates) -* PDF generation of the articles/pages (optional) +* Blog articles and static pages +* Integration with external services (ex. Google Analytics and Disqus) +* Site themes (created using Jinja2_ templates) * Publication of articles in multiple languages -* Atom/RSS feeds -* Code syntax highlighting -* Import from WordPress, Dotclear, or RSS feeds -* Integration with external tools: Twitter, Google Analytics, etc. (optional) -* Fast rebuild times thanks to content caching and selective output writing. +* Generation of Atom and RSS feeds +* Syntax highlighting via Pygments_ +* Importing existing content from WordPress, Dotclear, and more services +* Fast rebuild times due to content caching and selective output writing -Have a look at the `Pelican documentation`_ for more information. +Check out `Pelican's documentation`_ for further information. -Why the name "Pelican"? ------------------------ - -"Pelican" is an anagram for *calepin*, which means "notebook" in French. ;) - -Source code ------------ - -You can access the source code at: https://github.com/getpelican/pelican - -If you feel hackish, have a look at the explanation of `Pelican's internals`_. How to get help, contribute, or provide feedback ------------------------------------------------ See our `contribution submission and feedback guidelines `_. + +Source code +----------- + +Pelican's source code is `hosted on GitHub`_. If you're feeling hackish, +take a look at `Pelican's internals`_. + + +Why the name "Pelican"? +----------------------- + +"Pelican" is an anagram of *calepin*, which means "notebook" in French. + + .. Links .. _Python: http://www.python.org/ .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Markdown: http://daringfireball.net/projects/markdown/ .. _Jinja2: http://jinja.pocoo.org/ -.. _`Pelican documentation`: http://docs.getpelican.com/ +.. _Pygments: http://pygments.org/ +.. _`Pelican's documentation`: http://docs.getpelican.com/ .. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html +.. _`hosted on GitHub`: https://github.com/getpelican/pelican .. |build-status| image:: https://img.shields.io/travis/getpelican/pelican/master.svg :target: https://travis-ci.org/getpelican/pelican From e35ca1d6ff4fd9a31b6dd60b2bb345c2fee0828e Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 5 Mar 2015 12:04:39 -0800 Subject: [PATCH 1286/2344] Minor improvements to README --- README.rst | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index a5643514..0bb3bcc8 100644 --- a/README.rst +++ b/README.rst @@ -3,10 +3,10 @@ Pelican |build-status| |coverage-status| Pelican is a static site generator, written in Python_. -* Write content in reStructuredText_ or Markdown_ using your editor of choice. -* Includes a simple command line tool to (re)generate site files. -* Easy to interface with version control systems and web hooks. -* Completely static output is simple to host anywhere. +* Write content in reStructuredText_ or Markdown_ using your editor of choice +* Includes a simple command line tool to (re)generate site files +* Easy to interface with version control systems and web hooks +* Completely static output is simple to host anywhere Features @@ -14,13 +14,13 @@ Features Pelican currently supports: -* Blog articles and static pages -* Integration with external services (ex. Google Analytics and Disqus) +* Chronological content (e.g., articles, blog posts) as well as static pages +* Integration with external services (e.g., Google Analytics and Disqus) * Site themes (created using Jinja2_ templates) * Publication of articles in multiple languages * Generation of Atom and RSS feeds * Syntax highlighting via Pygments_ -* Importing existing content from WordPress, Dotclear, and more services +* Importing existing content from WordPress, Dotclear, and other services * Fast rebuild times due to content caching and selective output writing Check out `Pelican's documentation`_ for further information. @@ -35,7 +35,7 @@ See our `contribution submission and feedback guidelines `_. Source code ----------- -Pelican's source code is `hosted on GitHub`_. If you're feeling hackish, +Pelican's source code is `hosted on GitHub`_. If you feel like hacking, take a look at `Pelican's internals`_. From 3ea45420152a8465db33fd4a67ac88f1c1426df5 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Tue, 17 Feb 2015 20:05:00 -0500 Subject: [PATCH 1287/2344] Make sure Content uses URLWrappers --- pelican/contents.py | 14 +++----------- pelican/readers.py | 4 ++++ pelican/tests/test_contents.py | 11 ++++++----- pelican/tests/test_generators.py | 32 ++++++++++++++++++++++++++++++++ pelican/tests/test_paginator.py | 4 ++-- 5 files changed, 47 insertions(+), 18 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 074c28be..90121316 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -53,7 +53,7 @@ class Content(object): self._context = context self.translations = [] - local_metadata = dict(settings['DEFAULT_METADATA']) + local_metadata = dict() local_metadata.update(metadata) # set metadata as attributes @@ -166,21 +166,13 @@ class Content(object): """Returns the URL, formatted with the proper values""" metadata = copy.copy(self.metadata) path = self.metadata.get('path', self.get_relative_source_path()) - default_category = self.settings['DEFAULT_CATEGORY'] - slug_substitutions = self.settings.get('SLUG_SUBSTITUTIONS', ()) metadata.update({ 'path': path_to_url(path), 'slug': getattr(self, 'slug', ''), 'lang': getattr(self, 'lang', 'en'), 'date': getattr(self, 'date', SafeDatetime.now()), - 'author': slugify( - getattr(self, 'author', ''), - slug_substitutions - ), - 'category': slugify( - getattr(self, 'category', default_category), - slug_substitutions - ) + 'author': self.author.slug if hasattr(self, 'author') else '', + 'category': self.category.slug if hasattr(self, 'category') else '' }) return metadata diff --git a/pelican/readers.py b/pelican/readers.py index 731fb5da..a9b71bed 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -537,6 +537,10 @@ def find_empty_alt(content, path): def default_metadata(settings=None, process=None): metadata = {} if settings: + for name, value in dict(settings.get('DEFAULT_METADATA', {})).items(): + if process: + value = process(name, value) + metadata[name] = value if 'DEFAULT_CATEGORY' in settings: value = settings['DEFAULT_CATEGORY'] if process: diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 4b692e29..004d512e 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -8,7 +8,7 @@ import os.path from pelican.tests.support import unittest, get_settings -from pelican.contents import Page, Article, Static, URLWrapper +from pelican.contents import Page, Article, Static, URLWrapper, Author, Category from pelican.settings import DEFAULT_CONFIG from pelican.utils import path_to_url, truncate_html_words, SafeDatetime, posix_join from pelican.signals import content_object_init @@ -33,7 +33,7 @@ class TestPage(unittest.TestCase): 'metadata': { 'summary': TEST_SUMMARY, 'title': 'foo bar', - 'author': 'Blogger', + 'author': Author('Blogger', DEFAULT_CONFIG), }, 'source_path': '/path/to/file/foo.ext' } @@ -374,7 +374,8 @@ class TestPage(unittest.TestCase): content = Page(**args) assert content.authors == [content.author] args['metadata'].pop('author') - args['metadata']['authors'] = ['First Author', 'Second Author'] + args['metadata']['authors'] = [Author('First Author', DEFAULT_CONFIG), + Author('Second Author', DEFAULT_CONFIG)] content = Page(**args) assert content.authors assert content.author == content.authors[0] @@ -396,8 +397,8 @@ class TestArticle(TestPage): settings['ARTICLE_URL'] = '{author}/{category}/{slug}/' settings['ARTICLE_SAVE_AS'] = '{author}/{category}/{slug}/index.html' article_kwargs = self._copy_page_kwargs() - article_kwargs['metadata']['author'] = "O'Brien" - article_kwargs['metadata']['category'] = 'C# & stuff' + article_kwargs['metadata']['author'] = Author("O'Brien", settings) + article_kwargs['metadata']['category'] = Category('C# & stuff', settings) article_kwargs['metadata']['title'] = 'fnord' article_kwargs['settings'] = settings article = Article(**article_kwargs) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 9f38c002..acf767f2 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -413,6 +413,38 @@ class TestArticlesGenerator(unittest.TestCase): generator.generate_context() generator.readers.read_file.assert_called_count == orig_call_count + def test_standard_metadata_in_default_metadata(self): + settings = get_settings(filenames={}) + settings['CACHE_CONTENT'] = False + settings['DEFAULT_CATEGORY'] = 'Default' + settings['DEFAULT_DATE'] = (1970, 1, 1) + settings['DEFAULT_METADATA'] = (('author', 'Blogger'), + # category will be ignored in favor of + # DEFAULT_CATEGORY + ('category', 'Random'), + ('tags', 'general, untagged')) + generator = ArticlesGenerator( + context=settings.copy(), settings=settings, + path=CONTENT_DIR, theme=settings['THEME'], output_path=None) + generator.generate_context() + + authors = sorted([author.name for author, _ in generator.authors]) + authors_expected = sorted(['Alexis Métaireau', 'Blogger', + 'First Author', 'Second Author']) + self.assertEqual(authors, authors_expected) + + categories = sorted([category.name + for category, _ in generator.categories]) + categories_expected = [ + sorted(['Default', 'TestCategory', 'yeah', 'test', '指導書']), + sorted(['Default', 'TestCategory', 'Yeah', 'test', '指導書'])] + self.assertIn(categories, categories_expected) + + tags = sorted([tag.name for tag in generator.tags]) + tags_expected = sorted(['bar', 'foo', 'foobar', 'general', 'untagged', + 'パイソン', 'マック']) + self.assertEqual(tags, tags_expected) + class TestPageGenerator(unittest.TestCase): # Note: Every time you want to test for a new field; Make sure the test diff --git a/pelican/tests/test_paginator.py b/pelican/tests/test_paginator.py index 5494fda8..002d9e07 100644 --- a/pelican/tests/test_paginator.py +++ b/pelican/tests/test_paginator.py @@ -5,7 +5,7 @@ import locale from pelican.tests.support import unittest, get_settings from pelican.paginator import Paginator -from pelican.contents import Article +from pelican.contents import Article, Author from pelican.settings import DEFAULT_CONFIG from jinja2.utils import generate_lorem_ipsum @@ -26,7 +26,6 @@ class TestPage(unittest.TestCase): 'metadata': { 'summary': TEST_SUMMARY, 'title': 'foo bar', - 'author': 'Blogger', }, 'source_path': '/path/to/file/foo.ext' } @@ -49,6 +48,7 @@ class TestPage(unittest.TestCase): key=lambda r: r[0], ) + self.page_kwargs['metadata']['author'] = Author('Blogger', settings) object_list = [Article(**self.page_kwargs), Article(**self.page_kwargs)] paginator = Paginator('foobar.foo', object_list, settings) page = paginator.page(1) From 4e896c427ddef6b9a19088dfc653f7b8c15f5c08 Mon Sep 17 00:00:00 2001 From: Kevin Yap Date: Fri, 6 Mar 2015 23:51:26 -0800 Subject: [PATCH 1288/2344] Standardize formatting of .travis.yml Use 2 spaces for indentation. --- .travis.yml | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/.travis.yml b/.travis.yml index a052252b..f5a7f04f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,25 +1,24 @@ language: python python: - - "2.7" - - "3.3" - - "3.4" + - "2.7" + - "3.3" + - "3.4" addons: apt_packages: - pandoc before_install: - - sudo apt-get update -qq - - sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 + - sudo apt-get update -qq + - sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 install: - - pip install . - - pip install -r dev_requirements.txt - - pip install nose-cov + - pip install . + - pip install -r dev_requirements.txt + - pip install nose-cov script: nosetests -sv --with-coverage --cover-package=pelican pelican after_success: - # Report coverage results to coveralls.io - pip install coveralls - coveralls notifications: - irc: - channels: - - "irc.freenode.org#pelican" - on_success: change + irc: + channels: + - "irc.freenode.org#pelican" + on_success: change From ffe71d324d4812925b2eeddbc52b66f5ebbf3801 Mon Sep 17 00:00:00 2001 From: robertlagrant Date: Fri, 13 Mar 2015 13:42:56 +0200 Subject: [PATCH 1289/2344] Change docs wording on cache regen for #1630 --- docs/settings.rst | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 11444d2e..9fb97883 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -847,13 +847,11 @@ can be invoked by passing the ``--archive`` flag). The cache files are Python pickles, so they may not be readable by different versions of Python as the pickle format often changes. If -such an error is encountered, the cache files have to be rebuilt by -removing them and re-running Pelican, or by using the Pelican -command-line option ``--ignore-cache``. The cache files also have to -be rebuilt when changing the ``GZIP_CACHE`` setting for cache file -reading to work properly. +such an error is encountered, it is caught and the cache file is +rebuilt automatically in the new format. The cache files will also be +rebuilt after the ``GZIP_CACHE`` setting has been changed. -The ``--ignore-cache`` command-line option is also useful when the +The ``--ignore-cache`` command-line option is useful when the whole cache needs to be regenerated, such as when making modifications to the settings file that will affect the cached content, or just for debugging purposes. When Pelican runs in autoreload mode, modification From 0f7f328206b4b3eb085335aa86c620150143ee6e Mon Sep 17 00:00:00 2001 From: Kevin Yap Date: Fri, 13 Mar 2015 23:01:31 -0700 Subject: [PATCH 1290/2344] Remove a couple of unused imports As reported by Pyflakes. --- pelican/contents.py | 2 +- pelican/writers.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 074c28be..a680c411 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function import six -from six.moves.urllib.parse import (unquote, urlparse, urlunparse) +from six.moves.urllib.parse import urlparse, urlunparse import copy import locale diff --git a/pelican/writers.py b/pelican/writers.py index bf32e272..e90a0004 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -3,7 +3,6 @@ from __future__ import with_statement, unicode_literals, print_function import six import os -import locale import logging if not six.PY3: From ef737c22393174571fe17a6175eb98465c6ec246 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sat, 14 Mar 2015 13:36:51 -0400 Subject: [PATCH 1291/2344] Use `--relative-urls` only if it is specified Otherwise, `RELATIVE_URLS` in the config file is ignored and `RELATIVE_URLS` is set to `False` if `--relative-urls` is not specified. Fixes an issue introduced in #1592 --- pelican/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 3013744d..056c45ef 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -321,7 +321,8 @@ def get_config(args): config['CACHE_PATH'] = args.cache_path if args.selected_paths: config['WRITE_SELECTED'] = args.selected_paths.split(',') - config['RELATIVE_URLS'] = args.relative_paths + if args.relative_paths: + config['RELATIVE_URLS'] = args.relative_paths config['DEBUG'] = args.verbosity == logging.DEBUG # argparse returns bytes in Py2. There is no definite answer as to which From 875c4a5e05d818c776be3019506921b863b13dc0 Mon Sep 17 00:00:00 2001 From: Anton Antonov Date: Tue, 17 Mar 2015 01:23:29 +0200 Subject: [PATCH 1292/2344] Nitpick Content decorators A bit more readable this way. --- pelican/contents.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 96466a94..005d045c 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -90,7 +90,7 @@ class Content(object): self.in_default_lang = (self.lang == default_lang) - # create the slug if not existing, generate slug according to + # create the slug if not existing, generate slug according to # setting of SLUG_ATTRIBUTE if not hasattr(self, 'slug'): if settings['SLUGIFY_SOURCE'] == 'title' and hasattr(self, 'title'): @@ -308,8 +308,13 @@ class Content(object): """Dummy function""" pass - url = property(functools.partial(get_url_setting, key='url')) - save_as = property(functools.partial(get_url_setting, key='save_as')) + @property + def url(self): + return self.get_url_setting('url') + + @property + def save_as(self): + return self.get_url_setting('save_as') def _get_template(self): if hasattr(self, 'template') and self.template is not None: From db2e5174502787e447d3df32298cf950c6c894ae Mon Sep 17 00:00:00 2001 From: Forest Date: Mon, 29 Sep 2014 22:51:13 -0700 Subject: [PATCH 1293/2344] Ignore empty metadata. Fixes #1469. Fixes #1398. Some metadata values cause problems when empty. For example, a markdown file containing a Slug: line with no additional text causing Pelican to produce a file named ".html" instead of generating a proper file name. Others, like those created by a PATH_METADATA regex, must be preserved even if empty, so things like PAGE_URL="filename{customvalue}.html" will always work. Essentially, we want to discard empty metadata that we know will be useless or problematic. This is better than raising an exception because (a) it allows users to deliberately keep empty metadata in their source files for filling in later, and (b) users shouldn't be forced to fix empty metadata created by blog migration tools (see #1398). The metadata processors are the ideal place to do this, because they know the type of data they are handling and whether an empty value is wanted. Unfortunately, they can't discard items, and neither can process_metadata(), because their return values are always saved by calling code. We can't safely change the calling code, because some of it lives in custom reader classes out in the field, and we don't want to break those working systems. Discarding empty values at the time of use isn't good enough, because that still allows useless empty values in a source file to override configured defaults. My solution: - When processing a list of values, a metadata processor will omit any unwanted empty ones from the list it returns. - When processing an entirely unwanted value, it will return something easily identifiable that will pass through the reader code. - When collecting the processed metadata, read_file() will filter out items identified as unwanted. These metadata are affected by this change: author, authors, category, slug, status, tags. I also removed a bit of now-superfluous code from generators.py that was discarding empty authors at the time of use. --- pelican/generators.py | 4 +--- pelican/readers.py | 48 ++++++++++++++++++++++++++++++++++--------- 2 files changed, 39 insertions(+), 13 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index f0a6d264..75bd6b2a 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -544,10 +544,8 @@ class ArticlesGenerator(CachingGenerator): if hasattr(article, 'tags'): for tag in article.tags: self.tags[tag].append(article) - # ignore blank authors as well as undefined for author in getattr(article, 'authors', []): - if author.name != '': - self.authors[author].append(article) + self.authors[author].append(article) # sort the articles by date self.articles.sort(key=attrgetter('date'), reverse=True) self.dates = list(self.articles) diff --git a/pelican/readers.py b/pelican/readers.py index a9b71bed..3656cd96 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -28,16 +28,44 @@ from pelican.contents import Page, Category, Tag, Author from pelican.utils import get_date, pelican_open, FileStampDataCacher, SafeDatetime, posixize_path +def strip_split(text, sep=','): + """Return a list of stripped, non-empty substrings, delimited by sep.""" + items = [x.strip() for x in text.split(sep)] + return [x for x in items if x] + + +# Metadata processors have no way to discard an unwanted value, so we have +# them return this value instead to signal that it should be discarded later. +# This means that _filter_discardable_metadata() must be called on processed +# metadata dicts before use, to remove the items with the special value. +_DISCARD = object() + + +def _process_if_nonempty(processor, name, settings): + """Removes extra whitespace from name and applies a metadata processor. + If name is empty or all whitespace, returns _DISCARD instead. + """ + name = name.strip() + return processor(name, settings) if name else _DISCARD + + METADATA_PROCESSORS = { - 'tags': lambda x, y: [Tag(tag, y) for tag in x.split(',')], + 'tags': lambda x, y: [Tag(tag, y) for tag in strip_split(x)] or _DISCARD, 'date': lambda x, y: get_date(x.replace('_', ' ')), 'modified': lambda x, y: get_date(x), - 'status': lambda x, y: x.strip(), - 'category': Category, - 'author': Author, - 'authors': lambda x, y: [Author(author.strip(), y) for author in x.split(',')], + 'status': lambda x, y: x.strip() or _DISCARD, + 'category': lambda x, y: _process_if_nonempty(Category, x, y), + 'author': lambda x, y: _process_if_nonempty(Author, x, y), + 'authors': lambda x, y: [Author(a, y) for a in strip_split(x)] or _DISCARD, + 'slug': lambda x, y: x.strip() or _DISCARD, } + +def _filter_discardable_metadata(metadata): + """Return a copy of a dict, minus any items marked as discardable.""" + return {name: val for name, val in metadata.items() if val is not _DISCARD} + + logger = logging.getLogger(__name__) class BaseReader(object): @@ -447,14 +475,14 @@ class Readers(FileStampDataCacher): reader = self.readers[fmt] - metadata = default_metadata( - settings=self.settings, process=reader.process_metadata) + metadata = _filter_discardable_metadata(default_metadata( + settings=self.settings, process=reader.process_metadata)) metadata.update(path_metadata( full_path=path, source_path=source_path, settings=self.settings)) - metadata.update(parse_path_metadata( + metadata.update(_filter_discardable_metadata(parse_path_metadata( source_path=source_path, settings=self.settings, - process=reader.process_metadata)) + process=reader.process_metadata))) reader_name = reader.__class__.__name__ metadata['reader'] = reader_name.replace('Reader', '').lower() @@ -462,7 +490,7 @@ class Readers(FileStampDataCacher): if content is None: content, reader_metadata = reader.read(path) self.cache_data(path, (content, reader_metadata)) - metadata.update(reader_metadata) + metadata.update(_filter_discardable_metadata(reader_metadata)) if content: # find images with empty alt From 7ad649e3b79c20d9cbb783148e659824c46fbf8c Mon Sep 17 00:00:00 2001 From: Forest Date: Fri, 31 Oct 2014 23:05:19 -0700 Subject: [PATCH 1294/2344] Guess mime type with python-magic if available. Fixes #1514. --- pelican/server.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/pelican/server.py b/pelican/server.py index 0a8dc1b6..60252e1f 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -12,6 +12,11 @@ try: except ImportError: import socketserver # NOQA +try: + from magic import from_file as magic_from_file +except ImportError: + magic_from_file = None + PORT = len(sys.argv) in (2, 3) and int(sys.argv[1]) or 8000 SERVER = len(sys.argv) == 3 and sys.argv[2] or "" SUFFIXES = ['', '.html', '/index.html'] @@ -39,6 +44,18 @@ class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): logging.warning("Unable to find `%s` or variations.", self.original_path) + def guess_type(self, path): + """Guess at the mime type for the specified file. + """ + mimetype = srvmod.SimpleHTTPRequestHandler.guess_type(self, path) + + # If the default guess is too generic, try the python-magic library + if mimetype == 'application/octet-stream' and magic_from_file: + mimetype = magic_from_file(path, mime=True) + + return mimetype + + Handler = ComplexHTTPRequestHandler socketserver.TCPServer.allow_reuse_address = True From 7b4ceb29744b3a00f39925047a0dafef0176214f Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Fri, 3 Apr 2015 18:58:52 -0400 Subject: [PATCH 1295/2344] Make `pelican.server` importable and use it in `fab serve` `fab serve` and `make devserver` use different HTTP Handlers and as a result they behave differently. This makes sure `fab serve` also uses the Handler defined in `pelican.server` in order to get rid of the inconsistency. --- pelican/server.py | 46 ++++++++++++--------------- pelican/tools/templates/fabfile.py.in | 5 +-- 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/pelican/server.py b/pelican/server.py index 60252e1f..f58ac085 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -2,30 +2,22 @@ from __future__ import print_function import os import sys import logging -try: - import SimpleHTTPServer as srvmod -except ImportError: - import http.server as srvmod # NOQA -try: - import SocketServer as socketserver -except ImportError: - import socketserver # NOQA +from six.moves import SimpleHTTPServer as srvmod +from six.moves import socketserver try: from magic import from_file as magic_from_file except ImportError: magic_from_file = None -PORT = len(sys.argv) in (2, 3) and int(sys.argv[1]) or 8000 -SERVER = len(sys.argv) == 3 and sys.argv[2] or "" -SUFFIXES = ['', '.html', '/index.html'] - class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): + SUFFIXES = ['', '.html', '/index.html'] + def do_GET(self): # Try to detect file by applying various suffixes - for suffix in SUFFIXES: + for suffix in self.SUFFIXES: if not hasattr(self, 'original_path'): self.original_path = self.path @@ -56,19 +48,21 @@ class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): return mimetype -Handler = ComplexHTTPRequestHandler +if __name__ == '__main__': + PORT = len(sys.argv) in (2, 3) and int(sys.argv[1]) or 8000 + SERVER = len(sys.argv) == 3 and sys.argv[2] or "" -socketserver.TCPServer.allow_reuse_address = True -try: - httpd = socketserver.TCPServer((SERVER, PORT), Handler) -except OSError as e: - logging.error("Could not listen on port %s, server %s.", PORT, SERVER) - sys.exit(getattr(e, 'exitcode', 1)) + socketserver.TCPServer.allow_reuse_address = True + try: + httpd = socketserver.TCPServer((SERVER, PORT), ComplexHTTPRequestHandler) + except OSError as e: + logging.error("Could not listen on port %s, server %s.", PORT, SERVER) + sys.exit(getattr(e, 'exitcode', 1)) -logging.info("Serving at port %s, server %s.", PORT, SERVER) -try: - httpd.serve_forever() -except KeyboardInterrupt as e: - logging.info("Shutting down server.") - httpd.socket.close() + logging.info("Serving at port %s, server %s.", PORT, SERVER) + try: + httpd.serve_forever() + except KeyboardInterrupt as e: + logging.info("Shutting down server.") + httpd.socket.close() diff --git a/pelican/tools/templates/fabfile.py.in b/pelican/tools/templates/fabfile.py.in index a8ab586b..bcc66f6a 100644 --- a/pelican/tools/templates/fabfile.py.in +++ b/pelican/tools/templates/fabfile.py.in @@ -3,9 +3,10 @@ import fabric.contrib.project as project import os import shutil import sys -import SimpleHTTPServer import SocketServer +from pelican.server import ComplexHTTPRequestHandler + # Local path configuration (can be absolute or relative to fabfile) env.deploy_path = 'output' DEPLOY_PATH = env.deploy_path @@ -51,7 +52,7 @@ def serve(): class AddressReuseTCPServer(SocketServer.TCPServer): allow_reuse_address = True - server = AddressReuseTCPServer(('', PORT), SimpleHTTPServer.SimpleHTTPRequestHandler) + server = AddressReuseTCPServer(('', PORT), ComplexHTTPRequestHandler) sys.stderr.write('Serving on port {0} ...\n'.format(PORT)) server.serve_forever() From 946e95172fa85e7d5967226f3dbc723f099f94c9 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sat, 4 Apr 2015 15:17:59 -0400 Subject: [PATCH 1296/2344] Use pelican.server in Quickstart docs --- docs/quickstart.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 122d65b5..c4f5a897 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -61,10 +61,10 @@ Preview your site ----------------- Open a new terminal session and run the following commands to switch to your -``output`` directory and launch Python's built-in web server:: +``output`` directory and launch Pelican's web server:: cd ~/projects/yoursite/output - python -m SimpleHTTPServer # -m http.server if you use python3 + python -m pelican.server Preview your site by navigating to http://localhost:8000/ in your browser. From 5ca808ed598679dfef4574892c79e1d262632051 Mon Sep 17 00:00:00 2001 From: winlu Date: Mon, 6 Apr 2015 09:49:01 +0200 Subject: [PATCH 1297/2344] fix broken internal metadata link --- docs/settings.rst | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 9fb97883..73837181 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -470,14 +470,14 @@ your resume, and a contact page — you could have:: Path metadata ============= -Not all metadata needs to be `embedded in source file itself`__. For -example, blog posts are often named following a ``YYYY-MM-DD-SLUG.rst`` -pattern, or nested into ``YYYY/MM/DD-SLUG`` directories. To extract -metadata from the filename or path, set ``FILENAME_METADATA`` or -``PATH_METADATA`` to regular expressions that use Python's `group name -notation`_ ``(?P…)``. If you want to attach additional metadata -but don't want to encode it in the path, you can set -``EXTRA_PATH_METADATA``: +Not all metadata needs to be :ref:`embedded in source file itself +`. For example, blog posts are often named +following a ``YYYY-MM-DD-SLUG.rst`` pattern, or nested into +``YYYY/MM/DD-SLUG`` directories. To extract metadata from the +filename or path, set ``FILENAME_METADATA`` or ``PATH_METADATA`` to +regular expressions that use Python's `group name notation`_ ``(?P…)``. +If you want to attach additional metadata but don't want to encode +it in the path, you can set ``EXTRA_PATH_METADATA``: .. parsed-literal:: @@ -506,7 +506,6 @@ particular file: 'static/robots.txt': {'path': 'robots.txt'}, } -__ internal_metadata__ .. _group name notation: http://docs.python.org/3/library/re.html#regular-expression-syntax From 2e590d0e866a8679b99978819a75edded3c1bcef Mon Sep 17 00:00:00 2001 From: winlu Date: Mon, 6 Apr 2015 14:59:06 +0200 Subject: [PATCH 1298/2344] maintain test_readers * move all metadata tests to use a single function call (assertDictHasSubset) * add tests for assertDictHasSubset * correct some tests that iterated over metadata instead of expected metadata, resulting in metadata that was expected to be there but was not * correct resulting broken tests * add additional tests for EXTRA_PATH_METADATA * make MdReaderTest fail if Markdown is not available instead of skipping each method individually --- pelican/tests/test_readers.py | 181 ++++++++++++++++++++++++++-------- 1 file changed, 140 insertions(+), 41 deletions(-) diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index cb657673..d390fb48 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -22,6 +22,52 @@ class ReaderTest(unittest.TestCase): r = readers.Readers(settings=get_settings(**kwargs)) return r.read_file(base_path=CONTENT_PATH, path=path) + def assertDictHasSubset(self, dictionary, subset): + for key, value in subset.items(): + if key in dictionary: + real_value = dictionary.get(key) + self.assertEqual( + value, + real_value, + str('Expected %r to have value %r, but was %r') + % (key, value, real_value)) + else: + self.fail( + str('Expected %r to have value %r, but was not in Dict') + % (key, value)) + +class TestAssertDictHasSubset(ReaderTest): + def setUp(self): + self.dictionary = { + 'key-a' : 'val-a', + 'key-b' : 'val-b'} + + def tearDown(self): + self.dictionary = None + + def test_subset(self): + self.assertDictHasSubset(self.dictionary, {'key-a':'val-a'}) + + def test_equal(self): + self.assertDictHasSubset(self.dictionary, self.dictionary) + + def test_fail_not_set(self): + self.assertRaisesRegexp( + AssertionError, + 'Expected.*key-c.*to have value.*val-c.*but was not in Dict', + self.assertDictHasSubset, + self.dictionary, + {'key-c':'val-c'} + ) + + def test_fail_wrong_val(self): + self.assertRaisesRegexp( + AssertionError, + 'Expected .*key-a.* to have value .*val-b.* but was .*val-a.*', + self.assertDictHasSubset, + self.dictionary, + {'key-a':'val-b'} + ) class DefaultReaderTest(ReaderTest): @@ -48,8 +94,7 @@ class RstReaderTest(ReaderTest): 'custom_field': 'http://notmyidea.org', } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) def test_article_with_filename_metadata(self): page = self.read_file( @@ -61,8 +106,7 @@ class RstReaderTest(ReaderTest): 'title': 'Rst with filename metadata', 'reader': 'rst', } - for key, value in page.metadata.items(): - self.assertEqual(value, expected[key], key) + self.assertDictHasSubset(page.metadata, expected) page = self.read_file( path='2012-11-29_rst_w_filename_meta#foo-bar.rst', @@ -74,13 +118,12 @@ class RstReaderTest(ReaderTest): 'date': SafeDatetime(2012, 11, 29), 'reader': 'rst', } - for key, value in page.metadata.items(): - self.assertEqual(value, expected[key], key) + self.assertDictHasSubset(page.metadata, expected) page = self.read_file( path='2012-11-29_rst_w_filename_meta#foo-bar.rst', FILENAME_METADATA=( - '(?P\d{4}-\d{2}-\d{2})_' + '(?P\d{4}-\d{2}-\d{2})' '_(?P.*)' '#(?P.*)-(?P.*)')) expected = { @@ -88,12 +131,11 @@ class RstReaderTest(ReaderTest): 'author': 'Alexis Métaireau', 'title': 'Rst with filename metadata', 'date': SafeDatetime(2012, 11, 29), - 'slug': 'article_with_filename_metadata', + 'slug': 'rst_w_filename_meta', 'mymeta': 'foo', 'reader': 'rst', } - for key, value in page.metadata.items(): - self.assertEqual(value, expected[key], key) + self.assertDictHasSubset(page.metadata, expected) def test_article_metadata_key_lowercase(self): # Keys of metadata should be lowercase. @@ -105,6 +147,81 @@ class RstReaderTest(ReaderTest): self.assertEqual('Yeah', metadata.get('category'), 'Value keeps case.') + def test_article_extra_path_metadata(self): + input_with_metadata = '2012-11-29_rst_w_filename_meta#foo-bar.rst' + page_metadata = self.read_file( + path=input_with_metadata, + FILENAME_METADATA=( + '(?P\d{4}-\d{2}-\d{2})' + '_(?P.*)' + '#(?P.*)-(?P.*)' + ), + EXTRA_PATH_METADATA={ + input_with_metadata: { + 'key-1a': 'value-1a', + 'key-1b': 'value-1b' + } + } + ) + expected_metadata = { + 'category': 'yeah', + 'author' : 'Alexis Métaireau', + 'title': 'Rst with filename metadata', + 'date': SafeDatetime(2012, 11, 29), + 'slug': 'rst_w_filename_meta', + 'mymeta': 'foo', + 'reader': 'rst', + 'key-1a': 'value-1a', + 'key-1b': 'value-1b' + } + self.assertDictHasSubset(page_metadata.metadata, expected_metadata) + + input_file_path_without_metadata = 'article.rst' + page_without_metadata = self.read_file( + path=input_file_path_without_metadata, + EXTRA_PATH_METADATA={ + input_file_path_without_metadata: { + 'author': 'Charlès Overwrite'} + } + ) + expected_without_metadata = { + 'category' : 'misc', + 'author' : 'Charlès Overwrite', + 'title' : 'Article title', + 'reader' : 'rst', + } + self.assertDictHasSubset( + page_without_metadata.metadata, + expected_without_metadata) + + def test_article_extra_path_metadata_dont_overwrite(self): + #EXTRA_PATH_METADATA['author'] should get ignored + #since we don't overwrite already set values + input_file_path = '2012-11-29_rst_w_filename_meta#foo-bar.rst' + page = self.read_file( + path=input_file_path, + FILENAME_METADATA=( + '(?P\d{4}-\d{2}-\d{2})' + '_(?P.*)' + '#(?P.*)-(?P.*)'), + EXTRA_PATH_METADATA={ + input_file_path: { + 'author': 'Charlès Overwrite', + 'key-1b': 'value-1b'} + } + ) + expected = { + 'category': 'yeah', + 'author' : 'Alexis Métaireau', + 'title': 'Rst with filename metadata', + 'date': SafeDatetime(2012, 11, 29), + 'slug': 'rst_w_filename_meta', + 'mymeta': 'foo', + 'reader': 'rst', + 'key-1b': 'value-1b' + } + self.assertDictHasSubset(page.metadata, expected) + def test_typogrify(self): # if nothing is specified in the settings, the content should be # unmodified @@ -205,13 +322,11 @@ class RstReaderTest(ReaderTest): 'authors': ['First Author', 'Second Author'] } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) - + self.assertDictHasSubset(page.metadata, expected) +@unittest.skipUnless(readers.Markdown, "markdown isn't installed") class MdReaderTest(ReaderTest): - @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_metadata(self): reader = readers.MarkdownReader(settings=get_settings()) content, metadata = reader.read( @@ -224,8 +339,7 @@ class MdReaderTest(ReaderTest): 'modified': SafeDatetime(2010, 12, 2, 10, 20), 'tags': ['foo', 'bar', 'foobar'], } - for key, value in metadata.items(): - self.assertEqual(value, expected[key], key) + self.assertDictHasSubset(metadata, expected) content, metadata = reader.read( _path('article_with_markdown_and_nonascii_summary.md')) @@ -238,10 +352,8 @@ class MdReaderTest(ReaderTest): 'tags': ['パイソン', 'マック'], 'slug': 'python-virtualenv-on-mac-osx-mountain-lion-10.8', } - for key, value in metadata.items(): - self.assertEqual(value, expected[key], key) + self.assertDictHasSubset(metadata, expected) - @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_footnote(self): reader = readers.MarkdownReader(settings=get_settings()) content, metadata = reader.read( @@ -271,7 +383,6 @@ class MdReaderTest(ReaderTest): 'should be supported.

    '), 'date': SafeDatetime(2012, 10, 31), 'modified': SafeDatetime(2012, 11, 1), - 'slug': 'article-with-markdown-containing-footnotes', 'multiline': [ 'Line Metadata should be handle properly.', 'See syntax of Meta-Data extension of Python Markdown package:', @@ -282,10 +393,8 @@ class MdReaderTest(ReaderTest): ] } self.assertEqual(content, expected_content) - for key, value in metadata.items(): - self.assertEqual(value, expected_metadata[key], key) + self.assertDictHasSubset(metadata, expected_metadata) - @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_file_extensions(self): reader = readers.MarkdownReader(settings=get_settings()) # test to ensure the md file extension is being processed by the @@ -322,7 +431,6 @@ class MdReaderTest(ReaderTest): " the mdown extension.

    ") self.assertEqual(content, expected) - @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_markdown_markup_extension(self): # test to ensure the markdown markup extension is being processed as # expected @@ -342,7 +450,6 @@ class MdReaderTest(ReaderTest): self.assertEqual(page.content, expected) - @unittest.skipUnless(readers.Markdown, "markdown isn't installed") def test_article_with_filename_metadata(self): page = self.read_file( path='2012-11-30_md_w_filename_meta#foo-bar.md', @@ -351,8 +458,7 @@ class MdReaderTest(ReaderTest): 'category': 'yeah', 'author': 'Alexis Métaireau', } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) page = self.read_file( path='2012-11-30_md_w_filename_meta#foo-bar.md', @@ -362,8 +468,7 @@ class MdReaderTest(ReaderTest): 'author': 'Alexis Métaireau', 'date': SafeDatetime(2012, 11, 30), } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) page = self.read_file( path='2012-11-30_md_w_filename_meta#foo-bar.md', @@ -378,8 +483,7 @@ class MdReaderTest(ReaderTest): 'slug': 'md_w_filename_meta', 'mymeta': 'foo', } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) class HTMLReaderTest(ReaderTest): @@ -397,8 +501,7 @@ class HTMLReaderTest(ReaderTest): 'tags': ['foo', 'bar', 'foobar'], } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) def test_article_with_metadata(self): page = self.read_file(path='article_with_metadata.html') @@ -412,8 +515,7 @@ class HTMLReaderTest(ReaderTest): 'custom_field': 'http://notmyidea.org', } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) def test_article_with_multiple_authors(self): page = self.read_file(path='article_with_multiple_authors.html') @@ -421,8 +523,7 @@ class HTMLReaderTest(ReaderTest): 'authors': ['First Author', 'Second Author'] } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) def test_article_with_metadata_and_contents_attrib(self): page = self.read_file(path='article_with_metadata_and_contents.html') @@ -435,8 +536,7 @@ class HTMLReaderTest(ReaderTest): 'tags': ['foo', 'bar', 'foobar'], 'custom_field': 'http://notmyidea.org', } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) def test_article_with_null_attributes(self): page = self.read_file(path='article_with_null_attributes.html') @@ -460,5 +560,4 @@ class HTMLReaderTest(ReaderTest): 'title': 'Article with Nonconformant HTML meta tags', } - for key, value in expected.items(): - self.assertEqual(value, page.metadata[key], key) + self.assertDictHasSubset(page.metadata, expected) From 0f7938ccb71e34cd020026095fcb086b99c79856 Mon Sep 17 00:00:00 2001 From: Alberto Scotto Date: Wed, 8 Apr 2015 03:32:48 +0200 Subject: [PATCH 1299/2344] fix the meta tags added in #1028 The attribute 'contents' should be 'content'. See http://www.w3schools.com/tags/att_meta_content.asp --- pelican/themes/simple/templates/article.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index e81261c5..d558183d 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -2,15 +2,15 @@ {% block head %} {{ super() }} {% for keyword in article.keywords %} - + {% endfor %} {% for description in article.description %} - + {% endfor %} {% for tag in article.tags %} - + {% endfor %} {% endblock %} From adc5c4b572195d12cea1df4d0f8daa49ec2e168f Mon Sep 17 00:00:00 2001 From: winlu Date: Fri, 10 Apr 2015 09:02:12 +0200 Subject: [PATCH 1300/2344] fix broken refs --- docs/themes.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/themes.rst b/docs/themes.rst index fd4ec8f9..7f2693ff 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -367,7 +367,7 @@ source_path Full system path of the article source file. status The article status, can be any of 'published' or 'draft'. summary Rendered summary content. -tags List of :ref:`Tag ` +tags List of :ref:`Tag ` objects. template Template name to use for rendering. title Title of the article. @@ -422,7 +422,7 @@ source_path Full system path of the page source file. status The page status, can be any of 'published' or 'draft'. summary Rendered summary content. -tags List of :ref:`Tag ` +tags List of :ref:`Tag ` objects. template Template name to use for rendering. title Title of the page. From bf7d113caaa9d9fcc860e6687a63589ea00aea10 Mon Sep 17 00:00:00 2001 From: winlu Date: Sat, 11 Apr 2015 22:45:31 +0200 Subject: [PATCH 1301/2344] add skips for tests relying on dev_requirements modules --- pelican/tests/test_generators.py | 16 +++++++++++++++- pelican/tests/test_importer.py | 7 +++++++ pelican/tests/test_rstdirectives.py | 10 ++++++++-- 3 files changed, 30 insertions(+), 3 deletions(-) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index acf767f2..4fb70826 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -6,7 +6,10 @@ from codecs import open try: from unittest.mock import MagicMock except ImportError: - from mock import MagicMock + try: + from mock import MagicMock + except ImportError: + MagicMock = False from shutil import rmtree from tempfile import mkdtemp @@ -112,6 +115,7 @@ class TestArticlesGenerator(unittest.TestCase): return [[article.title, article.status, article.category.name, article.template] for article in articles] + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_generate_feeds(self): settings = get_settings() settings['CACHE_PATH'] = self.temp_cache @@ -215,6 +219,7 @@ class TestArticlesGenerator(unittest.TestCase): categories_expected = ['default', 'yeah', 'test', 'zhi-dao-shu'] self.assertEqual(sorted(categories), sorted(categories_expected)) + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_direct_templates_save_as_default(self): settings = get_settings(filenames={}) @@ -228,6 +233,7 @@ class TestArticlesGenerator(unittest.TestCase): generator.get_template("archives"), settings, blog=True, paginated={}, page_name='archives') + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_direct_templates_save_as_modified(self): settings = get_settings() @@ -244,6 +250,7 @@ class TestArticlesGenerator(unittest.TestCase): blog=True, paginated={}, page_name='archives/index') + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_direct_templates_save_as_false(self): settings = get_settings() @@ -268,6 +275,7 @@ class TestArticlesGenerator(unittest.TestCase): self.assertIn(custom_template, self.articles) self.assertIn(standard_template, self.articles) + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_period_in_timeperiod_archive(self): """ Test that the context of a generated period_archive is passed @@ -347,6 +355,7 @@ class TestArticlesGenerator(unittest.TestCase): authors_expected = ['alexis-metaireau', 'first-author', 'second-author'] self.assertEqual(sorted(authors), sorted(authors_expected)) + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_article_object_caching(self): """Test Article objects caching at the generator level""" settings = get_settings(filenames={}) @@ -367,6 +376,7 @@ class TestArticlesGenerator(unittest.TestCase): generator.generate_context() generator.readers.read_file.assert_called_count == 0 + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_reader_content_caching(self): """Test raw content caching at the reader level""" settings = get_settings(filenames={}) @@ -389,6 +399,7 @@ class TestArticlesGenerator(unittest.TestCase): for reader in readers.values(): reader.read.assert_called_count == 0 + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_ignore_cache(self): """Test that all the articles are read again when not loading cache @@ -492,6 +503,7 @@ class TestPageGenerator(unittest.TestCase): self.assertEqual(sorted(pages_expected), sorted(pages)) self.assertEqual(sorted(hidden_pages_expected), sorted(hidden_pages)) + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_page_object_caching(self): """Test Page objects caching at the generator level""" settings = get_settings(filenames={}) @@ -512,6 +524,7 @@ class TestPageGenerator(unittest.TestCase): generator.generate_context() generator.readers.read_file.assert_called_count == 0 + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_reader_content_caching(self): """Test raw content caching at the reader level""" settings = get_settings(filenames={}) @@ -534,6 +547,7 @@ class TestPageGenerator(unittest.TestCase): for reader in readers.values(): reader.read.assert_called_count == 0 + @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_ignore_cache(self): """Test that all the pages are read again when not loading cache diff --git a/pelican/tests/test_importer.py b/pelican/tests/test_importer.py index c108bc52..4ace5ccc 100644 --- a/pelican/tests/test_importer.py +++ b/pelican/tests/test_importer.py @@ -26,6 +26,12 @@ try: except ImportError: BeautifulSoup = False # NOQA +try: + import bs4.builder._lxml as LXML +except ImportError: + LXML = False + + @skipIfNoExecutable(['pandoc', '--version']) @unittest.skipUnless(BeautifulSoup, 'Needs BeautifulSoup module') @@ -302,6 +308,7 @@ class TestBuildHeader(unittest.TestCase): @unittest.skipUnless(BeautifulSoup, 'Needs BeautifulSoup module') +@unittest.skipUnless(LXML, 'Needs lxml module') class TestWordpressXMLAttachements(unittest.TestCase): def setUp(self): self.old_locale = locale.setlocale(locale.LC_ALL) diff --git a/pelican/tests/test_rstdirectives.py b/pelican/tests/test_rstdirectives.py index ae863b30..7c5f8adf 100644 --- a/pelican/tests/test_rstdirectives.py +++ b/pelican/tests/test_rstdirectives.py @@ -1,9 +1,15 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function - -from mock import Mock +try: + from unittest.mock import Mock +except ImportError: + try: + from mock import Mock + except ImportError: + Mock = False from pelican.tests.support import unittest +@unittest.skipUnless(Mock, 'Needs Mock module') class Test_abbr_role(unittest.TestCase): def call_it(self, text): from pelican.rstdirectives import abbr_role From f864418b9e1af0a980052dc4c7d51519c57e3649 Mon Sep 17 00:00:00 2001 From: "Daniel M. Drucker" Date: Mon, 13 Apr 2015 11:12:52 -0400 Subject: [PATCH 1302/2344] make the quickstart work The quickstart was worded confusingly - it said "from your project directory", which implied doing a `cd ..` down to the `projects` dir, which would cause `pelican content` to fail. In fact, you need to be in the `yoursite` directory, which is the directory that has the `content` directory in it. --- docs/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index c4f5a897..ef5256c2 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -49,7 +49,7 @@ Given that this example article is in Markdown format, save it as Generate your site ------------------ -From your project directory, run the ``pelican`` command to generate your site:: +From your site directory, run the ``pelican`` command to generate your site:: pelican content From a45a917766089c9e733cf417f942a4b9c651a154 Mon Sep 17 00:00:00 2001 From: winlu Date: Sat, 11 Apr 2015 15:02:53 +0200 Subject: [PATCH 1303/2344] test docs via travis * move build environment into tox * add new environment installing sphinx and testing for doc errors * reorganize dependency installs for easier management --- .travis.yml | 16 +++++++--------- dev_requirements.txt | 3 --- tox.ini | 29 +++++++++++++++++++++++------ 3 files changed, 30 insertions(+), 18 deletions(-) diff --git a/.travis.yml b/.travis.yml index f5a7f04f..cc124ea4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,11 @@ language: python python: - "2.7" - - "3.3" - - "3.4" +env: + - TOX_ENV=docs + - TOX_ENV=py27 + - TOX_ENV=py33 + - TOX_ENV=py34 addons: apt_packages: - pandoc @@ -10,13 +13,8 @@ before_install: - sudo apt-get update -qq - sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 install: - - pip install . - - pip install -r dev_requirements.txt - - pip install nose-cov -script: nosetests -sv --with-coverage --cover-package=pelican pelican -after_success: - - pip install coveralls - - coveralls + - pip install tox +script: tox -e $TOX_ENV notifications: irc: channels: diff --git a/dev_requirements.txt b/dev_requirements.txt index a7c10719..028cbebd 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -10,6 +10,3 @@ typogrify # To perform release bumpr==0.2.0 wheel - -# For docs theme -sphinx_rtd_theme diff --git a/tox.ini b/tox.ini index 5dd36c36..11b3cae8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,28 @@ -# This tests the unified codebase (py27, py33) of Pelican. -# depends on some external libraries that aren't released yet. - [tox] -envlist = py27,py33,py34 +envlist = py27,py33,py34,docs [testenv] -commands = - python -m unittest discover +basepython = + py27: python2.7 + py33: python3.3 + py34: python3.4 +usedevelop=True deps = -rdev_requirements.txt + nose + nose-cov + coveralls + +commands = + {envpython} --version + nosetests -sv --with-coverage --cover-package=pelican pelican + coveralls + +[testenv:docs] +basepython = python2.7 +deps = + sphinx + sphinx_rtd_theme +changedir = docs +commands = + sphinx-build -W -b html -d {envtmpdir}/doctrees . {envtmpdir}/html From 2e84e30ad38175819ef97103f9720693c0218fc7 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Tue, 14 Apr 2015 15:19:16 -0400 Subject: [PATCH 1304/2344] Fixes #1695: replace with list comprehension for py3 compatibility --- pelican/tools/pelican_quickstart.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 74633630..2f1129dc 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -162,7 +162,7 @@ def ask(question, answer=str_compat, default=None, l=None): def ask_timezone(question, default, tzurl): """Prompt for time zone and validate input""" - lower_tz = map(str.lower, pytz.all_timezones) + lower_tz = [tz.lower() for tz in pytz.all_timezones] while True: r = ask(question, str_compat, default) r = r.strip().replace(' ', '_').lower() From 90a283bc44da299e0860dcc27516bfefe327fd56 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Thu, 16 Apr 2015 19:05:15 -0400 Subject: [PATCH 1305/2344] Fixes #1686: posixize paths in context['filenames'] to fix windows issues --- pelican/generators.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 75bd6b2a..0ce6439d 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -22,7 +22,8 @@ from jinja2 import (Environment, FileSystemLoader, PrefixLoader, ChoiceLoader, from pelican.contents import Article, Draft, Page, Static, is_valid_content from pelican.readers import Readers from pelican.utils import (copy, process_translations, mkdir_p, DateFormatter, - FileStampDataCacher, python_2_unicode_compatible) + FileStampDataCacher, python_2_unicode_compatible, + posixize_path) from pelican import signals @@ -160,7 +161,7 @@ class Generator(object): (For example, one that was missing mandatory metadata.) The path argument is expected to be relative to self.path. """ - self.context['filenames'][os.path.normpath(path)] = None + self.context['filenames'][posixize_path(os.path.normpath(path))] = None def _is_potential_source_path(self, path): """Return True if path was supposed to be used as a source file. @@ -168,7 +169,7 @@ class Generator(object): before this method is called, even if they failed to process.) The path argument is expected to be relative to self.path. """ - return os.path.normpath(path) in self.context['filenames'] + return posixize_path(os.path.normpath(path)) in self.context['filenames'] def _update_context(self, items): """Update the context with the given items from the currrent From dceea3aabe36e206d014e2540f86572dcb7c8859 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Thu, 16 Apr 2015 19:16:23 -0400 Subject: [PATCH 1306/2344] Change URLWrapper.slug to a property Main goal is to delay `slugify` call until `slug` is needed. `slugify` can be expensive depending on the input string (see #1172). Changing it to a property gives plugins time to place custom `slug`s before `name` is unnecessarily slugified. With this change, default behavior is same except the time slugification happens. But if you set custom slug, `slugify` won't be used at all. So, this is a partial solution to #1172. The rest, setting a custom slug, would best be handled by a plugin. --- pelican/urlwrappers.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/pelican/urlwrappers.py b/pelican/urlwrappers.py index 06cfa2ab..60bc6a3a 100644 --- a/pelican/urlwrappers.py +++ b/pelican/urlwrappers.py @@ -13,12 +13,10 @@ logger = logging.getLogger(__name__) @functools.total_ordering class URLWrapper(object): def __init__(self, name, settings): - # next 2 lines are redundant with the setter of the name property - # but are here for clarity self.settings = settings self._name = name - self.slug = slugify(name, self.settings.get('SLUG_SUBSTITUTIONS', ())) - self.name = name + self._slug = None + self._slug_from_name = True @property def name(self): @@ -27,11 +25,28 @@ class URLWrapper(object): @name.setter def name(self, name): self._name = name - self.slug = slugify(name, self.settings.get('SLUG_SUBSTITUTIONS', ())) + # if slug wasn't explicitly set, it needs to be regenerated from name + # so, changing name should reset slug for slugification + if self._slug_from_name: + self._slug = None + + @property + def slug(self): + if self._slug is None: + self._slug = slugify(self.name, + self.settings.get('SLUG_SUBSTITUTIONS', ())) + return self._slug + + @slug.setter + def slug(self, slug): + # if slug is expliticly set, changing name won't alter slug + self._slug_from_name = False + self._slug = slug def as_dict(self): d = self.__dict__ d['name'] = self.name + d['slug'] = self.slug return d def __hash__(self): From 9dd4080fe6162849aec0946cc8406b04da764157 Mon Sep 17 00:00:00 2001 From: winlu Date: Mon, 20 Apr 2015 12:16:05 +0200 Subject: [PATCH 1307/2344] remove tag_cloud from core --- docs/settings.rst | 47 ------------------------------------------- pelican/generators.py | 32 ++--------------------------- pelican/settings.py | 2 -- 3 files changed, 2 insertions(+), 79 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 73837181..2eec1e50 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -620,53 +620,6 @@ This would cause the first page to be written to ``page/{number}`` directories. -Tag cloud -========= - -If you want to generate a tag cloud with all your tags, you can do so using the -following settings. - -================================================ ===================================================== -Setting name (followed by default value) What does it do? -================================================ ===================================================== -``TAG_CLOUD_STEPS = 4`` Count of different font sizes in the tag - cloud. -``TAG_CLOUD_MAX_ITEMS = 100`` Maximum number of tags in the cloud. -================================================ ===================================================== - -The default theme does not include a tag cloud, but it is pretty easy to add one:: - -
      - {% for tag in tag_cloud %} -
    • {{ tag.0 }}
    • - {% endfor %} -
    - -You should then also define CSS styles with appropriate classes (tag-1 to tag-N, -where N matches ``TAG_CLOUD_STEPS``), tag-1 being the most frequent, and -define a ``ul.tagcloud`` class with appropriate list-style to create the cloud. -For example:: - - ul.tagcloud { - list-style: none; - padding: 0; - } - - ul.tagcloud li { - display: inline-block; - } - - li.tag-1 { - font-size: 150%; - } - - li.tag-2 { - font-size: 120%; - } - - ... - - Translations ============ diff --git a/pelican/generators.py b/pelican/generators.py index 75bd6b2a..672850d3 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -3,8 +3,6 @@ from __future__ import unicode_literals, print_function import os import six -import math -import random import logging import shutil import fnmatch @@ -14,7 +12,7 @@ from codecs import open from collections import defaultdict from functools import partial from itertools import chain, groupby -from operator import attrgetter, itemgetter +from operator import attrgetter from jinja2 import (Environment, FileSystemLoader, PrefixLoader, ChoiceLoader, BaseLoader, TemplateNotFound) @@ -552,32 +550,6 @@ class ArticlesGenerator(CachingGenerator): self.dates.sort(key=attrgetter('date'), reverse=self.context['NEWEST_FIRST_ARCHIVES']) - # create tag cloud - tag_cloud = defaultdict(int) - for article in self.articles: - for tag in getattr(article, 'tags', []): - tag_cloud[tag] += 1 - - tag_cloud = sorted(tag_cloud.items(), key=itemgetter(1), reverse=True) - tag_cloud = tag_cloud[:self.settings.get('TAG_CLOUD_MAX_ITEMS')] - - tags = list(map(itemgetter(1), tag_cloud)) - if tags: - max_count = max(tags) - steps = self.settings.get('TAG_CLOUD_STEPS') - - # calculate word sizes - self.tag_cloud = [ - ( - tag, - int(math.floor(steps - (steps - 1) * math.log(count) - / (math.log(max_count)or 1))) - ) - for tag, count in tag_cloud - ] - # put words in chaos - random.shuffle(self.tag_cloud) - # and generate the output :) # order the categories per name @@ -589,7 +561,7 @@ class ArticlesGenerator(CachingGenerator): self.authors.sort() self._update_context(('articles', 'dates', 'tags', 'categories', - 'tag_cloud', 'authors', 'related_posts')) + 'authors', 'related_posts')) self.save_cache() self.readers.save_cache() signals.article_generator_finalized.send(self) diff --git a/pelican/settings.py b/pelican/settings.py index 0d69c08e..0c54e89b 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -93,8 +93,6 @@ DEFAULT_CONFIG = { 'DAY_ARCHIVE_SAVE_AS': '', 'RELATIVE_URLS': False, 'DEFAULT_LANG': 'en', - 'TAG_CLOUD_STEPS': 4, - 'TAG_CLOUD_MAX_ITEMS': 100, 'DIRECT_TEMPLATES': ['index', 'tags', 'categories', 'authors', 'archives'], 'EXTRA_TEMPLATES_PATHS': [], 'PAGINATED_DIRECT_TEMPLATES': ['index'], From 3effe464c6a893c61d8a399f77531e14d348afd1 Mon Sep 17 00:00:00 2001 From: winlu Date: Mon, 20 Apr 2015 16:36:18 +0200 Subject: [PATCH 1308/2344] add faq entry about tag-cloud outsourcing --- docs/faq.rst | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/docs/faq.rst b/docs/faq.rst index 86f12462..ff473624 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -241,3 +241,12 @@ purposes. This can be achieved by explicitly specifying only the filenames of those articles in ``ARTICLE_PATHS``. A list of such filenames could be found using a command similar to ``cd content; find -name '*.md' | head -n 10``. + +My tag-cloud is missing/broken since I upgraded Pelican +======================================================= + +In an ongoing effort to steamline Pelican, `tag_cloud` generation has been +moved out of the pelican core and into a separate `plugin +`_. +See the :ref:`plugins` documentation further information about the +Pelican plugin system. From d6ebf772e3fa90910714e06cd9f5529cc2956df0 Mon Sep 17 00:00:00 2001 From: Matthew Scott Date: Thu, 23 Apr 2015 13:30:24 -0500 Subject: [PATCH 1309/2344] Allow `--path` even when using a virtualenv project --- pelican/tools/pelican_quickstart.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 2f1129dc..58da4649 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -59,6 +59,13 @@ if six.PY3: else: str_compat = unicode +# Create a 'marked' default path, to determine if someone has supplied +# a path on the command-line. +class _DEFAULT_PATH_TYPE(str_compat): + is_default_path = True + +_DEFAULT_PATH = _DEFAULT_PATH_TYPE(os.curdir) + def decoding_strings(f): def wrapper(*args, **kwargs): out = f(*args, **kwargs) @@ -178,7 +185,7 @@ def main(): parser = argparse.ArgumentParser( description="A kickstarter for Pelican", formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument('-p', '--path', default=os.curdir, + parser.add_argument('-p', '--path', default=_DEFAULT_PATH, help="The path to generate the blog into") parser.add_argument('-t', '--title', metavar="title", help='Set the title of the website') @@ -200,7 +207,8 @@ needed by Pelican. project = os.path.join( os.environ.get('VIRTUAL_ENV', os.curdir), '.project') - if os.path.isfile(project): + no_path_was_specified = hasattr(args.path, 'is_default_path') + if os.path.isfile(project) and no_path_was_specified: CONF['basedir'] = open(project, 'r').read().rstrip("\n") print('Using project associated with current virtual environment.' 'Will save to:\n%s\n' % CONF['basedir']) From df5495303257d0809139f418db0e9b2607917830 Mon Sep 17 00:00:00 2001 From: Ingmar Steen Date: Wed, 29 Apr 2015 15:08:46 +0200 Subject: [PATCH 1310/2344] Fix intra-site links to drafts. Overwrite an article's source path registration when it is 'upgraded' to a draft. Fixes #865 --- pelican/generators.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pelican/generators.py b/pelican/generators.py index 75bd6b2a..e95ec3ab 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -525,6 +525,7 @@ class ArticlesGenerator(CachingGenerator): preread_sender=self, context_signal=signals.article_generator_context, context_sender=self) + self.add_source_path(draft) all_drafts.append(draft) else: logger.error("Unknown status '%s' for file %s, skipping it.", From 264d75b9e04c4aa517a0bfd14473dfe78ee06d2f Mon Sep 17 00:00:00 2001 From: Forest Date: Fri, 8 May 2015 13:39:59 -0700 Subject: [PATCH 1311/2344] Clarify STATIC_EXCLUDE_SOURCES documentatoin. --- docs/settings.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 73837181..a18e24bf 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -159,7 +159,12 @@ Setting name (followed by default value, if any) Pelican's default settings include the "images" directory here. ``STATIC_EXCLUDES = []`` A list of directories to exclude when looking for static files. ``STATIC_EXCLUDE_SOURCES = True`` If set to False, content source files will not be skipped when - copying files found in ``STATIC_PATHS``. + copying files found in ``STATIC_PATHS``. This setting is for + backward compatibility with Pelican releases before version 3.5. + It has no effect unless ``STATIC_PATHS`` contains a directory that + is also in ``ARTICLE_PATHS`` or ``PAGE_PATHS``. If you are trying + to publish your site's source files, consider using the + ``OUTPUT_SOURCES` setting instead. ``TIMEZONE`` The timezone used in the date information, to generate Atom and RSS feeds. See the *Timezone* section below for more info. From 2f048d365222edd98119dfc9366e202008e5b57f Mon Sep 17 00:00:00 2001 From: Forest Date: Sat, 9 May 2015 21:20:07 -0700 Subject: [PATCH 1312/2344] Add backtick missing from my last docs commit. --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index a18e24bf..330ec2a6 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -164,7 +164,7 @@ Setting name (followed by default value, if any) It has no effect unless ``STATIC_PATHS`` contains a directory that is also in ``ARTICLE_PATHS`` or ``PAGE_PATHS``. If you are trying to publish your site's source files, consider using the - ``OUTPUT_SOURCES` setting instead. + ``OUTPUT_SOURCES`` setting instead. ``TIMEZONE`` The timezone used in the date information, to generate Atom and RSS feeds. See the *Timezone* section below for more info. From ab2dc71d34f0b3387afafb9251b0f6c0cae3998e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Tue, 12 May 2015 02:55:45 +0300 Subject: [PATCH 1313/2344] Improve internal error reporting. Fixes #1717. --- pelican/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 056c45ef..12da111a 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -444,7 +444,7 @@ def main(): except Exception as e: if (args.verbosity == logging.DEBUG): - logger.critical(e.args) + logger.critical('Internal failure: %r', e, exc_info=True) raise logger.warning( 'Caught exception "%s". Reloading.', e) From e10ae8a187876b7954d38d1968c0c8f8b6606e22 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Wed, 13 May 2015 21:08:39 +0200 Subject: [PATCH 1314/2344] make tox 2 compatible --- .travis.yml | 2 +- tox.ini | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index cc124ea4..5d7d4a5f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -13,7 +13,7 @@ before_install: - sudo apt-get update -qq - sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 install: - - pip install tox + - pip install tox==2.0.1 script: tox -e $TOX_ENV notifications: irc: diff --git a/tox.ini b/tox.ini index 11b3cae8..775241b8 100644 --- a/tox.ini +++ b/tox.ini @@ -1,11 +1,12 @@ [tox] -envlist = py27,py33,py34,docs +envlist = py{27,33,34},docs [testenv] basepython = py27: python2.7 py33: python3.3 py34: python3.4 +passenv = * usedevelop=True deps = -rdev_requirements.txt From f8f89a84761ede361fd97b15d96f0a7cdbef2c31 Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Sun, 24 May 2015 12:58:00 +0100 Subject: [PATCH 1315/2344] Fix spelling mistakes in docs --- docs/pelican-themes.rst | 6 +++--- docs/themes.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/pelican-themes.rst b/docs/pelican-themes.rst index 7090c648..e18ebadf 100644 --- a/docs/pelican-themes.rst +++ b/docs/pelican-themes.rst @@ -130,11 +130,11 @@ This is useful for theme development: $ sudo pelican-themes -s ~/Dev/Python/pelican-themes/two-column $ pelican ~/Blog/content -o /tmp/out -t two-column $ firefox /tmp/out/index.html - $ vim ~/Dev/Pelican/pelican-themes/two-coumn/static/css/main.css + $ vim ~/Dev/Pelican/pelican-themes/two-column/static/css/main.css $ pelican ~/Blog/content -o /tmp/out -t two-column - $ cp /tmp/bg.png ~/Dev/Pelican/pelican-themes/two-coumn/static/img/bg.png + $ cp /tmp/bg.png ~/Dev/Pelican/pelican-themes/two-column/static/img/bg.png $ pelican ~/Blog/content -o /tmp/out -t two-column - $ vim ~/Dev/Pelican/pelican-themes/two-coumn/templates/index.html + $ vim ~/Dev/Pelican/pelican-themes/two-column/templates/index.html $ pelican ~/Blog/content -o /tmp/out -t two-column diff --git a/docs/themes.rst b/docs/themes.rst index 7f2693ff..d64683bb 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -359,7 +359,7 @@ default_template Default template name. in_default_lang Boolean representing if the article is written in the default language. lang Language of the article. -locale_date Date formated by the `date_format`. +locale_date Date formatted by the `date_format`. metadata Article header metadata `dict`. save_as Location to save the article page. slug Page slug. @@ -414,7 +414,7 @@ default_template Default template name. in_default_lang Boolean representing if the article is written in the default language. lang Language of the article. -locale_date Date formated by the `date_format`. +locale_date Date formatted by the `date_format`. metadata Page header metadata `dict`. save_as Location to save the page. slug Page slug. From 641b3ffa71801eb5e4f5b818e925021f2287f699 Mon Sep 17 00:00:00 2001 From: Alex Chan Date: Sun, 24 May 2015 13:04:35 +0100 Subject: [PATCH 1316/2344] Fix capitalisation of WordPress --- docs/changelog.rst | 2 +- pelican/tools/pelican_import.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 52367cec..4e297562 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -205,7 +205,7 @@ Release history 2.5 (2010-11-20) ================== -* Import from Wordpress +* Import from WordPress * Added some new themes (martyalchin / wide-notmyidea) * First bug report! * Linkedin support diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index a6424ace..92e8c919 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -101,12 +101,12 @@ def decode_wp_content(content, br=True): return content def get_items(xml): - """Opens a wordpress xml file and returns a list of items""" + """Opens a WordPress xml file and returns a list of items""" try: from bs4 import BeautifulSoup except ImportError: error = ('Missing dependency ' - '"BeautifulSoup4" and "lxml" required to import Wordpress XML files.') + '"BeautifulSoup4" and "lxml" required to import WordPress XML files.') sys.exit(error) with open(xml, encoding='utf-8') as infile: xmlfile = infile.read() @@ -586,7 +586,7 @@ def get_attachments(xml): return attachedposts def download_attachments(output_path, urls): - """Downloads wordpress attachments and returns a list of paths to + """Downloads WordPress attachments and returns a list of paths to attachments that can be associated with a post (relative path to output directory). Files that fail to download, will not be added to posts""" locations = [] From 77ebd05fce1176f0f4c9cd2e48ffa47fb30d1901 Mon Sep 17 00:00:00 2001 From: Jonathan Sundqvist Date: Sun, 24 May 2015 16:59:23 +0100 Subject: [PATCH 1317/2344] Actually stopping server When running `make devserver` and then running `make stopserver` it doesn't stop the server. This patch fixes that. --- pelican/tools/templates/Makefile.in | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pelican/tools/templates/Makefile.in b/pelican/tools/templates/Makefile.in index 5e3635c3..b97fbe43 100644 --- a/pelican/tools/templates/Makefile.in +++ b/pelican/tools/templates/Makefile.in @@ -92,8 +92,7 @@ else endif stopserver: - kill -9 `cat pelican.pid` - kill -9 `cat srv.pid` + $(BASEDIR)/develop_server.sh stop @echo 'Stopped Pelican and SimpleHTTPServer processes running in background.' publish: From 940eb76b7f70b1c9c7f833d5328d44cb19bde406 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 2 Jun 2015 08:35:12 -0700 Subject: [PATCH 1318/2344] Load external resources via HTTPS when available This replaces all `http://` and `//:` links with `https:`. The protocol- relative URL scheme is now deemed to be an anti-pattern. There are security advantages to using HTTPS, and there are no significant performance concerns. In short, if the asset we need is available via HTTPS, then that asset should always be loaded via HTTPS. Fixes #1736 --- pelican/tests/output/basic/a-markdown-powered-article.html | 2 +- pelican/tests/output/basic/archives.html | 2 +- pelican/tests/output/basic/article-1.html | 2 +- pelican/tests/output/basic/article-2.html | 2 +- pelican/tests/output/basic/article-3.html | 2 +- pelican/tests/output/basic/author/alexis-metaireau.html | 2 +- pelican/tests/output/basic/authors.html | 2 +- pelican/tests/output/basic/categories.html | 2 +- pelican/tests/output/basic/category/bar.html | 2 +- pelican/tests/output/basic/category/cat1.html | 2 +- pelican/tests/output/basic/category/misc.html | 2 +- pelican/tests/output/basic/category/yeah.html | 2 +- pelican/tests/output/basic/filename_metadata-example.html | 2 +- pelican/tests/output/basic/index.html | 2 +- pelican/tests/output/basic/oh-yeah.html | 2 +- pelican/tests/output/basic/override/index.html | 2 +- .../output/basic/pages/this-is-a-test-hidden-page.html | 2 +- pelican/tests/output/basic/pages/this-is-a-test-page.html | 2 +- pelican/tests/output/basic/second-article-fr.html | 2 +- pelican/tests/output/basic/second-article.html | 2 +- pelican/tests/output/basic/tag/bar.html | 2 +- pelican/tests/output/basic/tag/baz.html | 2 +- pelican/tests/output/basic/tag/foo.html | 2 +- pelican/tests/output/basic/tag/foobar.html | 2 +- pelican/tests/output/basic/tag/oh.html | 2 +- pelican/tests/output/basic/tag/yeah.html | 2 +- pelican/tests/output/basic/tags.html | 2 +- pelican/tests/output/basic/theme/css/main.css | 2 +- pelican/tests/output/basic/this-is-a-super-article.html | 2 +- pelican/tests/output/basic/unbelievable.html | 2 +- pelican/tests/output/custom/a-markdown-powered-article.html | 6 +++--- pelican/tests/output/custom/archives.html | 6 +++--- pelican/tests/output/custom/article-1.html | 6 +++--- pelican/tests/output/custom/article-2.html | 6 +++--- pelican/tests/output/custom/article-3.html | 6 +++--- pelican/tests/output/custom/author/alexis-metaireau.html | 6 +++--- pelican/tests/output/custom/author/alexis-metaireau2.html | 6 +++--- pelican/tests/output/custom/author/alexis-metaireau3.html | 6 +++--- pelican/tests/output/custom/authors.html | 6 +++--- pelican/tests/output/custom/categories.html | 6 +++--- pelican/tests/output/custom/category/bar.html | 6 +++--- pelican/tests/output/custom/category/cat1.html | 6 +++--- pelican/tests/output/custom/category/misc.html | 6 +++--- pelican/tests/output/custom/category/yeah.html | 6 +++--- pelican/tests/output/custom/drafts/a-draft-article.html | 6 +++--- pelican/tests/output/custom/filename_metadata-example.html | 6 +++--- pelican/tests/output/custom/index.html | 6 +++--- pelican/tests/output/custom/index2.html | 6 +++--- pelican/tests/output/custom/index3.html | 6 +++--- pelican/tests/output/custom/jinja2_template.html | 6 +++--- pelican/tests/output/custom/oh-yeah-fr.html | 6 +++--- pelican/tests/output/custom/oh-yeah.html | 6 +++--- pelican/tests/output/custom/override/index.html | 6 +++--- .../output/custom/pages/this-is-a-test-hidden-page.html | 6 +++--- pelican/tests/output/custom/pages/this-is-a-test-page.html | 6 +++--- pelican/tests/output/custom/second-article-fr.html | 6 +++--- pelican/tests/output/custom/second-article.html | 6 +++--- pelican/tests/output/custom/tag/bar.html | 6 +++--- pelican/tests/output/custom/tag/baz.html | 6 +++--- pelican/tests/output/custom/tag/foo.html | 6 +++--- pelican/tests/output/custom/tag/foobar.html | 6 +++--- pelican/tests/output/custom/tag/oh.html | 6 +++--- pelican/tests/output/custom/tag/yeah.html | 6 +++--- pelican/tests/output/custom/tags.html | 6 +++--- pelican/tests/output/custom/theme/css/main.css | 2 +- pelican/tests/output/custom/this-is-a-super-article.html | 6 +++--- pelican/tests/output/custom/unbelievable.html | 6 +++--- pelican/tests/output/custom_locale/archives.html | 6 +++--- .../tests/output/custom_locale/author/alexis-metaireau.html | 6 +++--- .../output/custom_locale/author/alexis-metaireau2.html | 6 +++--- .../output/custom_locale/author/alexis-metaireau3.html | 6 +++--- pelican/tests/output/custom_locale/authors.html | 6 +++--- pelican/tests/output/custom_locale/categories.html | 6 +++--- pelican/tests/output/custom_locale/category/bar.html | 6 +++--- pelican/tests/output/custom_locale/category/cat1.html | 6 +++--- pelican/tests/output/custom_locale/category/misc.html | 6 +++--- pelican/tests/output/custom_locale/category/yeah.html | 6 +++--- .../tests/output/custom_locale/drafts/a-draft-article.html | 6 +++--- pelican/tests/output/custom_locale/index.html | 6 +++--- pelican/tests/output/custom_locale/index2.html | 6 +++--- pelican/tests/output/custom_locale/index3.html | 6 +++--- pelican/tests/output/custom_locale/jinja2_template.html | 6 +++--- pelican/tests/output/custom_locale/oh-yeah-fr.html | 6 +++--- pelican/tests/output/custom_locale/override/index.html | 6 +++--- .../custom_locale/pages/this-is-a-test-hidden-page.html | 6 +++--- .../output/custom_locale/pages/this-is-a-test-page.html | 6 +++--- .../2010/décembre/02/this-is-a-super-article/index.html | 6 +++--- .../posts/2010/octobre/15/unbelievable/index.html | 6 +++--- .../custom_locale/posts/2010/octobre/20/oh-yeah/index.html | 6 +++--- .../2011/avril/20/a-markdown-powered-article/index.html | 6 +++--- .../posts/2011/février/17/article-1/index.html | 6 +++--- .../posts/2011/février/17/article-2/index.html | 6 +++--- .../posts/2011/février/17/article-3/index.html | 6 +++--- .../posts/2012/février/29/second-article/index.html | 6 +++--- .../2012/novembre/30/filename_metadata-example/index.html | 6 +++--- pelican/tests/output/custom_locale/second-article-fr.html | 6 +++--- pelican/tests/output/custom_locale/tag/bar.html | 6 +++--- pelican/tests/output/custom_locale/tag/baz.html | 6 +++--- pelican/tests/output/custom_locale/tag/foo.html | 6 +++--- pelican/tests/output/custom_locale/tag/foobar.html | 6 +++--- pelican/tests/output/custom_locale/tag/oh.html | 6 +++--- pelican/tests/output/custom_locale/tag/yeah.html | 6 +++--- pelican/tests/output/custom_locale/tags.html | 6 +++--- pelican/tests/output/custom_locale/theme/css/main.css | 2 +- pelican/themes/notmyidea/static/css/main.css | 2 +- pelican/themes/notmyidea/templates/analytics.html | 2 +- pelican/themes/notmyidea/templates/base.html | 2 +- pelican/themes/notmyidea/templates/disqus_script.html | 2 +- pelican/themes/notmyidea/templates/github.html | 4 ++-- pelican/themes/notmyidea/templates/twitter.html | 2 +- pelican/themes/simple/templates/gosquared.html | 2 +- 111 files changed, 256 insertions(+), 256 deletions(-) diff --git a/pelican/tests/output/basic/a-markdown-powered-article.html b/pelican/tests/output/basic/a-markdown-powered-article.html index 5fcc42a9..dd92d691 100644 --- a/pelican/tests/output/basic/a-markdown-powered-article.html +++ b/pelican/tests/output/basic/a-markdown-powered-article.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/archives.html b/pelican/tests/output/basic/archives.html index f8f1a67f..27b7c862 100644 --- a/pelican/tests/output/basic/archives.html +++ b/pelican/tests/output/basic/archives.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/article-1.html b/pelican/tests/output/basic/article-1.html index 4ea7f4e3..b09eef79 100644 --- a/pelican/tests/output/basic/article-1.html +++ b/pelican/tests/output/basic/article-1.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/article-2.html b/pelican/tests/output/basic/article-2.html index 45130e55..e340a4f6 100644 --- a/pelican/tests/output/basic/article-2.html +++ b/pelican/tests/output/basic/article-2.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/article-3.html b/pelican/tests/output/basic/article-3.html index 8603430f..08bf4fc1 100644 --- a/pelican/tests/output/basic/article-3.html +++ b/pelican/tests/output/basic/article-3.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/author/alexis-metaireau.html b/pelican/tests/output/basic/author/alexis-metaireau.html index 11d54185..eeca537a 100644 --- a/pelican/tests/output/basic/author/alexis-metaireau.html +++ b/pelican/tests/output/basic/author/alexis-metaireau.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/authors.html b/pelican/tests/output/basic/authors.html index 20df01d2..288543b5 100644 --- a/pelican/tests/output/basic/authors.html +++ b/pelican/tests/output/basic/authors.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/categories.html b/pelican/tests/output/basic/categories.html index 55e955c8..9a6682c0 100644 --- a/pelican/tests/output/basic/categories.html +++ b/pelican/tests/output/basic/categories.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/category/bar.html b/pelican/tests/output/basic/category/bar.html index 18e434cb..d3eb38da 100644 --- a/pelican/tests/output/basic/category/bar.html +++ b/pelican/tests/output/basic/category/bar.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/category/cat1.html b/pelican/tests/output/basic/category/cat1.html index f99eb497..f21bc9ab 100644 --- a/pelican/tests/output/basic/category/cat1.html +++ b/pelican/tests/output/basic/category/cat1.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/category/misc.html b/pelican/tests/output/basic/category/misc.html index fc724edb..0368793e 100644 --- a/pelican/tests/output/basic/category/misc.html +++ b/pelican/tests/output/basic/category/misc.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/category/yeah.html b/pelican/tests/output/basic/category/yeah.html index 7fe75a86..09db53bc 100644 --- a/pelican/tests/output/basic/category/yeah.html +++ b/pelican/tests/output/basic/category/yeah.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/filename_metadata-example.html b/pelican/tests/output/basic/filename_metadata-example.html index 638c65dd..9f492fc2 100644 --- a/pelican/tests/output/basic/filename_metadata-example.html +++ b/pelican/tests/output/basic/filename_metadata-example.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html index f3814b00..3066172d 100644 --- a/pelican/tests/output/basic/index.html +++ b/pelican/tests/output/basic/index.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/oh-yeah.html b/pelican/tests/output/basic/oh-yeah.html index 76be69fe..caeb8ddb 100644 --- a/pelican/tests/output/basic/oh-yeah.html +++ b/pelican/tests/output/basic/oh-yeah.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/override/index.html b/pelican/tests/output/basic/override/index.html index ed9fa92a..d98009a2 100644 --- a/pelican/tests/output/basic/override/index.html +++ b/pelican/tests/output/basic/override/index.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html b/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html index ac31987a..b98f0008 100644 --- a/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html +++ b/pelican/tests/output/basic/pages/this-is-a-test-hidden-page.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/pages/this-is-a-test-page.html b/pelican/tests/output/basic/pages/this-is-a-test-page.html index 43e5f72e..282fe965 100644 --- a/pelican/tests/output/basic/pages/this-is-a-test-page.html +++ b/pelican/tests/output/basic/pages/this-is-a-test-page.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/second-article-fr.html b/pelican/tests/output/basic/second-article-fr.html index 551027da..c13acce6 100644 --- a/pelican/tests/output/basic/second-article-fr.html +++ b/pelican/tests/output/basic/second-article-fr.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/second-article.html b/pelican/tests/output/basic/second-article.html index ed350752..e9a5b14c 100644 --- a/pelican/tests/output/basic/second-article.html +++ b/pelican/tests/output/basic/second-article.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/tag/bar.html b/pelican/tests/output/basic/tag/bar.html index 5331767b..c461cac5 100644 --- a/pelican/tests/output/basic/tag/bar.html +++ b/pelican/tests/output/basic/tag/bar.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/tag/baz.html b/pelican/tests/output/basic/tag/baz.html index dc26d8e1..7961b19f 100644 --- a/pelican/tests/output/basic/tag/baz.html +++ b/pelican/tests/output/basic/tag/baz.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/tag/foo.html b/pelican/tests/output/basic/tag/foo.html index aed3ad17..1a97fd4a 100644 --- a/pelican/tests/output/basic/tag/foo.html +++ b/pelican/tests/output/basic/tag/foo.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/tag/foobar.html b/pelican/tests/output/basic/tag/foobar.html index 540cde25..891b6866 100644 --- a/pelican/tests/output/basic/tag/foobar.html +++ b/pelican/tests/output/basic/tag/foobar.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/tag/oh.html b/pelican/tests/output/basic/tag/oh.html index ef876b8d..61148527 100644 --- a/pelican/tests/output/basic/tag/oh.html +++ b/pelican/tests/output/basic/tag/oh.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/tag/yeah.html b/pelican/tests/output/basic/tag/yeah.html index b8da2bc6..bd5ff204 100644 --- a/pelican/tests/output/basic/tag/yeah.html +++ b/pelican/tests/output/basic/tag/yeah.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/tags.html b/pelican/tests/output/basic/tags.html index 0eda47d7..44b45591 100644 --- a/pelican/tests/output/basic/tags.html +++ b/pelican/tests/output/basic/tags.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/theme/css/main.css b/pelican/tests/output/basic/theme/css/main.css index 9d7221a2..03a77e69 100644 --- a/pelican/tests/output/basic/theme/css/main.css +++ b/pelican/tests/output/basic/theme/css/main.css @@ -12,7 +12,7 @@ @import url("reset.css"); @import url("pygment.css"); @import url("typogrify.css"); -@import url(//fonts.googleapis.com/css?family=Yanone+Kaffeesatz&subset=latin); +@import url(https://fonts.googleapis.com/css?family=Yanone+Kaffeesatz&subset=latin); /***** Global *****/ /* Body */ diff --git a/pelican/tests/output/basic/this-is-a-super-article.html b/pelican/tests/output/basic/this-is-a-super-article.html index cf957ebf..1fe944eb 100644 --- a/pelican/tests/output/basic/this-is-a-super-article.html +++ b/pelican/tests/output/basic/this-is-a-super-article.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/basic/unbelievable.html b/pelican/tests/output/basic/unbelievable.html index b9b52031..dfb0c54e 100644 --- a/pelican/tests/output/basic/unbelievable.html +++ b/pelican/tests/output/basic/unbelievable.html @@ -7,7 +7,7 @@ diff --git a/pelican/tests/output/custom/a-markdown-powered-article.html b/pelican/tests/output/custom/a-markdown-powered-article.html index 577d61b8..59ffa4d1 100644 --- a/pelican/tests/output/custom/a-markdown-powered-article.html +++ b/pelican/tests/output/custom/a-markdown-powered-article.html @@ -8,13 +8,13 @@ -Fork me on GitHub +Fork me on GitHub
    tags are not generated, resulting in page breakage. We need to check if articles_page.has_other_pages(); if it does, a list has been generated per line 19 or 25 and the tags must be closed. --- pelican/tests/output/custom/category/bar.html | 3 --- pelican/tests/output/custom/category/cat1.html | 3 --- pelican/tests/output/custom/category/misc.html | 3 --- pelican/tests/output/custom/category/yeah.html | 3 --- pelican/tests/output/custom/tag/bar.html | 3 --- pelican/tests/output/custom/tag/foo.html | 3 --- pelican/tests/output/custom/tag/foobar.html | 3 --- pelican/tests/output/custom/tag/yeah.html | 3 --- .../tests/output/custom_locale/category/bar.html | 3 --- .../tests/output/custom_locale/category/cat1.html | 3 --- .../tests/output/custom_locale/category/misc.html | 3 --- .../tests/output/custom_locale/category/yeah.html | 3 --- pelican/tests/output/custom_locale/tag/bar.html | 3 --- pelican/tests/output/custom_locale/tag/foo.html | 3 --- pelican/tests/output/custom_locale/tag/foobar.html | 3 --- pelican/tests/output/custom_locale/tag/yeah.html | 3 --- pelican/themes/notmyidea/templates/index.html | 13 ++++--------- 17 files changed, 4 insertions(+), 57 deletions(-) diff --git a/pelican/tests/output/custom/category/bar.html b/pelican/tests/output/custom/category/bar.html index 0bc5b02e..9666d2e2 100644 --- a/pelican/tests/output/custom/category/bar.html +++ b/pelican/tests/output/custom/category/bar.html @@ -51,9 +51,6 @@ YEAH !

    alternate text

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom/category/cat1.html b/pelican/tests/output/custom/category/cat1.html index 237943d7..d9132d10 100644 --- a/pelican/tests/output/custom/category/cat1.html +++ b/pelican/tests/output/custom/category/cat1.html @@ -120,9 +120,6 @@

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html index 5fcde24b..fa71085d 100644 --- a/pelican/tests/output/custom/category/misc.html +++ b/pelican/tests/output/custom/category/misc.html @@ -131,9 +131,6 @@ pelican.conf, it ...

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom/category/yeah.html b/pelican/tests/output/custom/category/yeah.html index 127eac13..6d94c9ad 100644 --- a/pelican/tests/output/custom/category/yeah.html +++ b/pelican/tests/output/custom/category/yeah.html @@ -59,9 +59,6 @@

    → And now try with some utf8 hell: ééé

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom/tag/bar.html b/pelican/tests/output/custom/tag/bar.html index 2e0d047c..f462ffbd 100644 --- a/pelican/tests/output/custom/tag/bar.html +++ b/pelican/tests/output/custom/tag/bar.html @@ -110,9 +110,6 @@ YEAH !

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom/tag/foo.html b/pelican/tests/output/custom/tag/foo.html index 7c38c24c..9c58956b 100644 --- a/pelican/tests/output/custom/tag/foo.html +++ b/pelican/tests/output/custom/tag/foo.html @@ -80,9 +80,6 @@ as well as inline markup.

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom/tag/foobar.html b/pelican/tests/output/custom/tag/foobar.html index 42705281..7d17d1fb 100644 --- a/pelican/tests/output/custom/tag/foobar.html +++ b/pelican/tests/output/custom/tag/foobar.html @@ -59,9 +59,6 @@

    → And now try with some utf8 hell: ééé

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom/tag/yeah.html b/pelican/tests/output/custom/tag/yeah.html index 4d7b506b..e3c765fa 100644 --- a/pelican/tests/output/custom/tag/yeah.html +++ b/pelican/tests/output/custom/tag/yeah.html @@ -51,9 +51,6 @@ YEAH !

    alternate text

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom_locale/category/bar.html b/pelican/tests/output/custom_locale/category/bar.html index 7c8f947d..c416b358 100644 --- a/pelican/tests/output/custom_locale/category/bar.html +++ b/pelican/tests/output/custom_locale/category/bar.html @@ -51,9 +51,6 @@ YEAH !

    alternate text

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom_locale/category/cat1.html b/pelican/tests/output/custom_locale/category/cat1.html index 25bc6179..871b2e3f 100644 --- a/pelican/tests/output/custom_locale/category/cat1.html +++ b/pelican/tests/output/custom_locale/category/cat1.html @@ -120,9 +120,6 @@

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom_locale/category/misc.html b/pelican/tests/output/custom_locale/category/misc.html index 8062c0d6..bb78a8cc 100644 --- a/pelican/tests/output/custom_locale/category/misc.html +++ b/pelican/tests/output/custom_locale/category/misc.html @@ -131,9 +131,6 @@ pelican.conf, it ...

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom_locale/category/yeah.html b/pelican/tests/output/custom_locale/category/yeah.html index d36c1608..c5e6c7f0 100644 --- a/pelican/tests/output/custom_locale/category/yeah.html +++ b/pelican/tests/output/custom_locale/category/yeah.html @@ -59,9 +59,6 @@

    → And now try with some utf8 hell: ééé

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom_locale/tag/bar.html b/pelican/tests/output/custom_locale/tag/bar.html index 8ba1aed2..c1f33e64 100644 --- a/pelican/tests/output/custom_locale/tag/bar.html +++ b/pelican/tests/output/custom_locale/tag/bar.html @@ -110,9 +110,6 @@ YEAH !

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom_locale/tag/foo.html b/pelican/tests/output/custom_locale/tag/foo.html index ed67ede0..288f1768 100644 --- a/pelican/tests/output/custom_locale/tag/foo.html +++ b/pelican/tests/output/custom_locale/tag/foo.html @@ -80,9 +80,6 @@ as well as inline markup.

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom_locale/tag/foobar.html b/pelican/tests/output/custom_locale/tag/foobar.html index a569b526..59dcede1 100644 --- a/pelican/tests/output/custom_locale/tag/foobar.html +++ b/pelican/tests/output/custom_locale/tag/foobar.html @@ -59,9 +59,6 @@

    → And now try with some utf8 hell: ééé

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/tests/output/custom_locale/tag/yeah.html b/pelican/tests/output/custom_locale/tag/yeah.html index ba767748..4dc36ce5 100644 --- a/pelican/tests/output/custom_locale/tag/yeah.html +++ b/pelican/tests/output/custom_locale/tag/yeah.html @@ -51,9 +51,6 @@ YEAH !

    alternate text

    There are comments.

    -

    - Page 1 / 1 -

    diff --git a/pelican/themes/notmyidea/templates/index.html b/pelican/themes/notmyidea/templates/index.html index 3eac8a3a..6019987b 100644 --- a/pelican/themes/notmyidea/templates/index.html +++ b/pelican/themes/notmyidea/templates/index.html @@ -11,9 +11,6 @@

    {{ article.title }}

    {% include 'article_infos.html' %}{{ article.content }}{% include 'comments.html' %} - {% if loop.length == 1 %} - {% include 'pagination.html' %} - {% endif %} {% if loop.length > 1 %}
    @@ -42,13 +39,11 @@ {% endif %} {% if loop.last %} - {% if loop.length > 1 %} + {% if loop.length > 1 or articles_page.has_other_pages() %} - {% endif %} - {% if articles_page.has_previous() or loop.length > 1 %} - {% include 'pagination.html' %} - {% endif %} - {% if loop.length > 1 %} + {% if articles_page.has_other_pages() %} + {% include 'pagination.html' %} + {% endif %}
    {% endif %} {% endif %} From 21544a404cf51b60d407b0fd4eeadfc1d8339a9c Mon Sep 17 00:00:00 2001 From: Elana Hashman Date: Sun, 21 Jun 2015 13:35:41 -0600 Subject: [PATCH 1342/2344] Update simple theme to fix #1068 --- pelican/themes/simple/templates/index.html | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pelican/themes/simple/templates/index.html b/pelican/themes/simple/templates/index.html index 20104db9..4bd81985 100644 --- a/pelican/themes/simple/templates/index.html +++ b/pelican/themes/simple/templates/index.html @@ -21,6 +21,8 @@ {% endfor %} -{% include 'pagination.html' %} +{% if articles_page.has_other_pages() %} + {% include 'pagination.html' %} +{% endif %}
    {% endblock content %} From ff88c4bb34779d979b8ce4ba042c07621204ea1a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 26 Jun 2015 09:44:45 -0700 Subject: [PATCH 1343/2344] Document enabling per-block Markdown line numbers Since users frequently ask how to enable line numbers in Markdown-formatted code blocks, adding instructions to the docs will allow us to point users there. Fixes #1773 --- docs/content.rst | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/docs/content.rst b/docs/content.rst index 0e3310f1..1e6ba099 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -420,22 +420,29 @@ which posts are translations:: Syntax highlighting =================== -Pelican is able to provide colorized syntax highlighting for your code blocks. -To do so, you have to use the following conventions inside your content files. +Pelican can provide colorized syntax highlighting for your code blocks. +To do so, you must use the following conventions inside your content files. -For reStructuredText, use the code-block directive:: +For reStructuredText, use the ``code-block`` directive to specify the type +of code to be highlighted (in these examples, we'll use ``python``):: - .. code-block:: identifier + .. code-block:: python - + print("Pelican is a static site generator.") -For Markdown, include the language identifier just above the code block, -indenting both the identifier and code:: +For Markdown, which utilizes the `CodeHilite extension`_ to provide syntax +highlighting, include the language identifier just above the code block, +indenting both the identifier and the code:: - A block of text. + There are two ways to specify the identifier: - :::identifier - + :::python + print("The triple-colon syntax will *not* show line numbers.") + + To display line numbers, use a path-less shebang instead of colons: + + #!python + print("The path-less shebang syntax *will* show line numbers.") The specified identifier (e.g. ``python``, ``ruby``) should be one that appears on the `list of available lexers `_. @@ -521,4 +528,5 @@ metadata to include ``Status: published``. .. _AsciiDoc: http://www.methods.co.nz/asciidoc/ .. _pelican-plugins: http://github.com/getpelican/pelican-plugins .. _Markdown Extensions: http://pythonhosted.org/Markdown/extensions/ +.. _CodeHilite extension: http://pythonhosted.org/Markdown/extensions/code_hilite.html#syntax .. _i18n_subsites plugin: http://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites From ec5c77b25145f7c20fee24c6b85b478295dbc956 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Thu, 18 Jun 2015 23:33:20 +0200 Subject: [PATCH 1344/2344] remove PAGES; use pages instead * remove PAGES from context as pages is available * add section to FAQ to provide guidance --- docs/faq.rst | 13 +++++++++++++ docs/themes.rst | 2 ++ pelican/generators.py | 1 - pelican/themes/notmyidea/templates/base.html | 2 +- pelican/themes/simple/templates/base.html | 2 +- 5 files changed, 17 insertions(+), 3 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index ff473624..08df017d 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -250,3 +250,16 @@ moved out of the pelican core and into a separate `plugin `_. See the :ref:`plugins` documentation further information about the Pelican plugin system. + +Since I upgraded Pelican my Pages are no longer rendered +======================================================== +Pages were available to Themes as lowercase ``pages`` and uppercase +``PAGES``. To bring this inline with the :ref:`templates-variables` section, +``PAGES`` has been removed. This is quickly resolved by updating your theme +to iterate over ``pages`` instead of ``PAGES``. Just replace:: + + {% for pg in PAGES %} + +with something like:: + + {% for pg in pages %} diff --git a/docs/themes.rst b/docs/themes.rst index 6ca753c6..3978e693 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -47,6 +47,8 @@ To make your own theme, you must follow the following structure:: if it helps you keep things organized while creating your theme. +.. _templates-variables: + Templates and variables ======================= diff --git a/pelican/generators.py b/pelican/generators.py index 0a5298e4..da651252 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -644,7 +644,6 @@ class PagesGenerator(CachingGenerator): process_translations(hidden_pages)) self._update_context(('pages', 'hidden_pages')) - self.context['PAGES'] = self.pages self.save_cache() self.readers.save_cache() diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 45ab4044..188715d4 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -25,7 +25,7 @@
  • {{ title }}
  • {% endfor %} {% if DISPLAY_PAGES_ON_MENU -%} - {% for pg in PAGES %} + {% for pg in pages %} {{ pg.title }} {% endfor %} {% endif %} diff --git a/pelican/themes/simple/templates/base.html b/pelican/themes/simple/templates/base.html index bde7983b..760ca5da 100644 --- a/pelican/themes/simple/templates/base.html +++ b/pelican/themes/simple/templates/base.html @@ -40,7 +40,7 @@
  • {{ title }}
  • {% endfor %} {% if DISPLAY_PAGES_ON_MENU %} - {% for p in PAGES %} + {% for p in pages %} {{ p.title }} {% endfor %} {% else %} From 5389543a39f3772afdb5701c5bcbb71e44883f05 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Fri, 19 Jun 2015 11:19:21 +0200 Subject: [PATCH 1345/2344] improve URLWrapper comparison * speed up via reduced slugify calls (only call when needed) * fix __repr__ to not contain str, should call repr on name * add test_urlwrappers and move URLWrappers tests there * add new equality test * cleanup header additionally: * Content is now decorated with python_2_unicode_compatible instead of treating __str__ differently * better formatting for test_article_metadata_key_lowercase to actually output the conflict instead of a non descriptive error --- pelican/contents.py | 8 ++--- pelican/tests/test_contents.py | 27 ---------------- pelican/tests/test_readers.py | 13 ++++---- pelican/tests/test_urlwrappers.py | 51 +++++++++++++++++++++++++++++++ pelican/urlwrappers.py | 29 ++++++++++++------ 5 files changed, 80 insertions(+), 48 deletions(-) create mode 100644 pelican/tests/test_urlwrappers.py diff --git a/pelican/contents.py b/pelican/contents.py index 005d045c..0e91933b 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -25,6 +25,7 @@ from pelican.urlwrappers import (URLWrapper, Author, Category, Tag) # NOQA logger = logging.getLogger(__name__) +@python_2_unicode_compatible class Content(object): """Represents a content. @@ -148,12 +149,7 @@ class Content(object): signals.content_object_init.send(self) def __str__(self): - if self.source_path is None: - return repr(self) - elif six.PY3: - return self.source_path or repr(self) - else: - return str(self.source_path.encode('utf-8', 'replace')) + return self.source_path or repr(self) def check_properties(self): """Test mandatory properties are set.""" diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 5879bde2..01d2ed3b 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -578,30 +578,3 @@ class TestStatic(unittest.TestCase): content = page.get_content('') self.assertNotEqual(content, html) - - -class TestURLWrapper(unittest.TestCase): - def test_comparisons(self): - # URLWrappers are sorted by name - wrapper_a = URLWrapper(name='first', settings={}) - wrapper_b = URLWrapper(name='last', settings={}) - self.assertFalse(wrapper_a > wrapper_b) - self.assertFalse(wrapper_a >= wrapper_b) - self.assertFalse(wrapper_a == wrapper_b) - self.assertTrue(wrapper_a != wrapper_b) - self.assertTrue(wrapper_a <= wrapper_b) - self.assertTrue(wrapper_a < wrapper_b) - wrapper_b.name = 'first' - self.assertFalse(wrapper_a > wrapper_b) - self.assertTrue(wrapper_a >= wrapper_b) - self.assertTrue(wrapper_a == wrapper_b) - self.assertFalse(wrapper_a != wrapper_b) - self.assertTrue(wrapper_a <= wrapper_b) - self.assertFalse(wrapper_a < wrapper_b) - wrapper_a.name = 'last' - self.assertTrue(wrapper_a > wrapper_b) - self.assertTrue(wrapper_a >= wrapper_b) - self.assertFalse(wrapper_a == wrapper_b) - self.assertTrue(wrapper_a != wrapper_b) - self.assertFalse(wrapper_a <= wrapper_b) - self.assertFalse(wrapper_a < wrapper_b) diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 18e5111e..dd7e5fc2 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -29,12 +29,10 @@ class ReaderTest(unittest.TestCase): self.assertEqual( value, real_value, - str('Expected %r to have value %r, but was %r') - % (key, value, real_value)) + 'Expected %s to have value %s, but was %s' % (key, value, real_value)) else: self.fail( - str('Expected %r to have value %r, but was not in Dict') - % (key, value)) + 'Expected %s to have value %s, but was not in Dict' % (key, value)) class TestAssertDictHasSubset(ReaderTest): def setUp(self): @@ -566,9 +564,12 @@ class HTMLReaderTest(ReaderTest): def test_article_metadata_key_lowercase(self): # Keys of metadata should be lowercase. page = self.read_file(path='article_with_uppercase_metadata.html') + + # Key should be lowercase self.assertIn('category', page.metadata, 'Key should be lowercase.') - self.assertEqual('Yeah', page.metadata.get('category'), - 'Value keeps cases.') + + # Value should keep cases + self.assertEqual('Yeah', page.metadata.get('category')) def test_article_with_nonconformant_meta_tags(self): page = self.read_file(path='article_with_nonconformant_meta_tags.html') diff --git a/pelican/tests/test_urlwrappers.py b/pelican/tests/test_urlwrappers.py new file mode 100644 index 00000000..20a87114 --- /dev/null +++ b/pelican/tests/test_urlwrappers.py @@ -0,0 +1,51 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from pelican.urlwrappers import URLWrapper, Tag, Category +from pelican.tests.support import unittest + +class TestURLWrapper(unittest.TestCase): + def test_ordering(self): + # URLWrappers are sorted by name + wrapper_a = URLWrapper(name='first', settings={}) + wrapper_b = URLWrapper(name='last', settings={}) + self.assertFalse(wrapper_a > wrapper_b) + self.assertFalse(wrapper_a >= wrapper_b) + self.assertFalse(wrapper_a == wrapper_b) + self.assertTrue(wrapper_a != wrapper_b) + self.assertTrue(wrapper_a <= wrapper_b) + self.assertTrue(wrapper_a < wrapper_b) + wrapper_b.name = 'first' + self.assertFalse(wrapper_a > wrapper_b) + self.assertTrue(wrapper_a >= wrapper_b) + self.assertTrue(wrapper_a == wrapper_b) + self.assertFalse(wrapper_a != wrapper_b) + self.assertTrue(wrapper_a <= wrapper_b) + self.assertFalse(wrapper_a < wrapper_b) + wrapper_a.name = 'last' + self.assertTrue(wrapper_a > wrapper_b) + self.assertTrue(wrapper_a >= wrapper_b) + self.assertFalse(wrapper_a == wrapper_b) + self.assertTrue(wrapper_a != wrapper_b) + self.assertFalse(wrapper_a <= wrapper_b) + self.assertFalse(wrapper_a < wrapper_b) + + def test_equality(self): + tag = Tag('test', settings={}) + cat = Category('test', settings={}) + + # same name, but different class + self.assertNotEqual(tag, cat) + + # should be equal vs text representing the same name + self.assertEqual(tag, u'test') + + # should not be equal vs binary + self.assertNotEqual(tag, b'test') + + # Tags describing the same should be equal + tag_equal = Tag('Test', settings={}) + self.assertEqual(tag, tag_equal) + + cat_ascii = Category('指導書', settings={}) + self.assertEqual(cat_ascii, u'zhi-dao-shu') diff --git a/pelican/urlwrappers.py b/pelican/urlwrappers.py index 60bc6a3a..65dee23b 100644 --- a/pelican/urlwrappers.py +++ b/pelican/urlwrappers.py @@ -1,7 +1,9 @@ -import os +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + import functools import logging - +import os import six from pelican.utils import (slugify, python_2_unicode_compatible) @@ -52,27 +54,36 @@ class URLWrapper(object): def __hash__(self): return hash(self.slug) - def _key(self): - return self.slug - def _normalize_key(self, key): subs = self.settings.get('SLUG_SUBSTITUTIONS', ()) return six.text_type(slugify(key, subs)) def __eq__(self, other): - return self._key() == self._normalize_key(other) + if isinstance(other, self.__class__): + return self.slug == other.slug + if isinstance(other, six.text_type): + return self.slug == self._normalize_key(other) + return False def __ne__(self, other): - return self._key() != self._normalize_key(other) + if isinstance(other, self.__class__): + return self.slug != other.slug + if isinstance(other, six.text_type): + return self.slug != self._normalize_key(other) + return True def __lt__(self, other): - return self._key() < self._normalize_key(other) + if isinstance(other, self.__class__): + return self.slug < other.slug + if isinstance(other, six.text_type): + return self.slug < self._normalize_key(other) + return False def __str__(self): return self.name def __repr__(self): - return '<{} {}>'.format(type(self).__name__, str(self)) + return '<{} {}>'.format(type(self).__name__, repr(self._name)) def _from_settings(self, key, get_page_name=False): """Returns URL information as defined in settings. From ba9b4a1d9bab0dba7cc8563e14a0bbb80ae10b43 Mon Sep 17 00:00:00 2001 From: guanidene Date: Tue, 30 Jun 2015 20:56:21 +0530 Subject: [PATCH 1346/2344] Watch for changes in mtime of symlinked folders and files too --- pelican/utils.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/utils.py b/pelican/utils.py index 6ad4de24..fb8ed9dc 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -576,7 +576,7 @@ def folder_watcher(path, extensions, ignores=[]): def file_times(path): '''Return `mtime` for each file in path''' - for root, dirs, files in os.walk(path): + for root, dirs, files in os.walk(path, followlinks=True): dirs[:] = [x for x in dirs if not x.startswith(os.curdir)] for f in files: From aa318a1366b4a1f8ce4eb8e50d52421c8abca031 Mon Sep 17 00:00:00 2001 From: Jotham Apaloo Date: Fri, 19 Jun 2015 14:50:12 -0400 Subject: [PATCH 1347/2344] Update tips.rst add 404 page instructions for amazon s3. --- docs/tips.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/tips.rst b/docs/tips.rst index 15d68769..82018400 100644 --- a/docs/tips.rst +++ b/docs/tips.rst @@ -28,6 +28,11 @@ configuration file's ``location`` block:: For Apache:: ErrorDocument 404 /404.html + +For Amazon S3, first navigate to the ``Static Site Hosting`` menu in the +bucket settings on your AWS cosole. From there:: + + Error Document: 404.html Publishing to GitHub ==================== From bd5dfa0b3ec9560a1a453907f9f3767b9b89ea01 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= Date: Fri, 10 Jul 2015 00:48:41 +0300 Subject: [PATCH 1348/2344] Avoid adding the tests in bdists (like wheel bdist). Supersedes and closes #1618. --- setup.py | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 93d7e5f6..01d40ae4 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,7 @@ #!/usr/bin/env python +from os import walk +from os.path import join, relpath, dirname + from setuptools import setup requires = ['feedgenerator >= 1.6', 'jinja2 >= 2.7', 'pygments', 'docutils', @@ -14,11 +17,9 @@ entry_points = { ] } - README = open('README.rst').read() CHANGELOG = open('docs/changelog.rst').read() - setup( name="pelican", version="3.6.1.dev", @@ -29,7 +30,19 @@ setup( "Markdown input files.", long_description=README + '\n' + CHANGELOG, packages=['pelican', 'pelican.tools'], - include_package_data=True, + package_data={ + # we manually collect the package data, as opposed to using include_package_data=True + # because we don't want the tests to be included automatically as package data + # (MANIFEST.in is too greedy) + 'pelican': [ + relpath(join(root, name), 'pelican') + for root, _, names in walk(join('pelican', 'themes')) for name in names + ], + 'pelican.tools': [ + relpath(join(root, name), join('pelican', 'tools')) + for root, _, names in walk(join('pelican', 'tools', 'templates')) for name in names + ], + }, install_requires=requires, entry_points=entry_points, classifiers=[ From 379f8666c1ada0f091edb0792a7e84a5e273576b Mon Sep 17 00:00:00 2001 From: Andrea Corbellini Date: Thu, 30 Jul 2015 21:04:28 +0200 Subject: [PATCH 1349/2344] Rewrite pelican.utils.truncate_html_words() to use an HTML parser instead of regular expressions. --- pelican/tests/test_utils.py | 26 +++++++++ pelican/utils.py | 107 +++++++++++++++++++----------------- 2 files changed, 84 insertions(+), 49 deletions(-) diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index f5a60584..0f8878af 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -144,6 +144,32 @@ class TestUtils(LoggedTestCase): for value, expected in samples: self.assertEqual(utils.get_relative_path(value), expected) + def test_truncate_html_words(self): + self.assertEqual( + utils.truncate_html_words('short string', 20), + 'short string') + + self.assertEqual( + utils.truncate_html_words('word ' * 100, 20), + 'word ' * 20 + '...') + + self.assertEqual( + utils.truncate_html_words('

    ' + 'word ' * 100 + '

    ', 20), + '

    ' + 'word ' * 20 + '...

    ') + + self.assertEqual( + utils.truncate_html_words( + '' + 'word ' * 100 + '', 20), + '' + 'word ' * 20 + '...') + + self.assertEqual( + utils.truncate_html_words('
    ' + 'word ' * 100, 20), + '
    ' + 'word ' * 20 + '...') + + self.assertEqual( + utils.truncate_html_words('' + 'word ' * 100, 20), + '' + 'word ' * 20 + '...') + def test_process_translations(self): # create a bunch of articles # 1: no translation metadata diff --git a/pelican/utils.py b/pelican/utils.py index fb8ed9dc..43dca212 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -24,6 +24,7 @@ from itertools import groupby from jinja2 import Markup from operator import attrgetter from posixpath import join as posix_join +from six.moves.html_parser import HTMLParser logger = logging.getLogger(__name__) @@ -402,6 +403,58 @@ def posixize_path(rel_path): return rel_path.replace(os.sep, '/') +class _HTMLWordTruncator(HTMLParser): + + _word_regex = re.compile(r'\w[\w-]*', re.U) + _singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', + 'hr', 'input') + + def __init__(self, max_words): + # In Python 2, HTMLParser is not a new-style class, + # hence super() cannot be used. + HTMLParser.__init__(self) + + self.max_words = max_words + self.words_found = 0 + self.open_tags = [] + self.truncate_at = None + + def handle_starttag(self, tag, attrs): + if self.truncate_at is not None: + return + if tag not in self._singlets: + self.open_tags.insert(0, tag) + + def handle_endtag(self, tag): + if self.truncate_at is not None: + return + try: + i = self.open_tags.index(tag) + except ValueError: + pass + else: + # SGML: An end tag closes, back to the matching start tag, + # all unclosed intervening start tags with omitted end tags + del self.open_tags[:i + 1] + + def handle_data(self, data): + word_end = 0 + + while self.words_found < self.max_words: + match = self._word_regex.search(data, word_end) + if not match: + break + word_end = match.end(0) + self.words_found += 1 + + if self.words_found == self.max_words: + line_start = 0 + lineno, line_offset = self.getpos() + for i in range(lineno - 1): + line_start = self.rawdata.index('\n', line_start) + 1 + self.truncate_at = line_start + line_offset + word_end + + def truncate_html_words(s, num, end_text='...'): """Truncates HTML to a certain number of words. @@ -414,59 +467,15 @@ def truncate_html_words(s, num, end_text='...'): length = int(num) if length <= 0: return '' - html4_singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', - 'hr', 'input') - - # Set up regular expressions - re_words = re.compile(r'&.*?;|<.*?>|(\w[\w-]*)', re.U) - re_tag = re.compile(r'<(/)?([^ ]+?)(?: (/)| .*?)?>') - # Count non-HTML words and keep note of open tags - pos = 0 - end_text_pos = 0 - words = 0 - open_tags = [] - while words <= length: - m = re_words.search(s, pos) - if not m: - # Checked through whole string - break - pos = m.end(0) - if m.group(1): - # It's an actual non-HTML word - words += 1 - if words == length: - end_text_pos = pos - continue - # Check for tag - tag = re_tag.match(m.group(0)) - if not tag or end_text_pos: - # Don't worry about non tags or tags after our truncate point - continue - closing_tag, tagname, self_closing = tag.groups() - tagname = tagname.lower() # Element names are always case-insensitive - if self_closing or tagname in html4_singlets: - pass - elif closing_tag: - # Check for match in open tags list - try: - i = open_tags.index(tagname) - except ValueError: - pass - else: - # SGML: An end tag closes, back to the matching start tag, - # all unclosed intervening start tags with omitted end tags - open_tags = open_tags[i + 1:] - else: - # Add it to the start of the open tags list - open_tags.insert(0, tagname) - if words <= length: - # Don't try to close tags if we don't need to truncate + truncator = _HTMLWordTruncator(length) + truncator.feed(s) + if truncator.truncate_at is None: return s - out = s[:end_text_pos] + out = s[:truncator.truncate_at] if end_text: out += ' ' + end_text # Close any tags still open - for tag in open_tags: + for tag in truncator.open_tags: out += '' % tag # Return string return out From 5e36a87916dd2cb431b7c916f53348605a687542 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 1 Aug 2015 13:20:04 -0700 Subject: [PATCH 1350/2344] Update changelog --- docs/changelog.rst | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index f08f67ec..72f71fa5 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -4,7 +4,10 @@ Release history Next release ============ -- Nothing yet +* Fix installation errors related to Unicode in tests +* Don't show pagination in ``notmyidea`` theme if there's only one page +* Make hidden pages available in context +* Improve URLWrapper comparison 3.6.0 (2015-06-15) ================== From 96b23e03bd7a2b8a904fafb70d87484f0c81c86e Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 1 Aug 2015 13:39:10 -0700 Subject: [PATCH 1351/2344] Bump version 3.6.2 --- docs/changelog.rst | 4 ++-- docs/conf.py | 2 +- pelican/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 72f71fa5..664e1310 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,8 +1,8 @@ Release history ############### -Next release -============ +3.6.2 (2015-08-01) +================== * Fix installation errors related to Unicode in tests * Don't show pagination in ``notmyidea`` theme if there's only one page diff --git a/docs/conf.py b/docs/conf.py index 43af8da4..15ae49b9 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ copyright = '2015, Alexis Metaireau and contributors' exclude_patterns = ['_build'] release = __version__ version = '.'.join(release.split('.')[:1]) -last_stable = '3.6.0' +last_stable = '3.6.2' rst_prolog = ''' .. |last_stable| replace:: :pelican-doc:`{0}` '''.format(last_stable) diff --git a/pelican/__init__.py b/pelican/__init__.py index 932974db..0b5c62d4 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -26,7 +26,7 @@ from pelican.utils import (clean_output_dir, folder_watcher, file_watcher, maybe_pluralize) from pelican.writers import Writer -__version__ = "3.6.1.dev" +__version__ = "3.6.2" DEFAULT_CONFIG_NAME = 'pelicanconf.py' diff --git a/setup.py b/setup.py index 01d40ae4..b6b5c3d8 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ CHANGELOG = open('docs/changelog.rst').read() setup( name="pelican", - version="3.6.1.dev", + version="3.6.2", url='http://getpelican.com/', author='Alexis Metaireau', author_email='authors@getpelican.com', From 7181cc36d59b7e50d1d2da0f4f03e0a77fe02be5 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 1 Aug 2015 13:39:24 -0700 Subject: [PATCH 1352/2344] Prepare version 3.6.3.dev for next development cycle --- docs/changelog.rst | 5 +++++ pelican/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 664e1310..b90fd997 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Release history ############### +Next release +============ + +- Nothing yet + 3.6.2 (2015-08-01) ================== diff --git a/pelican/__init__.py b/pelican/__init__.py index 0b5c62d4..2762ae71 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -26,7 +26,7 @@ from pelican.utils import (clean_output_dir, folder_watcher, file_watcher, maybe_pluralize) from pelican.writers import Writer -__version__ = "3.6.2" +__version__ = "3.6.3.dev" DEFAULT_CONFIG_NAME = 'pelicanconf.py' diff --git a/setup.py b/setup.py index b6b5c3d8..806464f2 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ CHANGELOG = open('docs/changelog.rst').read() setup( name="pelican", - version="3.6.2", + version="3.6.3.dev", url='http://getpelican.com/', author='Alexis Metaireau', author_email='authors@getpelican.com', From 2ca7aa8c80fa225021ff57da150ce25faaf315db Mon Sep 17 00:00:00 2001 From: Kubilay Kocak Date: Fri, 7 Aug 2015 14:46:12 +1000 Subject: [PATCH 1353/2344] Add missing *.markdown files to PyPI sdist The following file is missing from the PyPI source distribution (sdist) due to *.markdown not being referenced in MANIFEST.in: pelican/tests/content/article_with_markdown_extension.markdown This missing file appears to cause a number of errors running the test suite. An alternative to this change would be to rename the file to .md so that the file is covered by the existing *.md entry. --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index dcf9ea45..64ed4b3c 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include *.rst -recursive-include pelican *.html *.css *png *.in *.rst *.md *.mkd *.xml *.py +recursive-include pelican *.html *.css *png *.in *.rst *.markdown *.md *.mkd *.xml *.py include LICENSE THANKS docs/changelog.rst From 657ffdd75fc49f5364d7198e0f6ce80f1f473aa8 Mon Sep 17 00:00:00 2001 From: winlu Date: Sat, 8 Aug 2015 14:38:25 +0200 Subject: [PATCH 1354/2344] add warning for unknown replacement indicators If an unknown replacement indicator {bla} was used, it was ignored silently. This commit adds a warning when an unmatched indicator occurs to help identify the issue. closes #1794 --- pelican/contents.py | 5 +++++ pelican/tests/test_contents.py | 24 +++++++++++++++++++++--- 2 files changed, 26 insertions(+), 3 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 0e91933b..a6b8cc5f 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -248,6 +248,11 @@ class Content(object): origin = '/'.join((siteurl, Category(path, self.settings).url)) elif what == 'tag': origin = '/'.join((siteurl, Tag(path, self.settings).url)) + else: + logger.warning( + "Replacement Indicator '%s' not recognized, " + "skipping replacement", + what) # keep all other parts, such as query, fragment, etc. parts = list(value) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 01d2ed3b..145a53b6 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -1,5 +1,6 @@ from __future__ import unicode_literals, absolute_import +import logging import locale import os.path import six @@ -11,7 +12,7 @@ from pelican.contents import (Page, Article, Static, URLWrapper, Author, Category) from pelican.settings import DEFAULT_CONFIG from pelican.signals import content_object_init -from pelican.tests.support import unittest, get_settings +from pelican.tests.support import LoggedTestCase, mute, unittest, get_settings from pelican.utils import (path_to_url, truncate_html_words, SafeDatetime, posix_join) @@ -413,10 +414,10 @@ class TestArticle(TestPage): self.assertEqual(article.save_as, 'obrien/csharp-stuff/fnord/index.html') -class TestStatic(unittest.TestCase): +class TestStatic(LoggedTestCase): def setUp(self): - + super(TestStatic, self).setUp() self.settings = get_settings( STATIC_SAVE_AS='{path}', STATIC_URL='{path}', @@ -578,3 +579,20 @@ class TestStatic(unittest.TestCase): content = page.get_content('') self.assertNotEqual(content, html) + + def test_unknown_link_syntax(self): + "{unknown} link syntax should trigger warning." + + html = 'link' + page = Page(content=html, + metadata={'title': 'fakepage'}, settings=self.settings, + source_path=os.path.join('dir', 'otherdir', 'fakepage.md'), + context=self.context) + content = page.get_content('') + + self.assertEqual(content, html) + self.assertLogCountEqual( + count=1, + msg="Replacement Indicator 'unknown' not recognized, " + "skipping replacement", + level=logging.WARNING) From 45ff578f69df5c0f8eb3728569e9e583469d7f1c Mon Sep 17 00:00:00 2001 From: Your Name Date: Mon, 10 Aug 2015 15:44:13 -0400 Subject: [PATCH 1355/2344] Added optional override_output to write_feed. The write_feed function now takes an override_output parameter that does the same thing as override_output does to write_file. Implemented for custom generators. --- pelican/writers.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pelican/writers.py b/pelican/writers.py index e90a0004..36d2f038 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -79,7 +79,8 @@ class Writer(object): self._written_files.add(filename) return open(filename, 'w', encoding=encoding) - def write_feed(self, elements, context, path=None, feed_type='atom'): + def write_feed(self, elements, context, path=None, feed_type='atom', + override_output=False): """Generate a feed with the list of articles provided Return the feed. If no path or output_path is specified, just @@ -89,6 +90,9 @@ class Writer(object): :param context: the context to get the feed metadata. :param path: the path to output. :param feed_type: the feed type to use (atom or rss) + :param override_output: boolean telling if we can override previous + output with the same name (and if next files written with the same + name should be skipped to keep that one) """ if not is_selected_for_writing(self.settings, path): return @@ -115,7 +119,7 @@ class Writer(object): pass encoding = 'utf-8' if six.PY3 else None - with self._open_w(complete_path, encoding) as fp: + with self._open_w(complete_path, encoding, override_output) as fp: feed.write(fp, 'utf-8') logger.info('Writing %s', complete_path) From ed34ee1808699fa34d2170bf4fa8a26152f27514 Mon Sep 17 00:00:00 2001 From: jah Date: Tue, 11 Aug 2015 20:03:43 +0100 Subject: [PATCH 1356/2344] Correct render of article description meta in the simple theme: the template incorrectly assumed that the source metadata is made available as a list of strings. Fixes #1792. --- pelican/themes/simple/templates/article.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index d558183d..8ddda4d0 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -5,9 +5,9 @@ {% endfor %} - {% for description in article.description %} - - {% endfor %} + {% if article.description %} + + {% endif %} {% for tag in article.tags %} From ed83ad75a9aeaea97c6ab530b0679d1555c7691c Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 14 Aug 2015 16:34:25 -0700 Subject: [PATCH 1357/2344] Bump version 3.6.3 --- docs/changelog.rst | 5 +++++ docs/conf.py | 2 +- pelican/__init__.py | 2 +- setup.py | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 664e1310..70a96b30 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Release history ############### +3.6.3 (2015-08-14) +================== + +* Fix permissions issue in release tarball + 3.6.2 (2015-08-01) ================== diff --git a/docs/conf.py b/docs/conf.py index 15ae49b9..d3f58905 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ copyright = '2015, Alexis Metaireau and contributors' exclude_patterns = ['_build'] release = __version__ version = '.'.join(release.split('.')[:1]) -last_stable = '3.6.2' +last_stable = '3.6.3' rst_prolog = ''' .. |last_stable| replace:: :pelican-doc:`{0}` '''.format(last_stable) diff --git a/pelican/__init__.py b/pelican/__init__.py index 0b5c62d4..a738506a 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -26,7 +26,7 @@ from pelican.utils import (clean_output_dir, folder_watcher, file_watcher, maybe_pluralize) from pelican.writers import Writer -__version__ = "3.6.2" +__version__ = "3.6.3" DEFAULT_CONFIG_NAME = 'pelicanconf.py' diff --git a/setup.py b/setup.py index b6b5c3d8..bdcdea37 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ CHANGELOG = open('docs/changelog.rst').read() setup( name="pelican", - version="3.6.2", + version="3.6.3", url='http://getpelican.com/', author='Alexis Metaireau', author_email='authors@getpelican.com', From e06d0046b1e0ac988167810c0e8906d52d16960a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 14 Aug 2015 17:24:29 -0700 Subject: [PATCH 1358/2344] Prepare version 3.6.4.dev0 for next development cycle --- docs/changelog.rst | 5 +++++ pelican/__init__.py | 2 +- setup.py | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index 70a96b30..f52d6449 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Release history ############### +Next release +============ + +- Nothing yet + 3.6.3 (2015-08-14) ================== diff --git a/pelican/__init__.py b/pelican/__init__.py index a738506a..1af14897 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -26,7 +26,7 @@ from pelican.utils import (clean_output_dir, folder_watcher, file_watcher, maybe_pluralize) from pelican.writers import Writer -__version__ = "3.6.3" +__version__ = "3.6.4.dev0" DEFAULT_CONFIG_NAME = 'pelicanconf.py' diff --git a/setup.py b/setup.py index bdcdea37..86028424 100755 --- a/setup.py +++ b/setup.py @@ -22,7 +22,7 @@ CHANGELOG = open('docs/changelog.rst').read() setup( name="pelican", - version="3.6.3", + version="3.6.4.dev0", url='http://getpelican.com/', author='Alexis Metaireau', author_email='authors@getpelican.com', From 5dc6d2914e702c2b599a592fb8d6faeb179e3b0e Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 16 Aug 2015 09:57:55 -0700 Subject: [PATCH 1359/2344] Minor tweaks to FAQ docs --- docs/faq.rst | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index 08df017d..195a4e33 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -12,10 +12,10 @@ How can I help? ================ There are several ways to help out. First, you can report any Pelican -suggestions or problems you might have via IRC or the `issue tracker -`_. If submitting an issue -report, please first check the existing issue list (both open and closed) in -order to avoid submitting a duplicate issue. +suggestions or problems you might have via IRC (preferred) or the +`issue tracker `_. If submitting +an issue report, please first check the existing issue list (both open and +closed) in order to avoid submitting a duplicate issue. If you want to contribute, please fork `the git repository `_, create a new feature branch, make @@ -25,20 +25,20 @@ section for more details. You can also contribute by creating themes and improving the documentation. -Is it mandatory to have a configuration file? +Is the Pelican settings file mandatory? ============================================= Configuration files are optional and are just an easy way to configure Pelican. For basic operations, it's possible to specify options while invoking Pelican via the command line. See ``pelican --help`` for more information. -Changes to the setting file take no effect +Changes to the settings file take no effect ========================================== When experimenting with different settings (especially the metadata ones) caching may interfere and the changes may not be visible. In -such cases disable caching with ``LOAD_CONTENT_CACHE = False`` or -use the ``--ignore-cache`` command-line switch. +such cases, ensure that caching is disabled via ``LOAD_CONTENT_CACHE = False`` +or use the ``--ignore-cache`` command-line switch. I'm creating my own theme. How do I use Pygments for syntax highlighting? ========================================================================= @@ -251,15 +251,15 @@ moved out of the pelican core and into a separate `plugin See the :ref:`plugins` documentation further information about the Pelican plugin system. -Since I upgraded Pelican my Pages are no longer rendered +Since I upgraded Pelican my pages are no longer rendered ======================================================== -Pages were available to Themes as lowercase ``pages`` and uppercase +Pages were available to themes as lowercase ``pages`` and uppercase ``PAGES``. To bring this inline with the :ref:`templates-variables` section, ``PAGES`` has been removed. This is quickly resolved by updating your theme to iterate over ``pages`` instead of ``PAGES``. Just replace:: {% for pg in PAGES %} -with something like:: +...with something like:: {% for pg in pages %} From bd3bec493eb395699e6564383a50e1b89a11d25f Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 16 Aug 2015 10:14:49 -0700 Subject: [PATCH 1360/2344] Fix reST error in docs --- docs/faq.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/faq.rst b/docs/faq.rst index 195a4e33..cd7f598a 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -260,6 +260,6 @@ to iterate over ``pages`` instead of ``PAGES``. Just replace:: {% for pg in PAGES %} -...with something like:: +with something like:: {% for pg in pages %} From de6bd537b51ccba24f0666ee5d732e3d8453b08e Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 16 Aug 2015 10:37:43 -0700 Subject: [PATCH 1361/2344] Fix FAQ header underlines --- docs/faq.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index cd7f598a..bb4cd9e6 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -9,7 +9,7 @@ What's the best way to communicate a problem, question, or suggestion? Please read our :doc:`feedback guidelines `. How can I help? -================ +=============== There are several ways to help out. First, you can report any Pelican suggestions or problems you might have via IRC (preferred) or the @@ -26,14 +26,14 @@ section for more details. You can also contribute by creating themes and improving the documentation. Is the Pelican settings file mandatory? -============================================= +======================================= Configuration files are optional and are just an easy way to configure Pelican. For basic operations, it's possible to specify options while invoking Pelican via the command line. See ``pelican --help`` for more information. Changes to the settings file take no effect -========================================== +=========================================== When experimenting with different settings (especially the metadata ones) caching may interfere and the changes may not be visible. In @@ -60,12 +60,12 @@ CSS file to your new theme:: Don't forget to import your ``pygment.css`` file from your main CSS file. How do I create my own theme? -============================== +============================= Please refer to :ref:`theming-pelican`. I want to use Markdown, but I got an error. -========================================================================== +=========================================== If you try to generate Markdown content without first installing the Markdown library, may see a message that says ``No valid files found in content``. @@ -77,7 +77,7 @@ permissions require it:: pip install markdown Can I use arbitrary metadata in my templates? -============================================== +============================================= Yes. For example, to include a modified date in a Markdown post, one could include the following at the top of the article:: From 44f9cfaaf1c4cb7553314be8c00357825520aaa9 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Mon, 8 Jun 2015 12:50:35 +0200 Subject: [PATCH 1362/2344] add flake8 testing environment --- .travis.yml | 1 + tox.ini | 14 +++++++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 5d7d4a5f..1be196f2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ python: - "2.7" env: - TOX_ENV=docs + - TOX_ENV=flake8 - TOX_ENV=py27 - TOX_ENV=py33 - TOX_ENV=py34 diff --git a/tox.ini b/tox.ini index ff16929e..34335b82 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py{27,33,34},docs +envlist = py{27,33,34},docs,flake8 [testenv] basepython = @@ -27,3 +27,15 @@ deps = changedir = docs commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . _build/html + +[flake8] +application-import-names = pelican +import-order-style = cryptography + +[testenv:flake8] +basepython = python2.7 +deps = + flake8 <= 2.4.1 + git+https://github.com/public/flake8-import-order@2ac7052a4e02b4a8a0125a106d87465a3b9fd688 +commands = + flake8 pelican From 8993c55e6edc4993790e2aef182b924ff60b5239 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Tue, 16 Jun 2015 09:25:09 +0200 Subject: [PATCH 1363/2344] fulfil pep8 standard --- pelican/__init__.py | 68 +++--- pelican/cache.py | 11 +- pelican/contents.py | 66 +++-- pelican/generators.py | 100 ++++---- pelican/log.py | 30 +-- pelican/paginator.py | 13 +- pelican/readers.py | 100 ++++---- pelican/rstdirectives.py | 14 +- pelican/server.py | 16 +- pelican/settings.py | 88 ++++--- pelican/signals.py | 3 +- pelican/tests/default_conf.py | 7 +- pelican/tests/support.py | 32 +-- pelican/tests/test_cache.py | 26 +- pelican/tests/test_contents.py | 138 ++++++----- pelican/tests/test_generators.py | 158 +++++++----- pelican/tests/test_importer.py | 161 ++++++++----- pelican/tests/test_paginator.py | 18 +- pelican/tests/test_pelican.py | 70 +++--- pelican/tests/test_readers.py | 86 ++++--- pelican/tests/test_rstdirectives.py | 7 +- pelican/tests/test_settings.py | 65 ++--- pelican/tests/test_urlwrappers.py | 3 +- pelican/tests/test_utils.py | 111 +++++---- pelican/tools/pelican_import.py | 361 +++++++++++++++++----------- pelican/tools/pelican_quickstart.py | 160 ++++++++---- pelican/tools/pelican_themes.py | 122 ++++++---- pelican/urlwrappers.py | 3 +- pelican/utils.py | 85 ++++--- pelican/writers.py | 46 ++-- tox.ini | 1 + 31 files changed, 1280 insertions(+), 889 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 1af14897..7fb8dfe4 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -1,45 +1,41 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function -import six +from __future__ import print_function, unicode_literals +import argparse +import collections +import locale +import logging import os import re import sys import time -import logging -import argparse -import locale -import collections + +import six # pelican.log has to be the first pelican module to be loaded # because logging.setLoggerClass has to be called before logging.getLogger -from pelican.log import init - +from pelican.log import init # noqa from pelican import signals - from pelican.generators import (ArticlesGenerator, PagesGenerator, - StaticGenerator, SourceFileGenerator, + SourceFileGenerator, StaticGenerator, TemplatePagesGenerator) from pelican.readers import Readers from pelican.settings import read_settings -from pelican.utils import (clean_output_dir, folder_watcher, - file_watcher, maybe_pluralize) +from pelican.utils import (clean_output_dir, file_watcher, + folder_watcher, maybe_pluralize) from pelican.writers import Writer __version__ = "3.6.4.dev0" - DEFAULT_CONFIG_NAME = 'pelicanconf.py' - - logger = logging.getLogger(__name__) class Pelican(object): def __init__(self, settings): - """ - Pelican initialisation, performs some checks on the environment before - doing anything else. + """Pelican initialisation + + Performs some checks on the environment before doing anything else. """ # define the default settings @@ -152,7 +148,7 @@ class Pelican(object): context = self.settings.copy() # Share these among all the generators and content objects: context['filenames'] = {} # maps source path to Content object or None - context['localsiteurl'] = self.settings['SITEURL'] + context['localsiteurl'] = self.settings['SITEURL'] generators = [ cls( @@ -190,23 +186,23 @@ class Pelican(object): if isinstance(g, PagesGenerator)) pluralized_articles = maybe_pluralize( - len(articles_generator.articles) + - len(articles_generator.translations), + (len(articles_generator.articles) + + len(articles_generator.translations)), 'article', 'articles') pluralized_drafts = maybe_pluralize( - len(articles_generator.drafts) + - len(articles_generator.drafts_translations), + (len(articles_generator.drafts) + + len(articles_generator.drafts_translations)), 'draft', 'drafts') pluralized_pages = maybe_pluralize( - len(pages_generator.pages) + - len(pages_generator.translations), + (len(pages_generator.pages) + + len(pages_generator.translations)), 'page', 'pages') pluralized_hidden_pages = maybe_pluralize( - len(pages_generator.hidden_pages) + - len(pages_generator.hidden_translations), + (len(pages_generator.hidden_pages) + + len(pages_generator.hidden_translations)), 'hidden page', 'hidden pages') @@ -243,8 +239,8 @@ class Pelican(object): return generators def get_writer(self): - writers = [ w for (_, w) in signals.get_writer.send(self) - if isinstance(w, type) ] + writers = [w for (_, w) in signals.get_writer.send(self) + if isinstance(w, type)] writers_found = len(writers) if writers_found == 0: return Writer(self.output_path, settings=self.settings) @@ -254,15 +250,15 @@ class Pelican(object): logger.debug('Found writer: %s', writer) else: logger.warning( - '%s writers found, using only first one: %s', + '%s writers found, using only first one: %s', writers_found, writer) return writer(self.output_path, settings=self.settings) def parse_arguments(): parser = argparse.ArgumentParser( - description="""A tool to generate a static blog, - with restructured text input files.""", + description='A tool to generate a static blog, ' + ' with restructured text input files.', formatter_class=argparse.ArgumentDefaultsHelpFormatter ) @@ -354,7 +350,7 @@ def get_config(args): # argparse returns bytes in Py2. There is no definite answer as to which # encoding argparse (or sys.argv) uses. # "Best" option seems to be locale.getpreferredencoding() - # ref: http://mail.python.org/pipermail/python-list/2006-October/405766.html + # http://mail.python.org/pipermail/python-list/2006-October/405766.html if not six.PY3: enc = locale.getpreferredencoding() for key in config: @@ -424,7 +420,8 @@ def main(): # Added static paths # Add new watchers and set them as modified - for static_path in set(new_static).difference(old_static): + new_watchers = set(new_static).difference(old_static) + for static_path in new_watchers: static_key = '[static]%s' % static_path watchers[static_key] = folder_watcher( os.path.join(pelican.path, static_path), @@ -434,7 +431,8 @@ def main(): # Removed static paths # Remove watchers and modified values - for static_path in set(old_static).difference(new_static): + old_watchers = set(old_static).difference(new_static) + for static_path in old_watchers: static_key = '[static]%s' % static_path watchers.pop(static_key) modified.pop(static_key) diff --git a/pelican/cache.py b/pelican/cache.py index d955ae08..e6c10cb9 100644 --- a/pelican/cache.py +++ b/pelican/cache.py @@ -1,16 +1,14 @@ +# -*- coding: utf-8 -*- from __future__ import unicode_literals import hashlib import logging import os -try: - import cPickle as pickle -except: - import pickle + +from six.moves import cPickle as pickle from pelican.utils import mkdir_p - logger = logging.getLogger(__name__) @@ -83,6 +81,7 @@ class FileStampDataCacher(FileDataCacher): """This sublcass additionally sets filestamp function and base path for filestamping operations """ + super(FileStampDataCacher, self).__init__(settings, cache_name, caching_policy, load_policy) @@ -118,6 +117,7 @@ class FileStampDataCacher(FileDataCacher): a hash for a function name in the hashlib module or an empty bytes string otherwise """ + try: return self._filestamp_func(filename) except (IOError, OSError, TypeError) as err: @@ -133,6 +133,7 @@ class FileStampDataCacher(FileDataCacher): Modification is checked by comparing the cached and current file stamp. """ + stamp, data = super(FileStampDataCacher, self).get_cached_data( filename, (None, default)) if stamp != self._get_file_stamp(filename): diff --git a/pelican/contents.py b/pelican/contents.py index a6b8cc5f..16d1f074 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -1,23 +1,24 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function -import six -from six.moves.urllib.parse import urlparse, urlunparse +from __future__ import print_function, unicode_literals import copy import locale import logging -import functools import os import re import sys import pytz +import six +from six.moves.urllib.parse import urlparse, urlunparse + from pelican import signals from pelican.settings import DEFAULT_CONFIG -from pelican.utils import (slugify, truncate_html_words, memoized, strftime, - python_2_unicode_compatible, deprecated_attribute, - path_to_url, posixize_path, set_date_tzinfo, SafeDatetime) +from pelican.utils import (SafeDatetime, deprecated_attribute, memoized, + path_to_url, posixize_path, + python_2_unicode_compatible, set_date_tzinfo, + slugify, strftime, truncate_html_words) # Import these so that they're avalaible when you import from pelican.contents. from pelican.urlwrappers import (URLWrapper, Author, Category, Tag) # NOQA @@ -66,7 +67,7 @@ class Content(object): # also keep track of the metadata attributes available self.metadata = local_metadata - #default template if it's not defined in page + # default template if it's not defined in page self.template = self._get_template() # First, read the authors from "authors", if not, fallback to "author" @@ -94,13 +95,16 @@ class Content(object): # create the slug if not existing, generate slug according to # setting of SLUG_ATTRIBUTE if not hasattr(self, 'slug'): - if settings['SLUGIFY_SOURCE'] == 'title' and hasattr(self, 'title'): + if (settings['SLUGIFY_SOURCE'] == 'title' and + hasattr(self, 'title')): self.slug = slugify(self.title, - settings.get('SLUG_SUBSTITUTIONS', ())) - elif settings['SLUGIFY_SOURCE'] == 'basename' and source_path != None: - basename = os.path.basename(os.path.splitext(source_path)[0]) - self.slug = slugify(basename, - settings.get('SLUG_SUBSTITUTIONS', ())) + settings.get('SLUG_SUBSTITUTIONS', ())) + elif (settings['SLUGIFY_SOURCE'] == 'basename' and + source_path is not None): + basename = os.path.basename( + os.path.splitext(source_path)[0]) + self.slug = slugify( + basename, settings.get('SLUG_SUBSTITUTIONS', ())) self.source_path = source_path @@ -233,7 +237,8 @@ class Content(object): if isinstance(linked_content, Static): linked_content.attach_to(self) else: - logger.warning("%s used {attach} link syntax on a " + logger.warning( + "%s used {attach} link syntax on a " "non-static file. Use {filename} instead.", self.get_relative_source_path()) origin = '/'.join((siteurl, linked_content.url)) @@ -241,7 +246,7 @@ class Content(object): else: logger.warning( "Unable to find `%s`, skipping url replacement.", - value.geturl(), extra = { + value.geturl(), extra={ 'limit_msg': ("Other resources were not found " "and their urls not replaced")}) elif what == 'category': @@ -250,9 +255,9 @@ class Content(object): origin = '/'.join((siteurl, Tag(path, self.settings).url)) else: logger.warning( - "Replacement Indicator '%s' not recognized, " - "skipping replacement", - what) + "Replacement Indicator '%s' not recognized, " + "skipping replacement", + what) # keep all other parts, such as query, fragment, etc. parts = list(value) @@ -337,7 +342,9 @@ class Content(object): return posixize_path( os.path.relpath( - os.path.abspath(os.path.join(self.settings['PATH'], source_path)), + os.path.abspath(os.path.join( + self.settings['PATH'], + source_path)), os.path.abspath(self.settings['PATH']) )) @@ -402,9 +409,12 @@ class Static(Page): def attach_to(self, content): """Override our output directory with that of the given content object. """ - # Determine our file's new output path relative to the linking document. - # If it currently lives beneath the linking document's source directory, - # preserve that relationship on output. Otherwise, make it a sibling. + + # Determine our file's new output path relative to the linking + # document. If it currently lives beneath the linking + # document's source directory, preserve that relationship on output. + # Otherwise, make it a sibling. + linking_source_dir = os.path.dirname(content.source_path) tail_path = os.path.relpath(self.source_path, linking_source_dir) if tail_path.startswith(os.pardir + os.sep): @@ -420,11 +430,14 @@ class Static(Page): # 'some/content' with a file named 'index.html'.) Rather than trying # to figure it out by comparing the linking document's url and save_as # path, we simply build our new url from our new save_as path. + new_url = path_to_url(new_save_as) def _log_reason(reason): - logger.warning("The {attach} link in %s cannot relocate %s " - "because %s. Falling back to {filename} link behavior instead.", + logger.warning( + "The {attach} link in %s cannot relocate " + "%s because %s. Falling back to " + "{filename} link behavior instead.", content.get_relative_source_path(), self.get_relative_source_path(), reason, extra={'limit_msg': "More {attach} warnings silenced."}) @@ -452,5 +465,6 @@ def is_valid_content(content, f): content.check_properties() return True except NameError as e: - logger.error("Skipping %s: could not find information about '%s'", f, e) + logger.error( + "Skipping %s: could not find information about '%s'", f, e) return False diff --git a/pelican/generators.py b/pelican/generators.py index da651252..ff9a9d7c 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -1,28 +1,28 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals -import os -import six -import logging -import shutil -import fnmatch import calendar - +import fnmatch +import logging +import os +import shutil from codecs import open from collections import defaultdict from functools import partial from itertools import chain, groupby from operator import attrgetter -from jinja2 import (Environment, FileSystemLoader, PrefixLoader, ChoiceLoader, - BaseLoader, TemplateNotFound) +from jinja2 import (BaseLoader, ChoiceLoader, Environment, FileSystemLoader, + PrefixLoader, TemplateNotFound) +import six + +from pelican import signals from pelican.cache import FileStampDataCacher from pelican.contents import Article, Draft, Page, Static, is_valid_content from pelican.readers import Readers -from pelican.utils import (copy, process_translations, mkdir_p, DateFormatter, - python_2_unicode_compatible, posixize_path) -from pelican import signals +from pelican.utils import (DateFormatter, copy, mkdir_p, posixize_path, + process_translations, python_2_unicode_compatible) logger = logging.getLogger(__name__) @@ -31,6 +31,7 @@ logger = logging.getLogger(__name__) class PelicanTemplateNotFound(Exception): pass + @python_2_unicode_compatible class Generator(object): """Baseclass generator""" @@ -90,8 +91,9 @@ class Generator(object): try: self._templates[name] = self.env.get_template(name + '.html') except TemplateNotFound: - raise PelicanTemplateNotFound('[templates] unable to load %s.html from %s' - % (name, self._templates_path)) + raise PelicanTemplateNotFound( + '[templates] unable to load {}.html from {}'.format( + name, self._templates_path)) return self._templates[name] def _include_path(self, path, extensions=None): @@ -105,7 +107,7 @@ class Generator(object): extensions = tuple(self.readers.extensions) basename = os.path.basename(path) - #check IGNORE_FILES + # check IGNORE_FILES ignores = self.settings['IGNORE_FILES'] if any(fnmatch.fnmatch(basename, ignore) for ignore in ignores): return False @@ -122,8 +124,9 @@ class Generator(object): :param extensions: the list of allowed extensions (if False, all extensions are allowed) """ + # backward compatibility for older generators if isinstance(paths, six.string_types): - paths = [paths] # backward compatibility for older generators + paths = [paths] # group the exclude dir names by parent path, for use with os.walk() exclusions_by_dirpath = {} @@ -138,7 +141,8 @@ class Generator(object): root = os.path.join(self.path, path) if path else self.path if os.path.isdir(root): - for dirpath, dirs, temp_files in os.walk(root, followlinks=True): + for dirpath, dirs, temp_files in os.walk( + root, followlinks=True): drop = [] excl = exclusions_by_dirpath.get(dirpath, ()) for d in dirs: @@ -178,7 +182,8 @@ class Generator(object): before this method is called, even if they failed to process.) The path argument is expected to be relative to self.path. """ - return posixize_path(os.path.normpath(path)) in self.context['filenames'] + return (posixize_path(os.path.normpath(path)) + in self.context['filenames']) def _update_context(self, items): """Update the context with the given items from the currrent @@ -211,7 +216,8 @@ class CachingGenerator(Generator, FileStampDataCacher): readers_cache_name=(cls_name + '-Readers'), **kwargs) - cache_this_level = self.settings['CONTENT_CACHING_LAYER'] == 'generator' + cache_this_level = \ + self.settings['CONTENT_CACHING_LAYER'] == 'generator' caching_policy = cache_this_level and self.settings['CACHE_CONTENT'] load_policy = cache_this_level and self.settings['LOAD_CONTENT_CACHE'] FileStampDataCacher.__init__(self, self.settings, cls_name, @@ -259,14 +265,14 @@ class ArticlesGenerator(CachingGenerator): def __init__(self, *args, **kwargs): """initialize properties""" - self.articles = [] # only articles in default language + self.articles = [] # only articles in default language self.translations = [] self.dates = {} self.tags = defaultdict(list) self.categories = defaultdict(list) self.related_posts = [] self.authors = defaultdict(list) - self.drafts = [] # only drafts in default language + self.drafts = [] # only drafts in default language self.drafts_translations = [] super(ArticlesGenerator, self).__init__(*args, **kwargs) signals.article_generator_init.send(self) @@ -282,8 +288,8 @@ class ArticlesGenerator(CachingGenerator): writer.write_feed(self.articles, self.context, self.settings['FEED_RSS'], feed_type='rss') - if (self.settings.get('FEED_ALL_ATOM') - or self.settings.get('FEED_ALL_RSS')): + if (self.settings.get('FEED_ALL_ATOM') or + self.settings.get('FEED_ALL_RSS')): all_articles = list(self.articles) for article in self.articles: all_articles.extend(article.translations) @@ -322,8 +328,8 @@ class ArticlesGenerator(CachingGenerator): self.settings['AUTHOR_FEED_RSS'] % auth.slug, feed_type='rss') - if (self.settings.get('TAG_FEED_ATOM') - or self.settings.get('TAG_FEED_RSS')): + if (self.settings.get('TAG_FEED_ATOM') or + self.settings.get('TAG_FEED_RSS')): for tag, arts in self.tags.items(): arts.sort(key=attrgetter('date'), reverse=True) if self.settings.get('TAG_FEED_ATOM'): @@ -336,8 +342,8 @@ class ArticlesGenerator(CachingGenerator): self.settings['TAG_FEED_RSS'] % tag.slug, feed_type='rss') - if (self.settings.get('TRANSLATION_FEED_ATOM') - or self.settings.get('TRANSLATION_FEED_RSS')): + if (self.settings.get('TRANSLATION_FEED_ATOM') or + self.settings.get('TRANSLATION_FEED_RSS')): translations_feeds = defaultdict(list) for article in chain(self.articles, self.translations): translations_feeds[article.lang].append(article) @@ -472,9 +478,9 @@ class ArticlesGenerator(CachingGenerator): """Generate drafts pages.""" for draft in chain(self.drafts_translations, self.drafts): write(draft.save_as, self.get_template(draft.template), - self.context, article=draft, category=draft.category, - override_output=hasattr(draft, 'override_save_as'), - blog=True, all_articles=self.articles) + self.context, article=draft, category=draft.category, + override_output=hasattr(draft, 'override_save_as'), + blog=True, all_articles=self.articles) def generate_pages(self, writer): """Generate the pages on the disk""" @@ -503,7 +509,8 @@ class ArticlesGenerator(CachingGenerator): exclude=self.settings['ARTICLE_EXCLUDES']): article_or_draft = self.get_cached_data(f, None) if article_or_draft is None: - #TODO needs overhaul, maybe nomad for read_file solution, unified behaviour + # TODO needs overhaul, maybe nomad for read_file + # solution, unified behaviour try: article_or_draft = self.readers.read_file( base_path=self.path, path=f, content_class=Article, @@ -513,7 +520,8 @@ class ArticlesGenerator(CachingGenerator): context_signal=signals.article_generator_context, context_sender=self) except Exception as e: - logger.error('Could not process %s\n%s', f, e, + logger.error( + 'Could not process %s\n%s', f, e, exc_info=self.settings.get('DEBUG', False)) self._add_failed_source_path(f) continue @@ -535,8 +543,9 @@ class ArticlesGenerator(CachingGenerator): self.add_source_path(article_or_draft) all_drafts.append(article_or_draft) else: - logger.error("Unknown status '%s' for file %s, skipping it.", - article_or_draft.status, f) + logger.error( + "Unknown status '%s' for file %s, skipping it.", + article_or_draft.status, f) self._add_failed_source_path(f) continue @@ -544,9 +553,9 @@ class ArticlesGenerator(CachingGenerator): self.add_source_path(article_or_draft) - - self.articles, self.translations = process_translations(all_articles, - order_by=self.settings['ARTICLE_ORDER_BY']) + self.articles, self.translations = process_translations( + all_articles, + order_by=self.settings['ARTICLE_ORDER_BY']) self.drafts, self.drafts_translations = \ process_translations(all_drafts) @@ -615,7 +624,8 @@ class PagesGenerator(CachingGenerator): context_signal=signals.page_generator_context, context_sender=self) except Exception as e: - logger.error('Could not process %s\n%s', f, e, + logger.error( + 'Could not process %s\n%s', f, e, exc_info=self.settings.get('DEBUG', False)) self._add_failed_source_path(f) continue @@ -629,8 +639,9 @@ class PagesGenerator(CachingGenerator): elif page.status.lower() == "hidden": hidden_pages.append(page) else: - logger.error("Unknown status '%s' for file %s, skipping it.", - page.status, f) + logger.error( + "Unknown status '%s' for file %s, skipping it.", + page.status, f) self._add_failed_source_path(f) continue @@ -638,10 +649,11 @@ class PagesGenerator(CachingGenerator): self.add_source_path(page) - self.pages, self.translations = process_translations(all_pages, - order_by=self.settings['PAGE_ORDER_BY']) - self.hidden_pages, self.hidden_translations = ( - process_translations(hidden_pages)) + self.pages, self.translations = process_translations( + all_pages, + order_by=self.settings['PAGE_ORDER_BY']) + self.hidden_pages, self.hidden_translations = \ + process_translations(hidden_pages) self._update_context(('pages', 'hidden_pages')) diff --git a/pelican/log.py b/pelican/log.py index c83c5810..0f4b795b 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -1,18 +1,18 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals + +import locale +import logging +import os +import sys +from collections import Mapping, defaultdict + +import six __all__ = [ 'init' ] -import os -import sys -import logging -import locale - -from collections import defaultdict, Mapping - -import six class BaseFormatter(logging.Formatter): def __init__(self, fmt=None, datefmt=None): @@ -20,7 +20,8 @@ class BaseFormatter(logging.Formatter): super(BaseFormatter, self).__init__(fmt=FORMAT, datefmt=datefmt) def format(self, record): - record.__dict__['customlevelname'] = self._get_levelname(record.levelname) + customlevel = self._get_levelname(record.levelname) + record.__dict__['customlevelname'] = customlevel # format multiline messages 'nicely' to make it clear they are together record.msg = record.msg.replace('\n', '\n | ') return super(BaseFormatter, self).format(record) @@ -132,13 +133,13 @@ class SafeLogger(logging.Logger): def _log(self, level, msg, args, exc_info=None, extra=None): # if the only argument is a Mapping, Logger uses that for formatting # format values for that case - if args and len(args)==1 and isinstance(args[0], Mapping): + if args and len(args) == 1 and isinstance(args[0], Mapping): args = ({k: self._decode_arg(v) for k, v in args[0].items()},) # otherwise, format each arg else: args = tuple(self._decode_arg(arg) for arg in args) - super(SafeLogger, self)._log(level, msg, args, - exc_info=exc_info, extra=extra) + super(SafeLogger, self)._log( + level, msg, args, exc_info=exc_info, extra=extra) def _decode_arg(self, arg): ''' @@ -175,8 +176,7 @@ def init(level=None, handler=logging.StreamHandler()): logger = logging.getLogger() - if (os.isatty(sys.stdout.fileno()) - and not sys.platform.startswith('win')): + if os.isatty(sys.stdout.fileno()) and not sys.platform.startswith('win'): fmt = ANSIFormatter() else: fmt = TextFormatter() diff --git a/pelican/paginator.py b/pelican/paginator.py index 0189ec91..9aca550b 100644 --- a/pelican/paginator.py +++ b/pelican/paginator.py @@ -1,18 +1,15 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function -import six +from __future__ import print_function, unicode_literals -# From django.core.paginator -from collections import namedtuple import functools import logging import os - +from collections import namedtuple from math import ceil +import six + logger = logging.getLogger(__name__) - - PaginationRule = namedtuple( 'PaginationRule', 'min_page URL SAVE_AS', @@ -143,7 +140,7 @@ class Page(object): 'settings': self.settings, 'base_name': os.path.dirname(self.name), 'number_sep': '/', - 'extension': self.extension, + 'extension': self.extension, } if self.number == 1: diff --git a/pelican/readers.py b/pelican/readers.py index c1c8dbfa..bc4515e7 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals import logging import os @@ -9,24 +9,50 @@ import docutils import docutils.core import docutils.io from docutils.writers.html4css1 import HTMLTranslator -import six -# import the directives to have pygments support +import six +from six.moves.html_parser import HTMLParser + from pelican import rstdirectives # NOQA +from pelican import signals +from pelican.cache import FileStampDataCacher +from pelican.contents import Author, Category, Page, Tag +from pelican.utils import SafeDatetime, get_date, pelican_open, posixize_path + try: from markdown import Markdown except ImportError: Markdown = False # NOQA + try: from html import escape except ImportError: from cgi import escape -from six.moves.html_parser import HTMLParser -from pelican import signals -from pelican.cache import FileStampDataCacher -from pelican.contents import Page, Category, Tag, Author -from pelican.utils import get_date, pelican_open, SafeDatetime, posixize_path +# Metadata processors have no way to discard an unwanted value, so we have +# them return this value instead to signal that it should be discarded later. +# This means that _filter_discardable_metadata() must be called on processed +# metadata dicts before use, to remove the items with the special value. +_DISCARD = object() +METADATA_PROCESSORS = { + 'tags': lambda x, y: ([ + Tag(tag, y) + for tag in ensure_metadata_list(x) + ] or _DISCARD), + 'date': lambda x, y: get_date(x.replace('_', ' ')), + 'modified': lambda x, y: get_date(x), + 'status': lambda x, y: x.strip() or _DISCARD, + 'category': lambda x, y: _process_if_nonempty(Category, x, y), + 'author': lambda x, y: _process_if_nonempty(Author, x, y), + 'authors': lambda x, y: ([ + Author(author, y) + for author in ensure_metadata_list(x) + ] or _DISCARD), + 'slug': lambda x, y: x.strip() or _DISCARD, +} + +logger = logging.getLogger(__name__) + def ensure_metadata_list(text): """Canonicalize the format of a list of authors or tags. This works @@ -49,13 +75,6 @@ def ensure_metadata_list(text): return [v for v in (w.strip() for w in text) if v] -# Metadata processors have no way to discard an unwanted value, so we have -# them return this value instead to signal that it should be discarded later. -# This means that _filter_discardable_metadata() must be called on processed -# metadata dicts before use, to remove the items with the special value. -_DISCARD = object() - - def _process_if_nonempty(processor, name, settings): """Removes extra whitespace from name and applies a metadata processor. If name is empty or all whitespace, returns _DISCARD instead. @@ -64,28 +83,11 @@ def _process_if_nonempty(processor, name, settings): return processor(name, settings) if name else _DISCARD -METADATA_PROCESSORS = { - 'tags': lambda x, y: ([Tag(tag, y) for tag in ensure_metadata_list(x)] - or _DISCARD), - 'date': lambda x, y: get_date(x.replace('_', ' ')), - 'modified': lambda x, y: get_date(x), - 'status': lambda x, y: x.strip() or _DISCARD, - 'category': lambda x, y: _process_if_nonempty(Category, x, y), - 'author': lambda x, y: _process_if_nonempty(Author, x, y), - 'authors': lambda x, y: ([Author(author, y) - for author in ensure_metadata_list(x)] - or _DISCARD), - 'slug': lambda x, y: x.strip() or _DISCARD, -} - - def _filter_discardable_metadata(metadata): """Return a copy of a dict, minus any items marked as discardable.""" return {name: val for name, val in metadata.items() if val is not _DISCARD} -logger = logging.getLogger(__name__) - class BaseReader(object): """Base class to read files. @@ -267,8 +269,10 @@ class MarkdownReader(BaseReader): output[name] = self.process_metadata(name, summary) elif name in METADATA_PROCESSORS: if len(value) > 1: - logger.warning('Duplicate definition of `%s` ' - 'for %s. Using first one.', name, self._source_path) + logger.warning( + 'Duplicate definition of `%s` ' + 'for %s. Using first one.', + name, self._source_path) output[name] = self.process_metadata(name, value[0]) elif len(value) > 1: # handle list metadata as list of string @@ -380,7 +384,8 @@ class HTMLReader(BaseReader): def _handle_meta_tag(self, attrs): name = self._attr_value(attrs, 'name') if name is None: - attr_serialized = ', '.join(['{}="{}"'.format(k, v) for k, v in attrs]) + attr_list = ['{}="{}"'.format(k, v) for k, v in attrs] + attr_serialized = ', '.join(attr_list) logger.warning("Meta tag in file %s does not have a 'name' " "attribute, skipping. Attributes: %s", self._filename, attr_serialized) @@ -394,9 +399,9 @@ class HTMLReader(BaseReader): "Meta tag attribute 'contents' used in file %s, should" " be changed to 'content'", self._filename, - extra={'limit_msg': ("Other files have meta tag " - "attribute 'contents' that should " - "be changed to 'content'")}) + extra={'limit_msg': "Other files have meta tag " + "attribute 'contents' that should " + "be changed to 'content'"}) if name == 'keywords': name = 'tags' @@ -474,7 +479,8 @@ class Readers(FileStampDataCacher): path = os.path.abspath(os.path.join(base_path, path)) source_path = posixize_path(os.path.relpath(path, base_path)) - logger.debug('Read file %s -> %s', + logger.debug( + 'Read file %s -> %s', source_path, content_class.__name__) if not fmt: @@ -486,7 +492,8 @@ class Readers(FileStampDataCacher): 'Pelican does not know how to parse %s', path) if preread_signal: - logger.debug('Signal %s.send(%s)', + logger.debug( + 'Signal %s.send(%s)', preread_signal.name, preread_sender) preread_signal.send(preread_sender) @@ -527,7 +534,9 @@ class Readers(FileStampDataCacher): def typogrify_wrapper(text): """Ensures ignore_tags feature is backward compatible""" try: - return typogrify(text, self.settings['TYPOGRIFY_IGNORE_TAGS']) + return typogrify( + text, + self.settings['TYPOGRIFY_IGNORE_TAGS']) except TypeError: return typogrify(text) @@ -539,8 +548,10 @@ class Readers(FileStampDataCacher): metadata['summary'] = typogrify_wrapper(metadata['summary']) if context_signal: - logger.debug('Signal %s.send(%s, )', - context_signal.name, context_sender) + logger.debug( + 'Signal %s.send(%s, )', + context_signal.name, + context_sender) context_signal.send(context_sender, metadata=metadata) return content_class(content=content, metadata=metadata, @@ -591,7 +602,8 @@ def default_metadata(settings=None, process=None): if process: value = process('category', value) metadata['category'] = value - if settings.get('DEFAULT_DATE', None) and settings['DEFAULT_DATE'] != 'fs': + if settings.get('DEFAULT_DATE', None) and \ + settings['DEFAULT_DATE'] != 'fs': metadata['date'] = SafeDatetime(*settings['DEFAULT_DATE']) return metadata diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index 1c25cc42..b52785dd 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -1,13 +1,17 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals + +import re from docutils import nodes, utils -from docutils.parsers.rst import directives, roles, Directive -from pygments.formatters import HtmlFormatter +from docutils.parsers.rst import Directive, directives, roles + from pygments import highlight -from pygments.lexers import get_lexer_by_name, TextLexer -import re +from pygments.formatters import HtmlFormatter +from pygments.lexers import TextLexer, get_lexer_by_name + import six + import pelican.settings as pys diff --git a/pelican/server.py b/pelican/server.py index f58ac085..9074135b 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -1,16 +1,18 @@ -from __future__ import print_function +# -*- coding: utf-8 -*- +from __future__ import print_function, unicode_literals + +import logging import os import sys -import logging - -from six.moves import SimpleHTTPServer as srvmod -from six.moves import socketserver try: from magic import from_file as magic_from_file except ImportError: magic_from_file = None +from six.moves import SimpleHTTPServer as srvmod +from six.moves import socketserver + class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): SUFFIXES = ['', '.html', '/index.html'] @@ -54,12 +56,12 @@ if __name__ == '__main__': socketserver.TCPServer.allow_reuse_address = True try: - httpd = socketserver.TCPServer((SERVER, PORT), ComplexHTTPRequestHandler) + httpd = socketserver.TCPServer( + (SERVER, PORT), ComplexHTTPRequestHandler) except OSError as e: logging.error("Could not listen on port %s, server %s.", PORT, SERVER) sys.exit(getattr(e, 'exitcode', 1)) - logging.info("Serving at port %s, server %s.", PORT, SERVER) try: httpd.serve_forever() diff --git a/pelican/settings.py b/pelican/settings.py index c1a902cd..4d75333a 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -1,31 +1,32 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function -import six +from __future__ import print_function, unicode_literals import copy import inspect -import os import locale import logging +import os +from os.path import isabs +from posixpath import join as posix_join + +import six + +from pelican.log import LimitFilter try: # SourceFileLoader is the recommended way in 3.3+ from importlib.machinery import SourceFileLoader - load_source = lambda name, path: SourceFileLoader(name, path).load_module() + + def load_source(name, path): + return SourceFileLoader(name, path).load_module() except ImportError: # but it does not exist in 3.2-, so fall back to imp import imp load_source = imp.load_source -from os.path import isabs -from pelican.utils import posix_join - -from pelican.log import LimitFilter - logger = logging.getLogger(__name__) - DEFAULT_THEME = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'themes', 'notmyidea') DEFAULT_CONFIG = { @@ -131,7 +132,7 @@ DEFAULT_CONFIG = { 'LOAD_CONTENT_CACHE': False, 'WRITE_SELECTED': [], 'FORMATTED_FIELDS': ['summary'], - } +} PYGMENTS_RST_OPTIONS = None @@ -158,8 +159,20 @@ def read_settings(path=None, override=None): "has been deprecated (should be a list)") local_settings['PLUGIN_PATHS'] = [local_settings['PLUGIN_PATHS']] elif local_settings['PLUGIN_PATHS'] is not None: - local_settings['PLUGIN_PATHS'] = [os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(path), pluginpath))) - if not isabs(pluginpath) else pluginpath for pluginpath in local_settings['PLUGIN_PATHS']] + def getabs(path, pluginpath): + if isabs(pluginpath): + return pluginpath + else: + path_dirname = os.path.dirname(path) + path_joined = os.path.join(path_dirname, pluginpath) + path_normed = os.path.normpath(path_joined) + path_absolute = os.path.abspath(path_normed) + return path_absolute + + pluginpath_list = [getabs(path, pluginpath) + for pluginpath + in local_settings['PLUGIN_PATHS']] + local_settings['PLUGIN_PATHS'] = pluginpath_list else: local_settings = copy.deepcopy(DEFAULT_CONFIG) @@ -199,13 +212,13 @@ def configure_settings(settings): settings. Also, specify the log messages to be ignored. """ - if not 'PATH' in settings or not os.path.isdir(settings['PATH']): + if 'PATH' not in settings or not os.path.isdir(settings['PATH']): raise Exception('You need to specify a path containing the content' ' (see pelican --help for more information)') # specify the log messages to be ignored - LimitFilter._ignore.update(set(settings.get('LOG_FILTER', - DEFAULT_CONFIG['LOG_FILTER']))) + log_filter = settings.get('LOG_FILTER', DEFAULT_CONFIG['LOG_FILTER']) + LimitFilter._ignore.update(set(log_filter)) # lookup the theme in "pelican/themes" if the given one doesn't exist if not os.path.isdir(settings['THEME']): @@ -223,19 +236,15 @@ def configure_settings(settings): settings['WRITE_SELECTED'] = [ os.path.abspath(path) for path in settings.get('WRITE_SELECTED', DEFAULT_CONFIG['WRITE_SELECTED']) - ] + ] # standardize strings to lowercase strings - for key in [ - 'DEFAULT_LANG', - ]: + for key in ['DEFAULT_LANG']: if key in settings: settings[key] = settings[key].lower() # standardize strings to lists - for key in [ - 'LOCALE', - ]: + for key in ['LOCALE']: if key in settings and isinstance(settings[key], six.string_types): settings[key] = [settings[key]] @@ -243,12 +252,13 @@ def configure_settings(settings): for key, types in [ ('OUTPUT_SOURCES_EXTENSION', six.string_types), ('FILENAME_METADATA', six.string_types), - ]: + ]: if key in settings and not isinstance(settings[key], types): value = settings.pop(key) - logger.warn('Detected misconfigured %s (%s), ' - 'falling back to the default (%s)', - key, value, DEFAULT_CONFIG[key]) + logger.warn( + 'Detected misconfigured %s (%s), ' + 'falling back to the default (%s)', + key, value, DEFAULT_CONFIG[key]) # try to set the different locales, fallback on the default. locales = settings.get('LOCALE', DEFAULT_CONFIG['LOCALE']) @@ -270,16 +280,16 @@ def configure_settings(settings): logger.warning("Removed extraneous trailing slash from SITEURL.") # If SITEURL is defined but FEED_DOMAIN isn't, # set FEED_DOMAIN to SITEURL - if not 'FEED_DOMAIN' in settings: + if 'FEED_DOMAIN' not in settings: settings['FEED_DOMAIN'] = settings['SITEURL'] # check content caching layer and warn of incompatibilities - if (settings.get('CACHE_CONTENT', False) and - settings.get('CONTENT_CACHING_LAYER', '') == 'generator' and - settings.get('WITH_FUTURE_DATES', DEFAULT_CONFIG['WITH_FUTURE_DATES'])): - logger.warning('WITH_FUTURE_DATES conflicts with ' - "CONTENT_CACHING_LAYER set to 'generator', " - "use 'reader' layer instead") + if settings.get('CACHE_CONTENT', False) and \ + settings.get('CONTENT_CACHING_LAYER', '') == 'generator' and \ + settings.get('WITH_FUTURE_DATES', False): + logger.warning( + "WITH_FUTURE_DATES conflicts with CONTENT_CACHING_LAYER " + "set to 'generator', use 'reader' layer instead") # Warn if feeds are generated with both SITEURL & FEED_DOMAIN undefined feed_keys = [ @@ -296,7 +306,7 @@ def configure_settings(settings): logger.warning('Feeds generated without SITEURL set properly may' ' not be valid') - if not 'TIMEZONE' in settings: + if 'TIMEZONE' not in settings: logger.warning( 'No timezone information specified in the settings. Assuming' ' your timezone is UTC for feed generation. Check ' @@ -321,7 +331,8 @@ def configure_settings(settings): old_key = key + '_DIR' new_key = key + '_PATHS' if old_key in settings: - logger.warning('Deprecated setting %s, moving it to %s list', + logger.warning( + 'Deprecated setting %s, moving it to %s list', old_key, new_key) settings[new_key] = [settings[old_key]] # also make a list del settings[old_key] @@ -365,8 +376,9 @@ def configure_settings(settings): for old, new, doc in [ ('LESS_GENERATOR', 'the Webassets plugin', None), ('FILES_TO_COPY', 'STATIC_PATHS and EXTRA_PATH_METADATA', - 'https://github.com/getpelican/pelican/blob/master/docs/settings.rst#path-metadata'), - ]: + 'https://github.com/getpelican/pelican/' + 'blob/master/docs/settings.rst#path-metadata'), + ]: if old in settings: message = 'The {} setting has been removed in favor of {}'.format( old, new) diff --git a/pelican/signals.py b/pelican/signals.py index 65c98df7..aeeea9f6 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -1,5 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals + from blinker import signal # Run-level signals: diff --git a/pelican/tests/default_conf.py b/pelican/tests/default_conf.py index f38ef804..77c2b947 100644 --- a/pelican/tests/default_conf.py +++ b/pelican/tests/default_conf.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals AUTHOR = 'Alexis Métaireau' SITENAME = "Alexis' log" SITEURL = 'http://blog.notmyidea.org' @@ -31,17 +31,16 @@ DEFAULT_METADATA = {'yeah': 'it is'} # path-specific metadata EXTRA_PATH_METADATA = { 'extra/robots.txt': {'path': 'robots.txt'}, - } +} # static paths will be copied without parsing their contents STATIC_PATHS = [ 'pictures', 'extra/robots.txt', - ] +] FORMATTED_FIELDS = ['summary', 'custom_formatted_field'] # foobar will not be used, because it's not in caps. All configuration keys # have to be in caps foobar = "barbaz" - diff --git a/pelican/tests/support.py b/pelican/tests/support.py index 151fa3b6..3c2a203f 100644 --- a/pelican/tests/support.py +++ b/pelican/tests/support.py @@ -1,25 +1,26 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function -__all__ = ['get_article', 'unittest', ] +from __future__ import print_function, unicode_literals +import locale +import logging import os import re import subprocess import sys -from six import StringIO -import logging -from logging.handlers import BufferingHandler import unittest -import locale - -from functools import wraps from contextlib import contextmanager -from tempfile import mkdtemp +from functools import wraps +from logging.handlers import BufferingHandler from shutil import rmtree +from tempfile import mkdtemp + +from six import StringIO from pelican.contents import Article from pelican.settings import DEFAULT_CONFIG +__all__ = ['get_article', 'unittest', ] + @contextmanager def temporary_folder(): @@ -167,7 +168,7 @@ def get_settings(**kwargs): Set keyword arguments to override specific settings. """ settings = DEFAULT_CONFIG.copy() - for key,value in kwargs.items(): + for key, value in kwargs.items(): settings[key] = value return settings @@ -179,10 +180,13 @@ class LogCountHandler(BufferingHandler): logging.handlers.BufferingHandler.__init__(self, capacity) def count_logs(self, msg=None, level=None): - return len([l for l in self.buffer - if (msg is None or re.match(msg, l.getMessage())) - and (level is None or l.levelno == level) - ]) + return len([ + l + for l + in self.buffer + if (msg is None or re.match(msg, l.getMessage())) and + (level is None or l.levelno == level) + ]) class LoggedTestCase(unittest.TestCase): diff --git a/pelican/tests/test_cache.py b/pelican/tests/test_cache.py index 8a20c36b..006e421b 100644 --- a/pelican/tests/test_cache.py +++ b/pelican/tests/test_cache.py @@ -1,7 +1,14 @@ +# -*- coding: utf-8 -*- from __future__ import unicode_literals import os -from codecs import open + +from shutil import rmtree +from tempfile import mkdtemp + +from pelican.generators import ArticlesGenerator, PagesGenerator +from pelican.tests.support import get_settings, unittest + try: from unittest.mock import MagicMock except ImportError: @@ -10,12 +17,6 @@ except ImportError: except ImportError: MagicMock = False -from shutil import rmtree -from tempfile import mkdtemp - -from pelican.generators import ArticlesGenerator, PagesGenerator -from pelican.tests.support import unittest, get_settings - CUR_DIR = os.path.dirname(__file__) CONTENT_DIR = os.path.join(CUR_DIR, 'content') @@ -35,7 +36,6 @@ class TestCache(unittest.TestCase): settings['CACHE_PATH'] = self.temp_cache return settings - @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_article_object_caching(self): """Test Article objects caching at the generator level""" @@ -44,7 +44,6 @@ class TestCache(unittest.TestCase): settings['DEFAULT_DATE'] = (1970, 1, 1) settings['READERS'] = {'asc': None} - generator = ArticlesGenerator( context=settings.copy(), settings=settings, path=CONTENT_DIR, theme=settings['THEME'], output_path=None) @@ -108,7 +107,9 @@ class TestCache(unittest.TestCase): path=CONTENT_DIR, theme=settings['THEME'], output_path=None) generator.readers.read_file = MagicMock() generator.generate_context() - self.assertEqual(generator.readers.read_file.call_count, orig_call_count) + self.assertEqual( + generator.readers.read_file.call_count, + orig_call_count) @unittest.skipUnless(MagicMock, 'Needs Mock module') def test_page_object_caching(self): @@ -181,5 +182,6 @@ class TestCache(unittest.TestCase): path=CUR_DIR, theme=settings['THEME'], output_path=None) generator.readers.read_file = MagicMock() generator.generate_context() - self.assertEqual(generator.readers.read_file.call_count, orig_call_count) - + self.assertEqual( + generator.readers.read_file.call_count, + orig_call_count) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 145a53b6..a3664383 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -1,20 +1,21 @@ -from __future__ import unicode_literals, absolute_import +# -*- coding: utf-8 -*- +from __future__ import absolute_import, unicode_literals -import logging import locale +import logging import os.path -import six - -from jinja2.utils import generate_lorem_ipsum +from posixpath import join as posix_join from sys import platform -from pelican.contents import (Page, Article, Static, URLWrapper, - Author, Category) +from jinja2.utils import generate_lorem_ipsum + +import six + +from pelican.contents import Article, Author, Category, Page, Static from pelican.settings import DEFAULT_CONFIG from pelican.signals import content_object_init -from pelican.tests.support import LoggedTestCase, mute, unittest, get_settings -from pelican.utils import (path_to_url, truncate_html_words, SafeDatetime, - posix_join) +from pelican.tests.support import LoggedTestCase, get_settings, unittest +from pelican.utils import SafeDatetime, path_to_url, truncate_html_words # generate one paragraph, enclosed with

    @@ -49,7 +50,7 @@ class TestPage(unittest.TestCase): # them to initialise object's attributes. metadata = {'foo': 'bar', 'foobar': 'baz', 'title': 'foobar', } page = Page(TEST_CONTENT, metadata=metadata, - context={'localsiteurl': ''}) + context={'localsiteurl': ''}) for key, value in metadata.items(): self.assertTrue(hasattr(page, key)) self.assertEqual(value, getattr(page, key)) @@ -139,14 +140,9 @@ class TestPage(unittest.TestCase): page = Page(**page_kwargs) # page.locale_date is a unicode string in both python2 and python3 - dt_date = dt.strftime(DEFAULT_CONFIG['DEFAULT_DATE_FORMAT']) - # dt_date is a byte string in python2, and a unicode string in python3 - # Let's make sure it is a unicode string (relies on python 3.3 supporting the u prefix) - if type(dt_date) != type(u''): - # python2: - dt_date = unicode(dt_date, 'utf8') + dt_date = dt.strftime(DEFAULT_CONFIG['DEFAULT_DATE_FORMAT']) - self.assertEqual(page.locale_date, dt_date ) + self.assertEqual(page.locale_date, dt_date) page_kwargs['settings'] = get_settings() # I doubt this can work on all platforms ... @@ -307,10 +303,14 @@ class TestPage(unittest.TestCase): args['settings'] = get_settings() args['source_path'] = 'content' args['context']['filenames'] = { - 'images/poster.jpg': type(cls_name, (object,), {'url': 'images/poster.jpg'}), - 'assets/video.mp4': type(cls_name, (object,), {'url': 'assets/video.mp4'}), - 'images/graph.svg': type(cls_name, (object,), {'url': 'images/graph.svg'}), - 'reference.rst': type(cls_name, (object,), {'url': 'reference.html'}), + 'images/poster.jpg': type( + cls_name, (object,), {'url': 'images/poster.jpg'}), + 'assets/video.mp4': type( + cls_name, (object,), {'url': 'assets/video.mp4'}), + 'images/graph.svg': type( + cls_name, (object,), {'url': 'images/graph.svg'}), + 'reference.rst': type( + cls_name, (object,), {'url': 'reference.html'}), } # video.poster @@ -325,20 +325,25 @@ class TestPage(unittest.TestCase): content, 'There is a video with poster ' '' ) # object.data args['content'] = ( 'There is a svg object ' - '' + '' + '' ) content = Page(**args).get_content('http://notmyidea.org') self.assertEqual( content, 'There is a svg object ' - '' + '' + '' ) # blockquote.cite @@ -350,7 +355,9 @@ class TestPage(unittest.TestCase): self.assertEqual( content, 'There is a blockquote with cite attribute ' - '

    blah blah
    ' + '
    ' + 'blah blah' + '
    ' ) def test_intrasite_link_markdown_spaces(self): @@ -401,17 +408,19 @@ class TestArticle(TestPage): def test_slugify_category_author(self): settings = get_settings() - settings['SLUG_SUBSTITUTIONS'] = [ ('C#', 'csharp') ] + settings['SLUG_SUBSTITUTIONS'] = [('C#', 'csharp')] settings['ARTICLE_URL'] = '{author}/{category}/{slug}/' settings['ARTICLE_SAVE_AS'] = '{author}/{category}/{slug}/index.html' article_kwargs = self._copy_page_kwargs() article_kwargs['metadata']['author'] = Author("O'Brien", settings) - article_kwargs['metadata']['category'] = Category('C# & stuff', settings) + article_kwargs['metadata']['category'] = Category( + 'C# & stuff', settings) article_kwargs['metadata']['title'] = 'fnord' article_kwargs['settings'] = settings article = Article(**article_kwargs) self.assertEqual(article.url, 'obrien/csharp-stuff/fnord/') - self.assertEqual(article.save_as, 'obrien/csharp-stuff/fnord/index.html') + self.assertEqual( + article.save_as, 'obrien/csharp-stuff/fnord/index.html') class TestStatic(LoggedTestCase): @@ -426,7 +435,8 @@ class TestStatic(LoggedTestCase): self.context = self.settings.copy() self.static = Static(content=None, metadata={}, settings=self.settings, - source_path=posix_join('dir', 'foo.jpg'), context=self.context) + source_path=posix_join('dir', 'foo.jpg'), + context=self.context) self.context['filenames'] = {self.static.source_path: self.static} @@ -436,8 +446,10 @@ class TestStatic(LoggedTestCase): def test_attach_to_same_dir(self): """attach_to() overrides a static file's save_as and url. """ - page = Page(content="fake page", - metadata={'title': 'fakepage'}, settings=self.settings, + page = Page( + content="fake page", + metadata={'title': 'fakepage'}, + settings=self.settings, source_path=os.path.join('dir', 'fakepage.md')) self.static.attach_to(page) @@ -449,7 +461,7 @@ class TestStatic(LoggedTestCase): """attach_to() preserves dirs inside the linking document dir. """ page = Page(content="fake page", metadata={'title': 'fakepage'}, - settings=self.settings, source_path='fakepage.md') + settings=self.settings, source_path='fakepage.md') self.static.attach_to(page) expected_save_as = os.path.join('outpages', 'dir', 'foo.jpg') @@ -460,8 +472,8 @@ class TestStatic(LoggedTestCase): """attach_to() ignores dirs outside the linking document dir. """ page = Page(content="fake page", - metadata={'title': 'fakepage'}, settings=self.settings, - source_path=os.path.join('dir', 'otherdir', 'fakepage.md')) + metadata={'title': 'fakepage'}, settings=self.settings, + source_path=os.path.join('dir', 'otherdir', 'fakepage.md')) self.static.attach_to(page) expected_save_as = os.path.join('outpages', 'foo.jpg') @@ -472,8 +484,8 @@ class TestStatic(LoggedTestCase): """attach_to() does nothing when called a second time. """ page = Page(content="fake page", - metadata={'title': 'fakepage'}, settings=self.settings, - source_path=os.path.join('dir', 'fakepage.md')) + metadata={'title': 'fakepage'}, settings=self.settings, + source_path=os.path.join('dir', 'fakepage.md')) self.static.attach_to(page) @@ -481,8 +493,10 @@ class TestStatic(LoggedTestCase): otherdir_settings.update(dict( PAGE_SAVE_AS=os.path.join('otherpages', '{slug}.html'), PAGE_URL='otherpages/{slug}.html')) - otherdir_page = Page(content="other page", - metadata={'title': 'otherpage'}, settings=otherdir_settings, + otherdir_page = Page( + content="other page", + metadata={'title': 'otherpage'}, + settings=otherdir_settings, source_path=os.path.join('dir', 'otherpage.md')) self.static.attach_to(otherdir_page) @@ -497,8 +511,10 @@ class TestStatic(LoggedTestCase): """ original_save_as = self.static.save_as - page = Page(content="fake page", - metadata={'title': 'fakepage'}, settings=self.settings, + page = Page( + content="fake page", + metadata={'title': 'fakepage'}, + settings=self.settings, source_path=os.path.join('dir', 'fakepage.md')) self.static.attach_to(page) @@ -511,8 +527,10 @@ class TestStatic(LoggedTestCase): """ original_url = self.static.url - page = Page(content="fake page", - metadata={'title': 'fakepage'}, settings=self.settings, + page = Page( + content="fake page", + metadata={'title': 'fakepage'}, + settings=self.settings, source_path=os.path.join('dir', 'fakepage.md')) self.static.attach_to(page) @@ -523,13 +541,15 @@ class TestStatic(LoggedTestCase): """attach_to() does not override paths that were overridden elsewhere. (For example, by the user with EXTRA_PATH_METADATA) """ - customstatic = Static(content=None, + customstatic = Static( + content=None, metadata=dict(save_as='customfoo.jpg', url='customfoo.jpg'), settings=self.settings, source_path=os.path.join('dir', 'foo.jpg'), context=self.settings.copy()) - page = Page(content="fake page", + page = Page( + content="fake page", metadata={'title': 'fakepage'}, settings=self.settings, source_path=os.path.join('dir', 'fakepage.md')) @@ -542,13 +562,16 @@ class TestStatic(LoggedTestCase): """{attach} link syntax triggers output path override & url replacement. """ html = 'link' - page = Page(content=html, - metadata={'title': 'fakepage'}, settings=self.settings, + page = Page( + content=html, + metadata={'title': 'fakepage'}, + settings=self.settings, source_path=os.path.join('dir', 'otherdir', 'fakepage.md'), context=self.context) content = page.get_content('') - self.assertNotEqual(content, html, + self.assertNotEqual( + content, html, "{attach} link syntax did not trigger URL replacement.") expected_save_as = os.path.join('outpages', 'foo.jpg') @@ -561,7 +584,8 @@ class TestStatic(LoggedTestCase): html = 'link' page = Page( content=html, - metadata={'title': 'fakepage'}, settings=self.settings, + metadata={'title': 'fakepage'}, + settings=self.settings, source_path=os.path.join('dir', 'otherdir', 'fakepage.md'), context=self.context) content = page.get_content('') @@ -572,8 +596,10 @@ class TestStatic(LoggedTestCase): "{category} link syntax triggers url replacement." html = 'link' - page = Page(content=html, - metadata={'title': 'fakepage'}, settings=self.settings, + page = Page( + content=html, + metadata={'title': 'fakepage'}, + settings=self.settings, source_path=os.path.join('dir', 'otherdir', 'fakepage.md'), context=self.context) content = page.get_content('') @@ -588,11 +614,11 @@ class TestStatic(LoggedTestCase): metadata={'title': 'fakepage'}, settings=self.settings, source_path=os.path.join('dir', 'otherdir', 'fakepage.md'), context=self.context) - content = page.get_content('') + content = page.get_content('') self.assertEqual(content, html) self.assertLogCountEqual( - count=1, - msg="Replacement Indicator 'unknown' not recognized, " - "skipping replacement", - level=logging.WARNING) + count=1, + msg="Replacement Indicator 'unknown' not recognized, " + "skipping replacement", + level=logging.WARNING) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index c424b60f..2cfca04f 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -1,8 +1,18 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals +import locale import os + from codecs import open +from shutil import rmtree +from tempfile import mkdtemp + +from pelican.generators import (ArticlesGenerator, Generator, PagesGenerator, + StaticGenerator, TemplatePagesGenerator) +from pelican.tests.support import get_settings, unittest +from pelican.writers import Writer + try: from unittest.mock import MagicMock except ImportError: @@ -10,14 +20,7 @@ except ImportError: from mock import MagicMock except ImportError: MagicMock = False -from shutil import rmtree -from tempfile import mkdtemp -from pelican.generators import (Generator, ArticlesGenerator, PagesGenerator, - StaticGenerator, TemplatePagesGenerator) -from pelican.writers import Writer -from pelican.tests.support import unittest, get_settings -import locale CUR_DIR = os.path.dirname(__file__) CONTENT_DIR = os.path.join(CUR_DIR, 'content') @@ -35,7 +38,6 @@ class TestGenerator(unittest.TestCase): def tearDown(self): locale.setlocale(locale.LC_ALL, self.old_locale) - def test_include_path(self): self.settings['IGNORE_FILES'] = {'ignored1.rst', 'ignored2.rst'} @@ -52,7 +54,8 @@ class TestGenerator(unittest.TestCase): """Test that Generator.get_files() properly excludes directories. """ # We use our own Generator so we can give it our own content path - generator = Generator(context=self.settings.copy(), + generator = Generator( + context=self.settings.copy(), settings=self.settings, path=os.path.join(CUR_DIR, 'nested_content'), theme=self.settings['THEME'], output_path=None) @@ -60,34 +63,42 @@ class TestGenerator(unittest.TestCase): filepaths = generator.get_files(paths=['maindir']) found_files = {os.path.basename(f) for f in filepaths} expected_files = {'maindir.md', 'subdir.md'} - self.assertFalse(expected_files - found_files, + self.assertFalse( + expected_files - found_files, "get_files() failed to find one or more files") # Test string as `paths` argument rather than list filepaths = generator.get_files(paths='maindir') found_files = {os.path.basename(f) for f in filepaths} expected_files = {'maindir.md', 'subdir.md'} - self.assertFalse(expected_files - found_files, + self.assertFalse( + expected_files - found_files, "get_files() failed to find one or more files") filepaths = generator.get_files(paths=[''], exclude=['maindir']) found_files = {os.path.basename(f) for f in filepaths} - self.assertNotIn('maindir.md', found_files, + self.assertNotIn( + 'maindir.md', found_files, "get_files() failed to exclude a top-level directory") - self.assertNotIn('subdir.md', found_files, + self.assertNotIn( + 'subdir.md', found_files, "get_files() failed to exclude a subdir of an excluded directory") - filepaths = generator.get_files(paths=[''], + filepaths = generator.get_files( + paths=[''], exclude=[os.path.join('maindir', 'subdir')]) found_files = {os.path.basename(f) for f in filepaths} - self.assertNotIn('subdir.md', found_files, + self.assertNotIn( + 'subdir.md', found_files, "get_files() failed to exclude a subdirectory") filepaths = generator.get_files(paths=[''], exclude=['subdir']) found_files = {os.path.basename(f) for f in filepaths} - self.assertIn('subdir.md', found_files, + self.assertIn( + 'subdir.md', found_files, "get_files() excluded a subdirectory by name, ignoring its path") + class TestArticlesGenerator(unittest.TestCase): @classmethod @@ -96,7 +107,7 @@ class TestArticlesGenerator(unittest.TestCase): settings['DEFAULT_CATEGORY'] = 'Default' settings['DEFAULT_DATE'] = (1970, 1, 1) settings['READERS'] = {'asc': None} - settings['CACHE_CONTENT'] = False # cache not needed for this logic tests + settings['CACHE_CONTENT'] = False cls.generator = ArticlesGenerator( context=settings.copy(), settings=settings, @@ -152,25 +163,30 @@ class TestArticlesGenerator(unittest.TestCase): ['Test mkd File', 'published', 'test', 'article'], ['This is a super article !', 'published', 'Yeah', 'article'], ['This is a super article !', 'published', 'Yeah', 'article'], - ['Article with Nonconformant HTML meta tags', 'published', 'Default', 'article'], + ['Article with Nonconformant HTML meta tags', 'published', + 'Default', 'article'], ['This is a super article !', 'published', 'yeah', 'article'], ['This is a super article !', 'published', 'yeah', 'article'], ['This is a super article !', 'published', 'yeah', 'article'], ['This is a super article !', 'published', 'Default', 'article'], ['This is an article with category !', 'published', 'yeah', 'article'], - ['This is an article with multiple authors!', 'published', 'Default', 'article'], - ['This is an article with multiple authors!', 'published', 'Default', 'article'], - ['This is an article with multiple authors in list format!', 'published', 'Default', 'article'], - ['This is an article with multiple authors in lastname, firstname format!', 'published', 'Default', 'article'], + ['This is an article with multiple authors!', 'published', + 'Default', 'article'], + ['This is an article with multiple authors!', 'published', + 'Default', 'article'], + ['This is an article with multiple authors in list format!', + 'published', 'Default', 'article'], + ['This is an article with multiple authors in lastname, ' + 'firstname format!', 'published', 'Default', 'article'], ['This is an article without category !', 'published', 'Default', - 'article'], + 'article'], ['This is an article without category !', 'published', 'TestCategory', 'article'], ['An Article With Code Block To Test Typogrify Ignore', - 'published', 'Default', 'article'], - ['マックOS X 10.8でパイソンとVirtualenvをインストールと設定', 'published', - '指導書', 'article'], + 'published', 'Default', 'article'], + ['マックOS X 10.8でパイソンとVirtualenvをインストールと設定', + 'published', '指導書', 'article'], ] self.assertEqual(sorted(articles_expected), sorted(self.articles)) @@ -292,7 +308,7 @@ class TestArticlesGenerator(unittest.TestCase): generator.generate_period_archives(write) dates = [d for d in generator.dates if d.date.year == 1970] self.assertEqual(len(dates), 1) - #among other things it must have at least been called with this + # among other things it must have at least been called with this settings["period"] = (1970,) write.assert_called_with("posts/1970/index.html", generator.get_template("period_archives"), @@ -300,37 +316,42 @@ class TestArticlesGenerator(unittest.TestCase): blog=True, dates=dates) del settings["period"] - settings['MONTH_ARCHIVE_SAVE_AS'] = 'posts/{date:%Y}/{date:%b}/index.html' + settings['MONTH_ARCHIVE_SAVE_AS'] = \ + 'posts/{date:%Y}/{date:%b}/index.html' generator = ArticlesGenerator( context=settings, settings=settings, path=CONTENT_DIR, theme=settings['THEME'], output_path=None) generator.generate_context() write = MagicMock() generator.generate_period_archives(write) - dates = [d for d in generator.dates if d.date.year == 1970 - and d.date.month == 1] + dates = [d for d in generator.dates + if d.date.year == 1970 and d.date.month == 1] self.assertEqual(len(dates), 1) settings["period"] = (1970, "January") - #among other things it must have at least been called with this + # among other things it must have at least been called with this write.assert_called_with("posts/1970/Jan/index.html", generator.get_template("period_archives"), settings, blog=True, dates=dates) del settings["period"] - settings['DAY_ARCHIVE_SAVE_AS'] = 'posts/{date:%Y}/{date:%b}/{date:%d}/index.html' + settings['DAY_ARCHIVE_SAVE_AS'] = \ + 'posts/{date:%Y}/{date:%b}/{date:%d}/index.html' generator = ArticlesGenerator( context=settings, settings=settings, path=CONTENT_DIR, theme=settings['THEME'], output_path=None) generator.generate_context() write = MagicMock() generator.generate_period_archives(write) - dates = [d for d in generator.dates if d.date.year == 1970 - and d.date.month == 1 - and d.date.day == 1] + dates = [ + d for d in generator.dates if + d.date.year == 1970 and + d.date.month == 1 and + d.date.day == 1 + ] self.assertEqual(len(dates), 1) settings["period"] = (1970, "January", 1) - #among other things it must have at least been called with this + # among other things it must have at least been called with this write.assert_called_with("posts/1970/Jan/01/index.html", generator.get_template("period_archives"), settings, @@ -347,11 +368,14 @@ class TestArticlesGenerator(unittest.TestCase): def test_generate_authors(self): """Check authors generation.""" authors = [author.name for author, _ in self.generator.authors] - authors_expected = sorted(['Alexis Métaireau', 'Author, First', 'Author, Second', 'First Author', 'Second Author']) + authors_expected = sorted( + ['Alexis Métaireau', 'Author, First', 'Author, Second', + 'First Author', 'Second Author']) self.assertEqual(sorted(authors), authors_expected) # test for slug authors = [author.slug for author, _ in self.generator.authors] - authors_expected = ['alexis-metaireau', 'author-first', 'author-second', 'first-author', 'second-author'] + authors_expected = ['alexis-metaireau', 'author-first', + 'author-second', 'first-author', 'second-author'] self.assertEqual(sorted(authors), sorted(authors_expected)) def test_standard_metadata_in_default_metadata(self): @@ -391,7 +415,6 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings(filenames={}) settings['DEFAULT_CATEGORY'] = 'Default' settings['DEFAULT_DATE'] = (1970, 1, 1) - settings['CACHE_CONTENT'] = False # cache not needed for this logic tests settings['ARTICLE_ORDER_BY'] = 'title' generator = ArticlesGenerator( @@ -420,7 +443,8 @@ class TestArticlesGenerator(unittest.TestCase): 'This is a super article !', 'This is a super article !', 'This is an article with category !', - 'This is an article with multiple authors in lastname, firstname format!', + ('This is an article with multiple authors in lastname, ' + 'firstname format!'), 'This is an article with multiple authors in list format!', 'This is an article with multiple authors!', 'This is an article with multiple authors!', @@ -435,7 +459,6 @@ class TestArticlesGenerator(unittest.TestCase): settings = get_settings(filenames={}) settings['DEFAULT_CATEGORY'] = 'Default' settings['DEFAULT_DATE'] = (1970, 1, 1) - settings['CACHE_CONTENT'] = False # cache not needed for this logic tests settings['ARTICLE_ORDER_BY'] = 'reversed-title' generator = ArticlesGenerator( @@ -561,7 +584,7 @@ class TestPageGenerator(unittest.TestCase): are generated correctly on pages """ settings = get_settings(filenames={}) - settings['PAGE_PATHS'] = ['TestPages'] # relative to CUR_DIR + settings['PAGE_PATHS'] = ['TestPages'] # relative to CUR_DIR settings['CACHE_PATH'] = self.temp_cache settings['DEFAULT_DATE'] = (1970, 1, 1) @@ -586,7 +609,6 @@ class TestTemplatePagesGenerator(unittest.TestCase): self.old_locale = locale.setlocale(locale.LC_ALL) locale.setlocale(locale.LC_ALL, str('C')) - def tearDown(self): rmtree(self.temp_content) rmtree(self.temp_output) @@ -632,59 +654,67 @@ class TestStaticGenerator(unittest.TestCase): def test_static_excludes(self): """Test that StaticGenerator respects STATIC_EXCLUDES. """ - settings = get_settings(STATIC_EXCLUDES=['subdir'], - PATH=self.content_path, STATIC_PATHS=['']) + settings = get_settings( + STATIC_EXCLUDES=['subdir'], + PATH=self.content_path, + STATIC_PATHS=[''], + filenames={}) context = settings.copy() - context['filenames'] = {} - StaticGenerator(context=context, settings=settings, + StaticGenerator( + context=context, settings=settings, path=settings['PATH'], output_path=None, theme=settings['THEME']).generate_context() staticnames = [os.path.basename(c.source_path) - for c in context['staticfiles']] + for c in context['staticfiles']] - self.assertNotIn('subdir_fake_image.jpg', staticnames, + self.assertNotIn( + 'subdir_fake_image.jpg', staticnames, "StaticGenerator processed a file in a STATIC_EXCLUDES directory") - self.assertIn('fake_image.jpg', staticnames, + self.assertIn( + 'fake_image.jpg', staticnames, "StaticGenerator skipped a file that it should have included") def test_static_exclude_sources(self): """Test that StaticGenerator respects STATIC_EXCLUDE_SOURCES. """ - # Test STATIC_EXCLUDE_SOURCES=True - settings = get_settings(STATIC_EXCLUDE_SOURCES=True, - PATH=self.content_path, PAGE_PATHS=[''], STATIC_PATHS=[''], - CACHE_CONTENT=False) + settings = get_settings( + STATIC_EXCLUDE_SOURCES=True, + PATH=self.content_path, + PAGE_PATHS=[''], + STATIC_PATHS=[''], + CACHE_CONTENT=False, + filenames={}) context = settings.copy() - context['filenames'] = {} for generator_class in (PagesGenerator, StaticGenerator): - generator_class(context=context, settings=settings, + generator_class( + context=context, settings=settings, path=settings['PATH'], output_path=None, theme=settings['THEME']).generate_context() staticnames = [os.path.basename(c.source_path) - for c in context['staticfiles']] + for c in context['staticfiles']] - self.assertFalse(any(name.endswith(".md") for name in staticnames), + self.assertFalse( + any(name.endswith(".md") for name in staticnames), "STATIC_EXCLUDE_SOURCES=True failed to exclude a markdown file") - # Test STATIC_EXCLUDE_SOURCES=False - settings.update(STATIC_EXCLUDE_SOURCES=False) context = settings.copy() context['filenames'] = {} for generator_class in (PagesGenerator, StaticGenerator): - generator_class(context=context, settings=settings, + generator_class( + context=context, settings=settings, path=settings['PATH'], output_path=None, theme=settings['THEME']).generate_context() staticnames = [os.path.basename(c.source_path) - for c in context['staticfiles']] + for c in context['staticfiles']] - self.assertTrue(any(name.endswith(".md") for name in staticnames), + self.assertTrue( + any(name.endswith(".md") for name in staticnames), "STATIC_EXCLUDE_SOURCES=False failed to include a markdown file") - diff --git a/pelican/tests/test_importer.py b/pelican/tests/test_importer.py index 4ace5ccc..6af59212 100644 --- a/pelican/tests/test_importer.py +++ b/pelican/tests/test_importer.py @@ -1,16 +1,19 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +# -*- coding: utf-8 -*- +from __future__ import print_function, unicode_literals +import locale import os import re -import locale from codecs import open -from pelican.tools.pelican_import import wp2fields, fields2pelican, decode_wp_content, build_header, build_markdown_header, get_attachments, download_attachments -from pelican.tests.support import (unittest, temporary_folder, mute, - skipIfNoExecutable) -from pelican.utils import slugify, path_to_file_url +from pelican.tests.support import (mute, skipIfNoExecutable, temporary_folder, + unittest) +from pelican.tools.pelican_import import (build_header, build_markdown_header, + decode_wp_content, + download_attachments, fields2pelican, + get_attachments, wp2fields) +from pelican.utils import path_to_file_url, slugify CUR_DIR = os.path.abspath(os.path.dirname(__file__)) WORDPRESS_XML_SAMPLE = os.path.join(CUR_DIR, 'content', 'wordpressexport.xml') @@ -32,7 +35,6 @@ except ImportError: LXML = False - @skipIfNoExecutable(['pandoc', '--version']) @unittest.skipUnless(BeautifulSoup, 'Needs BeautifulSoup module') class TestWordpressXmlImporter(unittest.TestCase): @@ -48,17 +50,19 @@ class TestWordpressXmlImporter(unittest.TestCase): def test_ignore_empty_posts(self): self.assertTrue(self.posts) - for title, content, fname, date, author, categ, tags, status, kind, format in self.posts: - self.assertTrue(title.strip()) + for (title, content, fname, date, author, + categ, tags, status, kind, format) in self.posts: + self.assertTrue(title.strip()) def test_recognise_page_kind(self): """ Check that we recognise pages in wordpress, as opposed to posts """ self.assertTrue(self.posts) # Collect (title, filename, kind) of non-empty posts recognised as page pages_data = [] - for title, content, fname, date, author, categ, tags, status, kind, format in self.posts: - if kind == 'page': - pages_data.append((title, fname)) + for (title, content, fname, date, author, + categ, tags, status, kind, format) in self.posts: + if kind == 'page': + pages_data.append((title, fname)) self.assertEqual(2, len(pages_data)) self.assertEqual(('Page', 'contact'), pages_data[0]) self.assertEqual(('Empty Page', 'empty'), pages_data[1]) @@ -67,7 +71,8 @@ class TestWordpressXmlImporter(unittest.TestCase): silent_f2p = mute(True)(fields2pelican) test_post = filter(lambda p: p[0].startswith("Empty Page"), self.posts) with temporary_folder() as temp: - fname = list(silent_f2p(test_post, 'markdown', temp, dirpage=True))[0] + fname = list(silent_f2p(test_post, 'markdown', + temp, dirpage=True))[0] self.assertTrue(fname.endswith('pages%sempty.md' % os.path.sep)) def test_dircat(self): @@ -75,10 +80,11 @@ class TestWordpressXmlImporter(unittest.TestCase): test_posts = [] for post in self.posts: # check post kind - if len(post[5]) > 0: # Has a category + if len(post[5]) > 0: # Has a category test_posts.append(post) with temporary_folder() as temp: - fnames = list(silent_f2p(test_posts, 'markdown', temp, dircat=True)) + fnames = list(silent_f2p(test_posts, 'markdown', + temp, dircat=True)) index = 0 for post in test_posts: name = post[2] @@ -92,25 +98,33 @@ class TestWordpressXmlImporter(unittest.TestCase): def test_unless_custom_post_all_items_should_be_pages_or_posts(self): self.assertTrue(self.posts) pages_data = [] - for title, content, fname, date, author, categ, tags, status, kind, format in self.posts: - if kind == 'page' or kind == 'article': - pass - else: - pages_data.append((title, fname)) + for (title, content, fname, date, author, categ, + tags, status, kind, format) in self.posts: + if kind == 'page' or kind == 'article': + pass + else: + pages_data.append((title, fname)) self.assertEqual(0, len(pages_data)) def test_recognise_custom_post_type(self): self.assertTrue(self.custposts) cust_data = [] - for title, content, fname, date, author, categ, tags, status, kind, format in self.custposts: - if kind == 'article' or kind == 'page': - pass - else: - cust_data.append((title, kind)) + for (title, content, fname, date, author, categ, + tags, status, kind, format) in self.custposts: + if kind == 'article' or kind == 'page': + pass + else: + cust_data.append((title, kind)) self.assertEqual(3, len(cust_data)) - self.assertEqual(('A custom post in category 4', 'custom1'), cust_data[0]) - self.assertEqual(('A custom post in category 5', 'custom1'), cust_data[1]) - self.assertEqual(('A 2nd custom post type also in category 5', 'custom2'), cust_data[2]) + self.assertEqual( + ('A custom post in category 4', 'custom1'), + cust_data[0]) + self.assertEqual( + ('A custom post in category 5', 'custom1'), + cust_data[1]) + self.assertEqual( + ('A 2nd custom post type also in category 5', 'custom2'), + cust_data[2]) def test_custom_posts_put_in_own_dir(self): silent_f2p = mute(True)(fields2pelican) @@ -122,7 +136,8 @@ class TestWordpressXmlImporter(unittest.TestCase): else: test_posts.append(post) with temporary_folder() as temp: - fnames = list(silent_f2p(test_posts, 'markdown', temp, wp_custpost = True)) + fnames = list(silent_f2p(test_posts, 'markdown', + temp, wp_custpost=True)) index = 0 for post in test_posts: name = post[2] @@ -144,7 +159,7 @@ class TestWordpressXmlImporter(unittest.TestCase): test_posts.append(post) with temporary_folder() as temp: fnames = list(silent_f2p(test_posts, 'markdown', temp, - wp_custpost=True, dircat=True)) + wp_custpost=True, dircat=True)) index = 0 for post in test_posts: name = post[2] @@ -157,7 +172,7 @@ class TestWordpressXmlImporter(unittest.TestCase): index += 1 def test_wp_custpost_true_dirpage_false(self): - #pages should only be put in their own directory when dirpage = True + # pages should only be put in their own directory when dirpage = True silent_f2p = mute(True)(fields2pelican) test_posts = [] for post in self.custposts: @@ -166,7 +181,7 @@ class TestWordpressXmlImporter(unittest.TestCase): test_posts.append(post) with temporary_folder() as temp: fnames = list(silent_f2p(test_posts, 'markdown', temp, - wp_custpost=True, dirpage=False)) + wp_custpost=True, dirpage=False)) index = 0 for post in test_posts: name = post[2] @@ -175,7 +190,6 @@ class TestWordpressXmlImporter(unittest.TestCase): out_name = fnames[index] self.assertFalse(out_name.endswith(filename)) - def test_can_toggle_raw_html_code_parsing(self): def r(f): with open(f, encoding='utf-8') as infile: @@ -184,10 +198,12 @@ class TestWordpressXmlImporter(unittest.TestCase): with temporary_folder() as temp: - rst_files = (r(f) for f in silent_f2p(self.posts, 'markdown', temp)) + rst_files = (r(f) for f + in silent_f2p(self.posts, 'markdown', temp)) self.assertTrue(any(' entities in the" - " title. You can't miss them.") + self.assertTrue(title, "A normal post with some entities in " + "the title. You can't miss them.") self.assertNotIn('&', title) def test_decode_wp_content_returns_empty(self): @@ -216,14 +233,18 @@ class TestWordpressXmlImporter(unittest.TestCase): encoded_content = encoded_file.read() with open(WORDPRESS_DECODED_CONTENT_SAMPLE, 'r') as decoded_file: decoded_content = decoded_file.read() - self.assertEqual(decode_wp_content(encoded_content, br=False), decoded_content) + self.assertEqual( + decode_wp_content(encoded_content, br=False), + decoded_content) def test_preserve_verbatim_formatting(self): def r(f): with open(f, encoding='utf-8') as infile: return infile.read() silent_f2p = mute(True)(fields2pelican) - test_post = filter(lambda p: p[0].startswith("Code in List"), self.posts) + test_post = filter( + lambda p: p[0].startswith("Code in List"), + self.posts) with temporary_folder() as temp: md = [r(f) for f in silent_f2p(test_post, 'markdown', temp)][0] self.assertTrue(re.search(r'\s+a = \[1, 2, 3\]', md)) @@ -231,14 +252,17 @@ class TestWordpressXmlImporter(unittest.TestCase): for_line = re.search(r'\s+for i in zip\(a, b\):', md).group(0) print_line = re.search(r'\s+print i', md).group(0) - self.assertTrue(for_line.rindex('for') < print_line.rindex('print')) + self.assertTrue( + for_line.rindex('for') < print_line.rindex('print')) def test_code_in_list(self): def r(f): with open(f, encoding='utf-8') as infile: return infile.read() silent_f2p = mute(True)(fields2pelican) - test_post = filter(lambda p: p[0].startswith("Code in List"), self.posts) + test_post = filter( + lambda p: p[0].startswith("Code in List"), + self.posts) with temporary_folder() as temp: md = [r(f) for f in silent_f2p(test_post, 'markdown', temp)][0] sample_line = re.search(r'- This is a code sample', md).group(0) @@ -285,26 +309,29 @@ class TestBuildHeader(unittest.TestCase): self.assertEqual(build_header(*header_data), expected_docutils) self.assertEqual(build_markdown_header(*header_data), expected_md) - def test_build_header_with_east_asian_characters(self): header = build_header('これは広い幅の文字だけで構成されたタイトルです', - None, None, None, None, None) + None, None, None, None, None) self.assertEqual(header, - 'これは広い幅の文字だけで構成されたタイトルです\n' + - '##############################################\n\n') + ('これは広い幅の文字だけで構成されたタイトルです\n' + '##############################################' + '\n\n')) def test_galleries_added_to_header(self): - header = build_header('test', None, None, None, None, - None, attachments=['output/test1', 'output/test2']) - self.assertEqual(header, 'test\n####\n' + ':attachments: output/test1, ' - + 'output/test2\n\n') + header = build_header('test', None, None, None, None, None, + attachments=['output/test1', 'output/test2']) + self.assertEqual(header, ('test\n####\n' + ':attachments: output/test1, ' + 'output/test2\n\n')) def test_galleries_added_to_markdown_header(self): header = build_markdown_header('test', None, None, None, None, None, - attachments=['output/test1', 'output/test2']) - self.assertEqual(header, 'Title: test\n' + 'Attachments: output/test1, ' - + 'output/test2\n\n') + attachments=['output/test1', + 'output/test2']) + self.assertEqual( + header, + 'Title: test\nAttachments: output/test1, output/test2\n\n') @unittest.skipUnless(BeautifulSoup, 'Needs BeautifulSoup module') @@ -326,14 +353,24 @@ class TestWordpressXMLAttachements(unittest.TestCase): self.assertTrue(self.attachments) for post in self.attachments.keys(): if post is None: - self.assertTrue(self.attachments[post][0] == 'https://upload.wikimedia.org/wikipedia/commons/thumb/2/2c/Pelican_lakes_entrance02.jpg/240px-Pelican_lakes_entrance02.jpg') + expected = ('https://upload.wikimedia.org/wikipedia/commons/' + 'thumb/2/2c/Pelican_lakes_entrance02.jpg/' + '240px-Pelican_lakes_entrance02.jpg') + self.assertEqual(self.attachments[post][0], expected) elif post == 'with-excerpt': - self.assertTrue(self.attachments[post][0] == 'http://thisurlisinvalid.notarealdomain/not_an_image.jpg') - self.assertTrue(self.attachments[post][1] == 'http://en.wikipedia.org/wiki/File:Pelikan_Walvis_Bay.jpg') + expected_invalid = ('http://thisurlisinvalid.notarealdomain/' + 'not_an_image.jpg') + expected_pelikan = ('http://en.wikipedia.org/wiki/' + 'File:Pelikan_Walvis_Bay.jpg') + self.assertEqual(self.attachments[post][0], expected_invalid) + self.assertEqual(self.attachments[post][1], expected_pelikan) elif post == 'with-tags': - self.assertTrue(self.attachments[post][0] == 'http://thisurlisinvalid.notarealdomain') + expected_invalid = ('http://thisurlisinvalid.notarealdomain') + self.assertEqual(self.attachments[post][0], expected_invalid) else: - self.fail('all attachments should match to a filename or None, {}'.format(post)) + self.fail('all attachments should match to a ' + 'filename or None, {}' + .format(post)) def test_download_attachments(self): real_file = os.path.join(CUR_DIR, 'content/article.rst') @@ -344,4 +381,6 @@ class TestWordpressXMLAttachements(unittest.TestCase): locations = list(silent_da(temp, [good_url, bad_url])) self.assertEqual(1, len(locations)) directory = locations[0] - self.assertTrue(directory.endswith(os.path.join('content', 'article.rst')), directory) + self.assertTrue( + directory.endswith(os.path.join('content', 'article.rst')), + directory) diff --git a/pelican/tests/test_paginator.py b/pelican/tests/test_paginator.py index 002d9e07..903a0305 100644 --- a/pelican/tests/test_paginator.py +++ b/pelican/tests/test_paginator.py @@ -1,18 +1,21 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, absolute_import +from __future__ import absolute_import, unicode_literals + import locale -from pelican.tests.support import unittest, get_settings - -from pelican.paginator import Paginator -from pelican.contents import Article, Author -from pelican.settings import DEFAULT_CONFIG from jinja2.utils import generate_lorem_ipsum +from pelican.contents import Article, Author +from pelican.paginator import Paginator +from pelican.settings import DEFAULT_CONFIG +from pelican.tests.support import get_settings, unittest + + # generate one paragraph, enclosed with

    TEST_CONTENT = str(generate_lorem_ipsum(n=1)) TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False) + class TestPage(unittest.TestCase): def setUp(self): super(TestPage, self).setUp() @@ -49,7 +52,8 @@ class TestPage(unittest.TestCase): ) self.page_kwargs['metadata']['author'] = Author('Blogger', settings) - object_list = [Article(**self.page_kwargs), Article(**self.page_kwargs)] + object_list = [Article(**self.page_kwargs), + Article(**self.page_kwargs)] paginator = Paginator('foobar.foo', object_list, settings) page = paginator.page(1) self.assertEqual(page.save_as, 'foobar.foo') diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index c6332487..b88ad287 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -1,23 +1,25 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals import collections -import os -import sys -from tempfile import mkdtemp -from shutil import rmtree import locale import logging +import os import subprocess +import sys + +from shutil import rmtree +from tempfile import mkdtemp from pelican import Pelican from pelican.generators import StaticGenerator from pelican.settings import read_settings -from pelican.tests.support import LoggedTestCase, mute, locale_available, unittest +from pelican.tests.support import (LoggedTestCase, locale_available, + mute, unittest) CURRENT_DIR = os.path.dirname(os.path.abspath(__file__)) SAMPLES_PATH = os.path.abspath(os.path.join( - CURRENT_DIR, os.pardir, os.pardir, 'samples')) + CURRENT_DIR, os.pardir, os.pardir, 'samples')) OUTPUT_PATH = os.path.abspath(os.path.join(CURRENT_DIR, 'output')) INPUT_PATH = os.path.join(SAMPLES_PATH, "content") @@ -27,13 +29,10 @@ SAMPLE_FR_CONFIG = os.path.join(SAMPLES_PATH, "pelican.conf_FR.py") def recursiveDiff(dcmp): diff = { - 'diff_files': [os.path.join(dcmp.right, f) - for f in dcmp.diff_files], - 'left_only': [os.path.join(dcmp.right, f) - for f in dcmp.left_only], - 'right_only': [os.path.join(dcmp.right, f) - for f in dcmp.right_only], - } + 'diff_files': [os.path.join(dcmp.right, f) for f in dcmp.diff_files], + 'left_only': [os.path.join(dcmp.right, f) for f in dcmp.left_only], + 'right_only': [os.path.join(dcmp.right, f) for f in dcmp.right_only], + } for sub_dcmp in dcmp.subdirs.values(): for k, v in recursiveDiff(sub_dcmp).items(): diff[k] += v @@ -60,9 +59,13 @@ class TestPelican(LoggedTestCase): def assertDirsEqual(self, left_path, right_path): out, err = subprocess.Popen( - ['git', 'diff', '--no-ext-diff', '--exit-code', '-w', left_path, right_path], - env={str('PAGER'): str('')}, stdout=subprocess.PIPE, stderr=subprocess.PIPE + ['git', 'diff', '--no-ext-diff', '--exit-code', + '-w', left_path, right_path], + env={str('PAGER'): str('')}, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE ).communicate() + def ignorable_git_crlf_errors(line): # Work around for running tests on Windows for msg in [ @@ -85,9 +88,11 @@ class TestPelican(LoggedTestCase): pelican = Pelican(settings=read_settings(path=None)) generator_classes = pelican.get_generator_classes() - self.assertTrue(generator_classes[-1] is StaticGenerator, + self.assertTrue( + generator_classes[-1] is StaticGenerator, "StaticGenerator must be the last generator, but it isn't!") - self.assertIsInstance(generator_classes, collections.Sequence, + self.assertIsInstance( + generator_classes, collections.Sequence, "get_generator_classes() must return a Sequence to preserve order") def test_basic_generation_works(self): @@ -98,10 +103,11 @@ class TestPelican(LoggedTestCase): 'OUTPUT_PATH': self.temp_path, 'CACHE_PATH': self.temp_cache, 'LOCALE': locale.normalize('en_US'), - }) + }) pelican = Pelican(settings=settings) mute(True)(pelican.run)() - self.assertDirsEqual(self.temp_path, os.path.join(OUTPUT_PATH, 'basic')) + self.assertDirsEqual( + self.temp_path, os.path.join(OUTPUT_PATH, 'basic')) self.assertLogCountEqual( count=3, msg="Unable to find.*skipping url replacement", @@ -114,10 +120,11 @@ class TestPelican(LoggedTestCase): 'OUTPUT_PATH': self.temp_path, 'CACHE_PATH': self.temp_cache, 'LOCALE': locale.normalize('en_US'), - }) + }) pelican = Pelican(settings=settings) mute(True)(pelican.run)() - self.assertDirsEqual(self.temp_path, os.path.join(OUTPUT_PATH, 'custom')) + self.assertDirsEqual( + self.temp_path, os.path.join(OUTPUT_PATH, 'custom')) @unittest.skipUnless(locale_available('fr_FR.UTF-8') or locale_available('French'), 'French locale needed') @@ -133,10 +140,11 @@ class TestPelican(LoggedTestCase): 'OUTPUT_PATH': self.temp_path, 'CACHE_PATH': self.temp_cache, 'LOCALE': our_locale, - }) + }) pelican = Pelican(settings=settings) mute(True)(pelican.run)() - self.assertDirsEqual(self.temp_path, os.path.join(OUTPUT_PATH, 'custom_locale')) + self.assertDirsEqual( + self.temp_path, os.path.join(OUTPUT_PATH, 'custom_locale')) def test_theme_static_paths_copy(self): # the same thing with a specified set of settings should work @@ -146,8 +154,9 @@ class TestPelican(LoggedTestCase): 'CACHE_PATH': self.temp_cache, 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, 'very'), os.path.join(SAMPLES_PATH, 'kinda'), - os.path.join(SAMPLES_PATH, 'theme_standard')] - }) + os.path.join(SAMPLES_PATH, + 'theme_standard')] + }) pelican = Pelican(settings=settings) mute(True)(pelican.run)() theme_output = os.path.join(self.temp_path, 'theme') @@ -165,8 +174,9 @@ class TestPelican(LoggedTestCase): 'PATH': INPUT_PATH, 'OUTPUT_PATH': self.temp_path, 'CACHE_PATH': self.temp_cache, - 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, 'theme_standard')] - }) + 'THEME_STATIC_PATHS': [os.path.join(SAMPLES_PATH, + 'theme_standard')] + }) pelican = Pelican(settings=settings) mute(True)(pelican.run)() @@ -184,9 +194,9 @@ class TestPelican(LoggedTestCase): 'WRITE_SELECTED': [ os.path.join(self.temp_path, 'oh-yeah.html'), os.path.join(self.temp_path, 'categories.html'), - ], + ], 'LOCALE': locale.normalize('en_US'), - }) + }) pelican = Pelican(settings=settings) logger = logging.getLogger() orig_level = logger.getEffectiveLevel() diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index dd7e5fc2..71394ee4 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals import os from pelican import readers +from pelican.tests.support import get_settings, unittest from pelican.utils import SafeDatetime -from pelican.tests.support import unittest, get_settings + CUR_DIR = os.path.dirname(__file__) CONTENT_PATH = os.path.join(CUR_DIR, 'content') @@ -29,22 +30,26 @@ class ReaderTest(unittest.TestCase): self.assertEqual( value, real_value, - 'Expected %s to have value %s, but was %s' % (key, value, real_value)) + 'Expected %s to have value %s, but was %s' % + (key, value, real_value)) else: self.fail( - 'Expected %s to have value %s, but was not in Dict' % (key, value)) + 'Expected %s to have value %s, but was not in Dict' % + (key, value)) + class TestAssertDictHasSubset(ReaderTest): def setUp(self): self.dictionary = { - 'key-a' : 'val-a', - 'key-b' : 'val-b'} + 'key-a': 'val-a', + 'key-b': 'val-b' + } def tearDown(self): self.dictionary = None def test_subset(self): - self.assertDictHasSubset(self.dictionary, {'key-a':'val-a'}) + self.assertDictHasSubset(self.dictionary, {'key-a': 'val-a'}) def test_equal(self): self.assertDictHasSubset(self.dictionary, self.dictionary) @@ -54,18 +59,17 @@ class TestAssertDictHasSubset(ReaderTest): AssertionError, 'Expected.*key-c.*to have value.*val-c.*but was not in Dict', self.assertDictHasSubset, - self.dictionary, - {'key-c':'val-c'} - ) + self.dictionary, + {'key-c': 'val-c'}) def test_fail_wrong_val(self): self.assertRaisesRegexp( AssertionError, 'Expected .*key-a.* to have value .*val-b.* but was .*val-a.*', self.assertDictHasSubset, - self.dictionary, - {'key-a':'val-b'} - ) + self.dictionary, + {'key-a': 'val-b'}) + class DefaultReaderTest(ReaderTest): @@ -153,17 +157,17 @@ class RstReaderTest(ReaderTest): '(?P\d{4}-\d{2}-\d{2})' '_(?P.*)' '#(?P.*)-(?P.*)' - ), + ), EXTRA_PATH_METADATA={ input_with_metadata: { 'key-1a': 'value-1a', 'key-1b': 'value-1b' - } } - ) + } + ) expected_metadata = { 'category': 'yeah', - 'author' : 'Alexis Métaireau', + 'author': 'Alexis Métaireau', 'title': 'Rst with filename metadata', 'date': SafeDatetime(2012, 11, 29), 'slug': 'rst_w_filename_meta', @@ -179,38 +183,41 @@ class RstReaderTest(ReaderTest): path=input_file_path_without_metadata, EXTRA_PATH_METADATA={ input_file_path_without_metadata: { - 'author': 'Charlès Overwrite'} + 'author': 'Charlès Overwrite' } - ) + } + ) expected_without_metadata = { - 'category' : 'misc', - 'author' : 'Charlès Overwrite', - 'title' : 'Article title', - 'reader' : 'rst', + 'category': 'misc', + 'author': 'Charlès Overwrite', + 'title': 'Article title', + 'reader': 'rst', } self.assertDictHasSubset( page_without_metadata.metadata, expected_without_metadata) def test_article_extra_path_metadata_dont_overwrite(self): - #EXTRA_PATH_METADATA['author'] should get ignored - #since we don't overwrite already set values + # EXTRA_PATH_METADATA['author'] should get ignored + # since we don't overwrite already set values input_file_path = '2012-11-29_rst_w_filename_meta#foo-bar.rst' page = self.read_file( path=input_file_path, FILENAME_METADATA=( '(?P\d{4}-\d{2}-\d{2})' '_(?P.*)' - '#(?P.*)-(?P.*)'), + '#(?P.*)-(?P.*)' + ), EXTRA_PATH_METADATA={ input_file_path: { 'author': 'Charlès Overwrite', - 'key-1b': 'value-1b'} + 'key-1b': 'value-1b' } - ) + } + ) expected = { 'category': 'yeah', - 'author' : 'Alexis Métaireau', + 'author': 'Alexis Métaireau', 'title': 'Rst with filename metadata', 'date': SafeDatetime(2012, 11, 29), 'slug': 'rst_w_filename_meta', @@ -273,7 +280,7 @@ class RstReaderTest(ReaderTest): # typogrify should be able to ignore user specified tags, # but tries to be clever with widont extension page = self.read_file(path='article.rst', TYPOGRIFY=True, - TYPOGRIFY_IGNORE_TAGS = ['p']) + TYPOGRIFY_IGNORE_TAGS=['p']) expected = ('

    THIS is some content. With some stuff to ' '"typogrify"...

    \n

    Now with added ' 'support for ' @@ -284,7 +291,7 @@ class RstReaderTest(ReaderTest): # typogrify should ignore code blocks by default because # code blocks are composed inside the pre tag page = self.read_file(path='article_with_code_block.rst', - TYPOGRIFY=True) + TYPOGRIFY=True) expected = ('

    An article with some code

    \n' '
    x'
    @@ -292,13 +299,17 @@ class RstReaderTest(ReaderTest):
                             ' y\n
    \n' '

    A block quote:

    \n
    \nx ' '& y
    \n' - '

    Normal:\nx & y

    \n') + '

    Normal:\nx' + ' &' + ' y' + '

    \n') self.assertEqual(page.content, expected) # instruct typogrify to also ignore blockquotes page = self.read_file(path='article_with_code_block.rst', - TYPOGRIFY=True, TYPOGRIFY_IGNORE_TAGS = ['blockquote']) + TYPOGRIFY=True, + TYPOGRIFY_IGNORE_TAGS=['blockquote']) expected = ('

    An article with some code

    \n' '
    x'
    @@ -306,7 +317,10 @@ class RstReaderTest(ReaderTest):
                             ' y\n
    \n' '

    A block quote:

    \n
    \nx ' '& y
    \n' - '

    Normal:\nx & y

    \n') + '

    Normal:\nx' + ' &' + ' y' + '

    \n') self.assertEqual(page.content, expected) except ImportError: @@ -339,6 +353,7 @@ class RstReaderTest(ReaderTest): self.assertDictHasSubset(page.metadata, expected) + @unittest.skipUnless(readers.Markdown, "markdown isn't installed") class MdReaderTest(ReaderTest): @@ -400,7 +415,8 @@ class MdReaderTest(ReaderTest): 'modified': SafeDatetime(2012, 11, 1), 'multiline': [ 'Line Metadata should be handle properly.', - 'See syntax of Meta-Data extension of Python Markdown package:', + 'See syntax of Meta-Data extension of ' + 'Python Markdown package:', 'If a line is indented by 4 or more spaces,', 'that line is assumed to be an additional line of the value', 'for the previous keyword.', diff --git a/pelican/tests/test_rstdirectives.py b/pelican/tests/test_rstdirectives.py index 7c5f8adf..f6a7221f 100644 --- a/pelican/tests/test_rstdirectives.py +++ b/pelican/tests/test_rstdirectives.py @@ -1,5 +1,8 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals + +from pelican.tests.support import unittest + try: from unittest.mock import Mock except ImportError: @@ -7,7 +10,7 @@ except ImportError: from mock import Mock except ImportError: Mock = False -from pelican.tests.support import unittest + @unittest.skipUnless(Mock, 'Needs Mock module') class Test_abbr_role(unittest.TestCase): diff --git a/pelican/tests/test_settings.py b/pelican/tests/test_settings.py index 5653d07a..7b1e36df 100644 --- a/pelican/tests/test_settings.py +++ b/pelican/tests/test_settings.py @@ -1,13 +1,15 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function -import copy -import os -import locale -from sys import platform -from os.path import dirname, abspath, join +from __future__ import print_function, unicode_literals -from pelican.settings import (read_settings, configure_settings, - DEFAULT_CONFIG, DEFAULT_THEME) +import copy +import locale +import os +from os.path import abspath, dirname, join +from sys import platform + + +from pelican.settings import (DEFAULT_CONFIG, DEFAULT_THEME, + configure_settings, read_settings) from pelican.tests.support import unittest @@ -28,12 +30,14 @@ class TestSettingsConfiguration(unittest.TestCase): def test_overwrite_existing_settings(self): self.assertEqual(self.settings.get('SITENAME'), "Alexis' log") - self.assertEqual(self.settings.get('SITEURL'), - 'http://blog.notmyidea.org') + self.assertEqual( + self.settings.get('SITEURL'), + 'http://blog.notmyidea.org') def test_keep_default_settings(self): # Keep default settings if not defined. - self.assertEqual(self.settings.get('DEFAULT_CATEGORY'), + self.assertEqual( + self.settings.get('DEFAULT_CATEGORY'), DEFAULT_CONFIG['DEFAULT_CATEGORY']) def test_dont_copy_small_keys(self): @@ -69,28 +73,31 @@ class TestSettingsConfiguration(unittest.TestCase): def test_static_path_settings_safety(self): # Disallow static paths from being strings - settings = {'STATIC_PATHS': 'foo/bar', - 'THEME_STATIC_PATHS': 'bar/baz', - # These 4 settings are required to run configure_settings - 'PATH': '.', - 'THEME': DEFAULT_THEME, - 'SITEURL': 'http://blog.notmyidea.org/', - 'LOCALE': '', - } + settings = { + 'STATIC_PATHS': 'foo/bar', + 'THEME_STATIC_PATHS': 'bar/baz', + # These 4 settings are required to run configure_settings + 'PATH': '.', + 'THEME': DEFAULT_THEME, + 'SITEURL': 'http://blog.notmyidea.org/', + 'LOCALE': '', + } configure_settings(settings) - self.assertEqual(settings['STATIC_PATHS'], - DEFAULT_CONFIG['STATIC_PATHS']) - self.assertEqual(settings['THEME_STATIC_PATHS'], - DEFAULT_CONFIG['THEME_STATIC_PATHS']) + self.assertEqual( + settings['STATIC_PATHS'], + DEFAULT_CONFIG['STATIC_PATHS']) + self.assertEqual( + settings['THEME_STATIC_PATHS'], + DEFAULT_CONFIG['THEME_STATIC_PATHS']) def test_configure_settings(self): # Manipulations to settings should be applied correctly. settings = { - 'SITEURL': 'http://blog.notmyidea.org/', - 'LOCALE': '', - 'PATH': os.curdir, - 'THEME': DEFAULT_THEME, - } + 'SITEURL': 'http://blog.notmyidea.org/', + 'LOCALE': '', + 'PATH': os.curdir, + 'THEME': DEFAULT_THEME, + } configure_settings(settings) # SITEURL should not have a trailing slash @@ -154,7 +161,7 @@ class TestSettingsConfiguration(unittest.TestCase): settings['PATH'] = '' self.assertRaises(Exception, configure_settings, settings) - # Test nonexistent THEME + # Test nonexistent THEME settings['PATH'] = os.curdir settings['THEME'] = 'foo' diff --git a/pelican/tests/test_urlwrappers.py b/pelican/tests/test_urlwrappers.py index 20a87114..ae6eaaec 100644 --- a/pelican/tests/test_urlwrappers.py +++ b/pelican/tests/test_urlwrappers.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from __future__ import unicode_literals -from pelican.urlwrappers import URLWrapper, Tag, Category from pelican.tests.support import unittest +from pelican.urlwrappers import Category, Tag, URLWrapper + class TestURLWrapper(unittest.TestCase): def test_ordering(self): diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 0f8878af..d6fdf70e 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -1,20 +1,22 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function, absolute_import -import logging -import shutil -import os -import time +from __future__ import absolute_import, print_function, unicode_literals + import locale +import logging +import os +import shutil +import time from sys import platform from tempfile import mkdtemp import pytz -from pelican.generators import TemplatePagesGenerator -from pelican.writers import Writer -from pelican.settings import read_settings from pelican import utils -from pelican.tests.support import get_article, LoggedTestCase, locale_available, unittest +from pelican.generators import TemplatePagesGenerator +from pelican.settings import read_settings +from pelican.tests.support import (LoggedTestCase, get_article, + locale_available, unittest) +from pelican.writers import Writer class TestUtils(LoggedTestCase): @@ -72,7 +74,7 @@ class TestUtils(LoggedTestCase): '2012-11-22T22:11:10Z': date_hour_sec_z, '2012-11-22T22:11:10-0500': date_hour_sec_est, '2012-11-22T22:11:10.123Z': date_hour_sec_frac_z, - } + } # examples from http://www.w3.org/TR/NOTE-datetime iso_8601_date = utils.SafeDatetime(year=1997, month=7, day=16) @@ -95,7 +97,6 @@ class TestUtils(LoggedTestCase): # invalid ones invalid_dates = ['2010-110-12', 'yay'] - for value, expected in dates.items(): self.assertEqual(utils.get_date(value), expected, value) @@ -290,7 +291,9 @@ class TestUtils(LoggedTestCase): self.assertEqual(utils.strftime(d, '%d/%m/%Y'), '29/08/2012') # RFC 3339 - self.assertEqual(utils.strftime(d, '%Y-%m-%dT%H:%M:%SZ'),'2012-08-29T00:00:00Z') + self.assertEqual( + utils.strftime(d, '%Y-%m-%dT%H:%M:%SZ'), + '2012-08-29T00:00:00Z') # % escaped self.assertEqual(utils.strftime(d, '%d%%%m%%%y'), '29%08%12') @@ -306,8 +309,9 @@ class TestUtils(LoggedTestCase): 'Published in 29-08-2012') # with non-ascii text - self.assertEqual(utils.strftime(d, '%d/%m/%Y Øl trinken beim Besäufnis'), - '29/08/2012 Øl trinken beim Besäufnis') + self.assertEqual( + utils.strftime(d, '%d/%m/%Y Øl trinken beim Besäufnis'), + '29/08/2012 Øl trinken beim Besäufnis') # alternative formatting options self.assertEqual(utils.strftime(d, '%-d/%-m/%y'), '29/8/12') @@ -316,7 +320,6 @@ class TestUtils(LoggedTestCase): d = utils.SafeDatetime(2012, 8, 9) self.assertEqual(utils.strftime(d, '%-d/%-m/%y'), '9/8/12') - # test the output of utils.strftime in a different locale # Turkish locale @unittest.skipUnless(locale_available('tr_TR.UTF-8') or @@ -339,17 +342,18 @@ class TestUtils(LoggedTestCase): 'Çarşamba, 29 Ağustos 2012') # with text - self.assertEqual(utils.strftime(d, 'Yayınlanma tarihi: %A, %d %B %Y'), + self.assertEqual( + utils.strftime(d, 'Yayınlanma tarihi: %A, %d %B %Y'), 'Yayınlanma tarihi: Çarşamba, 29 Ağustos 2012') # non-ascii format candidate (someone might pass it... for some reason) - self.assertEqual(utils.strftime(d, '%Y yılında %üretim artışı'), + self.assertEqual( + utils.strftime(d, '%Y yılında %üretim artışı'), '2012 yılında %üretim artışı') # restore locale back locale.setlocale(locale.LC_ALL, old_locale) - # test the output of utils.strftime in a different locale # French locale @unittest.skipUnless(locale_available('fr_FR.UTF-8') or @@ -373,21 +377,28 @@ class TestUtils(LoggedTestCase): self.assertTrue(utils.strftime(d, '%A') in ('mercredi', 'Mercredi')) # with text - self.assertEqual(utils.strftime(d, 'Écrit le %d %B %Y'), + self.assertEqual( + utils.strftime(d, 'Écrit le %d %B %Y'), 'Écrit le 29 août 2012') # non-ascii format candidate (someone might pass it... for some reason) - self.assertEqual(utils.strftime(d, '%écrits en %Y'), + self.assertEqual( + utils.strftime(d, '%écrits en %Y'), '%écrits en 2012') # restore locale back locale.setlocale(locale.LC_ALL, old_locale) - def test_maybe_pluralize(self): - self.assertEqual(utils.maybe_pluralize(0, 'Article', 'Articles'), '0 Articles') - self.assertEqual(utils.maybe_pluralize(1, 'Article', 'Articles'), '1 Article') - self.assertEqual(utils.maybe_pluralize(2, 'Article', 'Articles'), '2 Articles') + self.assertEqual( + utils.maybe_pluralize(0, 'Article', 'Articles'), + '0 Articles') + self.assertEqual( + utils.maybe_pluralize(1, 'Article', 'Articles'), + '1 Article') + self.assertEqual( + utils.maybe_pluralize(2, 'Article', 'Articles'), + '2 Articles') class TestCopy(unittest.TestCase): @@ -435,8 +446,9 @@ class TestCopy(unittest.TestCase): def test_copy_file_create_dirs(self): self._create_file('a.txt') - utils.copy(os.path.join(self.root_dir, 'a.txt'), - os.path.join(self.root_dir, 'b0', 'b1', 'b2', 'b3', 'b.txt')) + utils.copy( + os.path.join(self.root_dir, 'a.txt'), + os.path.join(self.root_dir, 'b0', 'b1', 'b2', 'b3', 'b.txt')) self._exist_dir('b0') self._exist_dir('b0', 'b1') self._exist_dir('b0', 'b1', 'b2') @@ -491,35 +503,39 @@ class TestDateFormatter(unittest.TestCase): template_file.write('date = {{ date|strftime("%A, %d %B %Y") }}') self.date = utils.SafeDatetime(2012, 8, 29) - def tearDown(self): shutil.rmtree(self.temp_content) shutil.rmtree(self.temp_output) # reset locale to default locale.setlocale(locale.LC_ALL, '') - @unittest.skipUnless(locale_available('fr_FR.UTF-8') or locale_available('French'), 'French locale needed') def test_french_strftime(self): - # This test tries to reproduce an issue that occurred with python3.3 under macos10 only + # This test tries to reproduce an issue that + # occurred with python3.3 under macos10 only if platform == 'win32': locale.setlocale(locale.LC_ALL, str('French')) else: locale.setlocale(locale.LC_ALL, str('fr_FR.UTF-8')) - date = utils.SafeDatetime(2014,8,14) - # we compare the lower() dates since macos10 returns "Jeudi" for %A whereas linux reports "jeudi" - self.assertEqual( u'jeudi, 14 août 2014', utils.strftime(date, date_format="%A, %d %B %Y").lower() ) + date = utils.SafeDatetime(2014, 8, 14) + # we compare the lower() dates since macos10 returns + # "Jeudi" for %A whereas linux reports "jeudi" + self.assertEqual( + u'jeudi, 14 août 2014', + utils.strftime(date, date_format="%A, %d %B %Y").lower()) df = utils.DateFormatter() - self.assertEqual( u'jeudi, 14 août 2014', df(date, date_format="%A, %d %B %Y").lower() ) + self.assertEqual( + u'jeudi, 14 août 2014', + df(date, date_format="%A, %d %B %Y").lower()) # Let us now set the global locale to C: locale.setlocale(locale.LC_ALL, str('C')) - # DateFormatter should still work as expected since it is the whole point of DateFormatter + # DateFormatter should still work as expected + # since it is the whole point of DateFormatter # (This is where pre-2014/4/15 code fails on macos10) df_date = df(date, date_format="%A, %d %B %Y").lower() - self.assertEqual( u'jeudi, 14 août 2014', df_date ) - + self.assertEqual(u'jeudi, 14 août 2014', df_date) @unittest.skipUnless(locale_available('fr_FR.UTF-8') or locale_available('French'), @@ -530,9 +546,12 @@ class TestDateFormatter(unittest.TestCase): else: locale_string = 'fr_FR.UTF-8' settings = read_settings( - override = {'LOCALE': locale_string, - 'TEMPLATE_PAGES': {'template/source.html': - 'generated/file.html'}}) + override={ + 'LOCALE': locale_string, + 'TEMPLATE_PAGES': { + 'template/source.html': 'generated/file.html' + } + }) generator = TemplatePagesGenerator( {'date': self.date}, settings, @@ -543,7 +562,7 @@ class TestDateFormatter(unittest.TestCase): generator.generate_output(writer) output_path = os.path.join( - self.temp_output, 'generated', 'file.html') + self.temp_output, 'generated', 'file.html') # output file has been generated self.assertTrue(os.path.exists(output_path)) @@ -553,7 +572,6 @@ class TestDateFormatter(unittest.TestCase): self.assertEqual(output_file, utils.strftime(self.date, 'date = %A, %d %B %Y')) - @unittest.skipUnless(locale_available('tr_TR.UTF-8') or locale_available('Turkish'), 'Turkish locale needed') @@ -563,9 +581,12 @@ class TestDateFormatter(unittest.TestCase): else: locale_string = 'tr_TR.UTF-8' settings = read_settings( - override = {'LOCALE': locale_string, - 'TEMPLATE_PAGES': {'template/source.html': - 'generated/file.html'}}) + override={ + 'LOCALE': locale_string, + 'TEMPLATE_PAGES': { + 'template/source.html': 'generated/file.html' + } + }) generator = TemplatePagesGenerator( {'date': self.date}, settings, @@ -576,7 +597,7 @@ class TestDateFormatter(unittest.TestCase): generator.generate_output(writer) output_path = os.path.join( - self.temp_output, 'generated', 'file.html') + self.temp_output, 'generated', 'file.html') # output file has been generated self.assertTrue(os.path.exists(output_path)) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 92e8c919..f8abbd7a 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -1,29 +1,30 @@ #!/usr/bin/env python - # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function +from __future__ import print_function, unicode_literals + import argparse -try: - from html import unescape # py3.4+ -except ImportError: - from six.moves.html_parser import HTMLParser - unescape = HTMLParser().unescape +import logging import os import re import subprocess import sys import time -import logging from codecs import open + from six.moves.urllib.error import URLError from six.moves.urllib.parse import urlparse from six.moves.urllib.request import urlretrieve -# pelican.log has to be the first pelican module to be loaded # because logging.setLoggerClass has to be called before logging.getLogger from pelican.log import init -from pelican.utils import slugify, SafeDatetime +from pelican.utils import SafeDatetime, slugify + +try: + from html import unescape # py3.4+ +except ImportError: + from six.moves.html_parser import HTMLParser + unescape = HTMLParser().unescape logger = logging.getLogger(__name__) @@ -70,12 +71,19 @@ def decode_wp_content(content, br=True): content = "" for p in pgraphs: content = content + "

    " + p.strip() + "

    \n" - # under certain strange conditions it could create a P of entirely whitespace + # under certain strange conditions it could create + # a P of entirely whitespace content = re.sub(r'

    \s*

    ', '', content) - content = re.sub(r'

    ([^<]+)', "

    \\1

    ", content) + content = re.sub( + r'

    ([^<]+)', + "

    \\1

    ", + content) # don't wrap tags - content = re.sub(r'

    \s*(]*>)\s*

    ', "\\1", content) - #problem with nested lists + content = re.sub( + r'

    \s*(]*>)\s*

    ', + "\\1", + content) + # problem with nested lists content = re.sub(r'

    (', "\\1", content) content = re.sub(r'

    ]*)>', "

    ", content) content = content.replace('

    ', '

    ') @@ -84,12 +92,20 @@ def decode_wp_content(content, br=True): if br: def _preserve_newline(match): return match.group(0).replace("\n", "") - content = re.sub(r'/<(script|style).*?<\/\\1>/s', _preserve_newline, content) + content = re.sub( + r'/<(script|style).*?<\/\\1>/s', + _preserve_newline, + content) # optionally make line breaks content = re.sub(r'(?)\s*\n', "
    \n", content) content = content.replace("", "\n") - content = re.sub(r'(]*>)\s*
    ', "\\1", content) - content = re.sub(r'
    (\s*]*>)', '\\1', content) + content = re.sub( + r'(]*>)\s*
    ', "\\1", + content) + content = re.sub( + r'
    (\s*]*>)', + '\\1', + content) content = re.sub(r'\n

    ', "

    ", content) if pre_tags: @@ -100,13 +116,14 @@ def decode_wp_content(content, br=True): return content + def get_items(xml): """Opens a WordPress xml file and returns a list of items""" try: from bs4 import BeautifulSoup except ImportError: - error = ('Missing dependency ' - '"BeautifulSoup4" and "lxml" required to import WordPress XML files.') + error = ('Missing dependency "BeautifulSoup4" and "lxml" required to ' + 'import WordPress XML files.') sys.exit(error) with open(xml, encoding='utf-8') as infile: xmlfile = infile.read() @@ -114,12 +131,14 @@ def get_items(xml): items = soup.rss.channel.findAll('item') return items + def get_filename(filename, post_id): if filename is not None: return filename else: return post_id + def wp2fields(xml, wp_custpost=False): """Opens a wordpress XML file, and yield Pelican fields""" @@ -141,16 +160,18 @@ def wp2fields(xml, wp_custpost=False): content = item.find('encoded').string raw_date = item.find('post_date').string - date_object = time.strptime(raw_date, "%Y-%m-%d %H:%M:%S") - date = time.strftime("%Y-%m-%d %H:%M", date_object) + date_object = time.strptime(raw_date, '%Y-%m-%d %H:%M:%S') + date = time.strftime('%Y-%m-%d %H:%M', date_object) author = item.find('creator').string - categories = [cat.string for cat in item.findAll('category', {'domain' : 'category'})] - # caturl = [cat['nicename'] for cat in item.find(domain='category')] + categories = [cat.string for cat + in item.findAll('category', {'domain': 'category'})] - tags = [tag.string for tag in item.findAll('category', {'domain' : 'post_tag'})] + tags = [tag.string for tag + in item.findAll('category', {'domain': 'post_tag'})] # To publish a post the status should be 'published' - status = 'published' if item.find('status').string == "publish" else item.find('status').string + status = 'published' if item.find('status').string == "publish" \ + else item.find('status').string kind = 'article' post_type = item.find('post_type').string @@ -159,16 +180,17 @@ def wp2fields(xml, wp_custpost=False): elif wp_custpost: if post_type == 'post': pass - # Old behaviour was to name everything not a page as an article. - # Theoretically all attachments have status == inherit so - # no attachments should be here. But this statement is to + # Old behaviour was to name everything not a page as an + # article.Theoretically all attachments have status == inherit + # so no attachments should be here. But this statement is to # maintain existing behaviour in case that doesn't hold true. elif post_type == 'attachment': pass else: kind = post_type - yield (title, content, filename, date, author, categories, tags, status, - kind, "wp-html") + yield (title, content, filename, date, author, categories, + tags, status, kind, 'wp-html') + def dc2fields(file): """Opens a Dotclear export file, and yield pelican fields""" @@ -176,10 +198,10 @@ def dc2fields(file): from bs4 import BeautifulSoup except ImportError: error = ('Missing dependency ' - '"BeautifulSoup4" and "lxml" required to import Dotclear files.') + '"BeautifulSoup4" and "lxml" required ' + 'to import Dotclear files.') sys.exit(error) - in_cat = False in_post = False category_list = {} @@ -203,7 +225,7 @@ def dc2fields(file): # remove 1st and last "" fields[0] = fields[0][1:] # fields[-1] = fields[-1][:-1] - category_list[fields[0]]=fields[2] + category_list[fields[0]] = fields[2] elif in_post: if not line: in_post = False @@ -249,45 +271,50 @@ def dc2fields(file): # remove seconds post_creadt = ':'.join(post_creadt.split(':')[0:2]) - author = "" + author = '' categories = [] tags = [] if cat_id: - categories = [category_list[id].strip() for id in cat_id.split(',')] + categories = [category_list[id].strip() for id + in cat_id.split(',')] # Get tags related to a post - tag = post_meta.replace('{', '').replace('}', '').replace('a:1:s:3:\\"tag\\";a:', '').replace('a:0:', '') + tag = (post_meta.replace('{', '') + .replace('}', '') + .replace('a:1:s:3:\\"tag\\";a:', '') + .replace('a:0:', '')) if len(tag) > 1: if int(tag[:1]) == 1: newtag = tag.split('"')[1] tags.append( BeautifulSoup( - newtag - , "xml" + newtag, + 'xml' ) # bs4 always outputs UTF-8 .decode('utf-8') ) else: - i=1 - j=1 + i = 1 + j = 1 while(i <= int(tag[:1])): - newtag = tag.split('"')[j].replace('\\','') + newtag = tag.split('"')[j].replace('\\', '') tags.append( BeautifulSoup( - newtag - , "xml" + newtag, + 'xml' ) # bs4 always outputs UTF-8 .decode('utf-8') ) - i=i+1 - if j < int(tag[:1])*2: - j=j+2 + i = i + 1 + if j < int(tag[:1]) * 2: + j = j + 2 """ - dotclear2 does not use markdown by default unless you use the markdown plugin + dotclear2 does not use markdown by default unless + you use the markdown plugin Ref: http://plugins.dotaddict.org/dc2/details/formatting-markdown """ if post_format == "markdown": @@ -322,12 +349,13 @@ def posterous2fields(api_token, email, password): # py2 import import urllib2 as urllib_request - - def get_posterous_posts(api_token, email, password, page = 1): - base64string = base64.encodestring(("%s:%s" % (email, password)).encode('utf-8')).replace(b'\n', b'') - url = "http://posterous.com/api/v2/users/me/sites/primary/posts?api_token=%s&page=%d" % (api_token, page) + def get_posterous_posts(api_token, email, password, page=1): + base64string = base64.encodestring( + ("%s:%s" % (email, password)).encode('utf-8')).replace('\n', '') + url = ("http://posterous.com/api/v2/users/me/sites/primary/" + "posts?api_token=%s&page=%d") % (api_token, page) request = urllib_request.Request(url) - request.add_header("Authorization", "Basic %s" % base64string.decode()) + request.add_header('Authorization', 'Basic %s' % base64string.decode()) handle = urllib_request.urlopen(request) posts = json.loads(handle.read().decode('utf-8')) return posts @@ -344,16 +372,18 @@ def posterous2fields(api_token, email, password): slug = slugify(post.get('title')) tags = [tag.get('name') for tag in post.get('tags')] raw_date = post.get('display_date') - date_object = SafeDatetime.strptime(raw_date[:-6], "%Y/%m/%d %H:%M:%S") + date_object = SafeDatetime.strptime( + raw_date[:-6], '%Y/%m/%d %H:%M:%S') offset = int(raw_date[-5:]) - delta = timedelta(hours = offset / 100) + delta = timedelta(hours=(offset / 100)) date_object -= delta - date = date_object.strftime("%Y-%m-%d %H:%M") - kind = 'article' # TODO: Recognise pages + date = date_object.strftime('%Y-%m-%d %H:%M') + kind = 'article' # TODO: Recognise pages status = 'published' # TODO: Find a way for draft posts - yield (post.get('title'), post.get('body_cleaned'), slug, date, - post.get('user').get('display_name'), [], tags, status, kind, "html") + yield (post.get('title'), post.get('body_cleaned'), + slug, date, post.get('user').get('display_name'), + [], tags, status, kind, 'html') def tumblr2fields(api_key, blogname): @@ -374,7 +404,9 @@ def tumblr2fields(api_key, blogname): import urllib2 as urllib_request def get_tumblr_posts(api_key, blogname, offset=0): - url = "http://api.tumblr.com/v2/blog/%s.tumblr.com/posts?api_key=%s&offset=%d&filter=raw" % (blogname, api_key, offset) + url = ("http://api.tumblr.com/v2/blog/%s.tumblr.com/" + "posts?api_key=%s&offset=%d&filter=raw") % ( + blogname, api_key, offset) request = urllib_request.Request(url) handle = urllib_request.urlopen(request) posts = json.loads(handle.read().decode('utf-8')) @@ -384,7 +416,10 @@ def tumblr2fields(api_key, blogname): posts = get_tumblr_posts(api_key, blogname, offset) while len(posts) > 0: for post in posts: - title = post.get('title') or post.get('source_title') or post.get('type').capitalize() + title = \ + post.get('title') or \ + post.get('source_title') or \ + post.get('type').capitalize() slug = post.get('slug') or slugify(title) tags = post.get('tags') timestamp = post.get('timestamp') @@ -398,7 +433,11 @@ def tumblr2fields(api_key, blogname): fmtstr = '![%s](%s)' else: fmtstr = '%s' - content = '\n'.join(fmtstr % (photo.get('caption'), photo.get('original_size').get('url')) for photo in post.get('photos')) + content = '' + for photo in post.get('photos'): + content += '\n'.join( + fmtstr % (photo.get('caption'), + photo.get('original_size').get('url'))) content += '\n\n' + post.get('caption') elif type == 'quote': if format == 'markdown': @@ -417,16 +456,29 @@ def tumblr2fields(api_key, blogname): fmtstr = '[via](%s)\n\n' else: fmtstr = '

    via

    \n' - content = fmtstr % post.get('source_url') + post.get('caption') + post.get('player') + content = fmtstr % post.get('source_url') + \ + post.get('caption') + \ + post.get('player') elif type == 'video': if format == 'markdown': fmtstr = '[via](%s)\n\n' else: fmtstr = '

    via

    \n' - content = fmtstr % post.get('source_url') + post.get('caption') + '\n'.join(player.get('embed_code') for player in post.get('player')) + source = fmtstr % post.get('source_url') + caption = post.get('caption') + players = '\n'.join(player.get('embed_code') + for player in post.get('player')) + content = source + caption + players elif type == 'answer': title = post.get('question') - content = '

    %s: %s

    \n%s' % (post.get('asking_name'), post.get('asking_url'), post.get('question'), post.get('answer')) + content = ('

    ' + '%s' + ': %s' + '

    \n' + ' %s' % (post.get('asking_name'), + post.get('asking_url'), + post.get('question'), + post.get('answer'))) content = content.rstrip() + '\n' kind = 'article' @@ -438,25 +490,30 @@ def tumblr2fields(api_key, blogname): offset += len(posts) posts = get_tumblr_posts(api_key, blogname, offset) + def feed2fields(file): """Read a feed and yield pelican fields""" import feedparser d = feedparser.parse(file) for entry in d.entries: - date = (time.strftime("%Y-%m-%d %H:%M", entry.updated_parsed) - if hasattr(entry, "updated_parsed") else None) - author = entry.author if hasattr(entry, "author") else None - tags = [e['term'] for e in entry.tags] if hasattr(entry, "tags") else None + date = (time.strftime('%Y-%m-%d %H:%M', entry.updated_parsed) + if hasattr(entry, 'updated_parsed') else None) + author = entry.author if hasattr(entry, 'author') else None + tags = ([e['term'] for e in entry.tags] + if hasattr(entry, 'tags') else None) slug = slugify(entry.title) kind = 'article' - yield (entry.title, entry.description, slug, date, author, [], tags, None, - kind, "html") + yield (entry.title, entry.description, slug, date, + author, [], tags, None, kind, 'html') + + +def build_header(title, date, author, categories, tags, slug, + status=None, attachments=None): + """Build a header from a list of fields""" -def build_header(title, date, author, categories, tags, slug, status=None, attachments=None): from docutils.utils import column_width - """Build a header from a list of fields""" header = '%s\n%s\n' % (title, '#' * column_width(title)) if date: header += ':date: %s\n' % date @@ -475,8 +532,9 @@ def build_header(title, date, author, categories, tags, slug, status=None, attac header += '\n' return header -def build_markdown_header(title, date, author, categories, tags, slug, status=None, - attachments=None): + +def build_markdown_header(title, date, author, categories, tags, + slug, status=None, attachments=None): """Build a header from a list of fields""" header = 'Title: %s\n' % title if date: @@ -496,6 +554,7 @@ def build_markdown_header(title, date, author, categories, tags, slug, status=No header += '\n' return header + def get_ext(out_markup, in_markup='html'): if in_markup == 'markdown' or out_markup == 'markdown': ext = '.md' @@ -503,26 +562,27 @@ def get_ext(out_markup, in_markup='html'): ext = '.rst' return ext + def get_out_filename(output_path, filename, ext, kind, - dirpage, dircat, categories, wp_custpost): + dirpage, dircat, categories, wp_custpost): filename = os.path.basename(filename) # Enforce filename restrictions for various filesystems at once; see # http://en.wikipedia.org/wiki/Filename#Reserved_characters_and_words # we do not need to filter words because an extension will be appended - filename = re.sub(r'[<>:"/\\|?*^% ]', '-', filename) # invalid chars - filename = filename.lstrip('.') # should not start with a dot + filename = re.sub(r'[<>:"/\\|?*^% ]', '-', filename) # invalid chars + filename = filename.lstrip('.') # should not start with a dot if not filename: filename = '_' - filename = filename[:249] # allow for 5 extra characters + filename = filename[:249] # allow for 5 extra characters - out_filename = os.path.join(output_path, filename+ext) + out_filename = os.path.join(output_path, filename + ext) # option to put page posts in pages/ subdirectory if dirpage and kind == 'page': pages_dir = os.path.join(output_path, 'pages') if not os.path.isdir(pages_dir): os.mkdir(pages_dir) - out_filename = os.path.join(pages_dir, filename+ext) + out_filename = os.path.join(pages_dir, filename + ext) elif not dirpage and kind == 'page': pass # option to put wp custom post types in directories with post type @@ -539,18 +599,19 @@ def get_out_filename(output_path, filename, ext, kind, else: catname = '' out_filename = os.path.join(output_path, typename, - catname, filename+ext) + catname, filename + ext) if not os.path.isdir(os.path.join(output_path, typename, catname)): os.makedirs(os.path.join(output_path, typename, catname)) # option to put files in directories with categories names elif dircat and (len(categories) > 0): catname = slugify(categories[0]) - out_filename = os.path.join(output_path, catname, filename+ext) + out_filename = os.path.join(output_path, catname, filename + ext) if not os.path.isdir(os.path.join(output_path, catname)): os.mkdir(os.path.join(output_path, catname)) return out_filename + def get_attachments(xml): """returns a dictionary of posts that have attachments with a list of the attachment_urls @@ -566,7 +627,7 @@ def get_attachments(xml): if kind == 'attachment': attachments.append((item.find('post_parent').string, - item.find('attachment_url').string)) + item.find('attachment_url').string)) else: filename = get_filename(filename, post_id) names[post_id] = filename @@ -575,7 +636,7 @@ def get_attachments(xml): try: parent_name = names[parent] except KeyError: - #attachment's parent is not a valid post + # attachment's parent is not a valid post parent_name = None try: @@ -585,6 +646,7 @@ def get_attachments(xml): attachedposts[parent_name].append(url) return attachedposts + def download_attachments(output_path, urls): """Downloads WordPress attachments and returns a list of paths to attachments that can be associated with a post (relative path to output @@ -592,8 +654,8 @@ def download_attachments(output_path, urls): locations = [] for url in urls: path = urlparse(url).path - #teardown path and rebuild to negate any errors with - #os.path.join and leading /'s + # teardown path and rebuild to negate any errors with + # os.path.join and leading /'s path = path.split('/') filename = path.pop(-1) localpath = '' @@ -608,12 +670,13 @@ def download_attachments(output_path, urls): urlretrieve(url, os.path.join(full_path, filename)) locations.append(os.path.join(localpath, filename)) except (URLError, IOError) as e: - #Python 2.7 throws an IOError rather Than URLError + # Python 2.7 throws an IOError rather Than URLError logger.warning("No file could be downloaded from %s\n%s", url, e) return locations -def fields2pelican(fields, out_markup, output_path, +def fields2pelican( + fields, out_markup, output_path, dircat=False, strip_raw=False, disable_slugs=False, dirpage=False, filename_template=None, filter_author=None, wp_custpost=False, wp_attach=False, attachments=None): @@ -634,24 +697,26 @@ def fields2pelican(fields, out_markup, output_path, ext = get_ext(out_markup, in_markup) if ext == '.md': - header = build_markdown_header(title, date, author, categories, - tags, slug, status, attached_files) + header = build_markdown_header( + title, date, author, categories, tags, slug, + status, attached_files) else: - out_markup = "rst" + out_markup = 'rst' header = build_header(title, date, author, categories, - tags, slug, status, attached_files) + tags, slug, status, attached_files) - out_filename = get_out_filename(output_path, filename, ext, - kind, dirpage, dircat, categories, wp_custpost) + out_filename = get_out_filename( + output_path, filename, ext, kind, dirpage, dircat, + categories, wp_custpost) print(out_filename) - if in_markup in ("html", "wp-html"): - html_filename = os.path.join(output_path, filename+'.html') + if in_markup in ('html', 'wp-html'): + html_filename = os.path.join(output_path, filename + '.html') with open(html_filename, 'w', encoding='utf-8') as fp: # Replace newlines with paragraphs wrapped with

    so # HTML is valid before conversion - if in_markup == "wp-html": + if in_markup == 'wp-html': new_content = decode_wp_content(content) else: paragraphs = content.splitlines() @@ -660,79 +725,95 @@ def fields2pelican(fields, out_markup, output_path, fp.write(new_content) - parse_raw = '--parse-raw' if not strip_raw else '' cmd = ('pandoc --normalize {0} --from=html' - ' --to={1} -o "{2}" "{3}"').format( - parse_raw, out_markup, out_filename, html_filename) + ' --to={1} -o "{2}" "{3}"') + cmd = cmd.format(parse_raw, out_markup, + out_filename, html_filename) try: rc = subprocess.call(cmd, shell=True) if rc < 0: - error = "Child was terminated by signal %d" % -rc + error = 'Child was terminated by signal %d' % -rc exit(error) elif rc > 0: - error = "Please, check your Pandoc installation." + error = 'Please, check your Pandoc installation.' exit(error) except OSError as e: - error = "Pandoc execution failed: %s" % e + error = 'Pandoc execution failed: %s' % e exit(error) os.remove(html_filename) with open(out_filename, 'r', encoding='utf-8') as fs: content = fs.read() - if out_markup == "markdown": - # In markdown, to insert a
    , end a line with two or more spaces & then a end-of-line - content = content.replace("\\\n ", " \n") - content = content.replace("\\\n", " \n") + if out_markup == 'markdown': + # In markdown, to insert a
    , end a line with two + # or more spaces & then a end-of-line + content = content.replace('\\\n ', ' \n') + content = content.replace('\\\n', ' \n') with open(out_filename, 'w', encoding='utf-8') as fs: fs.write(header + content) if wp_attach and attachments and None in attachments: print("downloading attachments that don't have a parent post") urls = attachments[None] - orphan_galleries = download_attachments(output_path, urls) + download_attachments(output_path, urls) + def main(): parser = argparse.ArgumentParser( - description="Transform feed, WordPress, Tumblr, Dotclear, or Posterous " - "files into reST (rst) or Markdown (md) files. Be sure to " - "have pandoc installed.", + description="Transform feed, WordPress, Tumblr, Dotclear, or " + "Posterous files into reST (rst) or Markdown (md) files. " + "Be sure to have pandoc installed.", formatter_class=argparse.ArgumentDefaultsHelpFormatter) - parser.add_argument(dest='input', help='The input file to read') - parser.add_argument('--wpfile', action='store_true', dest='wpfile', + parser.add_argument( + dest='input', help='The input file to read') + parser.add_argument( + '--wpfile', action='store_true', dest='wpfile', help='Wordpress XML export') - parser.add_argument('--dotclear', action='store_true', dest='dotclear', + parser.add_argument( + '--dotclear', action='store_true', dest='dotclear', help='Dotclear export') - parser.add_argument('--posterous', action='store_true', dest='posterous', + parser.add_argument( + '--posterous', action='store_true', dest='posterous', help='Posterous export') - parser.add_argument('--tumblr', action='store_true', dest='tumblr', + parser.add_argument( + '--tumblr', action='store_true', dest='tumblr', help='Tumblr export') - parser.add_argument('--feed', action='store_true', dest='feed', + parser.add_argument( + '--feed', action='store_true', dest='feed', help='Feed to parse') - parser.add_argument('-o', '--output', dest='output', default='output', + parser.add_argument( + '-o', '--output', dest='output', default='output', help='Output path') - parser.add_argument('-m', '--markup', dest='markup', default='rst', + parser.add_argument( + '-m', '--markup', dest='markup', default='rst', help='Output markup format (supports rst & markdown)') - parser.add_argument('--dir-cat', action='store_true', dest='dircat', + parser.add_argument( + '--dir-cat', action='store_true', dest='dircat', help='Put files in directories with categories name') - parser.add_argument('--dir-page', action='store_true', dest='dirpage', + parser.add_argument( + '--dir-page', action='store_true', dest='dirpage', help=('Put files recognised as pages in "pages/" sub-directory' ' (wordpress import only)')) - parser.add_argument('--filter-author', dest='author', + parser.add_argument( + '--filter-author', dest='author', help='Import only post from the specified author') - parser.add_argument('--strip-raw', action='store_true', dest='strip_raw', + parser.add_argument( + '--strip-raw', action='store_true', dest='strip_raw', help="Strip raw HTML code that can't be converted to " "markup such as flash embeds or iframes (wordpress import only)") - parser.add_argument('--wp-custpost', action='store_true', + parser.add_argument( + '--wp-custpost', action='store_true', dest='wp_custpost', help='Put wordpress custom post types in directories. If used with ' '--dir-cat option directories will be created as ' '/post_type/category/ (wordpress import only)') - parser.add_argument('--wp-attach', action='store_true', dest='wp_attach', + parser.add_argument( + '--wp-attach', action='store_true', dest='wp_attach', help='(wordpress import only) Download files uploaded to wordpress as ' 'attachments. Files will be added to posts as a list in the post ' 'header. All files will be downloaded, even if ' @@ -740,16 +821,20 @@ def main(): 'with their original path inside the output directory. ' 'e.g. output/wp-uploads/date/postname/file.jpg ' '-- Requires an internet connection --') - parser.add_argument('--disable-slugs', action='store_true', + parser.add_argument( + '--disable-slugs', action='store_true', dest='disable_slugs', help='Disable storing slugs from imported posts within output. ' 'With this disabled, your Pelican URLs may not be consistent ' 'with your original posts.') - parser.add_argument('-e', '--email', dest='email', + parser.add_argument( + '-e', '--email', dest='email', help="Email address (posterous import only)") - parser.add_argument('-p', '--password', dest='password', + parser.add_argument( + '-p', '--password', dest='password', help="Password (posterous import only)") - parser.add_argument('-b', '--blogname', dest='blogname', + parser.add_argument( + '-b', '--blogname', dest='blogname', help="Blog name (Tumblr import only)") args = parser.parse_args() @@ -766,18 +851,20 @@ def main(): elif args.feed: input_type = 'feed' else: - error = "You must provide either --wpfile, --dotclear, --posterous, --tumblr or --feed options" + error = ('You must provide either --wpfile, --dotclear, ' + '--posterous, --tumblr or --feed options') exit(error) if not os.path.exists(args.output): try: os.mkdir(args.output) except OSError: - error = "Unable to create the output folder: " + args.output + error = 'Unable to create the output folder: ' + args.output exit(error) if args.wp_attach and input_type != 'wordpress': - error = "You must be importing a wordpress xml to use the --wp-attach option" + error = ('You must be importing a wordpress xml ' + 'to use the --wp-attach option') exit(error) if input_type == 'wordpress': @@ -796,14 +883,14 @@ def main(): else: attachments = None - init() # init logging - + # init logging + init() fields2pelican(fields, args.markup, args.output, dircat=args.dircat or False, dirpage=args.dirpage or False, strip_raw=args.strip_raw or False, disable_slugs=args.disable_slugs or False, filter_author=args.author, - wp_custpost = args.wp_custpost or False, - wp_attach = args.wp_attach or False, - attachments = attachments or None) + wp_custpost=args.wp_custpost or False, + wp_attach=args.wp_attach or False, + attachments=attachments or None) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 58da4649..e6ccf2a8 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -1,18 +1,20 @@ #!/usr/bin/env python - # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function -import six +from __future__ import print_function, unicode_literals +import argparse +import codecs import os import string -import argparse import sys -import codecs + import pytz +import six + from pelican import __version__ + _TEMPLATES_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "templates") @@ -44,9 +46,10 @@ CONF = { 'timezone': 'Europe/Paris' } -#url for list of valid timezones +# url for list of valid timezones _TZ_URL = 'http://en.wikipedia.org/wiki/List_of_tz_database_time_zones' + def _input_compat(prompt): if six.PY3: r = input(prompt) @@ -59,6 +62,7 @@ if six.PY3: else: str_compat = unicode + # Create a 'marked' default path, to determine if someone has supplied # a path on the command-line. class _DEFAULT_PATH_TYPE(str_compat): @@ -66,6 +70,7 @@ class _DEFAULT_PATH_TYPE(str_compat): _DEFAULT_PATH = _DEFAULT_PATH_TYPE(os.curdir) + def decoding_strings(f): def wrapper(*args, **kwargs): out = f(*args, **kwargs) @@ -164,7 +169,8 @@ def ask(question, answer=str_compat, default=None, l=None): print('You must enter an integer') return r else: - raise NotImplemented('Argument `answer` must be str_compat, bool, or integer') + raise NotImplemented( + 'Argument `answer` must be str_compat, bool, or integer') def ask_timezone(question, default, tzurl): @@ -177,7 +183,8 @@ def ask_timezone(question, default, tzurl): r = pytz.all_timezones[lower_tz.index(r)] break else: - print('Please enter a valid time zone:\n (check [{0}])'.format(tzurl)) + print('Please enter a valid time zone:\n' + ' (check [{0}])'.format(tzurl)) return r @@ -186,13 +193,13 @@ def main(): description="A kickstarter for Pelican", formatter_class=argparse.ArgumentDefaultsHelpFormatter) parser.add_argument('-p', '--path', default=_DEFAULT_PATH, - help="The path to generate the blog into") + help="The path to generate the blog into") parser.add_argument('-t', '--title', metavar="title", - help='Set the title of the website') + help='Set the title of the website') parser.add_argument('-a', '--author', metavar="author", - help='Set the author name of the website') + help='Set the author name of the website') parser.add_argument('-l', '--lang', metavar="lang", - help='Set the default web site language') + help='Set the default web site language') args = parser.parse_args() @@ -214,50 +221,94 @@ needed by Pelican. 'Will save to:\n%s\n' % CONF['basedir']) else: CONF['basedir'] = os.path.abspath(os.path.expanduser( - ask('Where do you want to create your new web site?', answer=str_compat, default=args.path))) + ask('Where do you want to create your new web site?', + answer=str_compat, default=args.path))) - CONF['sitename'] = ask('What will be the title of this web site?', answer=str_compat, default=args.title) - CONF['author'] = ask('Who will be the author of this web site?', answer=str_compat, default=args.author) - CONF['lang'] = ask('What will be the default language of this web site?', str_compat, args.lang or CONF['lang'], 2) + CONF['sitename'] = ask('What will be the title of this web site?', + answer=str_compat, default=args.title) + CONF['author'] = ask('Who will be the author of this web site?', + answer=str_compat, default=args.author) + CONF['lang'] = ask('What will be the default language of this web site?', + str_compat, args.lang or CONF['lang'], 2) - if ask('Do you want to specify a URL prefix? e.g., http://example.com ', answer=bool, default=True): - CONF['siteurl'] = ask('What is your URL prefix? (see above example; no trailing slash)', str_compat, CONF['siteurl']) + if ask('Do you want to specify a URL prefix? e.g., http://example.com ', + answer=bool, default=True): + CONF['siteurl'] = ask('What is your URL prefix? (see ' + 'above example; no trailing slash)', + str_compat, CONF['siteurl']) - CONF['with_pagination'] = ask('Do you want to enable article pagination?', bool, bool(CONF['default_pagination'])) + CONF['with_pagination'] = ask('Do you want to enable article pagination?', + bool, bool(CONF['default_pagination'])) if CONF['with_pagination']: - CONF['default_pagination'] = ask('How many articles per page do you want?', int, CONF['default_pagination']) + CONF['default_pagination'] = ask('How many articles per page ' + 'do you want?', + int, CONF['default_pagination']) else: CONF['default_pagination'] = False - CONF['timezone'] = ask_timezone('What is your time zone?', CONF['timezone'], _TZ_URL) + CONF['timezone'] = ask_timezone('What is your time zone?', + CONF['timezone'], _TZ_URL) - automation = ask('Do you want to generate a Fabfile/Makefile to automate generation and publishing?', bool, True) - develop = ask('Do you want an auto-reload & simpleHTTP script to assist with theme and site development?', bool, True) + automation = ask('Do you want to generate a Fabfile/Makefile ' + 'to automate generation and publishing?', bool, True) + develop = ask('Do you want an auto-reload & simpleHTTP script ' + 'to assist with theme and site development?', bool, True) if automation: - if ask('Do you want to upload your website using FTP?', answer=bool, default=False): - CONF['ftp_host'] = ask('What is the hostname of your FTP server?', str_compat, CONF['ftp_host']) - CONF['ftp_user'] = ask('What is your username on that server?', str_compat, CONF['ftp_user']) - CONF['ftp_target_dir'] = ask('Where do you want to put your web site on that server?', str_compat, CONF['ftp_target_dir']) - if ask('Do you want to upload your website using SSH?', answer=bool, default=False): - CONF['ssh_host'] = ask('What is the hostname of your SSH server?', str_compat, CONF['ssh_host']) - CONF['ssh_port'] = ask('What is the port of your SSH server?', int, CONF['ssh_port']) - CONF['ssh_user'] = ask('What is your username on that server?', str_compat, CONF['ssh_user']) - CONF['ssh_target_dir'] = ask('Where do you want to put your web site on that server?', str_compat, CONF['ssh_target_dir']) - if ask('Do you want to upload your website using Dropbox?', answer=bool, default=False): - CONF['dropbox_dir'] = ask('Where is your Dropbox directory?', str_compat, CONF['dropbox_dir']) - if ask('Do you want to upload your website using S3?', answer=bool, default=False): - CONF['s3_bucket'] = ask('What is the name of your S3 bucket?', str_compat, CONF['s3_bucket']) - if ask('Do you want to upload your website using Rackspace Cloud Files?', answer=bool, default=False): - CONF['cloudfiles_username'] = ask('What is your Rackspace Cloud username?', str_compat, CONF['cloudfiles_username']) - CONF['cloudfiles_api_key'] = ask('What is your Rackspace Cloud API key?', str_compat, CONF['cloudfiles_api_key']) - CONF['cloudfiles_container'] = ask('What is the name of your Cloud Files container?', str_compat, CONF['cloudfiles_container']) - if ask('Do you want to upload your website using GitHub Pages?', answer=bool, default=False): - if ask('Is this your personal page (username.github.io)?', answer=bool, default=False): - CONF['github_pages_branch'] = _GITHUB_PAGES_BRANCHES['personal'] + if ask('Do you want to upload your website using FTP?', + answer=bool, default=False): + CONF['ftp_host'] = ask('What is the hostname of your FTP server?', + str_compat, CONF['ftp_host']) + CONF['ftp_user'] = ask('What is your username on that server?', + str_compat, CONF['ftp_user']) + CONF['ftp_target_dir'] = ask('Where do you want to put your ' + 'web site on that server?', + str_compat, CONF['ftp_target_dir']) + if ask('Do you want to upload your website using SSH?', + answer=bool, default=False): + CONF['ssh_host'] = ask('What is the hostname of your SSH server?', + str_compat, CONF['ssh_host']) + CONF['ssh_port'] = ask('What is the port of your SSH server?', + int, CONF['ssh_port']) + CONF['ssh_user'] = ask('What is your username on that server?', + str_compat, CONF['ssh_user']) + CONF['ssh_target_dir'] = ask('Where do you want to put your ' + 'web site on that server?', + str_compat, CONF['ssh_target_dir']) + + if ask('Do you want to upload your website using Dropbox?', + answer=bool, default=False): + CONF['dropbox_dir'] = ask('Where is your Dropbox directory?', + str_compat, CONF['dropbox_dir']) + + if ask('Do you want to upload your website using S3?', + answer=bool, default=False): + CONF['s3_bucket'] = ask('What is the name of your S3 bucket?', + str_compat, CONF['s3_bucket']) + + if ask('Do you want to upload your website using ' + 'Rackspace Cloud Files?', answer=bool, default=False): + CONF['cloudfiles_username'] = ask('What is your Rackspace ' + 'Cloud username?', str_compat, + CONF['cloudfiles_username']) + CONF['cloudfiles_api_key'] = ask('What is your Rackspace ' + 'Cloud API key?', str_compat, + CONF['cloudfiles_api_key']) + CONF['cloudfiles_container'] = ask('What is the name of your ' + 'Cloud Files container?', + str_compat, + CONF['cloudfiles_container']) + + if ask('Do you want to upload your website using GitHub Pages?', + answer=bool, default=False): + if ask('Is this your personal page (username.github.io)?', + answer=bool, default=False): + CONF['github_pages_branch'] = \ + _GITHUB_PAGES_BRANCHES['personal'] else: - CONF['github_pages_branch'] = _GITHUB_PAGES_BRANCHES['project'] + CONF['github_pages_branch'] = \ + _GITHUB_PAGES_BRANCHES['project'] try: os.makedirs(os.path.join(CONF['basedir'], 'content')) @@ -270,7 +321,8 @@ needed by Pelican. print('Error: {0}'.format(e)) try: - with codecs.open(os.path.join(CONF['basedir'], 'pelicanconf.py'), 'w', 'utf-8') as fd: + with codecs.open(os.path.join(CONF['basedir'], 'pelicanconf.py'), + 'w', 'utf-8') as fd: conf_python = dict() for key, value in CONF.items(): conf_python[key] = repr(value) @@ -283,7 +335,8 @@ needed by Pelican. print('Error: {0}'.format(e)) try: - with codecs.open(os.path.join(CONF['basedir'], 'publishconf.py'), 'w', 'utf-8') as fd: + with codecs.open(os.path.join(CONF['basedir'], 'publishconf.py'), + 'w', 'utf-8') as fd: for line in get_template('publishconf.py'): template = string.Template(line) fd.write(template.safe_substitute(CONF)) @@ -293,7 +346,8 @@ needed by Pelican. if automation: try: - with codecs.open(os.path.join(CONF['basedir'], 'fabfile.py'), 'w', 'utf-8') as fd: + with codecs.open(os.path.join(CONF['basedir'], 'fabfile.py'), + 'w', 'utf-8') as fd: for line in get_template('fabfile.py'): template = string.Template(line) fd.write(template.safe_substitute(CONF)) @@ -301,7 +355,8 @@ needed by Pelican. except OSError as e: print('Error: {0}'.format(e)) try: - with codecs.open(os.path.join(CONF['basedir'], 'Makefile'), 'w', 'utf-8') as fd: + with codecs.open(os.path.join(CONF['basedir'], 'Makefile'), + 'w', 'utf-8') as fd: mkfile_template_name = 'Makefile' py_v = 'PY?=python' if six.PY3: @@ -323,7 +378,9 @@ needed by Pelican. value = '"' + value.replace('"', '\\"') + '"' conf_shell[key] = value try: - with codecs.open(os.path.join(CONF['basedir'], 'develop_server.sh'), 'w', 'utf-8') as fd: + with codecs.open(os.path.join(CONF['basedir'], + 'develop_server.sh'), + 'w', 'utf-8') as fd: lines = list(get_template('develop_server.sh')) py_v = 'PY=${PY:-python}\n' if six.PY3: @@ -333,7 +390,10 @@ needed by Pelican. template = string.Template(line) fd.write(template.safe_substitute(conf_shell)) fd.close() - os.chmod((os.path.join(CONF['basedir'], 'develop_server.sh')), 493) # mode 0o755 + + # mode 0o755 + os.chmod((os.path.join(CONF['basedir'], + 'develop_server.sh')), 493) except OSError as e: print('Error: {0}'.format(e)) diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index 8d71535d..e4bcb7c9 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -1,33 +1,12 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function - -import six +from __future__ import print_function, unicode_literals import argparse import os import shutil import sys -try: - import pelican -except: - err('Cannot import pelican.\nYou must install Pelican in order to run this script.', -1) - - -global _THEMES_PATH -_THEMES_PATH = os.path.join( - os.path.dirname( - os.path.abspath( - pelican.__file__ - ) - ), - 'themes' -) - -__version__ = '0.2' -_BUILTIN_THEMES = ['simple', 'notmyidea'] - def err(msg, die=None): """Print an error message and exits if an exit code is given""" @@ -35,43 +14,71 @@ def err(msg, die=None): if die: sys.exit((die if type(die) is int else 1)) +try: + import pelican +except: + err('Cannot import pelican.\nYou must ' + 'install Pelican in order to run this script.', + -1) + + +global _THEMES_PATH +_THEMES_PATH = os.path.join( + os.path.dirname( + os.path.abspath(pelican.__file__) + ), + 'themes' +) + +__version__ = '0.2' +_BUILTIN_THEMES = ['simple', 'notmyidea'] + def main(): """Main function""" - parser = argparse.ArgumentParser(description="""Install themes for Pelican""") + parser = argparse.ArgumentParser( + description="""Install themes for Pelican""") - excl= parser.add_mutually_exclusive_group() - excl.add_argument('-l', '--list', dest='action', action="store_const", const='list', + excl = parser.add_mutually_exclusive_group() + excl.add_argument( + '-l', '--list', dest='action', action="store_const", const='list', help="Show the themes already installed and exit") - excl.add_argument('-p', '--path', dest='action', action="store_const", const='path', + excl.add_argument( + '-p', '--path', dest='action', action="store_const", const='path', help="Show the themes path and exit") - excl.add_argument('-V', '--version', action='version', version='pelican-themes v{0}'.format(__version__), + excl.add_argument( + '-V', '--version', action='version', + version='pelican-themes v{0}'.format(__version__), help='Print the version of this script') - - parser.add_argument('-i', '--install', dest='to_install', nargs='+', metavar="theme path", + parser.add_argument( + '-i', '--install', dest='to_install', nargs='+', metavar="theme path", help='The themes to install') - parser.add_argument('-r', '--remove', dest='to_remove', nargs='+', metavar="theme name", + parser.add_argument( + '-r', '--remove', dest='to_remove', nargs='+', metavar="theme name", help='The themes to remove') - parser.add_argument('-U', '--upgrade', dest='to_upgrade', nargs='+', - metavar="theme path", help='The themes to upgrade') - parser.add_argument('-s', '--symlink', dest='to_symlink', nargs='+', metavar="theme path", - help="Same as `--install', but create a symbolic link instead of copying the theme. Useful for theme development") - parser.add_argument('-c', '--clean', dest='clean', action="store_true", + parser.add_argument( + '-U', '--upgrade', dest='to_upgrade', nargs='+', + metavar="theme path", help='The themes to upgrade') + parser.add_argument( + '-s', '--symlink', dest='to_symlink', nargs='+', metavar="theme path", + help="Same as `--install', but create a symbolic link instead of " + "copying the theme. Useful for theme development") + parser.add_argument( + '-c', '--clean', dest='clean', action="store_true", help="Remove the broken symbolic links of the theme path") - - parser.add_argument('-v', '--verbose', dest='verbose', action="store_true", + parser.add_argument( + '-v', '--verbose', dest='verbose', + action="store_true", help="Verbose output") - args = parser.parse_args() - + to_install = args.to_install or args.to_upgrade to_sym = args.to_symlink or args.clean - if args.action: if args.action is 'list': list_themes(args.verbose) @@ -95,7 +102,7 @@ def main(): if args.to_upgrade: if args.verbose: print('Upgrading themes...') - + for i in args.to_upgrade: install(i, v=args.verbose, u=True) @@ -144,11 +151,13 @@ def list_themes(v=False): def remove(theme_name, v=False): """Removes a theme""" - theme_name = theme_name.replace('/','') + theme_name = theme_name.replace('/', '') target = os.path.join(_THEMES_PATH, theme_name) if theme_name in _BUILTIN_THEMES: - err(theme_name + ' is a builtin theme.\nYou cannot remove a builtin theme with this script, remove it by hand if you want.') + err(theme_name + ' is a builtin theme.\n' + 'You cannot remove a builtin theme with this script, ' + 'remove it by hand if you want.') elif os.path.islink(target): if v: print('Removing link `' + target + "'") @@ -180,7 +189,8 @@ def install(path, v=False, u=False): install(path, v) else: if v: - print("Copying `{p}' to `{t}' ...".format(p=path, t=theme_path)) + print("Copying '{p}' to '{t}' ...".format(p=path, + t=theme_path)) try: shutil.copytree(path, theme_path) @@ -189,14 +199,18 @@ def install(path, v=False, u=False): for root, dirs, files in os.walk(theme_path): for d in dirs: dname = os.path.join(root, d) - os.chmod(dname, 493) # 0o755 + os.chmod(dname, 493) # 0o755 for f in files: fname = os.path.join(root, f) - os.chmod(fname, 420) # 0o644 + os.chmod(fname, 420) # 0o644 except OSError as e: - err("Cannot change permissions of files or directory in `{r}':\n{e}".format(r=theme_path, e=str(e)), die=False) + err("Cannot change permissions of files " + "or directory in `{r}':\n{e}".format(r=theme_path, + e=str(e)), + die=False) except Exception as e: - err("Cannot copy `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e))) + err("Cannot copy `{p}' to `{t}':\n{e}".format( + p=path, t=theme_path, e=str(e))) def symlink(path, v=False): @@ -212,11 +226,13 @@ def symlink(path, v=False): err(path + ' : already exists') else: if v: - print("Linking `{p}' to `{t}' ...".format(p=path, t=theme_path)) + print("Linking `{p}' to `{t}' ...".format( + p=path, t=theme_path)) try: os.symlink(path, theme_path) except Exception as e: - err("Cannot link `{p}' to `{t}':\n{e}".format(p=path, t=theme_path, e=str(e))) + err("Cannot link `{p}' to `{t}':\n{e}".format( + p=path, t=theme_path, e=str(e))) def is_broken_link(path): @@ -227,7 +243,7 @@ def is_broken_link(path): def clean(v=False): """Removes the broken symbolic links""" - c=0 + c = 0 for path in os.listdir(_THEMES_PATH): path = os.path.join(_THEMES_PATH, path) if os.path.islink(path): @@ -236,9 +252,9 @@ def clean(v=False): print('Removing {0}'.format(path)) try: os.remove(path) - except OSError as e: + except OSError: print('Error: cannot remove {0}'.format(path)) else: - c+=1 + c += 1 print("\nRemoved {0} broken links".format(c)) diff --git a/pelican/urlwrappers.py b/pelican/urlwrappers.py index 65dee23b..bf1199a8 100644 --- a/pelican/urlwrappers.py +++ b/pelican/urlwrappers.py @@ -4,9 +4,10 @@ from __future__ import unicode_literals import functools import logging import os + import six -from pelican.utils import (slugify, python_2_unicode_compatible) +from pelican.utils import python_2_unicode_compatible, slugify logger = logging.getLogger(__name__) diff --git a/pelican/utils.py b/pelican/utils.py index 43dca212..786a9425 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -1,29 +1,30 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals, print_function -import six +from __future__ import print_function, unicode_literals import codecs +import datetime import errno import fnmatch import locale import logging import os -import pytz import re import shutil import sys import traceback -import pickle -import datetime - from collections import Hashable from contextlib import contextmanager -import dateutil.parser from functools import partial from itertools import groupby -from jinja2 import Markup from operator import attrgetter -from posixpath import join as posix_join + +import dateutil.parser + +from jinja2 import Markup + +import pytz + +import six from six.moves.html_parser import HTMLParser logger = logging.getLogger(__name__) @@ -43,9 +44,9 @@ def strftime(date, date_format): formatting them with the date, (if necessary) decoding the output and replacing formatted output back. ''' - + def strip_zeros(x): + return x.lstrip('0') or '0' c89_directives = 'aAbBcdfHIjmMpSUwWxXyYzZ%' - strip_zeros = lambda x: x.lstrip('0') or '0' # grab candidate format options format_options = '%[-]?.' @@ -200,8 +201,8 @@ def deprecated_attribute(old, new, since=None, remove=None, doc=None): ' and will be removed by version {}'.format(version)) message.append('. Use {} instead.'.format(new)) logger.warning(''.join(message)) - logger.debug(''.join( - six.text_type(x) for x in traceback.format_stack())) + logger.debug(''.join(six.text_type(x) for x + in traceback.format_stack())) def fget(self): _warn() @@ -224,7 +225,7 @@ def get_date(string): """ string = re.sub(' +', ' ', string) default = SafeDatetime.now().replace(hour=0, minute=0, - second=0, microsecond=0) + second=0, microsecond=0) try: return dateutil.parser.parse(string, default=default) except (TypeError, ValueError): @@ -319,12 +320,12 @@ def copy(source, destination, ignores=None): for src_dir, subdirs, others in os.walk(source_): dst_dir = os.path.join(destination_, - os.path.relpath(src_dir, source_)) + os.path.relpath(src_dir, source_)) subdirs[:] = (s for s in subdirs if not any(fnmatch.fnmatch(s, i) for i in ignores)) - others[:] = (o for o in others if not any(fnmatch.fnmatch(o, i) - for i in ignores)) + others[:] = (o for o in others if not any(fnmatch.fnmatch(o, i) + for i in ignores)) if not os.path.isdir(dst_dir): logger.info('Creating directory %s', dst_dir) @@ -338,9 +339,11 @@ def copy(source, destination, ignores=None): logger.info('Copying %s to %s', src_path, dst_path) shutil.copy2(src_path, dst_path) else: - logger.warning('Skipped copy %s (not a file or directory) to %s', + logger.warning('Skipped copy %s (not a file or ' + 'directory) to %s', src_path, dst_path) + def clean_output_dir(path, retention): """Remove all files from output directory except those in retention list""" @@ -366,8 +369,8 @@ def clean_output_dir(path, retention): shutil.rmtree(file) logger.debug("Deleted directory %s", file) except Exception as e: - logger.error("Unable to delete directory %s; %s", - file, e) + logger.error("Unable to delete directory %s; %s", + file, e) elif os.path.isfile(file) or os.path.islink(file): try: os.remove(file) @@ -507,12 +510,12 @@ def process_translations(content_list, order_by=None): for slug, items in grouped_by_slugs: items = list(items) - # items with `translation` metadata will be used as translations… + # items with `translation` metadata will be used as translations... default_lang_items = list(filter( - lambda i: i.metadata.get('translation', 'false').lower() - == 'false', - items)) - # …unless all items with that slug are translations + lambda i: + i.metadata.get('translation', 'false').lower() == 'false', + items)) + # ...unless all items with that slug are translations if not default_lang_items: default_lang_items = items @@ -522,13 +525,14 @@ def process_translations(content_list, order_by=None): len_ = len(lang_items) if len_ > 1: logger.warning('There are %s variants of "%s" with lang %s', - len_, slug, lang) + len_, slug, lang) for x in lang_items: logger.warning('\t%s', x.source_path) # find items with default language - default_lang_items = list(filter(attrgetter('in_default_lang'), - default_lang_items)) + default_lang_items = list(filter( + attrgetter('in_default_lang'), + default_lang_items)) # if there is no article with default language, take an other one if not default_lang_items: @@ -536,10 +540,9 @@ def process_translations(content_list, order_by=None): if not slug: logger.warning( - 'empty slug for %s. ' - 'You can fix this by adding a title or a slug to your ' - 'content', - default_lang_items[0].source_path) + 'Empty slug for %s. You can fix this by ' + 'adding a title or a slug to your content', + default_lang_items[0].source_path) index.extend(default_lang_items) translations.extend([x for x in items if x not in default_lang_items]) for a in items: @@ -567,10 +570,12 @@ def process_translations(content_list, order_by=None): index.sort(key=attrgetter(order_by), reverse=order_reversed) except AttributeError: - logger.warning('There is no "%s" attribute in the item ' + logger.warning( + 'There is no "%s" attribute in the item ' 'metadata. Defaulting to slug order.', order_by) else: - logger.warning('Invalid *_ORDER_BY setting (%s).' + logger.warning( + 'Invalid *_ORDER_BY setting (%s).' 'Valid options are strings and functions.', order_by) return index, translations @@ -589,12 +594,12 @@ def folder_watcher(path, extensions, ignores=[]): dirs[:] = [x for x in dirs if not x.startswith(os.curdir)] for f in files: - if (f.endswith(tuple(extensions)) and - not any(fnmatch.fnmatch(f, ignore) for ignore in ignores)): - try: - yield os.stat(os.path.join(root, f)).st_mtime - except OSError as e: - logger.warning('Caught Exception: %s', e) + if f.endswith(tuple(extensions)) and \ + not any(fnmatch.fnmatch(f, ignore) for ignore in ignores): + try: + yield os.stat(os.path.join(root, f)).st_mtime + except OSError as e: + logger.warning('Caught Exception: %s', e) LAST_MTIME = 0 while True: diff --git a/pelican/writers.py b/pelican/writers.py index e90a0004..4df7b859 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -1,22 +1,24 @@ # -*- coding: utf-8 -*- -from __future__ import with_statement, unicode_literals, print_function -import six +from __future__ import print_function, unicode_literals, with_statement -import os import logging +import os + +from feedgenerator import Atom1Feed, Rss201rev2Feed + +from jinja2 import Markup + +import six +from six.moves.urllib.parse import urlparse + +from pelican import signals +from pelican.paginator import Paginator +from pelican.utils import (get_relative_path, is_selected_for_writing, + path_to_url, set_date_tzinfo) if not six.PY3: from codecs import open -from feedgenerator import Atom1Feed, Rss201rev2Feed -from jinja2 import Markup -from six.moves.urllib.parse import urlparse - -from pelican.paginator import Paginator -from pelican.utils import (get_relative_path, path_to_url, set_date_tzinfo, - is_selected_for_writing) -from pelican import signals - logger = logging.getLogger(__name__) @@ -119,10 +121,10 @@ class Writer(object): feed.write(fp, 'utf-8') logger.info('Writing %s', complete_path) - signals.feed_written.send(complete_path, context=context, feed=feed) + signals.feed_written.send( + complete_path, context=context, feed=feed) return feed - def write_file(self, name, template, context, relative_urls=False, paginated=None, override_output=False, **kwargs): """Render the template and write the file. @@ -139,9 +141,10 @@ class Writer(object): :param **kwargs: additional variables to pass to the templates """ - if name is False or name == "" or\ - not is_selected_for_writing(self.settings,\ - os.path.join(self.output_path, name)): + if name is False or \ + name == "" or \ + not is_selected_for_writing(self.settings, + os.path.join(self.output_path, name)): return elif not name: # other stuff, just return for now @@ -169,7 +172,8 @@ class Writer(object): def _get_localcontext(context, name, kwargs, relative_urls): localcontext = context.copy() - localcontext['localsiteurl'] = localcontext.get('localsiteurl', None) + localcontext['localsiteurl'] = localcontext.get( + 'localsiteurl', None) if relative_urls: relative_url = path_to_url(get_relative_path(name)) localcontext['SITEURL'] = relative_url @@ -201,11 +205,13 @@ class Writer(object): '%s_previous_page' % key: previous_page, '%s_next_page' % key: next_page}) - localcontext = _get_localcontext(context, page.save_as, paginated_kwargs, relative_urls) + localcontext = _get_localcontext( + context, page.save_as, paginated_kwargs, relative_urls) _write_file(template, localcontext, self.output_path, page.save_as, override_output) else: # no pagination - localcontext = _get_localcontext(context, name, kwargs, relative_urls) + localcontext = _get_localcontext( + context, name, kwargs, relative_urls) _write_file(template, localcontext, self.output_path, name, override_output) diff --git a/tox.ini b/tox.ini index 34335b82..56ad0c14 100644 --- a/tox.ini +++ b/tox.ini @@ -38,4 +38,5 @@ deps = flake8 <= 2.4.1 git+https://github.com/public/flake8-import-order@2ac7052a4e02b4a8a0125a106d87465a3b9fd688 commands = + flake8 --version flake8 pelican From 9d57dcf020c11abfb0efc16d6d4387a269964b97 Mon Sep 17 00:00:00 2001 From: Julien Vehent Date: Wed, 19 Aug 2015 12:28:14 -0400 Subject: [PATCH 1364/2344] Fix calculation of tag count in dotclear import Upon import of a dotclear backup, `pelican-import` returned this stacktrace: ``` File "/usr/bin/pelican-import", line 11, in sys.exit(main()) File "/usr/lib/python3.4/site-packages/pelican/tools/pelican_import.py", line 809, in main attachments = attachments or None) File "/usr/lib/python3.4/site-packages/pelican/tools/pelican_import.py", line 621, in fields2pelican kind, in_markup) in fields: File "/usr/lib/python3.4/site-packages/pelican/tools/pelican_import.py", line 262, in dc2fields if int(tag[:1]) == 1: ValueError: invalid literal for int() with base 10: 'a' ``` --- pelican/tools/pelican_import.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 92e8c919..a6547f63 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -259,7 +259,7 @@ def dc2fields(file): # Get tags related to a post tag = post_meta.replace('{', '').replace('}', '').replace('a:1:s:3:\\"tag\\";a:', '').replace('a:0:', '') if len(tag) > 1: - if int(tag[:1]) == 1: + if int(len(tag[:1])) == 1: newtag = tag.split('"')[1] tags.append( BeautifulSoup( From 170a429c52ed57c45826fa31c31d5bf692698cac Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 25 Aug 2015 10:05:15 -0700 Subject: [PATCH 1365/2344] Add flake8, sphinx, and tox to dev requirements --- dev_requirements.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dev_requirements.txt b/dev_requirements.txt index 028cbebd..d11b5c1f 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,5 +1,9 @@ # Tests +flake8 +-e git+https://github.com/public/flake8-import-order#egg=flake8-import-order mock +sphinx +tox # Optional Packages Markdown From ad72287b4cff8c46f35f693b487bfe39d00f0500 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 25 Aug 2015 11:25:57 -0700 Subject: [PATCH 1366/2344] Revert dev requirement additions Tox uses dev_requirements.txt to install things. That wasn't the original purpose of the dev_requirements.txt file, but for now these additions will have to remain a documentation issue until this can be sorted out properly. --- dev_requirements.txt | 4 ---- 1 file changed, 4 deletions(-) diff --git a/dev_requirements.txt b/dev_requirements.txt index d11b5c1f..028cbebd 100644 --- a/dev_requirements.txt +++ b/dev_requirements.txt @@ -1,9 +1,5 @@ # Tests -flake8 --e git+https://github.com/public/flake8-import-order#egg=flake8-import-order mock -sphinx -tox # Optional Packages Markdown From 7f795ed558f7eb5adabf1c2777db9b430ce121ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Fern=C3=A1ndez?= Date: Wed, 26 Aug 2015 11:23:28 +0200 Subject: [PATCH 1367/2344] Remove duplicate tags and authors in metadata --- pelican/readers.py | 5 ++++- .../article_with_duplicate_tags_authors.md | 15 +++++++++++++++ pelican/tests/test_generators.py | 2 ++ pelican/tests/test_readers.py | 10 ++++++++++ 4 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 pelican/tests/content/article_with_duplicate_tags_authors.md diff --git a/pelican/readers.py b/pelican/readers.py index bc4515e7..2e51c4ff 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -4,6 +4,7 @@ from __future__ import print_function, unicode_literals import logging import os import re +from collections import OrderedDict import docutils import docutils.core @@ -72,7 +73,9 @@ def ensure_metadata_list(text): else: text = text.split(',') - return [v for v in (w.strip() for w in text) if v] + return list(OrderedDict.fromkeys( + [v for v in (w.strip() for w in text) if v] + )) def _process_if_nonempty(processor, name, settings): diff --git a/pelican/tests/content/article_with_duplicate_tags_authors.md b/pelican/tests/content/article_with_duplicate_tags_authors.md new file mode 100644 index 00000000..7ab046f9 --- /dev/null +++ b/pelican/tests/content/article_with_duplicate_tags_authors.md @@ -0,0 +1,15 @@ +Title: Test metadata duplicates +Category: test +Tags: foo, bar, foobar, foo, bar +Authors: Author, First; Author, Second; Author, First +Date: 2010-12-02 10:14 +Modified: 2010-12-02 10:20 +Summary: I have a lot to test + +Test Markdown File Header +========================= + +Used for pelican test +--------------------- + +The quick brown fox jumped over the lazy dog's back. diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 2cfca04f..c9aa1cff 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -160,6 +160,7 @@ class TestArticlesGenerator(unittest.TestCase): ['Test markdown File', 'published', 'test', 'article'], ['Test md File', 'published', 'test', 'article'], ['Test mdown File', 'published', 'test', 'article'], + ['Test metadata duplicates', 'published', 'test', 'article'], ['Test mkd File', 'published', 'test', 'article'], ['This is a super article !', 'published', 'Yeah', 'article'], ['This is a super article !', 'published', 'Yeah', 'article'], @@ -435,6 +436,7 @@ class TestArticlesGenerator(unittest.TestCase): 'Test markdown File', 'Test md File', 'Test mdown File', + 'Test metadata duplicates', 'Test mkd File', 'This is a super article !', 'This is a super article !', diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 71394ee4..5fabc470 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -516,6 +516,16 @@ class MdReaderTest(ReaderTest): } self.assertDictHasSubset(page.metadata, expected) + def test_duplicate_tags_or_authors_are_removed(self): + reader = readers.MarkdownReader(settings=get_settings()) + content, metadata = reader.read( + _path('article_with_duplicate_tags_authors.md')) + expected = { + 'tags': ['foo', 'bar', 'foobar'], + 'authors': ['Author, First', 'Author, Second'], + } + self.assertDictHasSubset(metadata, expected) + class HTMLReaderTest(ReaderTest): def test_article_with_comments(self): From 9d0804de7af858880e5ef74f0c1c5d8f5ad6419b Mon Sep 17 00:00:00 2001 From: Andrea Corbellini Date: Wed, 19 Aug 2015 16:43:59 +0200 Subject: [PATCH 1368/2344] When truncating, consider hypens, apostrophes and HTML entities. --- pelican/tests/output/basic/category/misc.html | 2 +- pelican/tests/output/basic/index.html | 2 +- .../custom/author/alexis-metaireau3.html | 2 +- .../tests/output/custom/category/misc.html | 2 +- pelican/tests/output/custom/index3.html | 2 +- .../author/alexis-metaireau3.html | 4 +- .../output/custom_locale/category/misc.html | 4 +- .../tests/output/custom_locale/index3.html | 4 +- pelican/tests/test_utils.py | 28 ++++++-- pelican/utils.py | 69 ++++++++++++++++--- 10 files changed, 95 insertions(+), 24 deletions(-) diff --git a/pelican/tests/output/basic/category/misc.html b/pelican/tests/output/basic/category/misc.html index 0368793e..f491a464 100644 --- a/pelican/tests/output/basic/category/misc.html +++ b/pelican/tests/output/basic/category/misc.html @@ -90,7 +90,7 @@

    Testing another case

    This will now have a line number in 'custom' since it's the default in -pelican.conf, it ...

    +pelican.conf, it will ...

    read more diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html index 3066172d..4c74500d 100644 --- a/pelican/tests/output/basic/index.html +++ b/pelican/tests/output/basic/index.html @@ -227,7 +227,7 @@ YEAH !

    Testing another case

    This will now have a line number in 'custom' since it's the default in -pelican.conf, it ...

    +pelican.conf, it will ...

    read more diff --git a/pelican/tests/output/custom/author/alexis-metaireau3.html b/pelican/tests/output/custom/author/alexis-metaireau3.html index 54c768ac..3ca4dd0d 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom/author/alexis-metaireau3.html @@ -59,7 +59,7 @@

    Testing another case

    This will now have a line number in 'custom' since it's the default in -pelican.conf, it ...

    +pelican.conf, it will ...

    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html index fa71085d..b705a552 100644 --- a/pelican/tests/output/custom/category/misc.html +++ b/pelican/tests/output/custom/category/misc.html @@ -103,7 +103,7 @@

    Testing another case

    This will now have a line number in 'custom' since it's the default in -pelican.conf, it ...

    +pelican.conf, it will ...

    read more

    There are comments.

    diff --git a/pelican/tests/output/custom/index3.html b/pelican/tests/output/custom/index3.html index 1dab4e7d..b968b7e8 100644 --- a/pelican/tests/output/custom/index3.html +++ b/pelican/tests/output/custom/index3.html @@ -59,7 +59,7 @@

    Testing another case

    This will now have a line number in 'custom' since it's the default in -pelican.conf, it ...

    +pelican.conf, it will ...

    read more

    There are comments.

    diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau3.html b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html index 66575c71..2fea24c3 100644 --- a/pelican/tests/output/custom_locale/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html @@ -59,7 +59,7 @@

    Testing another case

    This will now have a line number in 'custom' since it's the default in -pelican.conf, it ...

    +pelican.conf, it will ...

    read more

    There are comments.

    @@ -135,4 +135,4 @@ pelican.conf, it ...

    }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom_locale/category/misc.html b/pelican/tests/output/custom_locale/category/misc.html index bb78a8cc..f44f725d 100644 --- a/pelican/tests/output/custom_locale/category/misc.html +++ b/pelican/tests/output/custom_locale/category/misc.html @@ -103,7 +103,7 @@

    Testing another case

    This will now have a line number in 'custom' since it's the default in -pelican.conf, it ...

    +pelican.conf, it will ...

    read more

    There are comments.

    @@ -175,4 +175,4 @@ pelican.conf, it ...

    }()); - \ No newline at end of file + diff --git a/pelican/tests/output/custom_locale/index3.html b/pelican/tests/output/custom_locale/index3.html index 49f70ba2..926bc25e 100644 --- a/pelican/tests/output/custom_locale/index3.html +++ b/pelican/tests/output/custom_locale/index3.html @@ -59,7 +59,7 @@

    Testing another case

    This will now have a line number in 'custom' since it's the default in -pelican.conf, it ...

    +pelican.conf, it will ...

    read more

    There are comments.

    @@ -135,4 +135,4 @@ pelican.conf, it ...

    }()); - \ No newline at end of file + diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index d6fdf70e..a076a2c7 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -146,31 +146,51 @@ class TestUtils(LoggedTestCase): self.assertEqual(utils.get_relative_path(value), expected) def test_truncate_html_words(self): + # Plain text. self.assertEqual( utils.truncate_html_words('short string', 20), 'short string') - self.assertEqual( utils.truncate_html_words('word ' * 100, 20), 'word ' * 20 + '...') + # Words enclosed or intervaled by HTML tags. self.assertEqual( utils.truncate_html_words('

    ' + 'word ' * 100 + '

    ', 20), '

    ' + 'word ' * 20 + '...

    ') - self.assertEqual( utils.truncate_html_words( '' + 'word ' * 100 + '', 20), '' + 'word ' * 20 + '...') - self.assertEqual( utils.truncate_html_words('
    ' + 'word ' * 100, 20), '
    ' + 'word ' * 20 + '...') - self.assertEqual( utils.truncate_html_words('' + 'word ' * 100, 20), '' + 'word ' * 20 + '...') + # Words with hypens and apostrophes. + self.assertEqual( + utils.truncate_html_words("a-b " * 100, 20), + "a-b " * 20 + '...') + self.assertEqual( + utils.truncate_html_words("it's " * 100, 20), + "it's " * 20 + '...') + + # Words with HTML entity references. + self.assertEqual( + utils.truncate_html_words("é " * 100, 20), + "é " * 20 + '...') + self.assertEqual( + utils.truncate_html_words("café " * 100, 20), + "café " * 20 + '...') + self.assertEqual( + utils.truncate_html_words("èlite " * 100, 20), + "èlite " * 20 + '...') + self.assertEqual( + utils.truncate_html_words("cafetiére " * 100, 20), + "cafetiére " * 20 + '...') + def test_process_translations(self): # create a bunch of articles # 1: no translation metadata diff --git a/pelican/utils.py b/pelican/utils.py index 786a9425..7ad0914c 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -25,6 +25,7 @@ from jinja2 import Markup import pytz import six +from six.moves import html_entities from six.moves.html_parser import HTMLParser logger = logging.getLogger(__name__) @@ -408,7 +409,8 @@ def posixize_path(rel_path): class _HTMLWordTruncator(HTMLParser): - _word_regex = re.compile(r'\w[\w-]*', re.U) + _word_regex = re.compile(r"\w[\w'-]*", re.U) + _word_prefix_regex = re.compile(r'\w', re.U) _singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', 'hr', 'input') @@ -420,17 +422,37 @@ class _HTMLWordTruncator(HTMLParser): self.max_words = max_words self.words_found = 0 self.open_tags = [] + self.last_word_end = None self.truncate_at = None + def getoffset(self): + line_start = 0 + lineno, line_offset = self.getpos() + for i in range(lineno - 1): + line_start = self.rawdata.index('\n', line_start) + 1 + return line_start + line_offset + + def add_word(self, word_end): + self.words_found += 1 + self.last_word_end = None + if self.words_found == self.max_words: + self.truncate_at = word_end + + def add_last_word(self): + if self.last_word_end is not None: + self.add_word(self.last_word_end) + def handle_starttag(self, tag, attrs): if self.truncate_at is not None: return + self.add_last_word() if tag not in self._singlets: self.open_tags.insert(0, tag) def handle_endtag(self, tag): if self.truncate_at is not None: return + self.add_last_word() try: i = self.open_tags.index(tag) except ValueError: @@ -442,20 +464,49 @@ class _HTMLWordTruncator(HTMLParser): def handle_data(self, data): word_end = 0 + offset = self.getoffset() while self.words_found < self.max_words: match = self._word_regex.search(data, word_end) if not match: break - word_end = match.end(0) - self.words_found += 1 - if self.words_found == self.max_words: - line_start = 0 - lineno, line_offset = self.getpos() - for i in range(lineno - 1): - line_start = self.rawdata.index('\n', line_start) + 1 - self.truncate_at = line_start + line_offset + word_end + if match.start(0) > 0: + self.add_last_word() + + word_end = match.end(0) + self.last_word_end = offset + word_end + + if word_end < len(data): + self.add_last_word() + + def handle_ref(self, char): + offset = self.getoffset() + ref_end = self.rawdata.index(';', offset) + 1 + + if self.last_word_end is None: + if self._word_prefix_regex.match(char): + self.last_word_end = ref_end + else: + if self._word_regex.match(char): + self.last_word_end = ref_end + else: + self.add_last_word() + + def handle_entityref(self, name): + try: + codepoint = html_entities.name2codepoint[name] + except KeyError: + self.handle_ref('') + else: + self.handle_ref(chr(codepoint)) + + def handle_charref(self, name): + if name.startswith('x'): + codepoint = int(name[1:], 16) + else: + codepoint = int(name) + self.handle_ref(chr(codepoint)) def truncate_html_words(s, num, end_text='...'): From b0d41f081b83cb8b1534d907b95ea5f198f9ea67 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Sat, 5 Sep 2015 10:53:44 +0200 Subject: [PATCH 1369/2344] remove article.keywords from simple theme We don't process 'keywords' metadata specially, so it never gets processed into a list. This prevents issues like #1733. --- pelican/themes/simple/templates/article.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index 8ddda4d0..48464ce4 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -1,10 +1,6 @@ {% extends "base.html" %} {% block head %} {{ super() }} - {% for keyword in article.keywords %} - - {% endfor %} - {% if article.description %} {% endif %} From 6afa7704b149c60384e5598afd9ceb11e064d373 Mon Sep 17 00:00:00 2001 From: derwinlu Date: Fri, 11 Sep 2015 22:06:51 +0200 Subject: [PATCH 1370/2344] Add versioning information to debug output --- pelican/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pelican/__init__.py b/pelican/__init__.py index 7fb8dfe4..48cb5980 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -379,6 +379,10 @@ def get_instance(args): def main(): args = parse_arguments() init(args.verbosity) + + logger.debug('Pelican version: %s', __version__) + logger.debug('Python version: %s', sys.version.split()[0]) + pelican, settings = get_instance(args) readers = Readers(settings) From a6c258eb7fda71e7421ae6b41180f2103c166bf3 Mon Sep 17 00:00:00 2001 From: Onur Aslan Date: Tue, 15 Sep 2015 02:24:21 +0300 Subject: [PATCH 1371/2344] Add index and author replacement indicators --- docs/content.rst | 8 ++++---- pelican/contents.py | 6 +++++- pelican/settings.py | 1 + pelican/tests/test_contents.py | 34 +++++++++++++++++++++++++++++++ pelican/tests/test_urlwrappers.py | 8 +++++++- 5 files changed, 51 insertions(+), 6 deletions(-) diff --git a/docs/content.rst b/docs/content.rst index 1e6ba099..0fa89921 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -329,11 +329,11 @@ of ``{attach}``, and letting the file's location be determined by the project's ``STATIC_SAVE_AS`` and ``STATIC_URL`` settings. (Per-file ``save_as`` and ``url`` overrides can still be set in ``EXTRA_PATH_METADATA``.) -Linking to tags and categories ------------------------------- +Linking to authors, categories, index and tags +---------------------------------------------- -You can link to tags and categories using the ``{tag}tagname`` and -``{category}foobar`` syntax. +You can link to authors, categories, index and tags using the ``{author}name``, +``{category}foobar``, ``{index}`` and ``{tag}tagname`` syntax. Deprecated internal link syntax ------------------------------- diff --git a/pelican/contents.py b/pelican/contents.py index 16d1f074..4d313ab8 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -21,7 +21,7 @@ from pelican.utils import (SafeDatetime, deprecated_attribute, memoized, slugify, strftime, truncate_html_words) # Import these so that they're avalaible when you import from pelican.contents. -from pelican.urlwrappers import (URLWrapper, Author, Category, Tag) # NOQA +from pelican.urlwrappers import (Author, Category, Tag, URLWrapper) # NOQA logger = logging.getLogger(__name__) @@ -253,6 +253,10 @@ class Content(object): origin = '/'.join((siteurl, Category(path, self.settings).url)) elif what == 'tag': origin = '/'.join((siteurl, Tag(path, self.settings).url)) + elif what == 'index': + origin = '/'.join((siteurl, self.settings['INDEX_SAVE_AS'])) + elif what == 'author': + origin = '/'.join((siteurl, Author(path, self.settings).url)) else: logger.warning( "Replacement Indicator '%s' not recognized, " diff --git a/pelican/settings.py b/pelican/settings.py index 4d75333a..d1b1648b 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -64,6 +64,7 @@ DEFAULT_CONFIG = { 'REVERSE_CATEGORY_ORDER': False, 'DELETE_OUTPUT_DIRECTORY': False, 'OUTPUT_RETENTION': [], + 'INDEX_SAVE_AS': 'index.html', 'ARTICLE_URL': '{slug}.html', 'ARTICLE_SAVE_AS': '{slug}.html', 'ARTICLE_ORDER_BY': 'reversed-date', diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index a3664383..59cff844 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -606,6 +606,40 @@ class TestStatic(LoggedTestCase): self.assertNotEqual(content, html) + def test_author_link_syntax(self): + "{author} link syntax triggers url replacement." + + html = 'link' + page = Page( + content=html, + metadata={'title': 'fakepage'}, + settings=self.settings, + source_path=os.path.join('dir', 'otherdir', 'fakepage.md'), + context=self.context) + content = page.get_content('') + + self.assertNotEqual(content, html) + + def test_index_link_syntax(self): + "{index} link syntax triggers url replacement." + + html = 'link' + page = Page( + content=html, + metadata={'title': 'fakepage'}, + settings=self.settings, + source_path=os.path.join('dir', 'otherdir', 'fakepage.md'), + context=self.context) + content = page.get_content('') + + self.assertNotEqual(content, html) + + expected_html = ('link') + self.assertEqual(content, expected_html) + def test_unknown_link_syntax(self): "{unknown} link syntax should trigger warning." diff --git a/pelican/tests/test_urlwrappers.py b/pelican/tests/test_urlwrappers.py index ae6eaaec..f3dc8198 100644 --- a/pelican/tests/test_urlwrappers.py +++ b/pelican/tests/test_urlwrappers.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals from pelican.tests.support import unittest -from pelican.urlwrappers import Category, Tag, URLWrapper +from pelican.urlwrappers import Author, Category, Tag, URLWrapper class TestURLWrapper(unittest.TestCase): @@ -34,9 +34,11 @@ class TestURLWrapper(unittest.TestCase): def test_equality(self): tag = Tag('test', settings={}) cat = Category('test', settings={}) + author = Author('test', settings={}) # same name, but different class self.assertNotEqual(tag, cat) + self.assertNotEqual(tag, author) # should be equal vs text representing the same name self.assertEqual(tag, u'test') @@ -48,5 +50,9 @@ class TestURLWrapper(unittest.TestCase): tag_equal = Tag('Test', settings={}) self.assertEqual(tag, tag_equal) + # Author describing the same should be equal + author_equal = Author('Test', settings={}) + self.assertEqual(author, author_equal) + cat_ascii = Category('指導書', settings={}) self.assertEqual(cat_ascii, u'zhi-dao-shu') From d583efb8616cf19401865b04c4270b1a41a96d7f Mon Sep 17 00:00:00 2001 From: Andrea Corbellini Date: Fri, 4 Sep 2015 16:49:41 +0200 Subject: [PATCH 1372/2344] When truncating, stop parsing the document immediately after finding the last word. --- pelican/utils.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index 7ad0914c..97768f53 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -414,6 +414,13 @@ class _HTMLWordTruncator(HTMLParser): _singlets = ('br', 'col', 'link', 'base', 'img', 'param', 'area', 'hr', 'input') + class TruncationCompleted(Exception): + + def __init__(self, truncate_at): + super(_HTMLWordTruncator.TruncationCompleted, self).__init__( + truncate_at) + self.truncate_at = truncate_at + def __init__(self, max_words): # In Python 2, HTMLParser is not a new-style class, # hence super() cannot be used. @@ -425,6 +432,16 @@ class _HTMLWordTruncator(HTMLParser): self.last_word_end = None self.truncate_at = None + def feed(self, *args, **kwargs): + try: + # With Python 2, super() cannot be used. + # See the comment for __init__(). + HTMLParser.feed(self, *args, **kwargs) + except self.TruncationCompleted as exc: + self.truncate_at = exc.truncate_at + else: + self.truncate_at = None + def getoffset(self): line_start = 0 lineno, line_offset = self.getpos() @@ -436,22 +453,18 @@ class _HTMLWordTruncator(HTMLParser): self.words_found += 1 self.last_word_end = None if self.words_found == self.max_words: - self.truncate_at = word_end + raise self.TruncationCompleted(word_end) def add_last_word(self): if self.last_word_end is not None: self.add_word(self.last_word_end) def handle_starttag(self, tag, attrs): - if self.truncate_at is not None: - return self.add_last_word() if tag not in self._singlets: self.open_tags.insert(0, tag) def handle_endtag(self, tag): - if self.truncate_at is not None: - return self.add_last_word() try: i = self.open_tags.index(tag) From c255a35800911f74a3d07689cc6f1296cb6660a9 Mon Sep 17 00:00:00 2001 From: Andrea Corbellini Date: Tue, 22 Sep 2015 20:52:30 +0200 Subject: [PATCH 1373/2344] Use unichr() instead of chr() with Python 2. --- pelican/tests/test_utils.py | 12 ++++++++++++ pelican/utils.py | 4 ++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index a076a2c7..d967b247 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -190,6 +190,18 @@ class TestUtils(LoggedTestCase): self.assertEqual( utils.truncate_html_words("cafetiére " * 100, 20), "cafetiére " * 20 + '...') + self.assertEqual( + utils.truncate_html_words("∫dx " * 100, 20), + "∫dx " * 20 + '...') + + # Words with HTML character references inside and outside + # the ASCII range. + self.assertEqual( + utils.truncate_html_words("é " * 100, 20), + "é " * 20 + '...') + self.assertEqual( + utils.truncate_html_words("∫dx " * 100, 20), + "∫dx " * 20 + '...') def test_process_translations(self): # create a bunch of articles diff --git a/pelican/utils.py b/pelican/utils.py index 7ad0914c..697a182b 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -499,14 +499,14 @@ class _HTMLWordTruncator(HTMLParser): except KeyError: self.handle_ref('') else: - self.handle_ref(chr(codepoint)) + self.handle_ref(six.unichr(codepoint)) def handle_charref(self, name): if name.startswith('x'): codepoint = int(name[1:], 16) else: codepoint = int(name) - self.handle_ref(chr(codepoint)) + self.handle_ref(six.unichr(codepoint)) def truncate_html_words(s, num, end_text='...'): From a670a3e0409719779d6dbe5939e6c39836e6162b Mon Sep 17 00:00:00 2001 From: Ben Rosser Date: Mon, 21 Sep 2015 00:15:29 -0400 Subject: [PATCH 1374/2344] Made name of blogroll/social widgets configurable. The BLOGROLL_WIDGET_NAME and SOCIAL_WIDGET_NAME settings are now respected by notmyidea if they are specified in your config file. They override the default names of "blogroll" and "links" in the notmyidea theme. Used default() in template to simplify template code. Renaming BLOGROLL setting to LINKS, changed default also. Updated tests to check 'links' instead of 'blogroll'. Whoops; links, not link. --- THANKS | 1 + docs/settings.rst | 4 ++++ pelican/tests/output/custom/a-markdown-powered-article.html | 2 +- pelican/tests/output/custom/archives.html | 2 +- pelican/tests/output/custom/article-1.html | 2 +- pelican/tests/output/custom/article-2.html | 2 +- pelican/tests/output/custom/article-3.html | 2 +- pelican/tests/output/custom/author/alexis-metaireau.html | 2 +- pelican/tests/output/custom/author/alexis-metaireau2.html | 2 +- pelican/tests/output/custom/author/alexis-metaireau3.html | 2 +- pelican/tests/output/custom/authors.html | 2 +- pelican/tests/output/custom/categories.html | 2 +- pelican/tests/output/custom/category/bar.html | 2 +- pelican/tests/output/custom/category/cat1.html | 2 +- pelican/tests/output/custom/category/misc.html | 2 +- pelican/tests/output/custom/category/yeah.html | 2 +- pelican/tests/output/custom/drafts/a-draft-article.html | 2 +- pelican/tests/output/custom/filename_metadata-example.html | 2 +- pelican/tests/output/custom/index.html | 2 +- pelican/tests/output/custom/index2.html | 2 +- pelican/tests/output/custom/index3.html | 2 +- pelican/tests/output/custom/jinja2_template.html | 2 +- pelican/tests/output/custom/oh-yeah-fr.html | 2 +- pelican/tests/output/custom/oh-yeah.html | 2 +- pelican/tests/output/custom/override/index.html | 2 +- .../tests/output/custom/pages/this-is-a-test-hidden-page.html | 2 +- pelican/tests/output/custom/pages/this-is-a-test-page.html | 2 +- pelican/tests/output/custom/second-article-fr.html | 2 +- pelican/tests/output/custom/second-article.html | 2 +- pelican/tests/output/custom/tag/bar.html | 2 +- pelican/tests/output/custom/tag/baz.html | 2 +- pelican/tests/output/custom/tag/foo.html | 2 +- pelican/tests/output/custom/tag/foobar.html | 2 +- pelican/tests/output/custom/tag/oh.html | 2 +- pelican/tests/output/custom/tag/yeah.html | 2 +- pelican/tests/output/custom/tags.html | 2 +- pelican/tests/output/custom/this-is-a-super-article.html | 2 +- pelican/tests/output/custom/unbelievable.html | 2 +- pelican/tests/output/custom_locale/archives.html | 2 +- .../tests/output/custom_locale/author/alexis-metaireau.html | 2 +- .../tests/output/custom_locale/author/alexis-metaireau2.html | 2 +- .../tests/output/custom_locale/author/alexis-metaireau3.html | 2 +- pelican/tests/output/custom_locale/authors.html | 2 +- pelican/tests/output/custom_locale/categories.html | 2 +- pelican/tests/output/custom_locale/category/bar.html | 2 +- pelican/tests/output/custom_locale/category/cat1.html | 2 +- pelican/tests/output/custom_locale/category/misc.html | 2 +- pelican/tests/output/custom_locale/category/yeah.html | 2 +- .../tests/output/custom_locale/drafts/a-draft-article.html | 2 +- pelican/tests/output/custom_locale/index.html | 2 +- pelican/tests/output/custom_locale/index2.html | 2 +- pelican/tests/output/custom_locale/index3.html | 2 +- pelican/tests/output/custom_locale/jinja2_template.html | 2 +- pelican/tests/output/custom_locale/oh-yeah-fr.html | 2 +- pelican/tests/output/custom_locale/override/index.html | 2 +- .../custom_locale/pages/this-is-a-test-hidden-page.html | 2 +- .../tests/output/custom_locale/pages/this-is-a-test-page.html | 2 +- .../posts/2010/décembre/02/this-is-a-super-article/index.html | 2 +- .../posts/2010/octobre/15/unbelievable/index.html | 2 +- .../custom_locale/posts/2010/octobre/20/oh-yeah/index.html | 2 +- .../posts/2011/avril/20/a-markdown-powered-article/index.html | 2 +- .../custom_locale/posts/2011/février/17/article-1/index.html | 2 +- .../custom_locale/posts/2011/février/17/article-2/index.html | 2 +- .../custom_locale/posts/2011/février/17/article-3/index.html | 2 +- .../posts/2012/février/29/second-article/index.html | 2 +- .../2012/novembre/30/filename_metadata-example/index.html | 2 +- pelican/tests/output/custom_locale/second-article-fr.html | 2 +- pelican/tests/output/custom_locale/tag/bar.html | 2 +- pelican/tests/output/custom_locale/tag/baz.html | 2 +- pelican/tests/output/custom_locale/tag/foo.html | 2 +- pelican/tests/output/custom_locale/tag/foobar.html | 2 +- pelican/tests/output/custom_locale/tag/oh.html | 2 +- pelican/tests/output/custom_locale/tag/yeah.html | 2 +- pelican/tests/output/custom_locale/tags.html | 2 +- pelican/themes/notmyidea/templates/base.html | 4 ++-- 75 files changed, 79 insertions(+), 74 deletions(-) diff --git a/THANKS b/THANKS index 15503473..a3af2426 100644 --- a/THANKS +++ b/THANKS @@ -24,6 +24,7 @@ Andrew Spiers Arnaud BOS asselinpaul Axel Haustant +Ben Rosser (TC01) Benoît HERVIER Borgar Brandon W Maister diff --git a/docs/settings.rst b/docs/settings.rst index 202fc45f..61fd8521 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -724,6 +724,10 @@ Setting name What does it do? ``TWITTER_USERNAME`` Allows for adding a button to articles to encourage others to tweet about them. Add your Twitter username if you want this button to appear. +``LINKS_WIDGET_NAME`` Allows override of the name of the links widget. + If not specified, defaults to "links". +``SOCIAL_WIDGET_NAME`` Allows override of the name of the "social" widget. + If not specified, defaults to "social". ======================= ======================================================= In addition, you can use the "wide" version of the ``notmyidea`` theme by diff --git a/pelican/tests/output/custom/a-markdown-powered-article.html b/pelican/tests/output/custom/a-markdown-powered-article.html index 59ffa4d1..6ccc6c42 100644 --- a/pelican/tests/output/custom/a-markdown-powered-article.html +++ b/pelican/tests/output/custom/a-markdown-powered-article.html @@ -71,7 +71,7 @@
    -

    blogroll

    +

    links

    • Biologeek
    • Filyb
    • diff --git a/pelican/tests/output/custom/archives.html b/pelican/tests/output/custom/archives.html index e238b73d..c256b7de 100644 --- a/pelican/tests/output/custom/archives.html +++ b/pelican/tests/output/custom/archives.html @@ -56,7 +56,7 @@
    -

    blogroll

    +

    links

    • Biologeek
    • Filyb
    • diff --git a/pelican/tests/output/custom/article-1.html b/pelican/tests/output/custom/article-1.html index 1fbd6719..33cf3a5f 100644 --- a/pelican/tests/output/custom/article-1.html +++ b/pelican/tests/output/custom/article-1.html @@ -70,7 +70,7 @@
    -

    blogroll

    +

    links

    • Biologeek
    • Filyb
    • diff --git a/pelican/tests/output/custom/article-2.html b/pelican/tests/output/custom/article-2.html index d62ddd14..8c8e47eb 100644 --- a/pelican/tests/output/custom/article-2.html +++ b/pelican/tests/output/custom/article-2.html @@ -70,7 +70,7 @@
    -

    blogroll

    +

    links

    • Biologeek
    • Filyb
    • diff --git a/pelican/tests/output/custom/article-3.html b/pelican/tests/output/custom/article-3.html index c862a0c2..773b89e0 100644 --- a/pelican/tests/output/custom/article-3.html +++ b/pelican/tests/output/custom/article-3.html @@ -70,7 +70,7 @@
    -

    blogroll

    +

    links

    • Biologeek
    • Filyb
    • diff --git a/pelican/tests/output/custom/author/alexis-metaireau.html b/pelican/tests/output/custom/author/alexis-metaireau.html index cbeb0555..d6521a5e 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau.html +++ b/pelican/tests/output/custom/author/alexis-metaireau.html @@ -129,7 +129,7 @@
    -

    blogroll

    +

    links

    • Biologeek
    • Filyb
    • diff --git a/pelican/tests/output/custom/author/alexis-metaireau2.html b/pelican/tests/output/custom/author/alexis-metaireau2.html index 6357bfb3..2101719b 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau2.html +++ b/pelican/tests/output/custom/author/alexis-metaireau2.html @@ -143,7 +143,7 @@ YEAH !

    -

    blogroll

    +

    links

    • Biologeek
    • Filyb
    • diff --git a/pelican/tests/output/custom/author/alexis-metaireau3.html b/pelican/tests/output/custom/author/alexis-metaireau3.html index 3ca4dd0d..d531fd1e 100644 --- a/pelican/tests/output/custom/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom/author/alexis-metaireau3.html @@ -94,7 +94,7 @@ pelican.conf, it will ...

    -

    blogroll

    +

    links

    • Biologeek
    • Filyb
    • diff --git a/pelican/tests/output/custom/authors.html b/pelican/tests/output/custom/authors.html index f157de26..6539b3e9 100644 --- a/pelican/tests/output/custom/authors.html +++ b/pelican/tests/output/custom/authors.html @@ -38,7 +38,7 @@
      -

      blogroll

      +

      links

      • Biologeek
      • Filyb
      • diff --git a/pelican/tests/output/custom/categories.html b/pelican/tests/output/custom/categories.html index ddb1377b..17f44be7 100644 --- a/pelican/tests/output/custom/categories.html +++ b/pelican/tests/output/custom/categories.html @@ -36,7 +36,7 @@
      -

      blogroll

      +

      links

      • Biologeek
      • Filyb
      • diff --git a/pelican/tests/output/custom/category/bar.html b/pelican/tests/output/custom/category/bar.html index 9666d2e2..79803b1a 100644 --- a/pelican/tests/output/custom/category/bar.html +++ b/pelican/tests/output/custom/category/bar.html @@ -54,7 +54,7 @@ YEAH !

        -

        blogroll

        +

        links

        • Biologeek
        • Filyb
        • diff --git a/pelican/tests/output/custom/category/cat1.html b/pelican/tests/output/custom/category/cat1.html index d9132d10..0230ac2f 100644 --- a/pelican/tests/output/custom/category/cat1.html +++ b/pelican/tests/output/custom/category/cat1.html @@ -123,7 +123,7 @@
        -

        blogroll

        +

        links

        • Biologeek
        • Filyb
        • diff --git a/pelican/tests/output/custom/category/misc.html b/pelican/tests/output/custom/category/misc.html index b705a552..abe32c8d 100644 --- a/pelican/tests/output/custom/category/misc.html +++ b/pelican/tests/output/custom/category/misc.html @@ -134,7 +134,7 @@ pelican.conf, it will ...

        -

        blogroll

        +

        links

        • Biologeek
        • Filyb
        • diff --git a/pelican/tests/output/custom/category/yeah.html b/pelican/tests/output/custom/category/yeah.html index 6d94c9ad..d22bb9f8 100644 --- a/pelican/tests/output/custom/category/yeah.html +++ b/pelican/tests/output/custom/category/yeah.html @@ -62,7 +62,7 @@
          -

          blogroll

          +

          links

          • Biologeek
          • Filyb
          • diff --git a/pelican/tests/output/custom/drafts/a-draft-article.html b/pelican/tests/output/custom/drafts/a-draft-article.html index 963722f6..ba424259 100644 --- a/pelican/tests/output/custom/drafts/a-draft-article.html +++ b/pelican/tests/output/custom/drafts/a-draft-article.html @@ -56,7 +56,7 @@ listed anywhere else.

          -

          blogroll

          +

          links

          • Biologeek
          • Filyb
          • diff --git a/pelican/tests/output/custom/filename_metadata-example.html b/pelican/tests/output/custom/filename_metadata-example.html index cf4fc782..c4977f63 100644 --- a/pelican/tests/output/custom/filename_metadata-example.html +++ b/pelican/tests/output/custom/filename_metadata-example.html @@ -70,7 +70,7 @@
          -

          blogroll

          +

          links

          • Biologeek
          • Filyb
          • diff --git a/pelican/tests/output/custom/index.html b/pelican/tests/output/custom/index.html index 284bd0f4..87af6a06 100644 --- a/pelican/tests/output/custom/index.html +++ b/pelican/tests/output/custom/index.html @@ -129,7 +129,7 @@
          -

          blogroll

          +

          links

          • Biologeek
          • Filyb
          • diff --git a/pelican/tests/output/custom/index2.html b/pelican/tests/output/custom/index2.html index 7e5b7230..0c457a65 100644 --- a/pelican/tests/output/custom/index2.html +++ b/pelican/tests/output/custom/index2.html @@ -143,7 +143,7 @@ YEAH !

          -

          blogroll

          +

          links

          • Biologeek
          • Filyb
          • diff --git a/pelican/tests/output/custom/index3.html b/pelican/tests/output/custom/index3.html index b968b7e8..523288c5 100644 --- a/pelican/tests/output/custom/index3.html +++ b/pelican/tests/output/custom/index3.html @@ -94,7 +94,7 @@ pelican.conf, it will ...

          -

          blogroll

          +

          links

          • Biologeek
          • Filyb
          • diff --git a/pelican/tests/output/custom/jinja2_template.html b/pelican/tests/output/custom/jinja2_template.html index 21f678f9..a098ed49 100644 --- a/pelican/tests/output/custom/jinja2_template.html +++ b/pelican/tests/output/custom/jinja2_template.html @@ -33,7 +33,7 @@ Some text
            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/oh-yeah-fr.html b/pelican/tests/output/custom/oh-yeah-fr.html index d457b1bf..9f56f27b 100644 --- a/pelican/tests/output/custom/oh-yeah-fr.html +++ b/pelican/tests/output/custom/oh-yeah-fr.html @@ -72,7 +72,7 @@ Translations:
            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/oh-yeah.html b/pelican/tests/output/custom/oh-yeah.html index 235a4903..caddf53c 100644 --- a/pelican/tests/output/custom/oh-yeah.html +++ b/pelican/tests/output/custom/oh-yeah.html @@ -77,7 +77,7 @@ YEAH !

            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/override/index.html b/pelican/tests/output/custom/override/index.html index 3753ba84..8ab5f7eb 100644 --- a/pelican/tests/output/custom/override/index.html +++ b/pelican/tests/output/custom/override/index.html @@ -37,7 +37,7 @@ at a custom location.

            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/pages/this-is-a-test-hidden-page.html b/pelican/tests/output/custom/pages/this-is-a-test-hidden-page.html index f8c06b1f..41beb5a3 100644 --- a/pelican/tests/output/custom/pages/this-is-a-test-hidden-page.html +++ b/pelican/tests/output/custom/pages/this-is-a-test-hidden-page.html @@ -37,7 +37,7 @@ Anyone can see this page but it's not linked to anywhere!

            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/pages/this-is-a-test-page.html b/pelican/tests/output/custom/pages/this-is-a-test-page.html index a4b171c9..b548b52c 100644 --- a/pelican/tests/output/custom/pages/this-is-a-test-page.html +++ b/pelican/tests/output/custom/pages/this-is-a-test-page.html @@ -37,7 +37,7 @@
            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/second-article-fr.html b/pelican/tests/output/custom/second-article-fr.html index 42289377..9ada2475 100644 --- a/pelican/tests/output/custom/second-article-fr.html +++ b/pelican/tests/output/custom/second-article-fr.html @@ -72,7 +72,7 @@
            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/second-article.html b/pelican/tests/output/custom/second-article.html index 689b1203..f2d9ffa4 100644 --- a/pelican/tests/output/custom/second-article.html +++ b/pelican/tests/output/custom/second-article.html @@ -72,7 +72,7 @@
            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/tag/bar.html b/pelican/tests/output/custom/tag/bar.html index f462ffbd..b15860f1 100644 --- a/pelican/tests/output/custom/tag/bar.html +++ b/pelican/tests/output/custom/tag/bar.html @@ -113,7 +113,7 @@ YEAH !

            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/tag/baz.html b/pelican/tests/output/custom/tag/baz.html index 2c9b1d08..a581e319 100644 --- a/pelican/tests/output/custom/tag/baz.html +++ b/pelican/tests/output/custom/tag/baz.html @@ -70,7 +70,7 @@
            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/tag/foo.html b/pelican/tests/output/custom/tag/foo.html index 9c58956b..36282dd7 100644 --- a/pelican/tests/output/custom/tag/foo.html +++ b/pelican/tests/output/custom/tag/foo.html @@ -83,7 +83,7 @@ as well as inline markup.

            -

            blogroll

            +

            links

            • Biologeek
            • Filyb
            • diff --git a/pelican/tests/output/custom/tag/foobar.html b/pelican/tests/output/custom/tag/foobar.html index 7d17d1fb..ab84124c 100644 --- a/pelican/tests/output/custom/tag/foobar.html +++ b/pelican/tests/output/custom/tag/foobar.html @@ -62,7 +62,7 @@
              -

              blogroll

              +

              links

              • Biologeek
              • Filyb
              • diff --git a/pelican/tests/output/custom/tag/oh.html b/pelican/tests/output/custom/tag/oh.html index 855d1f8b..c7f9701d 100644 --- a/pelican/tests/output/custom/tag/oh.html +++ b/pelican/tests/output/custom/tag/oh.html @@ -36,7 +36,7 @@
              -

              blogroll

              +

              links

              • Biologeek
              • Filyb
              • diff --git a/pelican/tests/output/custom/tag/yeah.html b/pelican/tests/output/custom/tag/yeah.html index e3c765fa..c14f1f47 100644 --- a/pelican/tests/output/custom/tag/yeah.html +++ b/pelican/tests/output/custom/tag/yeah.html @@ -54,7 +54,7 @@ YEAH !

                -

                blogroll

                +

                links

                • Biologeek
                • Filyb
                • diff --git a/pelican/tests/output/custom/tags.html b/pelican/tests/output/custom/tags.html index 23f70c0f..9d3e2bdf 100644 --- a/pelican/tests/output/custom/tags.html +++ b/pelican/tests/output/custom/tags.html @@ -43,7 +43,7 @@
                  -

                  blogroll

                  +

                  links

                  • Biologeek
                  • Filyb
                  • diff --git a/pelican/tests/output/custom/this-is-a-super-article.html b/pelican/tests/output/custom/this-is-a-super-article.html index e370769c..a36bf412 100644 --- a/pelican/tests/output/custom/this-is-a-super-article.html +++ b/pelican/tests/output/custom/this-is-a-super-article.html @@ -85,7 +85,7 @@
                  -

                  blogroll

                  +

                  links

                  • Biologeek
                  • Filyb
                  • diff --git a/pelican/tests/output/custom/unbelievable.html b/pelican/tests/output/custom/unbelievable.html index 2e51cf07..77a16a8d 100644 --- a/pelican/tests/output/custom/unbelievable.html +++ b/pelican/tests/output/custom/unbelievable.html @@ -102,7 +102,7 @@ pelican.conf, it will have nothing in default.

                  -

                  blogroll

                  +

                  links

                  • Biologeek
                  • Filyb
                  • diff --git a/pelican/tests/output/custom_locale/archives.html b/pelican/tests/output/custom_locale/archives.html index 68b46b14..ed375051 100644 --- a/pelican/tests/output/custom_locale/archives.html +++ b/pelican/tests/output/custom_locale/archives.html @@ -56,7 +56,7 @@
                  -

                  blogroll

                  +

                  links

                  • Biologeek
                  • Filyb
                  • diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau.html b/pelican/tests/output/custom_locale/author/alexis-metaireau.html index f8b36655..299578cf 100644 --- a/pelican/tests/output/custom_locale/author/alexis-metaireau.html +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau.html @@ -129,7 +129,7 @@
                  -

                  blogroll

                  +

                  links

                  • Biologeek
                  • Filyb
                  • diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau2.html b/pelican/tests/output/custom_locale/author/alexis-metaireau2.html index 5d9e6c3c..6f3a0b71 100644 --- a/pelican/tests/output/custom_locale/author/alexis-metaireau2.html +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau2.html @@ -143,7 +143,7 @@ YEAH !

                  -

                  blogroll

                  +

                  links

                  • Biologeek
                  • Filyb
                  • diff --git a/pelican/tests/output/custom_locale/author/alexis-metaireau3.html b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html index 2fea24c3..6eb5645e 100644 --- a/pelican/tests/output/custom_locale/author/alexis-metaireau3.html +++ b/pelican/tests/output/custom_locale/author/alexis-metaireau3.html @@ -94,7 +94,7 @@ pelican.conf, it will ...

                  -

                  blogroll

                  +

                  links

                  • Biologeek
                  • Filyb
                  • diff --git a/pelican/tests/output/custom_locale/authors.html b/pelican/tests/output/custom_locale/authors.html index 91ea479d..5cd227d9 100644 --- a/pelican/tests/output/custom_locale/authors.html +++ b/pelican/tests/output/custom_locale/authors.html @@ -38,7 +38,7 @@
                    -

                    blogroll

                    +

                    links

                    • Biologeek
                    • Filyb
                    • diff --git a/pelican/tests/output/custom_locale/categories.html b/pelican/tests/output/custom_locale/categories.html index ddb1377b..17f44be7 100644 --- a/pelican/tests/output/custom_locale/categories.html +++ b/pelican/tests/output/custom_locale/categories.html @@ -36,7 +36,7 @@
                    -

                    blogroll

                    +

                    links

                    • Biologeek
                    • Filyb
                    • diff --git a/pelican/tests/output/custom_locale/category/bar.html b/pelican/tests/output/custom_locale/category/bar.html index c416b358..2aeef95c 100644 --- a/pelican/tests/output/custom_locale/category/bar.html +++ b/pelican/tests/output/custom_locale/category/bar.html @@ -54,7 +54,7 @@ YEAH !

                      -

                      blogroll

                      +

                      links

                      • Biologeek
                      • Filyb
                      • diff --git a/pelican/tests/output/custom_locale/category/cat1.html b/pelican/tests/output/custom_locale/category/cat1.html index 871b2e3f..48c3ba18 100644 --- a/pelican/tests/output/custom_locale/category/cat1.html +++ b/pelican/tests/output/custom_locale/category/cat1.html @@ -123,7 +123,7 @@
                      -

                      blogroll

                      +

                      links

                      • Biologeek
                      • Filyb
                      • diff --git a/pelican/tests/output/custom_locale/category/misc.html b/pelican/tests/output/custom_locale/category/misc.html index f44f725d..d977a4cc 100644 --- a/pelican/tests/output/custom_locale/category/misc.html +++ b/pelican/tests/output/custom_locale/category/misc.html @@ -134,7 +134,7 @@ pelican.conf, it will ...

                      -

                      blogroll

                      +

                      links

                      • Biologeek
                      • Filyb
                      • diff --git a/pelican/tests/output/custom_locale/category/yeah.html b/pelican/tests/output/custom_locale/category/yeah.html index c5e6c7f0..a00e2028 100644 --- a/pelican/tests/output/custom_locale/category/yeah.html +++ b/pelican/tests/output/custom_locale/category/yeah.html @@ -62,7 +62,7 @@
                        -

                        blogroll

                        +

                        links

                        • Biologeek
                        • Filyb
                        • diff --git a/pelican/tests/output/custom_locale/drafts/a-draft-article.html b/pelican/tests/output/custom_locale/drafts/a-draft-article.html index dfd4f00e..c1817e25 100644 --- a/pelican/tests/output/custom_locale/drafts/a-draft-article.html +++ b/pelican/tests/output/custom_locale/drafts/a-draft-article.html @@ -56,7 +56,7 @@ listed anywhere else.

                        -

                        blogroll

                        +

                        links

                        • Biologeek
                        • Filyb
                        • diff --git a/pelican/tests/output/custom_locale/index.html b/pelican/tests/output/custom_locale/index.html index 3ad201de..f1174c31 100644 --- a/pelican/tests/output/custom_locale/index.html +++ b/pelican/tests/output/custom_locale/index.html @@ -129,7 +129,7 @@
                        -

                        blogroll

                        +

                        links

                        • Biologeek
                        • Filyb
                        • diff --git a/pelican/tests/output/custom_locale/index2.html b/pelican/tests/output/custom_locale/index2.html index bbd1efd0..286ff9c3 100644 --- a/pelican/tests/output/custom_locale/index2.html +++ b/pelican/tests/output/custom_locale/index2.html @@ -143,7 +143,7 @@ YEAH !

                        -

                        blogroll

                        +

                        links

                        • Biologeek
                        • Filyb
                        • diff --git a/pelican/tests/output/custom_locale/index3.html b/pelican/tests/output/custom_locale/index3.html index 926bc25e..c30b7bb3 100644 --- a/pelican/tests/output/custom_locale/index3.html +++ b/pelican/tests/output/custom_locale/index3.html @@ -94,7 +94,7 @@ pelican.conf, it will ...

                        -

                        blogroll

                        +

                        links

                        • Biologeek
                        • Filyb
                        • diff --git a/pelican/tests/output/custom_locale/jinja2_template.html b/pelican/tests/output/custom_locale/jinja2_template.html index 21f678f9..a098ed49 100644 --- a/pelican/tests/output/custom_locale/jinja2_template.html +++ b/pelican/tests/output/custom_locale/jinja2_template.html @@ -33,7 +33,7 @@ Some text
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/oh-yeah-fr.html b/pelican/tests/output/custom_locale/oh-yeah-fr.html index f5cae7cf..33e05c3b 100644 --- a/pelican/tests/output/custom_locale/oh-yeah-fr.html +++ b/pelican/tests/output/custom_locale/oh-yeah-fr.html @@ -72,7 +72,7 @@ Translations:
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/override/index.html b/pelican/tests/output/custom_locale/override/index.html index 3753ba84..8ab5f7eb 100644 --- a/pelican/tests/output/custom_locale/override/index.html +++ b/pelican/tests/output/custom_locale/override/index.html @@ -37,7 +37,7 @@ at a custom location.

                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html b/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html index f8c06b1f..41beb5a3 100644 --- a/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html +++ b/pelican/tests/output/custom_locale/pages/this-is-a-test-hidden-page.html @@ -37,7 +37,7 @@ Anyone can see this page but it's not linked to anywhere!

                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html b/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html index a4b171c9..b548b52c 100644 --- a/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html +++ b/pelican/tests/output/custom_locale/pages/this-is-a-test-page.html @@ -37,7 +37,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html b/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html index def80358..b7018b64 100644 --- a/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html +++ b/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html @@ -85,7 +85,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html b/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html index a6ea8699..3c364ffc 100644 --- a/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html +++ b/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html @@ -102,7 +102,7 @@ pelican.conf, it will have nothing in default.

                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html b/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html index 59fd6edd..3ec06207 100644 --- a/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html +++ b/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html @@ -77,7 +77,7 @@ YEAH !

                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html b/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html index e6d585ff..81421b37 100644 --- a/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html +++ b/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html @@ -71,7 +71,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html index d768e15f..64bab330 100644 --- a/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html @@ -70,7 +70,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html index b223473a..60de5faa 100644 --- a/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html @@ -70,7 +70,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html index 3bd59fa5..13aa5797 100644 --- a/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html @@ -70,7 +70,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html b/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html index aff4d61f..9608314f 100644 --- a/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html +++ b/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html @@ -72,7 +72,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html b/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html index 659004bd..9b3df468 100644 --- a/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html +++ b/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html @@ -70,7 +70,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/second-article-fr.html b/pelican/tests/output/custom_locale/second-article-fr.html index 79fb5406..dc17237f 100644 --- a/pelican/tests/output/custom_locale/second-article-fr.html +++ b/pelican/tests/output/custom_locale/second-article-fr.html @@ -72,7 +72,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/tag/bar.html b/pelican/tests/output/custom_locale/tag/bar.html index c1f33e64..12f368aa 100644 --- a/pelican/tests/output/custom_locale/tag/bar.html +++ b/pelican/tests/output/custom_locale/tag/bar.html @@ -113,7 +113,7 @@ YEAH !

                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/tag/baz.html b/pelican/tests/output/custom_locale/tag/baz.html index 597199e7..8a2c1c31 100644 --- a/pelican/tests/output/custom_locale/tag/baz.html +++ b/pelican/tests/output/custom_locale/tag/baz.html @@ -70,7 +70,7 @@
                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/tag/foo.html b/pelican/tests/output/custom_locale/tag/foo.html index 288f1768..c08baed4 100644 --- a/pelican/tests/output/custom_locale/tag/foo.html +++ b/pelican/tests/output/custom_locale/tag/foo.html @@ -83,7 +83,7 @@ as well as inline markup.

                          -

                          blogroll

                          +

                          links

                          • Biologeek
                          • Filyb
                          • diff --git a/pelican/tests/output/custom_locale/tag/foobar.html b/pelican/tests/output/custom_locale/tag/foobar.html index 59dcede1..42bb1325 100644 --- a/pelican/tests/output/custom_locale/tag/foobar.html +++ b/pelican/tests/output/custom_locale/tag/foobar.html @@ -62,7 +62,7 @@
                            -

                            blogroll

                            +

                            links

                            • Biologeek
                            • Filyb
                            • diff --git a/pelican/tests/output/custom_locale/tag/oh.html b/pelican/tests/output/custom_locale/tag/oh.html index 855d1f8b..c7f9701d 100644 --- a/pelican/tests/output/custom_locale/tag/oh.html +++ b/pelican/tests/output/custom_locale/tag/oh.html @@ -36,7 +36,7 @@
                            -

                            blogroll

                            +

                            links

                            • Biologeek
                            • Filyb
                            • diff --git a/pelican/tests/output/custom_locale/tag/yeah.html b/pelican/tests/output/custom_locale/tag/yeah.html index 4dc36ce5..581c67c0 100644 --- a/pelican/tests/output/custom_locale/tag/yeah.html +++ b/pelican/tests/output/custom_locale/tag/yeah.html @@ -54,7 +54,7 @@ YEAH !

                              -

                              blogroll

                              +

                              links

                              • Biologeek
                              • Filyb
                              • diff --git a/pelican/tests/output/custom_locale/tags.html b/pelican/tests/output/custom_locale/tags.html index aa182ab6..59a36ace 100644 --- a/pelican/tests/output/custom_locale/tags.html +++ b/pelican/tests/output/custom_locale/tags.html @@ -43,7 +43,7 @@
                                -

                                blogroll

                                +

                                links

                                • Biologeek
                                • Filyb
                                • diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 188715d4..7818c235 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -41,7 +41,7 @@
                                  {% if LINKS %}
                                  -

                                  blogroll

                                  +

                                  {{ LINKS_WIDGET_NAME | default('links') }}

                                    {% for name, link in LINKS %}
                                  • {{ name }}
                                  • @@ -51,7 +51,7 @@ {% endif %} {% if SOCIAL or FEED_ALL_ATOM or FEED_ALL_RSS %}
                                  + +
                                + +