Commit graph

2,195 commits

Author SHA1 Message Date
Ondrej Grover
4fc448ac0d 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.
2014-06-28 16:18:46 -07:00
Justin Mayer
4239b47b83 Remove errant backtick 2014-06-28 16:18:46 -07:00
Ondrej Grover
9e6c669949 Fix get_writer signal received result unpacking 2014-06-28 16:18:46 -07:00
Justin Mayer
0d3687866a Remove errant leading spaces from fabfile.py.in 2014-06-28 16:18:46 -07:00
Justin Mayer
01a0e727e3 Show setting defaults as actual code
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.
2014-06-28 16:18:46 -07:00
Justin Mayer
4c1009e59c Add Python 3.4 to Travic CI configuration 2014-06-28 16:18:46 -07:00
Ondrej Grover
91d4202a68 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.
2014-06-28 16:18:46 -07:00
Ondrej Grover
9d5b2e9489 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.
2014-06-28 16:18:45 -07:00
Ondrej Grover
b3fe098c00 Fix #1311 wide tables in RTD theme, remove old theme files
This works by adding a CSS overrides file to the Sphinx app stylesheets.
2014-06-28 16:18:45 -07:00
Ondrej Grover
3b7189ec8a add get_writer signal and unify with get_generators
Fix outdated docs of get_generators to unify.
2014-06-28 16:18:45 -07:00
Ondrej Grover
a03881fd97 use correct CachingGenerator class in super() call
This was a leftover from code moving in c1324b0.
Detected by pylint.
2014-06-28 16:18:45 -07:00
Bernhard Scheirle
de3ed6c1ef send the static_generator_{init, finalized} signals.
Note: The two signals were already present but were never sent.
2014-06-28 16:18:45 -07:00
Ondrej Grover
3e12f40b08 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
2014-06-28 16:18:45 -07:00
Shauna
55cab63714 Add feeds for each author 2014-06-28 16:18:45 -07:00
Tastalian
5c317329b3 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.
2014-06-28 16:18:45 -07:00
Justin Mayer
be22bc807c Text tweaks for "PLUGIN_PATH as list" feature 2014-06-28 16:18:45 -07:00
Lonewolf
2f916d0154 Ability to specify PLUGIN_PATH as list
PLUGIN_PATH added to settings table
2014-06-28 16:18:45 -07:00
James Lee
e046f59ce2 Handle list metadata as list of string in MarkdownReader 2014-06-28 16:18:45 -07:00
Ondrej Grover
75feec21d6 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.
2014-06-28 16:18:45 -07:00
Simon Conseil
f1a93d68fb Add python 3.4 to tox config. 2014-06-28 16:18:45 -07:00
Ondrej Grover
23c1f2f3d0 enable writing of only selected output paths
- add WRITE_SELECTED setting
- add --write-selected commandline option
2014-06-28 16:18:45 -07:00
Antoine Brenner
cb17f11d9b Test to reproduce an issue that occurs with python3.3 under macos10 only
This test passes fine under linux
2014-06-28 16:18:44 -07:00
Justin Mayer
60905163c8 Fix settings table in docs 2014-06-28 16:18:44 -07:00
Antoine Brenner
b9a647547b Make sure locale is what we want before/after the tests
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.
2014-06-28 16:18:44 -07:00
Antoine Brenner
103e8e293a 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
2014-06-28 16:18:44 -07:00
Lonewolf
900fa755ba Added new sphinxtheme as requirement for docs Modified docs conf to support the theme update 2014-06-28 16:18:44 -07:00
Federico Ceratto
d0aa16e854 Add s3cmd MIME type detection 2014-06-28 16:18:44 -07:00
Ondrej Grover
6c06ee9e5b 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.
2014-06-28 16:18:44 -07:00
Antoine Brenner
8b022b3508 Fix error in download_attachments() triggered by python2 unit test
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
2014-06-28 16:18:44 -07:00
Justin Mayer
dafa2c36b1 Minor text changes to log message limitation 2014-06-28 16:18:44 -07:00
Antoine Brenner
9ca86adffc 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)
2014-06-28 16:18:44 -07:00
Justin Mayer
3b9564b069 Minor correction to settings documentation 2014-06-28 16:18:44 -07:00
Justin Mayer
a14b432084 Fix deprecated logger warning for Python 3
logger.warn() has been deprecated in Python 3 in favor of logger.warning()
2014-06-28 16:18:44 -07:00
Rogdham
1fb04bfc21 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).
2014-06-28 16:18:44 -07:00
Helmut Grohne
cb4b2e7dfa 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.
2014-06-28 16:18:44 -07:00
Justin Mayer
da5849d1a0 Fix docs last_stable version and copyright date 2014-06-28 16:18:44 -07:00
th3aftermath
715b9eae68 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.
2014-06-28 16:18:43 -07:00
Jean Lauliac
3779306de5 Apply typogrify on article summary as well 2014-06-28 16:18:43 -07:00
th3aftermath
7baeb6f70b 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.
2014-06-28 16:18:43 -07:00
th3aftermath
6533f803b7 Add the setting SLUGIFY_ATTRIBUTE 2014-06-28 16:18:43 -07:00
Justin Mayer
49a0559912 Minor improvements to Settings docs 2014-06-28 16:18:43 -07:00
Stefan hr Berder
fde856ec45 add lang support for drafts (#826 & #1107)
Fix #826
Fix #1107
2014-06-28 16:18:43 -07:00
Stefan hr Berder
656e85a2dd change date metadata parsing to dateutil.parser 2014-06-28 16:18:43 -07:00
Ben Bridts
a8c772289a Split multiple authors on ',' 2014-06-28 16:18:43 -07:00
Mario Lang
c3a8d80f42 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<>".)
2014-06-28 16:18:43 -07:00
Mario Lang
d4c3b616a9 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.
2014-06-28 16:18:43 -07:00
Mario Lang
66441e0efb Fix stray </ol> and </section> if only one article is displayed.
We already check if loop.length > 1 before outputting <section> and <ol>
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.
2014-06-28 16:18:43 -07:00
Mario Lang
43f8c2c246 HTML error in notmyidea: <li> not allowed in <section>.
<li> tags need to be inside of <ul> or <ol>.
Thanks to the w3c_validate plugin for finding this.
2014-06-28 16:18:43 -07:00
Justin Mayer
47ec2bc4a4 Add squashing to CONTRIBUTING docs. Fix URLs. 2014-06-28 16:18:43 -07:00
Rob Kennedy
cba5a888ac Allow socket address reuse; fixed #1264
The socket may remain in the TIME_WAIT state for some time after the
server shuts down, which prevents another instance of the server from
listening on the same port. This change allows the server to reuse the
address even when it's still waiting.
2014-06-28 16:18:43 -07:00