Add a --setting-overrides KEY=VAL command line option to override
default settings or those defined in settings files. This adds
flexibility in running Pelican and helps reduce sprawl of settings
files. Cast int and str setting overrides to their respective types.
Support other setting types by treating them as JSON. Fall back to JSON
when an override typecast errors. This should make it possible to set
int values to None, resp. to JSON 'none'
Python special cases single Mapping arguments to logging. This
adjusts BaseFormatter to skip "fancy" formatting if argument
is of type Mapping. Also adds various formatted log outputs.
Combined file and folder watchers under a class and refactored
common watcher related code from __init__.py to the class.
This simplifies the main and autoreload functions in __init__
as well as fix the problem with crashes related to multiprocessing
on systems where default spawn mode is "spawn" instead of "fork".
- pytest: verbose isn't needed but show skipped tests
- mock is not needed anymore. it is part of stdlib
- Unpin Sphinx and fix warning about lexer
- Mirror tox command for doc build in tasks.py
Sets the `modified:` metadata from `date:` if the user asked us
to use the filesystem for determining timestamps. Fixes#2497
* Added tests (ab)using the HTML reader a bit
There seems to be no way to test this generically since we need
to produce a valid document with meta information to be able to
compare, hence I used the lightest reader out there to do the
parsing of the samples.
* Fixed tests for generators since there were 4 more articles
introduced to the test content directory.
TestArticle was a subclass of TestPage and therefore included all
the tests TestPage already had. Effectively tests from TestPage
were run twice. This splits the common parts of TestPage to a
base class called TestBase and TestPage/TestArticle will both
inherit from it.
Adds a use_unicode kwarg to slugify to keep unicode
characters as is (no ASCII-fying) and add tests for
it. Also reworks how slugification logic.
slugify started with the Django method for slugiying:
- Normalize to compatibility decomposed from (NFKD)
- Encode and decode with 'ascii'
This works fine if the decomposed form contains ASCII
characters (i.e. ç can be changed in to c+CEDILLA and
ASCII would keep c only), but fails when decomposition
doesn't result in ASCII characters (i.e. Chinese). To
solve that 'unidecode' was added, which works fine for
both cases. However, old method is now redundant but
was kept. This commit removes the old method and
adjusts logic slightly.
Now slugify will normalize all text with composition
mode (NFKC) to unify format for regex substitutions.
And then if use_unicode is False, uses unidecode to
convert it to ASCII.
Calling read_settings to clear the options put into
pelican.settings.PYGMENTS_RST_OPTIONS in tearDown so
that tests that are run after are not affected
Adds a `preserve_case` parameter to the `slugify()` function and uses it
to preserve capital letters in category names when using the Pelican
importer.
This reduces the warnings and errors when generating the sample content
from twelve to one (intentional) warning. The latter is expected by
assertLogCountEqual() in the "test_basic_generation_works" test.
* Creates pelican.plugins
* Moves plugin related code under pelican.plugins
* pelican.plugins.signals is now the location for signals, pelican.signals is kept
for backwards compatibility
* pelican.plugins._utils contains necessary bits for plugin discovery and loading.
Logic from Pelican class is moved here. Pelican class now just asks for plugins
and registers them
* Contains tests for old and new plugin loading
This commit removes Six as a dependency for Pelican, replacing the
relevant aliases with the proper Python 3 imports. It also removes
references to Python 2 logic that did not require Six.