From 9ae32b8ff92b98c3baa04e5f92a590a7160b087a Mon Sep 17 00:00:00 2001 From: Oliver Urs Lenz Date: Sat, 24 Nov 2018 21:59:40 +0100 Subject: [PATCH 001/143] Try importing from collections.abc for compatibility with Python 3.8 --- pelican/__init__.py | 5 ++++- pelican/log.py | 6 +++++- pelican/utils.py | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index c05f560c..0a5080c3 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -2,7 +2,10 @@ from __future__ import print_function, unicode_literals import argparse -import collections +try: + import collections.abc as collections +except ImportError: + import collections import locale import logging import multiprocessing diff --git a/pelican/log.py b/pelican/log.py index e7a6f317..6f353264 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -5,7 +5,11 @@ import locale import logging import os import sys -from collections import Mapping, defaultdict +from collections import defaultdict +try: + from collections.abc import Mapping +except ImportError: + from collections import Mapping import six diff --git a/pelican/utils.py b/pelican/utils.py index 50d428a5..8ed08c2c 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -12,7 +12,10 @@ import re import shutil import sys import traceback -from collections import Hashable +try: + from collections.abc import Hashable +except ImportError: + from collections import Hashable from contextlib import contextmanager from functools import partial from itertools import groupby From 497271ea7ea9fe8c35ab112a9e4cdc209215a3a5 Mon Sep 17 00:00:00 2001 From: Bryan Brattlof Date: Fri, 23 Nov 2018 16:20:31 -0600 Subject: [PATCH 002/143] List files missing tag needed to order content --- pelican/utils.py | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/pelican/utils.py b/pelican/utils.py index 50d428a5..32f508ae 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -763,9 +763,19 @@ def order_content(content_list, order_by='slug'): content_list.sort(key=attrgetter(order_by), reverse=order_reversed) except AttributeError: - logger.warning( - 'There is no "%s" attribute in the item ' - 'metadata. Defaulting to slug order.', order_by) + for content in content_list: + try: + getattr(content, order_by) + except AttributeError: + logger.warning( + 'There is no "%s" attribute in "%s". ' + 'Defaulting to slug order.', + order_by, + content.get_relative_source_path(), + extra={ + 'limit_msg': ('More files are missing ' + 'the needed attribute.') + }) else: logger.warning( 'Invalid *_ORDER_BY setting (%s).' From 58be4f0e042f152753640b44e545d25d4c1011b2 Mon Sep 17 00:00:00 2001 From: Jorge Maldonado Ventura Date: Wed, 2 Jan 2019 13:13:16 +0100 Subject: [PATCH 003/143] Fix warning message Add space between words 'static' and 'content' --- pelican/contents.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index ccd38fe0..efaeb0a3 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -281,7 +281,7 @@ class Content(object): if linked_content: logger.warning( '{filename} used for linking to static' - 'content %s in %s. Use {static} instead', + ' content %s in %s. Use {static} instead', path, self.get_relative_source_path()) return linked_content From 9ffaaa16f87b12a011282ef026d42c8ebae914e8 Mon Sep 17 00:00:00 2001 From: Patrick <4002194+askpatrickw@users.noreply.github.com> Date: Mon, 21 Jan 2019 17:45:13 -0800 Subject: [PATCH 004/143] Move feedburner config to wiki Fixes #2386 https://github.com/getpelican/pelican/wiki/FeedBurner-Configuration --- docs/settings.rst | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 640d0571..b821cc2e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -954,27 +954,6 @@ variables to ``None``. .. [2] ``{slug}`` is replaced by name of the category / author / tag. -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_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``. - - Pagination ========== From 583c0d4e171fcc02c642270a49a737b63cc06342 Mon Sep 17 00:00:00 2001 From: Boian Berberov Date: Wed, 13 Mar 2019 17:00:21 -0600 Subject: [PATCH 005/143] Change TEMPLATE_EXTENSION to TEMPLATE_EXTENSIONS in documentation --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 3652788b..53b10053 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -736,7 +736,7 @@ Template pages 'src/resume.html': 'dest/resume.html', 'src/contact.html': 'dest/contact.html'} -.. data:: TEMPLATE_EXTENSION = ['.html'] +.. data:: TEMPLATE_EXTENSIONS = ['.html'] The extensions to use when looking up template files from template names. From de237e365a9c62daa22fc4ad28850025ae15801c Mon Sep 17 00:00:00 2001 From: Boian Berberov Date: Tue, 19 Mar 2019 20:56:44 -0600 Subject: [PATCH 006/143] Remove redundant text and reorder settings for consistency - Remove redundant `YEAR`, `MONTH`, and `DAY` `_ARCHIVE_SAVE_AS` sections - Move `AUTHOR_URL` and `AUTHOR_SAVE_AS` to match `AUTHOR`, `CATEGORY`, `TAG` order throughout the rest of the document - Move `YEAR`, `MONTH`, and `DAY` `_ARCHIVE_URL` and `_ARCHIVE_SAVE_AS` sections below paragraph describing them; and match ( `_URL`, `_SAVE_AS` ) order throughout the rest of the document Recommend viewing with `--diff-algorithm=patience` --- docs/settings.rst | 82 ++++++++++++++++++++--------------------------- 1 file changed, 35 insertions(+), 47 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 53b10053..f9576bf7 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -467,6 +467,14 @@ This would save your articles into something like The actual location a page draft which doesn't use the default language is saved at. +.. data:: AUTHOR_URL = 'author/{slug}.html' + + The URL to use for an author. + +.. data:: AUTHOR_SAVE_AS = 'author/{slug}.html' + + The location to save an author. + .. data:: CATEGORY_URL = 'category/{slug}.html' The URL to use for a category. @@ -483,41 +491,6 @@ This would save your articles into something like The location to save the tag page. -.. data:: AUTHOR_URL = 'author/{slug}.html' - - The URL to use for an author. - -.. data:: AUTHOR_SAVE_AS = 'author/{slug}.html' - - The location to save an author. - -.. data:: YEAR_ARCHIVE_SAVE_AS = '' - - The location to save per-year archives of your posts. - -.. data:: YEAR_ARCHIVE_URL = '' - - The URL to use for per-year archives of your posts. Used only if you have - the ``{url}`` placeholder in ``PAGINATION_PATTERNS``. - -.. data:: MONTH_ARCHIVE_SAVE_AS = '' - - The location to save per-month archives of your posts. - -.. data:: MONTH_ARCHIVE_URL = '' - - The URL to use for per-month archives of your posts. Used only if you have - the ``{url}`` placeholder in ``PAGINATION_PATTERNS``. - -.. data:: DAY_ARCHIVE_SAVE_AS = '' - - The location to save per-day archives of your posts. - -.. data:: DAY_ARCHIVE_URL = '' - - The URL to use for per-day archives of your posts. Used only if you have the - ``{url}`` placeholder in ``PAGINATION_PATTERNS``. - .. note:: If you do not want one or more of the default pages to be created (e.g., @@ -546,6 +519,33 @@ posts for the month at ``posts/2011/Aug/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. +.. data:: YEAR_ARCHIVE_URL = '' + + The URL to use for per-year archives of your posts. Used only if you have + the ``{url}`` placeholder in ``PAGINATION_PATTERNS``. + +.. data:: YEAR_ARCHIVE_SAVE_AS = '' + + The location to save per-year archives of your posts. + +.. data:: MONTH_ARCHIVE_URL = '' + + The URL to use for per-month archives of your posts. Used only if you have + the ``{url}`` placeholder in ``PAGINATION_PATTERNS``. + +.. data:: MONTH_ARCHIVE_SAVE_AS = '' + + The location to save per-month archives of your posts. + +.. data:: DAY_ARCHIVE_URL = '' + + The URL to use for per-day archives of your posts. Used only if you have the + ``{url}`` placeholder in ``PAGINATION_PATTERNS``. + +.. data:: DAY_ARCHIVE_SAVE_AS = '' + + The location to save per-day archives of your posts. + ``DIRECT_TEMPLATES`` work a bit differently than noted above. Only the ``_SAVE_AS`` settings are available, but it is available for any direct template. @@ -554,18 +554,6 @@ template. The location to save the article archives page. -.. data:: YEAR_ARCHIVE_SAVE_AS = '' - - The location to save per-year archives of your posts. - -.. data:: MONTH_ARCHIVE_SAVE_AS = '' - - The location to save per-month archives of your posts. - -.. data:: DAY_ARCHIVE_SAVE_AS = '' - - The location to save per-day archives of your posts. - .. data:: AUTHORS_SAVE_AS = 'authors.html' The location to save the author list. From 3d5cdad4734cedbd20d55d0c7e124344452c2796 Mon Sep 17 00:00:00 2001 From: Boian Berberov Date: Sat, 23 Mar 2019 15:34:47 -0600 Subject: [PATCH 007/143] Updating DIRECT_TEMPLATES documentation to match default configuration --- docs/settings.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index f9576bf7..df093c60 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -728,12 +728,12 @@ Template pages The extensions to use when looking up template files from template names. -.. data:: DIRECT_TEMPLATES = ['index', 'categories', 'authors', 'archives'] +.. data:: DIRECT_TEMPLATES = ['index', 'tags', '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']`` + needed, set ``DIRECT_TEMPLATES = ['index', 'authors', 'archives']`` ``DIRECT_TEMPLATES`` are searched for over paths maintained in ``THEME_TEMPLATES_OVERRIDES``. From 86c1db1c63d9c51c4aa5231a72eeda0294914bcc Mon Sep 17 00:00:00 2001 From: Boian Berberov Date: Tue, 26 Mar 2019 17:42:59 -0600 Subject: [PATCH 008/143] Adding `authors` to Common variables - Adding `authors` to Common variables in the documentation - Reordering the `authors`, `categories`, `tags` variables in the table --- docs/themes.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/themes.rst b/docs/themes.rst index dcd72d75..adc7ec65 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -81,10 +81,12 @@ articles The list of articles, ordered descending by date. dates The same list of articles, but ordered by date, ascending. drafts The list of draft articles -tags A list of (tag, articles) tuples, containing all - the tags. +authors A list of (author, articles) tuples, containing all + the authors. categories A list of (category, articles) tuples, containing all the categories and corresponding articles (values) +tags A list of (tag, articles) tuples, containing all + the tags. pages The list of pages hidden_pages The list of hidden pages draft_pages The list of draft pages From 4f494289611b514a62b3d0db2abecf79e54cba6b Mon Sep 17 00:00:00 2001 From: Boian Berberov Date: Thu, 4 Apr 2019 17:11:58 -0600 Subject: [PATCH 009/143] Documentation changes based on pull request comments. - Settings -> Template pages: DIRECT_TEMPLATES example - Creating Themes -> Common variables: authors and tags descriptions --- docs/settings.rst | 6 +++--- docs/themes.rst | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index df093c60..a10010d7 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -728,12 +728,12 @@ Template pages The extensions to use when looking up template files from template names. -.. data:: DIRECT_TEMPLATES = ['index', 'tags', 'categories', 'authors', 'archives'] +.. data:: DIRECT_TEMPLATES = ['index', 'authors', 'categories', 'tags', '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', 'authors', 'archives']`` + category and tag index pages). If the author, category and tag collections are not + needed, set ``DIRECT_TEMPLATES = ['index', 'archives']`` ``DIRECT_TEMPLATES`` are searched for over paths maintained in ``THEME_TEMPLATES_OVERRIDES``. diff --git a/docs/themes.rst b/docs/themes.rst index adc7ec65..e0854646 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -82,11 +82,11 @@ dates The same list of articles, but ordered by date, ascending. drafts The list of draft articles authors A list of (author, articles) tuples, containing all - the authors. + the authors and corresponding articles (values) categories A list of (category, articles) tuples, containing all the categories and corresponding articles (values) tags A list of (tag, articles) tuples, containing all - the tags. + the tags and corresponding articles (values) pages The list of pages hidden_pages The list of hidden pages draft_pages The list of draft pages From 8520840be6bbe17a4aeeea5ffde5489c6d4d5fc4 Mon Sep 17 00:00:00 2001 From: Marcin Juszkiewicz Date: Fri, 19 Apr 2019 16:55:17 +0200 Subject: [PATCH 010/143] Provide 'all_articles' variable to period pages This allows 'recent posts' functionality to work properly. --- pelican/generators.py | 2 +- pelican/tests/test_generators.py | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 0e772a62..75eca388 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -526,7 +526,7 @@ class ArticlesGenerator(CachingGenerator): write(save_as, template, context, articles=articles, dates=archive, template_name='period_archives', - blog=True, url=url) + blog=True, url=url, all_articles=self.articles) for period in 'year', 'month', 'day': save_as = period_save_as[period] diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 9b27d289..267571da 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -420,7 +420,8 @@ class TestArticlesGenerator(unittest.TestCase): generator.get_template("period_archives"), context, blog=True, articles=articles, dates=dates, template_name='period_archives', - url="posts/1970/") + url="posts/1970/", + all_articles=generator.articles) settings['MONTH_ARCHIVE_SAVE_AS'] = \ 'posts/{date:%Y}/{date:%b}/index.html' @@ -444,7 +445,8 @@ class TestArticlesGenerator(unittest.TestCase): generator.get_template("period_archives"), context, blog=True, articles=articles, dates=dates, template_name='period_archives', - url="posts/1970/Jan/") + url="posts/1970/Jan/", + all_articles=generator.articles) settings['DAY_ARCHIVE_SAVE_AS'] = \ 'posts/{date:%Y}/{date:%b}/{date:%d}/index.html' @@ -476,7 +478,8 @@ class TestArticlesGenerator(unittest.TestCase): generator.get_template("period_archives"), context, blog=True, articles=articles, dates=dates, template_name='period_archives', - url="posts/1970/Jan/01/") + url="posts/1970/Jan/01/", + all_articles=generator.articles) locale.setlocale(locale.LC_ALL, old_locale) def test_nonexistent_template(self): From 21a4169169784c9d8ee381ba1b31c8f830f31fa0 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 25 Apr 2019 14:25:39 +0200 Subject: [PATCH 011/143] Clarify copyright continues through to present day This obviates the need to manually update the copyright every year. --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index bac5d9bf..5b5255e3 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ extensions = ['sphinx.ext.autodoc', source_suffix = '.rst' master_doc = 'index' project = 'Pelican' -copyright = '2010, Alexis Metaireau and contributors' +copyright = '2010 – present, Alexis Metaireau and contributors' exclude_patterns = ['_build'] release = __version__ version = '.'.join(release.split('.')[:1]) From e6ecefb5948a6d634245394d4c1d07aab72cf5d1 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 25 Apr 2019 15:08:04 +0200 Subject: [PATCH 012/143] Update http:// links to https:// where appropriate --- CONTRIBUTING.rst | 14 +++++++------- README.rst | 8 ++++---- THANKS | 5 +++-- docs/conf.py | 2 +- docs/content.rst | 6 +++--- docs/index.rst | 8 ++++---- docs/settings.rst | 12 ++++++------ docs/themes.rst | 4 ++-- 8 files changed, 30 insertions(+), 29 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 37fc7ffb..49660ea1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -58,7 +58,7 @@ publicly-accessible location: * Upload detailed and **complete** output logs and backtraces (remember to add the ``--debug`` flag: ``pelican --debug content [...]``) -.. _documentation: http://docs.getpelican.com/ +.. _documentation: https://docs.getpelican.com/ .. _`paste service`: https://dpaste.de/ Once the above preparation is ready, you can contact people willing to help via @@ -124,7 +124,7 @@ Contribution quality standards * Adhere to `PEP8 coding standards`_. This can be eased via the `pycodestyle `_ or `flake8 - `_ tools, the latter of which in + `_ tools, the latter of which in particular will give you some useful hints about ways in which the code/formatting can be improved. If you are relying on your editor for PEP8 compliance, note that the line length specified by PEP8 is 79 (excluding the @@ -139,12 +139,12 @@ Contribution quality standards Check out our `Git Tips`_ page or `ask for help`_ if you need assistance or have any questions about these guidelines. -.. _`plugin`: http://docs.getpelican.com/en/latest/plugins.html -.. _`#pelican IRC channel`: http://webchat.freenode.net/?channels=pelican&uio=d4 +.. _`plugin`: https://docs.getpelican.com/en/latest/plugins.html +.. _`#pelican IRC channel`: https://webchat.freenode.net/?channels=pelican&uio=d4 .. _`Create a new git branch`: https://github.com/getpelican/pelican/wiki/Git-Tips#making-your-changes .. _`Squash your commits`: https://github.com/getpelican/pelican/wiki/Git-Tips#squashing-commits -.. _`Run all the tests`: http://docs.getpelican.com/en/latest/contribute.html#running-the-test-suite +.. _`Run all the tests`: https://docs.getpelican.com/en/latest/contribute.html#running-the-test-suite .. _`Git Tips`: https://github.com/getpelican/pelican/wiki/Git-Tips -.. _`PEP8 coding standards`: http://www.python.org/dev/peps/pep-0008/ +.. _`PEP8 coding standards`: https://www.python.org/dev/peps/pep-0008/ .. _`ask for help`: `How to get help`_ -.. _`compatibility cheatsheet`: http://docs.getpelican.com/en/latest/contribute.html#python-3-development-tips +.. _`compatibility cheatsheet`: https://docs.getpelican.com/en/latest/contribute.html#python-3-development-tips diff --git a/README.rst b/README.rst index 05063251..176dfce4 100644 --- a/README.rst +++ b/README.rst @@ -47,13 +47,13 @@ Why the name "Pelican"? .. Links -.. _Python: http://www.python.org/ +.. _Python: https://www.python.org/ .. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _Markdown: http://daringfireball.net/projects/markdown/ +.. _Markdown: https://daringfireball.net/projects/markdown/ .. _Jinja2: http://jinja.pocoo.org/ .. _Pygments: http://pygments.org/ -.. _`Pelican's documentation`: http://docs.getpelican.com/ -.. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html +.. _`Pelican's documentation`: https://docs.getpelican.com/ +.. _`Pelican's internals`: https://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 diff --git a/THANKS b/THANKS index 348c0b59..121a8aca 100644 --- a/THANKS +++ b/THANKS @@ -1,11 +1,12 @@ Pelican is a project originally created by Alexis Métaireau -, but there are a large number of people that have + and subsequently maintained by Justin Mayer +, but there are a large number of people that have contributed or implemented key features over time. We do our best to keep this list up-to-date, but you can also have a look at the nice contributor graphs produced by GitHub: https://github.com/getpelican/pelican/graphs/contributors If you want to contribute, check the documentation section about how to do so: - + Aaron Kavlie Abhishek L diff --git a/docs/conf.py b/docs/conf.py index 5b5255e3..7645a86d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -31,7 +31,7 @@ rst_prolog = ''' pygments_style = 'sphinx' extlinks = { - 'pelican-doc': ('http://docs.getpelican.com/%s/', '') + 'pelican-doc': ('https://docs.getpelican.com/%s/', '') } # -- Options for HTML output -------------------------------------------------- diff --git a/docs/content.rst b/docs/content.rst index 78fc7993..a6d1c4c6 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -560,9 +560,9 @@ the ``DEFAULT_METADATA``:: To publish a post when the default status is ``draft``, update the post's metadata to include ``Status: published``. -.. _W3C ISO 8601: http://www.w3.org/TR/NOTE-datetime +.. _W3C ISO 8601: https://www.w3.org/TR/NOTE-datetime .. _AsciiDoc: http://www.methods.co.nz/asciidoc/ -.. _pelican-plugins: http://github.com/getpelican/pelican-plugins +.. _pelican-plugins: https://github.com/getpelican/pelican-plugins .. _Markdown Extensions: https://python-markdown.github.io/extensions/ .. _CodeHilite extension: https://python-markdown.github.io/extensions/code_hilite/#syntax -.. _i18n_subsites plugin: http://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites +.. _i18n_subsites plugin: https://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites diff --git a/docs/index.rst b/docs/index.rst index a0084ffb..678732d8 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -76,10 +76,10 @@ Documentation .. Links -.. _Python: http://www.python.org/ +.. _Python: https://www.python.org/ .. _reStructuredText: http://docutils.sourceforge.net/rst.html -.. _Markdown: http://daringfireball.net/projects/markdown/ +.. _Markdown: https://daringfireball.net/projects/markdown/ .. _Jinja2: http://jinja.pocoo.org/ -.. _`Pelican documentation`: http://docs.getpelican.com/latest/ -.. _`Pelican's internals`: http://docs.getpelican.com/en/latest/internals.html +.. _`Pelican documentation`: https://docs.getpelican.com/latest/ +.. _`Pelican's internals`: https://docs.getpelican.com/en/latest/internals.html .. _`Pelican plugins`: https://github.com/getpelican/pelican-plugins diff --git a/docs/settings.rst b/docs/settings.rst index 153ec754..7e297c16 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -369,7 +369,7 @@ and pages anywhere you want. the `Python datetime documentation`_ for more information. .. _Python datetime documentation: - http://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior + https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior Also, you can use other file metadata attributes as well: @@ -620,7 +620,7 @@ Time and Date 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 +.. _the wikipedia page: https://en.wikipedia.org/wiki/List_of_tz_database_time_zones .. data:: DEFAULT_DATE = None @@ -696,11 +696,11 @@ Time and Date .. [#] Default is the system locale. -.. _Python strftime documentation: http://docs.python.org/library/datetime.html#strftime-strptime-behavior +.. _Python strftime documentation: https://docs.python.org/library/datetime.html#strftime-strptime-behavior .. _locales on Windows: http://msdn.microsoft.com/en-us/library/cdax410z%28VS.71%29.aspx -.. _locale(1): http://linux.die.net/man/1/locale +.. _locale(1): https://linux.die.net/man/1/locale .. _template_pages: @@ -811,7 +811,7 @@ file: } .. _group name notation: - http://docs.python.org/3/library/re.html#regular-expression-syntax + https://docs.python.org/3/library/re.html#regular-expression-syntax Feed settings @@ -828,7 +828,7 @@ the ``TAG_FEED_ATOM`` and ``TAG_FEED_RSS`` settings: 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 + "https://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``. diff --git a/docs/themes.rst b/docs/themes.rst index e0854646..354e0c36 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -120,8 +120,8 @@ your date according to the locale given in your settings:: {{ article.date|strftime('%d %B %Y') }} -.. _datetime: http://docs.python.org/2/library/datetime.html#datetime-objects -.. _strftime: http://docs.python.org/2/library/datetime.html#strftime-strptime-behavior +.. _datetime: https://docs.python.org/2/library/datetime.html#datetime-objects +.. _strftime: https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior index.html From 8ed686136a666ec8b09f3843191cfe6d186dbf38 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 13 May 2019 09:59:31 +0200 Subject: [PATCH 013/143] Un-pin Python-Markdown version in test requirements Refs #2493 #2569 --- requirements/test.pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.pip b/requirements/test.pip index 32f81d86..fa2634a0 100644 --- a/requirements/test.pip +++ b/requirements/test.pip @@ -2,7 +2,7 @@ mock # Optional Packages -Markdown < 3.0 +Markdown BeautifulSoup4 lxml typogrify From 7e859c277f00ce49a3d3ca938930bbe5204c702a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 10 Jun 2019 21:12:12 +0200 Subject: [PATCH 014/143] Pin Python-Markdown to >= 3.1 in test requirements Closes #2493 --- requirements/test.pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.pip b/requirements/test.pip index fa2634a0..ec4ea874 100644 --- a/requirements/test.pip +++ b/requirements/test.pip @@ -2,7 +2,7 @@ mock # Optional Packages -Markdown +Markdown >= 3.1 BeautifulSoup4 lxml typogrify From 7f77106c1bd157ca230fd0af2edad43ea1067e4f Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 10 Jun 2019 21:36:02 +0200 Subject: [PATCH 015/143] Configure footnote test to keep hyphen as separator Closes #2493 --- pelican/tests/test_readers.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 12c231de..181cefff 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -480,7 +480,11 @@ class MdReaderTest(ReaderTest): self.assertDictHasSubset(metadata, expected) def test_article_with_footnote(self): - reader = readers.MarkdownReader(settings=get_settings()) + settings = get_settings() + from markdown.extensions.footnotes import FootnoteExtension + ec = settings['MARKDOWN']['extension_configs'] + ec['markdown.extensions.footnotes'] = {'SEPARATOR': '-'} + reader = readers.MarkdownReader(settings) content, metadata = reader.read( _path('article_with_markdown_and_footnote.md')) expected_content = ( From d8d230b554397a145045d15a75b9a8c23b093fe3 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 10 Jun 2019 21:44:13 +0200 Subject: [PATCH 016/143] PyCodeStyle fix --- pelican/tests/test_readers.py | 1 - 1 file changed, 1 deletion(-) diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 181cefff..30181f54 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -481,7 +481,6 @@ class MdReaderTest(ReaderTest): def test_article_with_footnote(self): settings = get_settings() - from markdown.extensions.footnotes import FootnoteExtension ec = settings['MARKDOWN']['extension_configs'] ec['markdown.extensions.footnotes'] = {'SEPARATOR': '-'} reader = readers.MarkdownReader(settings) From 4bae94834e5325fe0d90631641cd2bdaa98b2b55 Mon Sep 17 00:00:00 2001 From: Tim Gates Date: Wed, 12 Jun 2019 17:02:49 +1000 Subject: [PATCH 017/143] Support for python -m pelican Addresses https://github.com/getpelican/pelican/issues/2523 Note: @avaris made a good point that there is no need to replace the existing module runner for pelican quickstart or the other tools as this can be run via: > python -m pelican.tools.pelican_quickstart --- pelican/__main__.py | 10 ++++++++++ pelican/tests/test_pelican.py | 7 +++++++ setup.py | 2 +- 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 pelican/__main__.py diff --git a/pelican/__main__.py b/pelican/__main__.py new file mode 100644 index 00000000..141823fc --- /dev/null +++ b/pelican/__main__.py @@ -0,0 +1,10 @@ +""" +python -m pelican module entry point to run via python -m +""" +from __future__ import absolute_import + +from . import main + + +if __name__ == '__main__': + main() diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index e93c1223..502a45ac 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -263,3 +263,10 @@ class TestPelican(LoggedTestCase): count=1, msg="Could not process .*parse_error.rst", level=logging.ERROR) + + def test_module_load(self): + """Test loading via python -m pelican --help displays the help""" + output = subprocess.check_output([ + sys.executable, '-m', 'pelican', '--help' + ]).decode('ascii', 'replace') + assert 'usage:' in output diff --git a/setup.py b/setup.py index d1dc4c4d..e8918941 100755 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', entry_points = { 'console_scripts': [ - 'pelican = pelican:main', + 'pelican = pelican.__main__:main', 'pelican-import = pelican.tools.pelican_import:main', 'pelican-quickstart = pelican.tools.pelican_quickstart:main', 'pelican-themes = pelican.tools.pelican_themes:main' From 2ab91bbaaa565dcb89726b6cac0002c1e0644dc3 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 16 Jun 2019 18:51:10 +0200 Subject: [PATCH 018/143] Clarify that `pelican --listen` operates on output --- docs/quickstart.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index a5fdfa60..4e6714b4 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -61,8 +61,8 @@ be ignored for now.) Preview your site ----------------- -Open a new terminal session, navigate to your site directory and run the -following command to launch Pelican's web server:: +Open a new terminal session, navigate to your generated output directory and +run the following command to launch Pelican's web server:: pelican --listen From 9fdcb901f3825eb602f47eeea476204d26c2d97b Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 16 Jun 2019 18:56:08 +0200 Subject: [PATCH 019/143] Both --autoreload and --listen can be combined But not on Windows. Refs #2400 --- docs/publish.rst | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/docs/publish.rst b/docs/publish.rst index 4dc1e3ef..197aa779 100644 --- a/docs/publish.rst +++ b/docs/publish.rst @@ -32,7 +32,12 @@ list of paths or can be configured as a setting. (See: 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`` command with the ``-r`` or ``--autoreload`` option. On non-Windows +environments, this option can also be combined with the ``-l`` or ``--listen`` +option to simultaneously both auto-regenerate *and* serve the output at +http://localhost:8000:: + + pelican --autoreload --listen Pelican has other command-line switches available. Have a look at the help to see all the options you can use:: From a343b166e0cb71a231e644515ae3a68a9e70f53a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 7 Jun 2019 11:48:21 +0200 Subject: [PATCH 020/143] Add FUNDING.yml to project This adds multiple methods for financially supporting Pelican's development. Primary motivations are to defray expenses for servers and domain name registration, as well to support and encourage Pelican's on-going maintenance and enhancement. --- .github/FUNDING.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/FUNDING.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 00000000..7e0d5359 --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,2 @@ +custom: https://donate.getpelican.com +liberapay: pelican From 98071fab942037b0c92d0316c6e08eeffed97f75 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 17 Jun 2019 16:50:54 +0200 Subject: [PATCH 021/143] Docs: MARKDOWN var replaces, not updates, default Closes #2100 --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 7e297c16..7085db84 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -152,7 +152,7 @@ Basic settings } .. Note:: - The dictionary defined in your settings file will update this default + The dictionary defined in your settings file will replace this default one. .. data:: OUTPUT_PATH = 'output/' From 2e82a53cdf3f1f9d66557850cc2811479d5bb645 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 17 Jun 2019 17:40:52 +0200 Subject: [PATCH 022/143] Document automatic titles from content file names Closes #2107 --- docs/content.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/content.rst b/docs/content.rst index a6d1c4c6..f0022c35 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -116,7 +116,7 @@ specified either via the ``tags`` metadata, as is standard in Pelican, or via the ``keywords`` metadata, as is standard in HTML. The two can be used interchangeably. -Note that, aside from the title, none of this article metadata is mandatory: +Note that, aside from the title, none of this content metadata is mandatory: if the date is not specified and ``DEFAULT_DATE`` is set to ``'fs'``, 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 @@ -126,6 +126,15 @@ not be a good category name, you can set the setting ``USE_FOLDER_AS_CATEGORY`` to ``False``. When parsing dates given in the page metadata, Pelican supports the W3C's `suggested subset ISO 8601`__. +So the title is the only required metadata. If that bothers you, worry not. +Instead of manually specifying a title in your metadata each time, you can use +the source content file name as the title. For example, a Markdown source file +named ``Publishing via Pelican.md`` would automatically be assigned a title of +*Publishing via Pelican*. If you would prefer this behavior, add the following +line to your settings file:: + + FILENAME_METADATA = '(?P.*)' + .. note:: When experimenting with different settings (especially the metadata From 9e07234baeb1542f37b1d2b9366d87e30de92f3c Mon Sep 17 00:00:00 2001 From: John Franey <johnfraney@gmail.com> Date: Mon, 13 May 2019 17:30:29 -0400 Subject: [PATCH 023/143] Update Tox config and fix failing CI envs Updates base Python version for Travis CI from 2.7 to 3.6 and fixes a linting error. --- .travis.yml | 4 ++-- pelican/server.py | 2 +- tox.ini | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 31b3ac8b..69034a97 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,11 +1,11 @@ language: python python: - - "3.5" + - "3.6" env: - TOX_ENV=docs - TOX_ENV=flake8 - TOX_ENV=py27 - - TOX_ENV=py35 + - TOX_ENV=py36 matrix: include: - python: 3.6 diff --git a/pelican/server.py b/pelican/server.py index 82ad70cd..841b8e88 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -138,6 +138,6 @@ if __name__ == '__main__': args.port, args.server) try: httpd.serve_forever() - except KeyboardInterrupt as e: + except KeyboardInterrupt: logger.info("Shutting down server.") httpd.socket.close() diff --git a/tox.ini b/tox.ini index fc95ff91..15dbaee8 100644 --- a/tox.ini +++ b/tox.ini @@ -22,7 +22,7 @@ commands = - coveralls [testenv:docs] -basepython = python2.7 +basepython = python3.6 deps = -rrequirements/docs.pip changedir = docs @@ -34,7 +34,7 @@ application-import-names = pelican import-order-style = cryptography [testenv:flake8] -basepython = python2.7 +basepython = python3.6 deps = -rrequirements/style.pip commands = From 28383a6355c6c238a86a469b4a410139a3ce3d7a Mon Sep 17 00:00:00 2001 From: John Franey <johnfraney@gmail.com> Date: Sat, 2 Feb 2019 16:24:11 -0400 Subject: [PATCH 024/143] Add livereload invoke task. Fixes #1326 Adds a `livereload` invoke task that builds the project and reloads the browser window when content files are updated. Usage: ```console $ invoke livereload [I 190202 16:28:30 server:298] Serving on http://127.0.0.1:5500 [I 190202 16:28:30 handlers:59] Start watching changes [I 190202 16:28:30 handlers:61] Start detecting changes [I 190202 16:28:32 handlers:132] Browser Connected: http://127.0.0.1:5500/ ``` See: https://livereload.readthedocs.io/en/latest/ --- pelican/tools/templates/tasks.py.jinja2 | 20 ++++++++++++++++++++ setup.py | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index f022bfc0..5b27e2b5 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -7,7 +7,14 @@ import datetime from invoke import task from invoke.util import cd +from livereload import Server from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer +from pelican.settings import DEFAULT_CONFIG, get_settings_from_file + +SETTINGS = {} +SETTINGS.update(DEFAULT_CONFIG) +LOCAL_SETTINGS = get_settings_from_file('pelicanconf.py') +SETTINGS.update(LOCAL_SETTINGS) CONFIG = { # Local path configuration (can be absolute or relative to tasks.py) @@ -80,6 +87,19 @@ def preview(c): """Build production version of site""" c.run('pelican -s publishconf.py') +@task +def livereload(c): + """Automatically reload browser tab upon file modification.""" + build(c) + server = Server() + deploy_path = CONFIG['deploy_path'] + content_path = SETTINGS['PATH'] + content_file_extensions = ['.md', '.rst'] + for file_extension in content_file_extensions: + content_blob = '{0}/**/*{1}'.format(content_path, file_extension) + server.watch(content_blob, lambda: build(c)) + server.serve(root=deploy_path) + {% if cloudfiles %} @task def cf_upload(c): diff --git a/setup.py b/setup.py index e8918941..25e109c4 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from setuptools import setup requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', - 'python-dateutil'] + 'python-dateutil', 'livereload'] entry_points = { 'console_scripts': [ From ca012bd288d388c45fa060caddfdd1e48bca8d8a Mon Sep 17 00:00:00 2001 From: John Franey <johnfraney@gmail.com> Date: Tue, 18 Jun 2019 22:56:18 -0400 Subject: [PATCH 025/143] Update livereload Invoke task and add docs Removes the `livereload` dependency from `setup.py`. Updates the `invoke livereload` task by moving the `livereload` import into the task function since it is now an optional dependency. Updates the Invoke section of the documentaion with instructions on using the `livereload` Invoke task. --- docs/publish.rst | 6 ++++++ pelican/tools/templates/tasks.py.jinja2 | 2 +- setup.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/publish.rst b/docs/publish.rst index 197aa779..96d67d58 100644 --- a/docs/publish.rst +++ b/docs/publish.rst @@ -146,6 +146,12 @@ http://localhost:8000/:: invoke serve +To serve the generated site with automatic browser reloading every time a +change is detected, first ``pip install livereload``, then use the +following command:: + + invoke livereload + 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:: diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 5b27e2b5..ef48e968 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -7,7 +7,6 @@ import datetime from invoke import task from invoke.util import cd -from livereload import Server from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer from pelican.settings import DEFAULT_CONFIG, get_settings_from_file @@ -90,6 +89,7 @@ def preview(c): @task def livereload(c): """Automatically reload browser tab upon file modification.""" + from livereload import Server build(c) server = Server() deploy_path = CONFIG['deploy_path'] diff --git a/setup.py b/setup.py index 25e109c4..e8918941 100755 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ from setuptools import setup requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', - 'python-dateutil', 'livereload'] + 'python-dateutil'] entry_points = { 'console_scripts': [ From 5525a9021ed197d3f6edb488d37cd371c18a73c8 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Wed, 19 Jun 2019 15:45:32 +0200 Subject: [PATCH 026/143] Use OUTPUT_PATH setting in Invoke tasks.py template The default setting for OUTPUT_PATH is already 'output', so it would be more DRY to use the existing default value instead of a hardcoded 'output' string. --- pelican/tools/templates/tasks.py.jinja2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index ef48e968..80bd2ae3 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -16,8 +16,8 @@ LOCAL_SETTINGS = get_settings_from_file('pelicanconf.py') SETTINGS.update(LOCAL_SETTINGS) CONFIG = { - # Local path configuration (can be absolute or relative to tasks.py) - 'deploy_path': 'output', + # Output path. Can be absolute or relative to tasks.py. Default: 'output' + 'deploy_path': SETTINGS['OUTPUT_PATH'], {% if ssh %} # Remote server configuration 'production': '{{ssh_user}}@{{ssh_host}}:{{ssh_port}}', From 4b5610175f9ae5698bb845b3853725bd9a097696 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Wed, 19 Jun 2019 16:11:16 +0200 Subject: [PATCH 027/143] Invoke: Make settings file name handling more DRY Instead of repeating hard-coded 'pelicanconf.py' values throughout Invoke's task.py template, assign default settings file names to variables, and use those variables where applicable. --- pelican/tools/templates/tasks.py.jinja2 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 80bd2ae3..889253c9 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -10,12 +10,15 @@ from invoke.util import cd from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer from pelican.settings import DEFAULT_CONFIG, get_settings_from_file +SETTINGS_FILE_BASE = 'pelicanconf.py' SETTINGS = {} SETTINGS.update(DEFAULT_CONFIG) -LOCAL_SETTINGS = get_settings_from_file('pelicanconf.py') +LOCAL_SETTINGS = get_settings_from_file(SETTINGS_FILE_BASE) SETTINGS.update(LOCAL_SETTINGS) CONFIG = { + 'settings_base': SETTINGS_FILE_BASE, + 'settings_publish': 'publishconf.py', # Output path. Can be absolute or relative to tasks.py. Default: 'output' 'deploy_path': SETTINGS['OUTPUT_PATH'], {% if ssh %} @@ -48,17 +51,17 @@ def clean(c): @task def build(c): """Build local version of site""" - c.run('pelican -s pelicanconf.py') + c.run('pelican -s {settings_base}'.format(**CONFIG)) @task def rebuild(c): """`build` with the delete switch""" - c.run('pelican -d -s pelicanconf.py') + c.run('pelican -d -s {settings_base}'.format(**CONFIG)) @task def regenerate(c): """Automatically regenerate site upon file modification""" - c.run('pelican -r -s pelicanconf.py') + c.run('pelican -r -s {settings_base}'.format(**CONFIG)) @task def serve(c): @@ -84,7 +87,7 @@ def reserve(c): @task def preview(c): """Build production version of site""" - c.run('pelican -s publishconf.py') + c.run('pelican -s {settings_publish}'.format(**CONFIG)) @task def livereload(c): @@ -115,7 +118,7 @@ def cf_upload(c): @task def publish(c): """Publish to production via rsync""" - c.run('pelican -s publishconf.py') + c.run('pelican -s {settings_publish}'.format(**CONFIG)) c.run( 'rsync --delete --exclude ".DS_Store" -pthrvz -c ' '{} {production}:{dest_path}'.format( From 8b4c46d74b08851c8d4efa14ad31579f50bed55e Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Thu, 20 Jun 2019 07:49:48 +0200 Subject: [PATCH 028/143] Invoke `serve` task docstring: port is configurable --- pelican/tools/templates/tasks.py.jinja2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 889253c9..95164354 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -65,7 +65,7 @@ def regenerate(c): @task def serve(c): - """Serve site at http://localhost:8000/""" + """Serve site at http://localhost:$PORT/ (default port is 8000)""" class AddressReuseTCPServer(RootedHTTPServer): allow_reuse_address = True From ae7af1d696997f1194007c3a6859cd564557f403 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Thu, 20 Jun 2019 08:08:48 +0200 Subject: [PATCH 029/143] Remove redundant vars in Invoke livereload task --- pelican/tools/templates/tasks.py.jinja2 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 95164354..0e1fad7a 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -95,13 +95,12 @@ def livereload(c): from livereload import Server build(c) server = Server() - deploy_path = CONFIG['deploy_path'] - content_path = SETTINGS['PATH'] + # Watch content source files content_file_extensions = ['.md', '.rst'] - for file_extension in content_file_extensions: - content_blob = '{0}/**/*{1}'.format(content_path, file_extension) + for extension in content_file_extensions: + content_blob = '{0}/**/*{1}'.format(SETTINGS['PATH'], extension) server.watch(content_blob, lambda: build(c)) - server.serve(root=deploy_path) + server.serve(root=CONFIG['deploy_path']) {% if cloudfiles %} @task From c8b0b52d4e8f76bfd9bd59cb0a6bb4cf0d697b5c Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Thu, 20 Jun 2019 08:12:14 +0200 Subject: [PATCH 030/143] Use port settings in Invoke livereload task Instead of using LiveReload's default port 5500, use the existing `port` value from the task's CONFIG dictionary, which defaults to 8000. --- pelican/tools/templates/tasks.py.jinja2 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 0e1fad7a..7922aa9a 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -100,7 +100,8 @@ def livereload(c): for extension in content_file_extensions: content_blob = '{0}/**/*{1}'.format(SETTINGS['PATH'], extension) server.watch(content_blob, lambda: build(c)) - server.serve(root=CONFIG['deploy_path']) + # Serve output path on configured port + server.serve(port=CONFIG['port'], root=CONFIG['deploy_path']) {% if cloudfiles %} @task From cf2275c3be307d4061be892524621e146811d8fd Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Thu, 20 Jun 2019 08:18:00 +0200 Subject: [PATCH 031/143] Add settings file to Invoke livereload watch list --- pelican/tools/templates/tasks.py.jinja2 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 7922aa9a..45c8768d 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -95,6 +95,8 @@ def livereload(c): from livereload import Server build(c) server = Server() + # Watch the base settings file + server.watch(CONFIG['settings_base'], lambda: build(c)) # Watch content source files content_file_extensions = ['.md', '.rst'] for extension in content_file_extensions: From a4cecd2d0c719beab52fa86b2bc5b7a9ddaa1659 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Thu, 20 Jun 2019 08:30:04 +0200 Subject: [PATCH 032/143] Add theme templates, CSS, JS to Invoke livereload task --- pelican/tools/templates/tasks.py.jinja2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 45c8768d..a800b79b 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -102,6 +102,13 @@ def livereload(c): for extension in content_file_extensions: content_blob = '{0}/**/*{1}'.format(SETTINGS['PATH'], extension) server.watch(content_blob, lambda: build(c)) + # Watch the theme's templates and static assets + theme_path = SETTINGS['THEME'] + server.watch('{}/templates/*.html'.format(theme_path), lambda: build(c)) + static_file_extensions = ['.css', '.js'] + for extension in static_file_extensions: + static_file = '{0}/static/**/*{1}'.format(theme_path, extension) + server.watch(static_file, lambda: build(c)) # Serve output path on configured port server.serve(port=CONFIG['port'], root=CONFIG['deploy_path']) From 80540281bc245ca02933682f8b54be2d49a35226 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Mon, 24 Jun 2019 20:21:19 +0200 Subject: [PATCH 033/143] Add Python 3.5 env back to Travis tests. Refs #2571 Previous change resulted in Python 3.5 missing from the test environment, as well as a duplicate Python 3.6 test run. --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 69034a97..762ada98 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,12 +5,10 @@ env: - TOX_ENV=docs - TOX_ENV=flake8 - TOX_ENV=py27 + - TOX_ENV=py35 - TOX_ENV=py36 matrix: include: - - python: 3.6 - env: - - TOX_ENV=py36 - python: 3.7 sudo: true dist: xenial From 216eec50fcc19a29fc36c051147430b8f01a88ea Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Fri, 28 Jun 2019 16:57:23 +0200 Subject: [PATCH 034/143] Add pyproject.toml and poetry.lock to project This could facilitate publishing new versions of Pelican as well as make it easier for Poetry users to install Pelican via: `poetry install` Closes #2450 --- poetry.lock | 547 +++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 57 ++++++ 2 files changed, 604 insertions(+) create mode 100644 poetry.lock create mode 100644 pyproject.toml diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..027094e4 --- /dev/null +++ b/poetry.lock @@ -0,0 +1,547 @@ +[[package]] +category = "dev" +description = "A configurable sidebar-enabled Sphinx theme" +name = "alabaster" +optional = false +python-versions = "*" +version = "0.7.12" + +[[package]] +category = "dev" +description = "Internationalization utilities" +name = "babel" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "2.7.0" + +[package.dependencies] +pytz = ">=2015.7" + +[[package]] +category = "dev" +description = "backports.functools_lru_cache" +marker = "python_version < \"3\"" +name = "backports.functools-lru-cache" +optional = false +python-versions = ">=2.6" +version = "1.5" + +[[package]] +category = "dev" +description = "Screen-scraping library" +name = "beautifulsoup4" +optional = false +python-versions = "*" +version = "4.7.1" + +[package.dependencies] +soupsieve = ">=1.2" + +[[package]] +category = "main" +description = "Fast, simple object-to-object and broadcast signaling" +name = "blinker" +optional = false +python-versions = "*" +version = "1.4" + +[[package]] +category = "dev" +description = "Cross-platform colored terminal text." +marker = "sys_platform == \"win32\"" +name = "colorama" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "0.4.1" + +[[package]] +category = "dev" +description = "Updated configparser from Python 3.7 for Python 2.6+." +marker = "python_version < \"3.2\"" +name = "configparser" +optional = false +python-versions = ">=2.6" +version = "3.7.4" + +[[package]] +category = "dev" +description = "Backports and enhancements for the contextlib module" +marker = "python_version < \"3\"" +name = "contextlib2" +optional = false +python-versions = "*" +version = "0.5.5" + +[[package]] +category = "main" +description = "Docutils -- Python Documentation Utilities" +name = "docutils" +optional = false +python-versions = "*" +version = "0.14" + +[[package]] +category = "dev" +description = "Discover and load entry points from installed packages." +name = "entrypoints" +optional = false +python-versions = ">=2.7" +version = "0.3" + +[package.dependencies] +[package.dependencies.configparser] +python = ">=2.7,<2.8" +version = ">=3.5" + +[[package]] +category = "dev" +description = "Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4" +marker = "python_version < \"3.4\"" +name = "enum34" +optional = false +python-versions = "*" +version = "1.1.6" + +[[package]] +category = "main" +description = "Standalone version of django.utils.feedgenerator" +name = "feedgenerator" +optional = false +python-versions = "*" +version = "1.9" + +[package.dependencies] +pytz = ">=0a" +six = "*" + +[[package]] +category = "dev" +description = "A platform independent file lock." +name = "filelock" +optional = false +python-versions = "*" +version = "3.0.12" + +[[package]] +category = "dev" +description = "the modular source code checker: pep8, pyflakes and co" +name = "flake8" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "3.7.7" + +[package.dependencies] +entrypoints = ">=0.3.0,<0.4.0" +mccabe = ">=0.6.0,<0.7.0" +pycodestyle = ">=2.5.0,<2.6.0" +pyflakes = ">=2.1.0,<2.2.0" + +[package.dependencies.configparser] +python = "<3.2" +version = "*" + +[package.dependencies.enum34] +python = "<3.4" +version = "*" + +[package.dependencies.functools32] +python = "<3.2" +version = "*" + +[package.dependencies.typing] +python = "<3.5" +version = "*" + +[[package]] +category = "dev" +description = "Flake8 and pylama plugin that checks the ordering of import statements." +name = "flake8-import-order" +optional = false +python-versions = "*" +version = "0.18.1" + +[package.dependencies] +pycodestyle = "*" +setuptools = "*" + +[package.dependencies.enum34] +python = "<2.8" +version = "*" + +[[package]] +category = "dev" +description = "Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+" +marker = "python_version < \"3.3\"" +name = "funcsigs" +optional = false +python-versions = "*" +version = "1.0.2" + +[[package]] +category = "dev" +description = "Backport of the functools module from Python 3.2.3 for use on 2.7 and PyPy." +marker = "python_version < \"3.2\"" +name = "functools32" +optional = false +python-versions = "*" +version = "3.2.3-2" + +[[package]] +category = "dev" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +name = "imagesize" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.1.0" + +[[package]] +category = "dev" +description = "Read metadata from Python packages" +name = "importlib-metadata" +optional = false +python-versions = ">=2.7,!=3.0,!=3.1,!=3.2,!=3.3" +version = "0.18" + +[package.dependencies] +zipp = ">=0.5" + +[package.dependencies.configparser] +python = "<3" +version = ">=3.5" + +[package.dependencies.contextlib2] +python = "<3" +version = "*" + +[[package]] +category = "main" +description = "A small but fast and easy to use stand-alone template engine written in pure python." +name = "jinja2" +optional = false +python-versions = "*" +version = "2.10.1" + +[package.dependencies] +MarkupSafe = ">=0.23" + +[[package]] +category = "dev" +description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." +name = "lxml" +optional = false +python-versions = "*" +version = "4.3.4" + +[[package]] +category = "main" +description = "Python implementation of Markdown." +name = "markdown" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" +version = "3.1.1" + +[package.dependencies] +setuptools = ">=36" + +[[package]] +category = "main" +description = "Safely add untrusted strings to HTML/XML markup." +name = "markupsafe" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" +version = "1.1.1" + +[[package]] +category = "dev" +description = "McCabe checker, plugin for flake8" +name = "mccabe" +optional = false +python-versions = "*" +version = "0.6.1" + +[[package]] +category = "dev" +description = "Rolling backport of unittest.mock for all Pythons" +name = "mock" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "3.0.5" + +[package.dependencies] +six = "*" + +[package.dependencies.funcsigs] +python = "<3.3" +version = ">=1" + +[[package]] +category = "dev" +description = "Core utilities for Python packages" +name = "packaging" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "19.0" + +[package.dependencies] +pyparsing = ">=2.0.2" +six = "*" + +[[package]] +category = "dev" +description = "plugin and hook calling mechanisms for python" +name = "pluggy" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "0.12.0" + +[package.dependencies] +importlib-metadata = ">=0.12" + +[[package]] +category = "dev" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +name = "py" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.8.0" + +[[package]] +category = "dev" +description = "Python style guide checker" +name = "pycodestyle" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "2.5.0" + +[[package]] +category = "dev" +description = "passive checker of Python programs" +name = "pyflakes" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "2.1.1" + +[[package]] +category = "main" +description = "Pygments is a syntax highlighting package written in Python." +name = "pygments" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" +version = "2.4.2" + +[[package]] +category = "dev" +description = "Python parsing module" +name = "pyparsing" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +version = "2.4.0" + +[[package]] +category = "main" +description = "Extensions to the standard Python datetime module" +name = "python-dateutil" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +version = "2.8.0" + +[package.dependencies] +six = ">=1.5" + +[[package]] +category = "main" +description = "World timezone definitions, modern and historical" +name = "pytz" +optional = false +python-versions = "*" +version = "2019.1" + +[[package]] +category = "main" +description = "Python 2 and 3 compatibility utilities" +name = "six" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*" +version = "1.12.0" + +[[package]] +category = "dev" +description = "Python with the SmartyPants" +name = "smartypants" +optional = false +python-versions = "*" +version = "2.0.1" + +[[package]] +category = "dev" +description = "This package provides 23 stemmers for 22 languages generated from Snowball algorithms." +name = "snowballstemmer" +optional = false +python-versions = "*" +version = "1.9.0" + +[[package]] +category = "dev" +description = "A modern CSS selector implementation for Beautiful Soup." +name = "soupsieve" +optional = false +python-versions = "*" +version = "1.9.2" + +[package.dependencies] +[package.dependencies."backports.functools-lru-cache"] +python = "<3" +version = "*" + +[[package]] +category = "dev" +description = "Python documentation generator" +name = "sphinx" +optional = false +python-versions = "*" +version = "1.4.9" + +[package.dependencies] +Jinja2 = ">=2.3" +Pygments = ">=2.0" +alabaster = ">=0.7,<0.8" +babel = ">=1.3,<2.0 || >2.0" +colorama = ">=0.3.5" +docutils = ">=0.11" +imagesize = "*" +six = ">=1.5" +snowballstemmer = ">=1.1" + +[[package]] +category = "dev" +description = "Read the Docs theme for Sphinx" +name = "sphinx-rtd-theme" +optional = false +python-versions = "*" +version = "0.4.3" + +[package.dependencies] +sphinx = "*" + +[[package]] +category = "dev" +description = "Python Library for Tom's Obvious, Minimal Language" +name = "toml" +optional = false +python-versions = "*" +version = "0.10.0" + +[[package]] +category = "dev" +description = "tox is a generic virtualenv management and test command line tool" +name = "tox" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "3.13.1" + +[package.dependencies] +filelock = ">=3.0.0,<4" +importlib-metadata = ">=0.12,<1" +packaging = ">=14" +pluggy = ">=0.12.0,<1" +py = ">=1.4.17,<2" +six = ">=1.0.0,<2" +toml = ">=0.9.4" +virtualenv = ">=14.0.0" + +[[package]] +category = "dev" +description = "Type Hints for Python" +marker = "python_version < \"3.5\"" +name = "typing" +optional = false +python-versions = "*" +version = "3.7.4" + +[[package]] +category = "dev" +description = "Filters to enhance web typography, including support for Django & Jinja templates" +name = "typogrify" +optional = false +python-versions = "*" +version = "2.0.7" + +[package.dependencies] +smartypants = ">=1.8.3" + +[[package]] +category = "main" +description = "ASCII transliterations of Unicode text" +name = "unidecode" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "1.1.1" + +[[package]] +category = "dev" +description = "Virtual Python Environment builder" +name = "virtualenv" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +version = "16.6.1" + +[[package]] +category = "dev" +description = "Backport of pathlib-compatible object wrapper for zip files" +name = "zipp" +optional = false +python-versions = ">=2.7" +version = "0.5.1" + +[metadata] +content-hash = "fe931042341d072acdb02907e16b4cd34947b8edbac5222f2521d961147280d7" +python-versions = "~2.7 || ^3.5" + +[metadata.hashes] +alabaster = ["446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359", "a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"] +babel = ["af92e6106cb7c55286b25b38ad7695f8b4efb36a90ba483d7f7a6628c46158ab", "e86135ae101e31e2c8ec20a4e0c5220f4eed12487d5cf3f78be7e98d3a57fc28"] +"backports.functools-lru-cache" = ["9d98697f088eb1b0fa451391f91afb5e3ebde16bbdb272819fd091151fda4f1a", "f0b0e4eba956de51238e17573b7087e852dfe9854afd2e9c873f73fc0ca0a6dd"] +beautifulsoup4 = ["034740f6cb549b4e932ae1ab975581e6103ac8f942200a0e9759065984391858", "945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348", "ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718"] +blinker = ["471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6"] +colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"] +configparser = ["8be81d89d6e7b4c0d4e44bcc525845f6da25821de80cb5e06e7e0238a2899e32", "da60d0014fd8c55eb48c1c5354352e363e2d30bbf7057e5e171a468390184c75"] +contextlib2 = ["509f9419ee91cdd00ba34443217d5ca51f5a364a404e1dce9e8979cea969ca48", "f5260a6e679d2ff42ec91ec5252f4eeffdcf21053db9113bd0a8e4d953769c00"] +docutils = ["02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", "51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", "7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"] +entrypoints = ["589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", "c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"] +enum34 = ["2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850", "644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", "6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"] +feedgenerator = ["5ae05daa9cfa47fa406ee4744d0b7fa1c8a05a7a47ee0ad328ddf55327cfb106"] +filelock = ["18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59", "929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"] +flake8 = ["859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", "a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8"] +flake8-import-order = ["90a80e46886259b9c396b578d75c749801a41ee969a235e163cfe1be7afd2543", "a28dc39545ea4606c1ac3c24e9d05c849c6e5444a50fb7e9cdd430fc94de6e92"] +funcsigs = ["330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca", "a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"] +functools32 = ["89d824aa6c358c421a234d7f9ee0bd75933a67c29588ce50aaa3acdf4d403fa0", "f6253dfbe0538ad2e387bd8fdfd9293c925d63553f5813c4e587745416501e6d"] +imagesize = ["3f349de3eb99145973fefb7dbe38554414e5c30abd0c8e4b970a7c9d09f3a1d8", "f3832918bc3c66617f92e35f5d70729187676313caa60c187eb0f28b8fe5e3b5"] +importlib-metadata = ["6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", "cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db"] +jinja2 = ["065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013", "14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b"] +lxml = ["06c7616601430aa140a69f97e3116308fffe0848f543b639a5ec2e8920ae72fd", "177202792f9842374a8077735c69c41a4282183f7851443d2beb8ee310720819", "19317ad721ceb9e39847d11131903931e2794e447d4751ebb0d9236f1b349ff2", "36d206e62f3e5dbaafd4ec692b67157e271f5da7fd925fda8515da675eace50d", "387115b066c797c85f9861a9613abf50046a15aac16759bc92d04f94acfad082", "3ce1c49d4b4a7bc75fb12acb3a6247bb7a91fe420542e6d671ba9187d12a12c2", "4d2a5a7d6b0dbb8c37dab66a8ce09a8761409c044017721c21718659fa3365a1", "58d0a1b33364d1253a88d18df6c0b2676a1746d27c969dc9e32d143a3701dda5", "62a651c618b846b88fdcae0533ec23f185bb322d6c1845733f3123e8980c1d1b", "69ff21064e7debc9b1b1e2eee8c2d686d042d4257186d70b338206a80c5bc5ea", "7060453eba9ba59d821625c6af6a266bd68277dce6577f754d1eb9116c094266", "7d26b36a9c4bce53b9cfe42e67849ae3c5c23558bc08363e53ffd6d94f4ff4d2", "83b427ad2bfa0b9705e02a83d8d607d2c2f01889eb138168e462a3a052c42368", "923d03c84534078386cf50193057aae98fa94cace8ea7580b74754493fda73ad", "b773715609649a1a180025213f67ffdeb5a4878c784293ada300ee95a1f3257b", "baff149c174e9108d4a2fee192c496711be85534eab63adb122f93e70aa35431", "bca9d118b1014b4c2d19319b10a3ebed508ff649396ce1855e1c96528d9b2fa9", "ce580c28845581535dc6000fc7c35fdadf8bea7ccb57d6321b044508e9ba0685", "d34923a569e70224d88e6682490e24c842907ba2c948c5fd26185413cbe0cd96", "dd9f0e531a049d8b35ec5e6c68a37f1ba6ec3a591415e6804cbdf652793d15d7", "ecb805cbfe9102f3fd3d2ef16dfe5ae9e2d7a7dfbba92f4ff1e16ac9784dbfb0", "ede9aad2197a0202caff35d417b671f5f91a3631477441076082a17c94edd846", "ef2d1fc370400e0aa755aab0b20cf4f1d0e934e7fd5244f3dd4869078e4942b9", "f2fec194a49bfaef42a548ee657362af5c7a640da757f6f452a35da7dd9f923c"] +markdown = ["2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a", "56a46ac655704b91e5b7e6326ce43d5ef72411376588afa1dd90e881b83c7e8c"] +markupsafe = ["00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473", "09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161", "09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235", "1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5", "24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff", "29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b", "43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1", "46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e", "500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183", "535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66", "62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1", "6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1", "717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e", "79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b", "7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905", "88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735", "8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d", "98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e", "9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d", "9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c", "ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21", "b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2", "b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5", "b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b", "ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6", "c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f", "cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f", "e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"] +mccabe = ["ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", "dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"] +mock = ["83657d894c90d5681d62155c82bda9c1187827525880eda8ff5df4ec813437c3", "d157e52d4e5b938c550f39eb2fd15610db062441a9c2747d3dbfa9298211d0f8"] +packaging = ["0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", "9e1cbf8c12b1f1ce0bb5344b8d7ecf66a6f8a6e91bcb0c84593ed6d3ab5c4ab3"] +pluggy = ["0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", "b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c"] +py = ["64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", "dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53"] +pycodestyle = ["95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", "e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c"] +pyflakes = ["17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", "d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2"] +pygments = ["71e430bc85c88a430f000ac1d9b331d2407f681d6f6aec95e8bcfbc3df5b0127", "881c4c157e45f30af185c1ffe8d549d48ac9127433f2c380c24b84572ad66297"] +pyparsing = ["1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", "9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03"] +python-dateutil = ["7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb", "c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"] +pytz = ["303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda", "d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141"] +six = ["3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"] +smartypants = ["8db97f7cbdf08d15b158a86037cd9e116b4cf37703d24e0419a0d64ca5808f0d"] +snowballstemmer = ["9f3b9ffe0809d174f7047e121431acf99c89a7040f0ca84f94ba53a498e6d0c9"] +soupsieve = ["72b5f1aea9101cf720a36bb2327ede866fd6f1a07b1e87c92a1cc18113cbc946", "e4e9c053d59795e440163733a7fec6c5972210e1790c507e4c7b051d6c5259de"] +sphinx = ["82cd2728c906be96e307b81352d3fd9fb731869234c6b835cc25e9a3dfb4b7e4", "b83f430200f546bfd5088c653f0c5516af708da36066dfde08d08bedb1b33a4b"] +sphinx-rtd-theme = ["00cf895504a7895ee433807c62094cf1e95f065843bf3acd17037c3e9a2becd4", "728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a"] +toml = ["229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", "235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e", "f1db651f9657708513243e61e6cc67d101a39bad662eaa9b5546f789338e07a3"] +tox = ["45a265e953368fb372cca3eac33b69fdb1b1453e5b114be231c84fc3dfadceed", "f5cb0b5b8d14f2100982b0981c750d840228180a348e6bad355aa38e949fbc3f"] +typing = ["38566c558a0a94d6531012c8e917b1b8518a41e418f7f15f00e129cc80162ad3", "53765ec4f83a2b720214727e319607879fec4acde22c4fbb54fa2604e79e44ce", "84698954b4e6719e912ef9a42a2431407fe3755590831699debda6fba92aac55"] +typogrify = ["8be4668cda434163ce229d87ca273a11922cb1614cb359970b7dc96eed13cb38"] +unidecode = ["1d7a042116536098d05d599ef2b8616759f02985c85b4fef50c78a5aaf10822a", "2b6aab710c2a1647e928e36d69c21e76b453cd455f4e2621000e54b2a9b8cce8"] +virtualenv = ["b7335cddd9260a3dd214b73a2521ffc09647bde3e9457fcca31dc3be3999d04a", "d28ca64c0f3f125f59cabf13e0a150e1c68e5eea60983cc4395d88c584495783"] +zipp = ["8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d", "ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3"] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..2545aa1c --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,57 @@ +[tool.poetry] +name = "pelican" +version = "4.0.1" +description = "Static site generator supporting Markdown and reStructuredText" +authors = ["Justin Mayer <entrop@gmail.com>"] +license = "AGPLv3" +readme = "README.rst" +keywords = ["static site generator", "static sites", "ssg"] + +homepage = "https://getpelican.com" +repository = "https://github.com/getpelican/pelican" +documentation = "https://docs.getpelican.com" + +classifiers = [ + "Development Status :: 5 - Production/Stable", + "Environment :: Console", + "Framework :: Pelican", + "License :: OSI Approved :: GNU Affero General Public License v3", + "Operating System :: OS Independent", + "Programming Language :: Python :: 2", + "Programming Language :: Python :: 2.7", + "Programming Language :: Python :: 3", + "Programming Language :: Python :: 3.5", + "Programming Language :: Python :: 3.6", + "Programming Language :: Python :: 3.7", + "Programming Language :: Python :: Implementation :: CPython", + "Topic :: Internet :: WWW/HTTP", + "Topic :: Software Development :: Libraries :: Python Modules", +] + +[tool.poetry.dependencies] +python = "~2.7 || ^3.5" +feedgenerator = "^1.9" +jinja2 = "~2.10.1" +pygments = "^2.4" +pytz = "^2019.1" +blinker = "^1.4" +unidecode = "^1.1" +python-dateutil = "^2.8" +docutils = "^0.14" +markdown = "~3.1.1" +six = "^1.4" + +[tool.poetry.dev-dependencies] +BeautifulSoup4 = "^4.7" +lxml = "^4.3" +typogrify = "^2.0" +mock = "^3.0" +sphinx = "=1.4.9" +sphinx_rtd_theme = "^0.4.3" +tox = "^3.13" +flake8 = "^3.7" +flake8-import-order = "^0.18.1" + +[build-system] +requires = ["poetry>=0.12"] +build-backend = "poetry.masonry.api" From b5c7e6fbe8cadb51f925f7060e91c7abecffe2f4 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Mon, 1 Jul 2019 13:52:57 +0200 Subject: [PATCH 035/143] Make Markdown an optional dependency in pyproject Refs #2585 --- poetry.lock | 9 ++++++--- pyproject.toml | 6 +++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/poetry.lock b/poetry.lock index 027094e4..971f6520 100644 --- a/poetry.lock +++ b/poetry.lock @@ -437,7 +437,7 @@ description = "tox is a generic virtualenv management and test command line tool name = "tox" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "3.13.1" +version = "3.13.2" [package.dependencies] filelock = ">=3.0.0,<4" @@ -493,8 +493,11 @@ optional = false python-versions = ">=2.7" version = "0.5.1" +[extras] +markdown = ["markdown"] + [metadata] -content-hash = "fe931042341d072acdb02907e16b4cd34947b8edbac5222f2521d961147280d7" +content-hash = "d22ff0db3331186ab2f809313de1f9efef1f9c708cc354eaa1638a5111404612" python-versions = "~2.7 || ^3.5" [metadata.hashes] @@ -539,7 +542,7 @@ soupsieve = ["72b5f1aea9101cf720a36bb2327ede866fd6f1a07b1e87c92a1cc18113cbc946", sphinx = ["82cd2728c906be96e307b81352d3fd9fb731869234c6b835cc25e9a3dfb4b7e4", "b83f430200f546bfd5088c653f0c5516af708da36066dfde08d08bedb1b33a4b"] sphinx-rtd-theme = ["00cf895504a7895ee433807c62094cf1e95f065843bf3acd17037c3e9a2becd4", "728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a"] toml = ["229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", "235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e", "f1db651f9657708513243e61e6cc67d101a39bad662eaa9b5546f789338e07a3"] -tox = ["45a265e953368fb372cca3eac33b69fdb1b1453e5b114be231c84fc3dfadceed", "f5cb0b5b8d14f2100982b0981c750d840228180a348e6bad355aa38e949fbc3f"] +tox = ["dab0b0160dd187b654fc33d690ee1d7bf328bd5b8dc6ef3bb3cc468969c659ba", "ee35ffce74933a6c6ac10c9a0182e41763140a5a5070e21b114feca56eaccdcd"] typing = ["38566c558a0a94d6531012c8e917b1b8518a41e418f7f15f00e129cc80162ad3", "53765ec4f83a2b720214727e319607879fec4acde22c4fbb54fa2604e79e44ce", "84698954b4e6719e912ef9a42a2431407fe3755590831699debda6fba92aac55"] typogrify = ["8be4668cda434163ce229d87ca273a11922cb1614cb359970b7dc96eed13cb38"] unidecode = ["1d7a042116536098d05d599ef2b8616759f02985c85b4fef50c78a5aaf10822a", "2b6aab710c2a1647e928e36d69c21e76b453cd455f4e2621000e54b2a9b8cce8"] diff --git a/pyproject.toml b/pyproject.toml index 2545aa1c..741b04bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,12 +38,13 @@ blinker = "^1.4" unidecode = "^1.1" python-dateutil = "^2.8" docutils = "^0.14" -markdown = "~3.1.1" +markdown = {version = "~3.1.1", optional = true} six = "^1.4" [tool.poetry.dev-dependencies] BeautifulSoup4 = "^4.7" lxml = "^4.3" +markdown = "~3.1.1" typogrify = "^2.0" mock = "^3.0" sphinx = "=1.4.9" @@ -52,6 +53,9 @@ tox = "^3.13" flake8 = "^3.7" flake8-import-order = "^0.18.1" +[tool.poetry.extras] +markdown = ["markdown"] + [build-system] requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api" From c988d6aaa25567ac71dd3db0b0e26eb7d3662326 Mon Sep 17 00:00:00 2001 From: Oliver Urs Lenz <oliver.urs.lenz@gmail.com> Date: Wed, 3 Jul 2019 22:55:44 +0200 Subject: [PATCH 036/143] replace os.mknod with open for macos and windows compatibility --- pelican/tests/test_server.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pelican/tests/test_server.py b/pelican/tests/test_server.py index 508b75ff..8704c6b5 100644 --- a/pelican/tests/test_server.py +++ b/pelican/tests/test_server.py @@ -35,12 +35,12 @@ class TestServer(unittest.TestCase): self.server) handler.base_path = self.temp_output - os.mknod(os.path.join(self.temp_output, 'foo.html')) + open(os.path.join(self.temp_output, 'foo.html'), 'a').close() os.mkdir(os.path.join(self.temp_output, 'foo')) - os.mknod(os.path.join(self.temp_output, 'foo', 'index.html')) + open(os.path.join(self.temp_output, 'foo', 'index.html'), 'a').close() os.mkdir(os.path.join(self.temp_output, 'bar')) - os.mknod(os.path.join(self.temp_output, 'bar', 'index.html')) + open(os.path.join(self.temp_output, 'bar', 'index.html'), 'a').close() os.mkdir(os.path.join(self.temp_output, 'baz')) From 54911fff39a57426f4b071675c5f0b0a5dc6e2ef Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Wed, 3 Jul 2019 23:31:38 +0200 Subject: [PATCH 037/143] Consolidate version strings in pyproject.toml Storing the current version in a single place greatly simplifies issuing new package releases. --- docs/conf.py | 2 +- pelican/__init__.py | 7 ++++++- setup.py | 20 +++++++++++++++++++- 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7645a86d..43009cdd 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -22,7 +22,7 @@ copyright = '2010 – present, Alexis Metaireau and contributors' exclude_patterns = ['_build'] release = __version__ version = '.'.join(release.split('.')[:1]) -last_stable = '4.0.1' +last_stable = __version__ rst_prolog = ''' .. |last_stable| replace:: :pelican-doc:`{0}` '''.format(last_stable) diff --git a/pelican/__init__.py b/pelican/__init__.py index 9b5791ac..0a06d905 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -32,7 +32,12 @@ from pelican.utils import (clean_output_dir, file_watcher, folder_watcher, maybe_pluralize) from pelican.writers import Writer -__version__ = "4.0.2.dev0" +try: + __version__ = __import__('pkg_resources') \ + .get_distribution('pelican').version +except Exception: + __version__ = "unknown" + DEFAULT_CONFIG_NAME = 'pelicanconf.py' logger = logging.getLogger(__name__) diff --git a/setup.py b/setup.py index e8918941..53d9dd1c 100755 --- a/setup.py +++ b/setup.py @@ -1,4 +1,5 @@ #!/usr/bin/env python +import re import sys from io import open from os import walk @@ -6,6 +7,23 @@ from os.path import join, relpath from setuptools import setup + +def get_version(): + VERSION_REGEX = re.compile( + r"^version\s*=\s*\"(?P<version>.*)\"$" + ) + with open("pyproject.toml") as f: + for line in f: + match = VERSION_REGEX.match(line) + + if match: + return match.group("version") + + return None + + +version = get_version() + requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', 'python-dateutil'] @@ -28,7 +46,7 @@ if sys.version_info.major < 3: setup( name='pelican', - version='4.0.2.dev0', + version=version, url='https://getpelican.com/', author='Alexis Metaireau', maintainer='Justin Mayer', From a52c67d42c5989ac939a231ee0611b60d96e91d2 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sun, 14 Jul 2019 16:55:32 +0200 Subject: [PATCH 038/143] Revert setup.py portion of "version-in-one-place" Defining the version string in a single place is a nice goal to have, but since we are currently straddling the fence as it relates to setuptools and pyproject.toml, mingling them together results in some unexpected behavior and is thus not advisable. We can revisit this if and when we make a full switch away from setuptools. --- setup.py | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/setup.py b/setup.py index 53d9dd1c..2a7f60d9 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ #!/usr/bin/env python -import re import sys from io import open from os import walk @@ -8,21 +7,7 @@ from os.path import join, relpath from setuptools import setup -def get_version(): - VERSION_REGEX = re.compile( - r"^version\s*=\s*\"(?P<version>.*)\"$" - ) - with open("pyproject.toml") as f: - for line in f: - match = VERSION_REGEX.match(line) - - if match: - return match.group("version") - - return None - - -version = get_version() +version = "4.0.1" requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', From 3aacc114fd286c1bfea3ae33c29cf20ab2f90d6f Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sun, 14 Jul 2019 17:05:40 +0200 Subject: [PATCH 039/143] Add Pelican entry point to pyproject.toml Otherwise, the `pelican` CLI command may not be available when installing via Poetry. --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 741b04bb..4564d53f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -56,6 +56,9 @@ flake8-import-order = "^0.18.1" [tool.poetry.extras] markdown = ["markdown"] +[tool.poetry.scripts] +pelican = "pelican.__main__:main" + [build-system] requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api" From 5bb4bab71858b21f887f737e97b4dd4c9599e7bf Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sun, 14 Jul 2019 17:09:11 +0200 Subject: [PATCH 040/143] Add pyproject.toml to MANIFEST.in --- MANIFEST.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MANIFEST.in b/MANIFEST.in index 49e2bef9..138c8f00 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,3 +1,3 @@ include *.rst recursive-include pelican *.html *.css *png *.rst *.markdown *.md *.mkd *.xml *.py -include LICENSE THANKS docs/changelog.rst +include LICENSE THANKS docs/changelog.rst pyproject.toml From d9e58f3096d85e281df78fbc860b87354d2fa72a Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sun, 14 Jul 2019 17:21:54 +0200 Subject: [PATCH 041/143] Increment version in preparation for imminent release --- pyproject.toml | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 4564d53f..f27dc047 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pelican" -version = "4.0.1" +version = "4.1.0" description = "Static site generator supporting Markdown and reStructuredText" authors = ["Justin Mayer <entrop@gmail.com>"] license = "AGPLv3" diff --git a/setup.py b/setup.py index 2a7f60d9..f9076f4d 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from os.path import join, relpath from setuptools import setup -version = "4.0.1" +version = "4.1.0" requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', From f61bd2ceba5be68833d6a7b9d1a6670046dc0581 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sun, 14 Jul 2019 17:32:12 +0200 Subject: [PATCH 042/143] Update changelog for Pelican 4.1.0 --- docs/changelog.rst | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/changelog.rst b/docs/changelog.rst index cdd3697c..be87ed17 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,9 +1,18 @@ Release history ############### -Next Release +4.1.0 - 2019-07-14 ================== +* Live browser reload upon changed files (provided via Invoke task) +* Add ``pyproject.toml``, managed by Poetry +* Support for invoking ``python -m pelican`` +* Add relative source path attribute to content +* Allow directories in ``EXTRA_PATH_METADATA`` +* Add ``all_articles`` variable to period pages (for recent posts functionality) +* Improve debug mode output +* Remove blank or duplicate summaries from Atom feed +* Fix bugs in pagination, pelican-import, pelican-quickstart, and feed importer 4.0.1 (2018-11-30) ================== From 021f15256a825e256be0cb6a8a3d237abc59ecda Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Tue, 23 Jul 2019 16:37:09 +0200 Subject: [PATCH 043/143] Add CSS classes for reStructuredText figures Fixes #2113 --- pelican/tests/output/basic/theme/css/main.css | 19 +++++++++++++++++-- .../tests/output/custom/theme/css/main.css | 19 +++++++++++++++++-- .../output/custom_locale/theme/css/main.css | 19 +++++++++++++++++-- pelican/themes/notmyidea/static/css/main.css | 19 +++++++++++++++++-- 4 files changed, 68 insertions(+), 8 deletions(-) diff --git a/pelican/tests/output/basic/theme/css/main.css b/pelican/tests/output/basic/theme/css/main.css index 9673ca45..2b9d96e3 100644 --- a/pelican/tests/output/basic/theme/css/main.css +++ b/pelican/tests/output/basic/theme/css/main.css @@ -148,8 +148,23 @@ aside, nav, article, figure { /***** 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;} +img.right, figure.right, div.figure.align-right { + float: right; + margin: 0 0 2em 2em; +} +img.left, figure.left, div.figure.align-left { + float: left; + margin: 0 2em 2em 0; +} + +/* .rst support */ +div.figure img, figure img { /* to fill figure exactly */ + width: 100%; +} +div.figure p.caption, figure p.caption { /* margin provided by figure */ + margin-top: 0; + margin-bottom: 0; +} /* Header diff --git a/pelican/tests/output/custom/theme/css/main.css b/pelican/tests/output/custom/theme/css/main.css index 9673ca45..2b9d96e3 100644 --- a/pelican/tests/output/custom/theme/css/main.css +++ b/pelican/tests/output/custom/theme/css/main.css @@ -148,8 +148,23 @@ aside, nav, article, figure { /***** 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;} +img.right, figure.right, div.figure.align-right { + float: right; + margin: 0 0 2em 2em; +} +img.left, figure.left, div.figure.align-left { + float: left; + margin: 0 2em 2em 0; +} + +/* .rst support */ +div.figure img, figure img { /* to fill figure exactly */ + width: 100%; +} +div.figure p.caption, figure p.caption { /* margin provided by figure */ + margin-top: 0; + margin-bottom: 0; +} /* Header diff --git a/pelican/tests/output/custom_locale/theme/css/main.css b/pelican/tests/output/custom_locale/theme/css/main.css index 9673ca45..2b9d96e3 100644 --- a/pelican/tests/output/custom_locale/theme/css/main.css +++ b/pelican/tests/output/custom_locale/theme/css/main.css @@ -148,8 +148,23 @@ aside, nav, article, figure { /***** 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;} +img.right, figure.right, div.figure.align-right { + float: right; + margin: 0 0 2em 2em; +} +img.left, figure.left, div.figure.align-left { + float: left; + margin: 0 2em 2em 0; +} + +/* .rst support */ +div.figure img, figure img { /* to fill figure exactly */ + width: 100%; +} +div.figure p.caption, figure p.caption { /* margin provided by figure */ + margin-top: 0; + margin-bottom: 0; +} /* Header diff --git a/pelican/themes/notmyidea/static/css/main.css b/pelican/themes/notmyidea/static/css/main.css index 9673ca45..2b9d96e3 100644 --- a/pelican/themes/notmyidea/static/css/main.css +++ b/pelican/themes/notmyidea/static/css/main.css @@ -148,8 +148,23 @@ aside, nav, article, figure { /***** 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;} +img.right, figure.right, div.figure.align-right { + float: right; + margin: 0 0 2em 2em; +} +img.left, figure.left, div.figure.align-left { + float: left; + margin: 0 2em 2em 0; +} + +/* .rst support */ +div.figure img, figure img { /* to fill figure exactly */ + width: 100%; +} +div.figure p.caption, figure p.caption { /* margin provided by figure */ + margin-top: 0; + margin-bottom: 0; +} /* Header From daee3c2336b66141cf3aaf8e9824b21ab3661e72 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Tue, 23 Jul 2019 18:44:55 +0200 Subject: [PATCH 044/143] Add Stale bot --- .github/stale.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/stale.yml diff --git a/.github/stale.yml b/.github/stale.yml new file mode 100644 index 00000000..d457dc02 --- /dev/null +++ b/.github/stale.yml @@ -0,0 +1,25 @@ +# Configuration for probot-stale - https://github.com/probot/stale + +# Set to true to ignore issues in a project (defaults to false) +exemptProjects: true + +# Set to true to ignore issues in a milestone (defaults to false) +exemptMilestones: true + +# Set to true to ignore issues with an assignee (defaults to false) +exemptAssignees: true + +# Label to use when marking as stale +staleLabel: retired + +# Comment to post when marking as stale. Set to `false` to disable +markComment: > + This issue has been automatically marked as stale because it has not had + recent activity. It will be closed if no further activity occurs. Thank you + for your participation and understanding. + +# Limit the number of actions per hour, from 1-30. Default is 30 +limitPerRun: 1 + +# Limit to only `issues` or `pulls` +only: issues From a7e58ac3a354e5476beb23200d968ec1cd9d0e7f Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sun, 28 Jul 2019 07:09:40 +0200 Subject: [PATCH 045/143] Keep building packages via setuptools for now While it may make sense to switch to an alternate build system (such as Poetry) at some point, at this early stage it seems prudent to designate setuptools as the build system in pyproject.toml until the more modern build system tooling matures. --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index f27dc047..903e4532 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -60,5 +60,4 @@ markdown = ["markdown"] pelican = "pelican.__main__:main" [build-system] -requires = ["poetry>=0.12"] -build-backend = "poetry.masonry.api" +requires = ["setuptools >= 40.6.0", "wheel"] From 06dee4de581fffddc3e188b9ab8074f6a98bd461 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sun, 28 Jul 2019 07:15:48 +0200 Subject: [PATCH 046/143] Add AutoPub to auto-publish releases on PR merge Contributors will henceforth be asked to include a `RELEASE.md` file containing the release type and summary of changes, which will be used by the continuous integration (CI) system to automatically publish a new release to PyPI when the pull request is merged. For more details, see: https://github.com/autopub/autopub --- .travis.yml | 23 +++++++++++++++++++++++ CONTRIBUTING.rst | 8 ++++++++ pyproject.toml | 7 +++++++ 3 files changed, 38 insertions(+) diff --git a/.travis.yml b/.travis.yml index 762ada98..a4a1e1f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,8 +23,31 @@ before_install: install: - pip install tox==2.5.0 script: tox -e $TOX_ENV +before_deploy: + - 'if [ "$TRAVIS_PULL_REQUEST" != "false" ]; then travis_terminate 0; fi' + - pip install githubrelease + - pip install --pre autopub + - autopub check || travis_terminate 0 + - pip install poetry + - pip install twine + - git checkout ${TRAVIS_BRANCH} + - git remote set-url origin https://$GITHUB_TOKEN@github.com/$TRAVIS_REPO_SLUG +deploy: + provider: script + script: autopub deploy + skip_cleanup: true + on: + branch: master + python: "3.7" notifications: irc: channels: - "irc.freenode.org#pelican" on_success: change +env: + global: + - PYPI_USERNAME=autopub + - secure: "h5V/+YL+CrqvfAesNkSb824Ngk5x+f0eFzj/LBbmnzjvArKAmc6R6WGyx8SDD7WF/PlaTf0M1fH3a7pjIS8Ee+TS1Rb0Lt1HPqUs1yntg1+Js2ZQp3p20wfsDc+bZ4/2g8xLsSMv1EJ4np7/GJ5fXqpSxjr/Xs5LYA7ZLwNNwDw=" + - secure: "GiDFfmjH7uzYNnkjQMV/mIkbRdmgkGmtbFPeaj9taBNA5tPp3IBt3GOOS6UL/zm9xiwu9Xo6sxZWkGzY19Hsdv28YPH34N3abo0QSnz4IGiHs152Hi7Qi6Tb0QkT5D3OxuSIm8LmFL7+su89Q7vBFowrT6HL1Mn8CDDWSj3eqbo=" + - TWINE_USERNAME=$PYPI_USERNAME + - TWINE_PASSWORD=$PYPI_PASSWORD diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 49660ea1..7ae47593 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -97,6 +97,14 @@ Using Git and GitHub For example, if you're hacking on a new feature and find a bugfix that doesn't *require* your new feature, **make a new distinct branch and pull request** for the bugfix. +* Add a ``RELEASE.md`` file in the root of the project that contains the + release type (major, minor, patch) and a summary of the changes that will be + used as the release changelog entry. For example:: + + Release type: minor + + Reload browser window upon changes to content, settings, or theme + * Check for unnecessary whitespace via ``git diff --check`` before committing. * First line of your commit message should start with present-tense verb, be 50 characters or less, and include the relevant issue number(s) if applicable. diff --git a/pyproject.toml b/pyproject.toml index 903e4532..185c605b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -59,5 +59,12 @@ markdown = ["markdown"] [tool.poetry.scripts] pelican = "pelican.__main__:main" +[tool.autopub] +project-name = "Pelican" +git-username = "botpub" +git-email = "botpub@autopub.rocks" +version-strings = ["setup.py"] +build-system = "setuptools" + [build-system] requires = ["setuptools >= 40.6.0", "wheel"] From 360ff420d34603ffa490aff29ff8c66fd6cf4223 Mon Sep 17 00:00:00 2001 From: Lucas Cimon <lucas.cimon@gmail.com> Date: Thu, 1 Aug 2019 13:53:56 +0200 Subject: [PATCH 047/143] Allowing to pass `argv` to pelican `main` entrypoint --- pelican/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 0a06d905..86c956b0 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -307,7 +307,7 @@ class PrintSettings(argparse.Action): parser.exit() -def parse_arguments(): +def parse_arguments(argv=None): parser = argparse.ArgumentParser( description='A tool to generate a static blog, ' ' with restructured text input files.', @@ -400,7 +400,7 @@ def parse_arguments(): help='IP to bind to when serving files via HTTP ' '(default: 127.0.0.1)') - args = parser.parse_args() + args = parser.parse_args(argv) if args.port is not None and not args.listen: logger.warning('--port without --listen has no effect') @@ -560,8 +560,8 @@ def listen(server, port, output, excqueue=None): return -def main(): - args = parse_arguments() +def main(argv=None): + args = parse_arguments(argv) logs_dedup_min_level = getattr(logging, args.logs_dedup_min_level) init_logging(args.verbosity, args.fatal, logs_dedup_min_level=logs_dedup_min_level) From 7c2a7478d7a6024f6f854f934f213e7130666e2b Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Fri, 2 Aug 2019 14:53:51 +0200 Subject: [PATCH 048/143] Consolidate duplicate Travis `env` definitions --- .travis.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.travis.yml b/.travis.yml index a4a1e1f7..7bb5ef3b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -2,11 +2,18 @@ language: python python: - "3.6" env: - - TOX_ENV=docs - - TOX_ENV=flake8 - - TOX_ENV=py27 - - TOX_ENV=py35 - - TOX_ENV=py36 + global: + - PYPI_USERNAME=autopub + - secure: "h5V/+YL+CrqvfAesNkSb824Ngk5x+f0eFzj/LBbmnzjvArKAmc6R6WGyx8SDD7WF/PlaTf0M1fH3a7pjIS8Ee+TS1Rb0Lt1HPqUs1yntg1+Js2ZQp3p20wfsDc+bZ4/2g8xLsSMv1EJ4np7/GJ5fXqpSxjr/Xs5LYA7ZLwNNwDw=" + - secure: "GiDFfmjH7uzYNnkjQMV/mIkbRdmgkGmtbFPeaj9taBNA5tPp3IBt3GOOS6UL/zm9xiwu9Xo6sxZWkGzY19Hsdv28YPH34N3abo0QSnz4IGiHs152Hi7Qi6Tb0QkT5D3OxuSIm8LmFL7+su89Q7vBFowrT6HL1Mn8CDDWSj3eqbo=" + - TWINE_USERNAME=$PYPI_USERNAME + - TWINE_PASSWORD=$PYPI_PASSWORD + matrix: + - TOX_ENV=docs + - TOX_ENV=flake8 + - TOX_ENV=py27 + - TOX_ENV=py35 + - TOX_ENV=py36 matrix: include: - python: 3.7 @@ -44,10 +51,3 @@ notifications: channels: - "irc.freenode.org#pelican" on_success: change -env: - global: - - PYPI_USERNAME=autopub - - secure: "h5V/+YL+CrqvfAesNkSb824Ngk5x+f0eFzj/LBbmnzjvArKAmc6R6WGyx8SDD7WF/PlaTf0M1fH3a7pjIS8Ee+TS1Rb0Lt1HPqUs1yntg1+Js2ZQp3p20wfsDc+bZ4/2g8xLsSMv1EJ4np7/GJ5fXqpSxjr/Xs5LYA7ZLwNNwDw=" - - secure: "GiDFfmjH7uzYNnkjQMV/mIkbRdmgkGmtbFPeaj9taBNA5tPp3IBt3GOOS6UL/zm9xiwu9Xo6sxZWkGzY19Hsdv28YPH34N3abo0QSnz4IGiHs152Hi7Qi6Tb0QkT5D3OxuSIm8LmFL7+su89Q7vBFowrT6HL1Mn8CDDWSj3eqbo=" - - TWINE_USERNAME=$PYPI_USERNAME - - TWINE_PASSWORD=$PYPI_PASSWORD From b2da535fecafa7a81feee2dd5b19eb1fffcc9a94 Mon Sep 17 00:00:00 2001 From: MinchinWeb <w_minchin@hotmail.com> Date: Tue, 20 Aug 2019 19:39:14 -0600 Subject: [PATCH 049/143] Set default content status to a blank string rather than `None`. Fixes #2558. Fixes issues encountered by comment plugins among others c.f. [1](https://github.com/bstpierre/pelican-comments/pull/4), [2](https://github.com/Scheirle/pelican_comment_system/issues/8), [3](https://github.com/Scheirle/pelican_comment_system/pull/7) --- RELEASE.md | 7 +++++++ pelican/contents.py | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..dccbdff8 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,7 @@ +Release type: patch + +Set default content status to a blank string rather than `None`. Fixes +[#2558](https://github.com/getpelican/pelican/issues/2558). Fixes issues +encountered by comment plugins among others +([1](https://github.com/bstpierre/pelican-comments/pull/4), +[2](https://github.com/Scheirle/pelican_comment_system/issues/8)). diff --git a/pelican/contents.py b/pelican/contents.py index 9292f14f..74524d60 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -141,7 +141,9 @@ class Content(object): # manage status if not hasattr(self, 'status'): - self.status = getattr(self, 'default_status', None) + # using None as the default here breaks comment plugins (and + # probably others) + self.status = getattr(self, 'default_status', '') # store the summary metadata if it is set if 'summary' in metadata: From f1430472b8cb43302516de8acf356c56706b92ff Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Wed, 21 Aug 2019 14:31:51 +0200 Subject: [PATCH 050/143] Configure AutoPub for Pelican changelog path & format --- pyproject.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pyproject.toml b/pyproject.toml index 185c605b..6a0e048a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -63,6 +63,9 @@ pelican = "pelican.__main__:main" project-name = "Pelican" git-username = "botpub" git-email = "botpub@autopub.rocks" +changelog-file = "docs/changelog.rst" +changelog-header = "###############" +version-header = "=" version-strings = ["setup.py"] build-system = "setuptools" From 8353cea6b6b66f73893f6ccc7d886eb227cb1ce0 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Wed, 21 Aug 2019 14:38:17 +0200 Subject: [PATCH 051/143] Add changelog entries to prepare for release --- RELEASE.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index dccbdff8..920b6a14 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,7 +1,6 @@ Release type: patch -Set default content status to a blank string rather than `None`. Fixes -[#2558](https://github.com/getpelican/pelican/issues/2558). Fixes issues -encountered by comment plugins among others -([1](https://github.com/bstpierre/pelican-comments/pull/4), -[2](https://github.com/Scheirle/pelican_comment_system/issues/8)). +* Add AutoPub to auto-publish releases on PR merge +* Add CSS classes for reStructuredText figures +* Pass `argv` to Pelican `main` entrypoint +* Set default content status to a blank string rather than `None` From 2ee423017bb444e1370b50862340559012bda739 Mon Sep 17 00:00:00 2001 From: MinchinWeb <w_minchin@hotmail.com> Date: Tue, 20 Aug 2019 19:01:39 -0600 Subject: [PATCH 052/143] Skip some non-Windows tests on Windows Some tests will never pass on Windows due to differences in filesystems between Windows and Linux. --- RELEASE.md | 4 ++++ pelican/tests/test_contents.py | 9 +++++---- pelican/tests/test_generators.py | 19 ++++++++++++++++--- pelican/tests/test_utils.py | 6 ++++++ 4 files changed, 31 insertions(+), 7 deletions(-) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..521973a9 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,4 @@ +Release type: patch + +Skip some tests (on Windows) that are un-able to pass on Windows due to the +difference in Windows vs Linux filesystems. diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 104bc889..efc438c8 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -14,9 +14,10 @@ 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, get_context, get_settings,\ - unittest -from pelican.utils import SafeDatetime, path_to_url, truncate_html_words +from pelican.tests.support import (LoggedTestCase, get_context, get_settings, + unittest) +from pelican.utils import (SafeDatetime, path_to_url, posixize_path, + truncate_html_words) # generate one paragraph, enclosed with <p> @@ -943,7 +944,7 @@ class TestStatic(LoggedTestCase): source_path=os.path.join('dir', 'foo.jpg'), context=self.settings.copy()) - expected_save_as = os.path.join('dir', 'foo.jpg') + expected_save_as = posixize_path(os.path.join('dir', 'foo.jpg')) self.assertEqual(static.status, 'draft') self.assertEqual(static.save_as, expected_save_as) self.assertEqual(static.url, path_to_url(expected_save_as)) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 267571da..2455d1f4 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -1089,7 +1089,12 @@ class TestStaticGenerator(unittest.TestCase): os.mkdir(os.path.join(self.temp_output, "static")) self.generator.fallback_to_symlinks = True self.generator.generate_context() - self.generator.generate_output(None) + try: + self.generator.generate_output(None) + except OSError as e: + # On Windows, possibly others, due to not holding symbolic link + # privilege + self.skipTest(e) self.assertTrue(os.path.islink(self.endfile)) def test_existing_symlink_is_considered_up_to_date(self): @@ -1097,7 +1102,11 @@ class TestStaticGenerator(unittest.TestCase): with open(self.startfile, "w") as f: f.write("staticcontent") os.mkdir(os.path.join(self.temp_output, "static")) - os.symlink(self.startfile, self.endfile) + try: + os.symlink(self.startfile, self.endfile) + except OSError as e: + # On Windows, possibly others + self.skipTest(e) staticfile = MagicMock() staticfile.source_path = self.startfile staticfile.save_as = self.endfile @@ -1109,7 +1118,11 @@ class TestStaticGenerator(unittest.TestCase): with open(self.startfile, "w") as f: f.write("staticcontent") os.mkdir(os.path.join(self.temp_output, "static")) - os.symlink("invalid", self.endfile) + try: + os.symlink("invalid", self.endfile) + except OSError as e: + # On Windows, possibly others + self.skipTest(e) staticfile = MagicMock() staticfile.source_path = self.startfile staticfile.save_as = self.endfile diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 2831eeed..444190d3 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -717,6 +717,8 @@ class TestDateFormatter(unittest.TestCase): class TestSanitisedJoin(unittest.TestCase): + @unittest.skipIf(platform == 'win32', + "Different filesystem root on Windows") def test_detect_parent_breakout(self): with six.assertRaisesRegex( self, @@ -727,6 +729,8 @@ class TestSanitisedJoin(unittest.TestCase): "../test" ) + @unittest.skipIf(platform == 'win32', + "Different filesystem root on Windows") def test_detect_root_breakout(self): with six.assertRaisesRegex( self, @@ -737,6 +741,8 @@ class TestSanitisedJoin(unittest.TestCase): "/test" ) + @unittest.skipIf(platform == 'win32', + "Different filesystem root on Windows") def test_pass_deep_subpaths(self): self.assertEqual( utils.sanitised_join( From 9db42658e50254bf72b0f9a16755bb631f601b6c Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Fri, 23 Aug 2019 17:02:47 +0200 Subject: [PATCH 053/143] Prevent Travis IRC spam from forks See: https://github.com/travis-ci/travis-ci/issues/5063 --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 7bb5ef3b..6641d4cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -46,8 +46,9 @@ deploy: on: branch: master python: "3.7" +# The channel name "irc.freenode.org#pelican" is encrypted against getpelican/pelican to prevent IRC spam of forks notifications: irc: channels: - - "irc.freenode.org#pelican" + - secure: "JP57f61QovrhmLoAF6oPOzIK2aXGfSO06FHg7yiuKBOWMiaxQejZUGJX919muCLhWJXDugsviIqCMoAWwNV3o1WQbqIr+G5TR+N9MrtCs4Zi6vpGj09bR8giKUKx+PPKEoe1Ew56E4y2LxzGO4Lj9hZx8M2YVdwPNWrWZgp6WXE=" on_success: change From f6ef0270144b96863ae9811edbc802c56091a2a3 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Fri, 23 Aug 2019 19:02:48 +0200 Subject: [PATCH 054/143] Tidy and shorten a comment --- pelican/contents.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pelican/contents.py b/pelican/contents.py index 74524d60..a862db2d 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -141,8 +141,7 @@ class Content(object): # manage status if not hasattr(self, 'status'): - # using None as the default here breaks comment plugins (and - # probably others) + # Previous default of None broke comment plugins and perhaps others self.status = getattr(self, 'default_status', '') # store the summary metadata if it is set From e44aa294b0641655165fefdcbce72484e3ce7c57 Mon Sep 17 00:00:00 2001 From: botpub <botpub@autopub.rocks> Date: Fri, 23 Aug 2019 17:06:52 +0000 Subject: [PATCH 055/143] Release Pelican 4.1.1 --- RELEASE.md | 6 ------ docs/changelog.rst | 8 ++++++++ pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 920b6a14..00000000 --- a/RELEASE.md +++ /dev/null @@ -1,6 +0,0 @@ -Release type: patch - -* Add AutoPub to auto-publish releases on PR merge -* Add CSS classes for reStructuredText figures -* Pass `argv` to Pelican `main` entrypoint -* Set default content status to a blank string rather than `None` diff --git a/docs/changelog.rst b/docs/changelog.rst index be87ed17..fd7cada4 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,14 @@ Release history ############### +4.1.1 - 2019-08-23 +================== + +* Add AutoPub to auto-publish releases on PR merge +* Add CSS classes for reStructuredText figures +* Pass `argv` to Pelican `main` entrypoint +* Set default content status to a blank string rather than `None` + 4.1.0 - 2019-07-14 ================== diff --git a/pyproject.toml b/pyproject.toml index 6a0e048a..31bb1829 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pelican" -version = "4.1.0" +version = "4.1.1" description = "Static site generator supporting Markdown and reStructuredText" authors = ["Justin Mayer <entrop@gmail.com>"] license = "AGPLv3" diff --git a/setup.py b/setup.py index f9076f4d..1bdeee80 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from os.path import join, relpath from setuptools import setup -version = "4.1.0" +version = "4.1.1" requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', From 41fbf3adb29d35dd558999420858538bc41108a3 Mon Sep 17 00:00:00 2001 From: Jorge Maldonado Ventura <jorgesumle@freakspot.net> Date: Mon, 26 Aug 2019 00:35:53 +0200 Subject: [PATCH 056/143] [Documentation] Add comma after 'for instance' --- docs/themes.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/themes.rst b/docs/themes.rst index 354e0c36..b00d0236 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -75,7 +75,7 @@ output_file The name of the file currently being generated. For 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 + 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, From 7f4e614bb8f7f43b8419c896ee0cd1bedd4e0a9c Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sat, 21 Sep 2019 10:57:35 -0600 Subject: [PATCH 057/143] Fix formatting, etc in Settings documentation --- docs/settings.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 7085db84..5d090a62 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -983,7 +983,7 @@ By default, pages subsequent to ``.../foo.html`` are created as ``.../foo2.html``, etc. The ``PAGINATION_PATTERNS`` setting can be used to change this. It takes a sequence of triples, where each triple consists of:: - (minimum_page, page_url, page_save_as,) + (minimum_page, page_url, page_save_as,) For ``page_url`` and ``page_save_as``, you may use a number of variables. ``{url}`` and ``{save_as}`` correspond respectively to the ``*_URL`` and @@ -997,7 +997,7 @@ subsequent pages at ``.../page/2/`` etc, you could set ``PAGINATION_PATTERNS`` as follows:: PAGINATION_PATTERNS = ( - (1, '{url}', '{save_as}`, + (1, '{url}', '{save_as}', (2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'), ) @@ -1238,7 +1238,7 @@ ignored. Simply populate the list with the log messages you want to hide, and they will be filtered out. For example:: - + import logging LOG_FILTER = [(logging.WARN, 'TAG_SAVE_AS is set to False')] From 589a31ddd0d447934b7cf09d8675bb0c73a92d90 Mon Sep 17 00:00:00 2001 From: Lucas Cimon <lucas.cimon@gmail.com> Date: Mon, 23 Sep 2019 19:38:18 +0200 Subject: [PATCH 058/143] Pushing Python compatibility to Python 3.5+ --- docs/quickstart.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 4e6714b4..4ad9416f 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -8,7 +8,7 @@ Installation ------------ Install Pelican (and optionally Markdown if you intend to use it) on Python -2.7.x or Python 3.3+ by running the following command in your preferred +2.7.x or Python 3.5+ by running the following command in your preferred terminal, prefixing with ``sudo`` if permissions warrant:: pip install pelican markdown From 367245cc47e9acae03e06f37de088551165154c7 Mon Sep 17 00:00:00 2001 From: Lucas Cimon <lucas.cimon@gmail.com> Date: Mon, 23 Sep 2019 17:48:56 +0200 Subject: [PATCH 059/143] Fix pelican.settings.load_source to avoid caching issues --- RELEASE.md | 3 +++ pelican/settings.py | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..5c1ba5d3 --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,3 @@ +Release type: patch + +Fix pelican.settings.load_source to avoid caching issues - PR #2621 diff --git a/pelican/settings.py b/pelican/settings.py index a957b26c..4aa31afe 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -14,12 +14,16 @@ import six from pelican.log import LimitFilter + try: - # SourceFileLoader is the recommended way in Python 3.3+ - from importlib.machinery import SourceFileLoader + # spec_from_file_location is the recommended way in Python 3.5+ + import importlib.util def load_source(name, path): - return SourceFileLoader(name, path).load_module() + spec = importlib.util.spec_from_file_location(name, path) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod except ImportError: # but it does not exist in Python 2.7, so fall back to imp import imp From 3f96cb8a4a91742a85fe8b548749efd4b12a1ff0 Mon Sep 17 00:00:00 2001 From: botpub <botpub@autopub.rocks> Date: Mon, 23 Sep 2019 18:21:15 +0000 Subject: [PATCH 060/143] Release Pelican 4.1.2 --- RELEASE.md | 3 --- docs/changelog.rst | 5 +++++ pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) delete mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 5c1ba5d3..00000000 --- a/RELEASE.md +++ /dev/null @@ -1,3 +0,0 @@ -Release type: patch - -Fix pelican.settings.load_source to avoid caching issues - PR #2621 diff --git a/docs/changelog.rst b/docs/changelog.rst index fd7cada4..5e5d7cdf 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,11 @@ Release history ############### +4.1.2 - 2019-09-23 +================== + +Fix pelican.settings.load_source to avoid caching issues - PR #2621 + 4.1.1 - 2019-08-23 ================== diff --git a/pyproject.toml b/pyproject.toml index 31bb1829..fce734f6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pelican" -version = "4.1.1" +version = "4.1.2" description = "Static site generator supporting Markdown and reStructuredText" authors = ["Justin Mayer <entrop@gmail.com>"] license = "AGPLv3" diff --git a/setup.py b/setup.py index 1bdeee80..e4f2995a 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from os.path import join, relpath from setuptools import setup -version = "4.1.1" +version = "4.1.2" requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', From 8734bd1a6f0944442ac8536bf3d92a5ad28f9201 Mon Sep 17 00:00:00 2001 From: Romain Porte <microjoe@microjoe.org> Date: Tue, 24 Sep 2019 22:07:01 +0200 Subject: [PATCH 061/143] templates: tasks.py: introduce "production_port" to fix #2623 The syntax passed to rsync for specifying the port is incorrect. In the Makefile template, the -e option is correctly used to pass the port. We use the same syntax here to pass the SSH port. This fix issue #2623. Signed-off-by: Romain Porte <microjoe@microjoe.org> --- pelican/tools/templates/tasks.py.jinja2 | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index a800b79b..1c063f08 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -23,7 +23,8 @@ CONFIG = { 'deploy_path': SETTINGS['OUTPUT_PATH'], {% if ssh %} # Remote server configuration - 'production': '{{ssh_user}}@{{ssh_host}}:{{ssh_port}}', + 'production': '{{ssh_user}}@{{ssh_host}}', + 'production_port': {{ssh_port}}, 'dest_path': '{{ssh_target_dir}}', {% endif %} {% if cloudfiles %} @@ -130,6 +131,7 @@ def publish(c): c.run('pelican -s {settings_publish}'.format(**CONFIG)) c.run( 'rsync --delete --exclude ".DS_Store" -pthrvz -c ' + '-e "ssh -p {production_port}" ' '{} {production}:{dest_path}'.format( CONFIG['deploy_path'].rstrip('/') + '/', **CONFIG)) From db04f012971f154c3f7601ced1d666bee0ea8da9 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sat, 28 Sep 2019 13:45:58 -0700 Subject: [PATCH 062/143] Add related project URLs for display on PyPI Adding `project_urls` and `keywords` to setup.py ensures they will be available for the PyPI package page and any other place/service that may look for these fields. --- setup.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/setup.py b/setup.py index e4f2995a..5eea85b6 100755 --- a/setup.py +++ b/setup.py @@ -33,11 +33,17 @@ setup( name='pelican', version=version, url='https://getpelican.com/', - author='Alexis Metaireau', - maintainer='Justin Mayer', + author='Justin Mayer', author_email='authors@getpelican.com', description="Static site generator supporting reStructuredText and " "Markdown source content.", + project_urls={ + 'Documentation': 'https://docs.getpelican.com/', + 'Funding': 'https://donate.getpelican.com/', + 'Source': 'https://github.com/getpelican/pelican', + 'Tracker': 'https://github.com/getpelican/pelican/issues', + }, + keywords='static web site generator SSG reStructuredText Markdown', license='AGPLv3', long_description=description, packages=['pelican', 'pelican.tools'], From 047d884323a67495a4358acee984b276d3456f07 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Sat, 28 Sep 2019 13:51:20 -0700 Subject: [PATCH 063/143] Fix quick-start docs regarding `pelican --listen` Reverts 2ab91bbaaa565dcb89726b6cac0002c1e0644dc3 and resolves #2626 --- docs/publish.rst | 16 ++++------------ docs/quickstart.rst | 6 +++--- 2 files changed, 7 insertions(+), 15 deletions(-) diff --git a/docs/publish.rst b/docs/publish.rst index 96d67d58..489558d8 100644 --- a/docs/publish.rst +++ b/docs/publish.rst @@ -54,20 +54,12 @@ 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. +assets, running Pelican's simple built-in web server will often provide a more +reliable previewing experience:: -For Python 2, run:: + pelican --listen - cd output - python -m SimpleHTTPServer - -For Python 3, run:: - - cd output - python -m http.server - -Once the basic server has been started, you can preview your site at +Once the web server has been started, you can preview your site at: http://localhost:8000/ Deployment diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 4ad9416f..646dd987 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -50,18 +50,18 @@ Given that this example article is in Markdown format, save it as Generate your site ------------------ -From your site directory, run the ``pelican`` command to generate your site:: +From your project root directory, run the ``pelican`` command to generate your site:: pelican content -Your site has now been generated inside the ``output`` directory. (You may see +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, navigate to your generated output directory and +Open a new terminal session, navigate to your project root directory, and run the following command to launch Pelican's web server:: pelican --listen From 2c8e7b3e6bc43f8e151b814957de617213f48382 Mon Sep 17 00:00:00 2001 From: Oliver Urs Lenz <oliver.urs.lenz@gmail.com> Date: Fri, 4 Oct 2019 22:28:24 +0200 Subject: [PATCH 064/143] place all deprecated settings handling together --- pelican/__init__.py | 61 --------------------------------------------- pelican/settings.py | 61 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 61 insertions(+), 61 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 86c956b0..499ded04 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -11,7 +11,6 @@ import logging import multiprocessing import os import pprint -import re import sys import time import traceback @@ -52,7 +51,6 @@ class Pelican(object): # define the default settings self.settings = settings - self._handle_deprecation() self.path = settings['PATH'] self.theme = settings['THEME'] @@ -94,65 +92,6 @@ class Pelican(object): logger.debug('Restoring system path') sys.path = _sys_path - 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' - ' 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'): - logger.warning("%s = '%s'", setting, self.settings[setting]) - - if self.settings.get('AUTORELOAD_IGNORE_CACHE'): - logger.warning('Found deprecated `AUTORELOAD_IGNORE_CACHE` in ' - 'settings. Use --ignore-cache instead.') - self.settings.pop('AUTORELOAD_IGNORE_CACHE') - - if self.settings.get('ARTICLE_PERMALINK_STRUCTURE', False): - logger.warning('Found deprecated `ARTICLE_PERMALINK_STRUCTURE` in' - ' settings. Modifying the following settings for' - ' the same behaviour.') - - structure = self.settings['ARTICLE_PERMALINK_STRUCTURE'] - - # Convert %(variable) into {variable}. - structure = re.sub(r'%\((\w+)\)s', r'{\g<1>}', structure) - - # Convert %x into {date:%x} for strftime - structure = re.sub(r'(%[A-z])', r'{date:\g<1>}', structure) - - # Strip a / prefix - structure = re.sub('^/', '', structure) - - for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', - '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]) - - for new, old in [('FEED', 'FEED_ATOM'), ('TAG_FEED', 'TAG_FEED_ATOM'), - ('CATEGORY_FEED', 'CATEGORY_FEED_ATOM'), - ('TRANSLATION_FEED', 'TRANSLATION_FEED_ATOM')]: - if self.settings.get(new, False): - logger.warning( - 'Found deprecated `%(new)s` in settings. Modify %(new)s ' - 'to %(old)s in your settings and theme for the same ' - 'behavior. Temporarily setting %(old)s for backwards ' - 'compatibility.', - {'new': new, 'old': old} - ) - self.settings[old] = self.settings[new] - def run(self): """Run the generators and return""" start_time = time.time() diff --git a/pelican/settings.py b/pelican/settings.py index 4aa31afe..ca415791 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -442,6 +442,67 @@ def handle_deprecated_settings(settings): 'Falling back to default.', key) settings[key] = DEFAULT_CONFIG[key] + # CLEAN_URLS + if settings.get('CLEAN_URLS', False): + logger.warning('Found deprecated `CLEAN_URLS` in settings.' + ' Modifying 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'): + logger.warning("%s = '%s'", setting, settings[setting]) + + # AUTORELOAD_IGNORE_CACHE -> --ignore-cache + if settings.get('AUTORELOAD_IGNORE_CACHE'): + logger.warning('Found deprecated `AUTORELOAD_IGNORE_CACHE` in ' + 'settings. Use --ignore-cache instead.') + settings.pop('AUTORELOAD_IGNORE_CACHE') + + # ARTICLE_PERMALINK_STRUCTURE + if settings.get('ARTICLE_PERMALINK_STRUCTURE', False): + logger.warning('Found deprecated `ARTICLE_PERMALINK_STRUCTURE` in' + ' settings. Modifying the following settings for' + ' the same behaviour.') + + structure = settings['ARTICLE_PERMALINK_STRUCTURE'] + + # Convert %(variable) into {variable}. + structure = re.sub(r'%\((\w+)\)s', r'{\g<1>}', structure) + + # Convert %x into {date:%x} for strftime + structure = re.sub(r'(%[A-z])', r'{date:\g<1>}', structure) + + # Strip a / prefix + structure = re.sub('^/', '', structure) + + for setting in ('ARTICLE_URL', 'ARTICLE_LANG_URL', 'PAGE_URL', + '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'): + settings[setting] = os.path.join(structure, + settings[setting]) + logger.warning("%s = '%s'", setting, settings[setting]) + + # {,TAG,CATEGORY,TRANSLATION}_FEED -> {,TAG,CATEGORY,TRANSLATION}_FEED_ATOM + for new, old in [('FEED', 'FEED_ATOM'), ('TAG_FEED', 'TAG_FEED_ATOM'), + ('CATEGORY_FEED', 'CATEGORY_FEED_ATOM'), + ('TRANSLATION_FEED', 'TRANSLATION_FEED_ATOM')]: + if settings.get(new, False): + logger.warning( + 'Found deprecated `%(new)s` in settings. Modify %(new)s ' + 'to %(old)s in your settings and theme for the same ' + 'behavior. Temporarily setting %(old)s for backwards ' + 'compatibility.', + {'new': new, 'old': old} + ) + settings[old] = settings[new] + return settings From b88b5f7b3679f98d1aa3934f5fcf818b2a726ea8 Mon Sep 17 00:00:00 2001 From: Andrea Grandi <a.grandi@gmail.com> Date: Sat, 5 Oct 2019 15:25:31 +0200 Subject: [PATCH 065/143] Set default binding addres to 127.0.0.1 --- pelican/settings.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/settings.py b/pelican/settings.py index 4aa31afe..d79f64fe 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -170,7 +170,7 @@ DEFAULT_CONFIG = { 'WRITE_SELECTED': [], 'FORMATTED_FIELDS': ['summary'], 'PORT': 8000, - 'BIND': '', + 'BIND': '127.0.0.1', } PYGMENTS_RST_OPTIONS = None From bc450b3339d9eb4ce4649a5989836dcee496688f Mon Sep 17 00:00:00 2001 From: David Alfonso <developer@davidalfonso.es> Date: Wed, 9 Oct 2019 11:08:39 +0200 Subject: [PATCH 066/143] Add extra/optional Markdown dependency to setup.py - Modify documentation to use the extra dependency in order to install the recommended markdown package version. --- docs/install.rst | 10 +++++++++- docs/quickstart.rst | 2 +- setup.py | 3 +++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/install.rst b/docs/install.rst index 571de95e..2da7b9be 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -9,6 +9,10 @@ You can install Pelican via several different methods. The simplest is via pip install pelican +Or, if you plan on using Markdown:: + + pip install pelican[Markdown] + (Keep in mind that operating systems will often require you to prefix the above command with ``sudo`` in order to install Pelican system-wide.) @@ -40,7 +44,11 @@ Optional packages ----------------- If you plan on using `Markdown <http://pypi.python.org/pypi/Markdown>`_ as a -markup format, you'll need to install the Markdown library:: +markup format, you can install Pelican with Markdown support:: + + pip install pelican[Markdown] + +Or you might need to install it a posteriori:: pip install Markdown diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 646dd987..484a318f 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -11,7 +11,7 @@ Install Pelican (and optionally Markdown if you intend to use it) on Python 2.7.x or Python 3.5+ by running the following command in your preferred terminal, prefixing with ``sudo`` if permissions warrant:: - pip install pelican markdown + pip install pelican[Markdown] Create a project ---------------- diff --git a/setup.py b/setup.py index 5eea85b6..0979d1c4 100755 --- a/setup.py +++ b/setup.py @@ -61,6 +61,9 @@ setup( for name in names], }, install_requires=requires, + extras_require={ + 'Markdown': ['markdown~=3.1.1'] + }, entry_points=entry_points, classifiers=[ 'Development Status :: 5 - Production/Stable', From f52f276f2ea9c23311cdd8c49d19358d432925a8 Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Wed, 9 Oct 2019 11:17:44 -0700 Subject: [PATCH 067/143] Separate SSH user/host/path vars in tasks.py Refs #2623 --- pelican/tools/templates/tasks.py.jinja2 | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pelican/tools/templates/tasks.py.jinja2 b/pelican/tools/templates/tasks.py.jinja2 index 1c063f08..0362eba7 100644 --- a/pelican/tools/templates/tasks.py.jinja2 +++ b/pelican/tools/templates/tasks.py.jinja2 @@ -23,9 +23,10 @@ CONFIG = { 'deploy_path': SETTINGS['OUTPUT_PATH'], {% if ssh %} # Remote server configuration - 'production': '{{ssh_user}}@{{ssh_host}}', - 'production_port': {{ssh_port}}, - 'dest_path': '{{ssh_target_dir}}', + 'ssh_user': '{{ssh_user}}', + 'ssh_host': '{{ssh_host}}', + 'ssh_port': '{{ssh_port}}', + 'ssh_path': '{{ssh_target_dir}}', {% endif %} {% if cloudfiles %} # Rackspace Cloud Files configuration settings @@ -131,8 +132,8 @@ def publish(c): c.run('pelican -s {settings_publish}'.format(**CONFIG)) c.run( 'rsync --delete --exclude ".DS_Store" -pthrvz -c ' - '-e "ssh -p {production_port}" ' - '{} {production}:{dest_path}'.format( + '-e "ssh -p {ssh_port}" ' + '{} {ssh_user}@{ssh_host}:{ssh_path}'.format( CONFIG['deploy_path'].rstrip('/') + '/', **CONFIG)) From f9975ed47e8af49e723aa0c4cde50686e127292a Mon Sep 17 00:00:00 2001 From: Justin Mayer <entroP@gmail.com> Date: Wed, 9 Oct 2019 11:28:53 -0700 Subject: [PATCH 068/143] Update RELEASE.md --- RELEASE.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 521973a9..02c40331 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,4 +1,9 @@ Release type: patch -Skip some tests (on Windows) that are un-able to pass on Windows due to the -difference in Windows vs Linux filesystems. +* Fix quick-start docs regarding `pelican --listen` +* Set default listen address to 127.0.0.1 +* Add extra/optional Markdown dependency to setup.py +* Use correct SSH port syntax for rsync in tasks.py +* Place all deprecated settings handling together +* Add related project URLs for display on PyPI +* Skip some tests on Windows that can't pass due to filesystem differences From 643bccc497183d9cc2d7c80423fbd8e088dd3dad Mon Sep 17 00:00:00 2001 From: botpub <botpub@autopub.rocks> Date: Wed, 9 Oct 2019 18:45:18 +0000 Subject: [PATCH 069/143] Release Pelican 4.1.3 --- RELEASE.md | 9 --------- docs/changelog.rst | 11 +++++++++++ pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 13 insertions(+), 11 deletions(-) delete mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 02c40331..00000000 --- a/RELEASE.md +++ /dev/null @@ -1,9 +0,0 @@ -Release type: patch - -* Fix quick-start docs regarding `pelican --listen` -* Set default listen address to 127.0.0.1 -* Add extra/optional Markdown dependency to setup.py -* Use correct SSH port syntax for rsync in tasks.py -* Place all deprecated settings handling together -* Add related project URLs for display on PyPI -* Skip some tests on Windows that can't pass due to filesystem differences diff --git a/docs/changelog.rst b/docs/changelog.rst index 5e5d7cdf..befe358a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,17 @@ Release history ############### +4.1.3 - 2019-10-09 +================== + +* Fix quick-start docs regarding `pelican --listen` +* Set default listen address to 127.0.0.1 +* Add extra/optional Markdown dependency to setup.py +* Use correct SSH port syntax for rsync in tasks.py +* Place all deprecated settings handling together +* Add related project URLs for display on PyPI +* Skip some tests on Windows that can't pass due to filesystem differences + 4.1.2 - 2019-09-23 ================== diff --git a/pyproject.toml b/pyproject.toml index fce734f6..11c91c42 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pelican" -version = "4.1.2" +version = "4.1.3" description = "Static site generator supporting Markdown and reStructuredText" authors = ["Justin Mayer <entrop@gmail.com>"] license = "AGPLv3" diff --git a/setup.py b/setup.py index 0979d1c4..23857608 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from os.path import join, relpath from setuptools import setup -version = "4.1.2" +version = "4.1.3" requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', From eaccca52dd440d76ed73d5027a29c4192c98f444 Mon Sep 17 00:00:00 2001 From: Stuart Axon <stuaxo2@yahoo.com> Date: Fri, 11 Oct 2019 00:29:00 +0100 Subject: [PATCH 070/143] Support inline SVGs (don't break on title in inline SVG). --- RELEASE.md | 3 +++ pelican/readers.py | 2 +- .../tests/content/article_with_inline_svg.html | 17 +++++++++++++++++ pelican/tests/test_generators.py | 2 ++ pelican/tests/test_readers.py | 7 +++++++ 5 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 RELEASE.md create mode 100644 pelican/tests/content/article_with_inline_svg.html diff --git a/RELEASE.md b/RELEASE.md new file mode 100644 index 00000000..874bba5d --- /dev/null +++ b/RELEASE.md @@ -0,0 +1,3 @@ +Release type: patch + +Support inline SVGs, don't treat titles in SVGs as HTML titles. Fixes #2561. diff --git a/pelican/readers.py b/pelican/readers.py index 0edfed0e..52378c4f 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -407,7 +407,7 @@ class HTMLReader(BaseReader): if self._in_head: self._in_head = False self._in_top_level = True - elif tag == 'title': + elif self._in_head and tag == 'title': self._in_title = False self.metadata['title'] = self._data_buffer elif tag == 'body': diff --git a/pelican/tests/content/article_with_inline_svg.html b/pelican/tests/content/article_with_inline_svg.html new file mode 100644 index 00000000..07f97a8a --- /dev/null +++ b/pelican/tests/content/article_with_inline_svg.html @@ -0,0 +1,17 @@ +<html> + <head> + <title>Article with an inline SVG + + + Ensure that the title attribute in an inline svg is not handled as an HTML title. + + + A different title inside the inline SVG + + + + + + + + diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 2455d1f4..9ade301e 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -262,6 +262,7 @@ class TestArticlesGenerator(unittest.TestCase): ['This is a super article !', 'published', 'yeah', 'article'], ['This is a super article !', 'published', 'yeah', 'article'], ['This is a super article !', 'published', 'Default', 'article'], + ['Article with an inline SVG', 'published', 'Default', 'article'], ['This is an article with category !', 'published', 'yeah', 'article'], ['This is an article with multiple authors!', 'published', @@ -554,6 +555,7 @@ class TestArticlesGenerator(unittest.TestCase): 'An Article With Code Block To Test Typogrify Ignore', 'Article title', 'Article with Nonconformant HTML meta tags', + 'Article with an inline SVG', 'Article with markdown and summary metadata multi', 'Article with markdown and summary metadata single', 'Article with markdown containing footnotes', diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 30181f54..3f05bb4a 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -764,3 +764,10 @@ class HTMLReaderTest(ReaderTest): } self.assertDictHasSubset(page.metadata, expected) + + def test_article_with_inline_svg(self): + page = self.read_file(path='article_with_inline_svg.html') + expected = { + 'title': 'Article with an inline SVG', + } + self.assertDictHasSubset(page.metadata, expected) From bcac6e80b9e22cf6140e6ceba6fe1f977832c5b9 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 21 Sep 2019 12:19:43 -0700 Subject: [PATCH 071/143] Improve content metadata field docs. Fixes #2347 --- docs/content.rst | 37 +++++++++++++++++++++++-------------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/docs/content.rst b/docs/content.rst index f0022c35..bff30e1d 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -71,22 +71,31 @@ Metadata syntax for Markdown posts should follow this pattern:: This is the content of my super blog post. You can also have your own metadata keys (so long as they don't conflict with -reserved metadata keywords) for use in your python templates. The following is +reserved metadata keywords) for use in your templates. Following is the list of reserved metadata keywords: -* `Title` -* `Tags` -* `Date` -* `Modified` -* `Status` -* `Category` -* `Author` -* `Authors` -* `Slug` -* `Summary` -* `Template` -* `Save_as` -* `Url` +================= ================ ============================================ +reStructuredText Markdown Description +================= ================ ============================================ +``:title:`` ``Title:`` Title of the article or page +``:date:`` ``Date:`` Publication date (``YYYY-MM-DD HH:SS``) +``:modified:`` ``Modified:`` Modification date (``YYYY-MM-DD HH:SS``) +``:tags:`` ``Tags:`` Content tags, separated by commas +``:keywords:`` ``Keywords:`` Content keywords, separated by commas +``:category:`` ``Category:`` Content category (one only — not multiple) +``:slug:`` ``Slug:`` Identifier used in URLs and translations +``:author:`` ``Author:`` Content author, when there is only one +``:authors:`` ``Authors:`` Content authors, when there are multiple +``:summary:`` ``Summary:`` Brief description of content for index pages +``:lang:`` ``Lang:`` Content language ID (``en``, ``fr``, etc.) +``:translation:`` ``Translation:`` Is article is a translation of another + (``true`` or ``false``) +``:status:`` ``Status:`` Content status: + ``draft``, ``hidden``, or ``published`` +``:template:`` ``Template:`` Name of template to use to generate content +``:save_us:`` ``Save_us:`` Save content to this relative file path +``:url:`` ``Url:`` URL to use for this article/page +================= ================ ============================================ Readers for additional formats (such as AsciiDoc_) are available via plugins. Refer to `pelican-plugins`_ repository for those. From f0617a53dc253432077fe3acbcd8d8bd87f636ab Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 16 Oct 2019 15:52:50 -0700 Subject: [PATCH 072/143] Follow-up changes to metadata field docs --- docs/content.rst | 46 ++++++++++++++++++++++------------------------ 1 file changed, 22 insertions(+), 24 deletions(-) diff --git a/docs/content.rst b/docs/content.rst index bff30e1d..2ca4a347 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -71,31 +71,29 @@ Metadata syntax for Markdown posts should follow this pattern:: This is the content of my super blog post. You can also have your own metadata keys (so long as they don't conflict with -reserved metadata keywords) for use in your templates. Following is -the list of reserved metadata keywords: +reserved metadata keywords) for use in your templates. The following table +contains a list of reserved metadata keywords: -================= ================ ============================================ -reStructuredText Markdown Description -================= ================ ============================================ -``:title:`` ``Title:`` Title of the article or page -``:date:`` ``Date:`` Publication date (``YYYY-MM-DD HH:SS``) -``:modified:`` ``Modified:`` Modification date (``YYYY-MM-DD HH:SS``) -``:tags:`` ``Tags:`` Content tags, separated by commas -``:keywords:`` ``Keywords:`` Content keywords, separated by commas -``:category:`` ``Category:`` Content category (one only — not multiple) -``:slug:`` ``Slug:`` Identifier used in URLs and translations -``:author:`` ``Author:`` Content author, when there is only one -``:authors:`` ``Authors:`` Content authors, when there are multiple -``:summary:`` ``Summary:`` Brief description of content for index pages -``:lang:`` ``Lang:`` Content language ID (``en``, ``fr``, etc.) -``:translation:`` ``Translation:`` Is article is a translation of another - (``true`` or ``false``) -``:status:`` ``Status:`` Content status: - ``draft``, ``hidden``, or ``published`` -``:template:`` ``Template:`` Name of template to use to generate content -``:save_us:`` ``Save_us:`` Save content to this relative file path -``:url:`` ``Url:`` URL to use for this article/page -================= ================ ============================================ +=============== =============================================================== + Metadata Description +=============== =============================================================== +``title`` Title of the article or page +``date`` Publication date (e.g., ``YYYY-MM-DD HH:SS``) +``modified`` Modification date (e.g., ``YYYY-MM-DD HH:SS``) +``tags`` Content tags, separated by commas +``keywords`` Content keywords, separated by commas (HTML content only) +``category`` Content category (one only — not multiple) +``slug`` Identifier used in URLs and translations +``author`` Content author, when there is only one +``authors`` Content authors, when there are multiple +``summary`` Brief description of content for index pages +``lang`` Content language ID (``en``, ``fr``, etc.) +``translation`` Is content is a translation of another (``true`` or ``false``) +``status`` Content status: ``draft``, ``hidden``, or ``published`` +``template`` Name of template to use to generate content (without extension) +``save_as`` Save content to this relative file path +``url`` URL to use for this article/page +=============== =============================================================== Readers for additional formats (such as AsciiDoc_) are available via plugins. Refer to `pelican-plugins`_ repository for those. From e092f7ca75182024a9a96fcf50bd1d3fe4f487a6 Mon Sep 17 00:00:00 2001 From: Lucas Cimon Date: Thu, 17 Oct 2019 13:05:53 +0200 Subject: [PATCH 073/143] Adding missing call to topdown=True in Generator.get_files --- pelican/generators.py | 11 +++++------ pelican/tests/support.py | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 75eca388..ef021070 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -155,16 +155,15 @@ class Generator(object): if os.path.isdir(root): for dirpath, dirs, temp_files in os.walk( - root, followlinks=True): - drop = [] + root, topdown=True, followlinks=True): excl = exclusions_by_dirpath.get(dirpath, ()) - for d in dirs: + # We copy the `dirs` list as we will modify it in the loop: + for d in list(dirs): if (d in excl or any(fnmatch.fnmatch(d, ignore) for ignore in ignores)): - drop.append(d) - for d in drop: - dirs.remove(d) + if d in dirs: + dirs.remove(d) reldir = os.path.relpath(dirpath, self.path) for f in temp_files: diff --git a/pelican/tests/support.py b/pelican/tests/support.py index 93db8328..751fb5ec 100644 --- a/pelican/tests/support.py +++ b/pelican/tests/support.py @@ -188,7 +188,7 @@ class LogCountHandler(BufferingHandler): """Capturing and counting logged messages.""" def __init__(self, capacity=1000): - logging.handlers.BufferingHandler.__init__(self, capacity) + super(LogCountHandler, self).__init__(capacity) def count_logs(self, msg=None, level=None): return len([ From e5b94d7248527d2b721c9389fe26bdfe7191fd5c Mon Sep 17 00:00:00 2001 From: Lucas Cimon Date: Thu, 17 Oct 2019 13:06:28 +0200 Subject: [PATCH 074/143] Adding docs on how to include other files - fix #1902 --- docs/content.rst | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/docs/content.rst b/docs/content.rst index f0022c35..f169abed 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -382,6 +382,40 @@ to allow linking to both generated articles and pages and their static sources. Support for the old syntax may eventually be removed. +Including other files +--------------------- +Both Markdown and reStructuredText syntaxes provide mechanisms for this. + +Following below are some examples for **reStructuredText** using `the include directive`_: + + .. code-block:: rst + + .. include:: file.rst + +Include a fragment of a file delimited by two identifiers, highlighted as C++ (slicing based on line numbers is also possible): + + .. code-block:: rst + + .. include:: main.cpp + :code: c++ + :start-after: // begin + :end-before: // end + +Include a raw HTML file (or an inline SVG) and put it directly into the output without any processing: + + .. code-block:: rst + + .. raw:: html + :file: table.html + +For **Markdown**, one must rely on an extension. For example, using the `mdx_include plugin`_: + + .. code-block:: none + + ```html + {! template.html !} + ``` + Importing an existing site ========================== @@ -575,3 +609,5 @@ metadata to include ``Status: published``. .. _Markdown Extensions: https://python-markdown.github.io/extensions/ .. _CodeHilite extension: https://python-markdown.github.io/extensions/code_hilite/#syntax .. _i18n_subsites plugin: https://github.com/getpelican/pelican-plugins/tree/master/i18n_subsites +.. _the include directive: http://docutils.sourceforge.net/docs/ref/rst/directives.html#include +.. _mdx_include plugin: https://github.com/neurobin/mdx_include From f72d06a4a5271d1a4156ef042f307a479dd7b452 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maur=C3=ADcio=20Gardini?= Date: Fri, 26 Apr 2019 20:11:37 -0300 Subject: [PATCH 075/143] Adds the category to the feed item. Fix #2556. Adds the article category as a feed item category. --- pelican/writers.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pelican/writers.py b/pelican/writers.py index bdaabd8d..b610e2e2 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -78,13 +78,19 @@ class Writer(object): if description == content: description = None + categories = list() + if hasattr(item, 'category'): + categories.append(item.category) + if hasattr(item, 'tags'): + categories.extend(item.tags) + feed.add_item( title=title, link=link, unique_id=get_tag_uri(link, item.date), description=description, content=content, - categories=item.tags if hasattr(item, 'tags') else None, + categories=categories if categories else None, author_name=getattr(item, 'author', ''), pubdate=set_date_tzinfo( item.date, self.settings.get('TIMEZONE', None)), From 7bfc70c1538108dfaf1b0cbfc563ee4883bc1f2a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 17 Oct 2019 10:34:03 -0700 Subject: [PATCH 076/143] Update functional test output for category in feed --- .../basic/feeds/alexis-metaireau.atom.xml | 4 ++-- .../basic/feeds/alexis-metaireau.rss.xml | 4 ++-- .../tests/output/basic/feeds/all-en.atom.xml | 20 ++++++++-------- .../tests/output/basic/feeds/all-fr.atom.xml | 2 +- pelican/tests/output/basic/feeds/all.atom.xml | 22 ++++++++--------- pelican/tests/output/basic/feeds/bar.atom.xml | 2 +- .../tests/output/basic/feeds/cat1.atom.xml | 8 +++---- .../tests/output/basic/feeds/misc.atom.xml | 8 +++---- .../tests/output/basic/feeds/yeah.atom.xml | 2 +- .../custom/feeds/alexis-metaireau.atom.xml | 20 ++++++++-------- .../custom/feeds/alexis-metaireau.rss.xml | 20 ++++++++-------- .../tests/output/custom/feeds/all-en.atom.xml | 20 ++++++++-------- .../tests/output/custom/feeds/all-fr.atom.xml | 4 ++-- .../tests/output/custom/feeds/all.atom.xml | 24 +++++++++---------- pelican/tests/output/custom/feeds/all.rss.xml | 24 +++++++++---------- .../tests/output/custom/feeds/bar.atom.xml | 2 +- pelican/tests/output/custom/feeds/bar.rss.xml | 2 +- .../tests/output/custom/feeds/cat1.atom.xml | 8 +++---- .../tests/output/custom/feeds/cat1.rss.xml | 8 +++---- .../tests/output/custom/feeds/misc.atom.xml | 8 +++---- .../tests/output/custom/feeds/misc.rss.xml | 8 +++---- .../tests/output/custom/feeds/yeah.atom.xml | 2 +- .../tests/output/custom/feeds/yeah.rss.xml | 2 +- .../feeds/alexis-metaireau.atom.xml | 20 ++++++++-------- .../feeds/alexis-metaireau.rss.xml | 20 ++++++++-------- .../custom_locale/feeds/all-en.atom.xml | 20 ++++++++-------- .../custom_locale/feeds/all-fr.atom.xml | 4 ++-- .../output/custom_locale/feeds/all.atom.xml | 24 +++++++++---------- .../output/custom_locale/feeds/all.rss.xml | 24 +++++++++---------- .../output/custom_locale/feeds/bar.atom.xml | 2 +- .../output/custom_locale/feeds/bar.rss.xml | 2 +- .../output/custom_locale/feeds/cat1.atom.xml | 8 +++---- .../output/custom_locale/feeds/cat1.rss.xml | 8 +++---- .../output/custom_locale/feeds/misc.atom.xml | 8 +++---- .../output/custom_locale/feeds/misc.rss.xml | 8 +++---- .../output/custom_locale/feeds/yeah.atom.xml | 2 +- .../output/custom_locale/feeds/yeah.rss.xml | 2 +- 37 files changed, 188 insertions(+), 188 deletions(-) diff --git a/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml b/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml index a0cf576f..8f9a85fa 100644 --- a/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml +++ b/pelican/tests/output/basic/feeds/alexis-metaireau.atom.xml @@ -13,10 +13,10 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+00:002010-10-20T10:14:00+00:00Alexis Métaireautag:None,2010-10-20:/oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+00:002010-10-20T10:14:00+00:00Alexis Métaireautag:None,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> - \ No newline at end of file + \ 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 index 57942aed..1af41d47 100644 --- a/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml +++ b/pelican/tests/output/basic/feeds/alexis-metaireau.rss.xml @@ -1,10 +1,10 @@ A Pelican Blog - Alexis Métaireau/Sun, 17 Nov 2013 23:29:00 +0000This is a super article !/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> -Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0000tag:None,2010-12-02:/this-is-a-super-article.htmlfoobarfoobarOh yeah !/oh-yeah.html<div class="section" id="why-not"> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0000tag:None,2010-12-02:/this-is-a-super-article.htmlyeahfoobarfoobarOh 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="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> -Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0000tag:None,2010-10-20:/oh-yeah.htmlohbaryeah \ No newline at end of file +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0000tag:None,2010-10-20:/oh-yeah.htmlbarohbaryeah \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/all-en.atom.xml b/pelican/tests/output/basic/feeds/all-en.atom.xml index 410d6855..561b7484 100644 --- a/pelican/tests/output/basic/feeds/all-en.atom.xml +++ b/pelican/tests/output/basic/feeds/all-en.atom.xml @@ -1,12 +1,12 @@ A Pelican Blog/2013-11-17T23:29:00+00:00FILENAME_METADATA example2012-11-30T00:00:00+00:002012-11-30T00:00:00+00:00tag:None,2012-11-30:/filename_metadata-example.html<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article.html<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00+00:002011-04-20T00:00:00+00:00tag:None,2011-04-20:/a-markdown-powered-article.html<p>You're mutually oblivious.</p> +Second article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article.html<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+00:002011-04-20T00:00:00+00:00tag:None,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:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+00:002013-11-17T23:29:00+00:00Alexis Métaireautag:None,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported +<a href="/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+00:002013-11-17T23:29:00+00:00Alexis Métaireautag:None,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> <p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> @@ -20,13 +20,13 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+00:002010-10-20T10:14:00+00:00Alexis Métaireautag:None,2010-10-20:/oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+00:002010-10-20T10:14:00+00:00Alexis Métaireautag:None,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+00:002010-10-15T20:30:00+00:00tag:None,2010-10-15:/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+00:002010-10-15T20:30:00+00:00tag:None,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"> @@ -70,5 +70,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+00:002010-03-14T00:00:00+00:00tag:None,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 +The baz tag2010-03-14T00:00:00+00:002010-03-14T00:00:00+00:00tag:None,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-fr.atom.xml b/pelican/tests/output/basic/feeds/all-fr.atom.xml index f4c1daf7..cf64e4ad 100644 --- a/pelican/tests/output/basic/feeds/all-fr.atom.xml +++ b/pelican/tests/output/basic/feeds/all-fr.atom.xml @@ -1,3 +1,3 @@ A Pelican Blog/2012-02-29T00:00:00+00:00Deuxième article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article-fr.html<p>Ceci est un article, en français.</p> - \ No newline at end of file + \ 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 fcb4e401..d75aca63 100644 --- a/pelican/tests/output/basic/feeds/all.atom.xml +++ b/pelican/tests/output/basic/feeds/all.atom.xml @@ -1,13 +1,13 @@ A Pelican Blog/2013-11-17T23:29:00+00:00FILENAME_METADATA example2012-11-30T00:00:00+00:002012-11-30T00:00:00+00:00tag:None,2012-11-30:/filename_metadata-example.html<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article.html<p>This is some article, in english</p> -Deuxième article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article-fr.html<p>Ceci est un article, en français.</p> -A markdown powered article2011-04-20T00:00:00+00:002011-04-20T00:00:00+00:00tag:None,2011-04-20:/a-markdown-powered-article.html<p>You're mutually oblivious.</p> +Second article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article.html<p>This is some article, in english</p> +Deuxième article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article-fr.html<p>Ceci est un article, en français.</p> +A markdown powered article2011-04-20T00:00:00+00:002011-04-20T00:00:00+00:00tag:None,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:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-3.html<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+00:002013-11-17T23:29:00+00:00Alexis Métaireautag:None,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported +<a href="/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-3.html<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+00:002013-11-17T23:29:00+00:00Alexis Métaireautag:None,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> <p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> @@ -21,13 +21,13 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+00:002010-10-20T10:14:00+00:00Alexis Métaireautag:None,2010-10-20:/oh-yeah.html<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+00:002010-10-20T10:14:00+00:00Alexis Métaireautag:None,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+00:002010-10-15T20:30:00+00:00tag:None,2010-10-15:/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+00:002010-10-15T20:30:00+00:00tag:None,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"> @@ -71,5 +71,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+00:002010-03-14T00:00:00+00:00tag:None,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 +The baz tag2010-03-14T00:00:00+00:002010-03-14T00:00:00+00:00tag:None,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/bar.atom.xml b/pelican/tests/output/basic/feeds/bar.atom.xml index 63d2dc24..edd1170a 100644 --- a/pelican/tests/output/basic/feeds/bar.atom.xml +++ b/pelican/tests/output/basic/feeds/bar.atom.xml @@ -5,4 +5,4 @@ YEAH !</p> <img alt="alternate text" src="/pictures/Sushi.jpg" style="width: 600px; height: 450px;" /> </div> - \ No newline at end of file + \ No newline at end of file diff --git a/pelican/tests/output/basic/feeds/cat1.atom.xml b/pelican/tests/output/basic/feeds/cat1.atom.xml index 36312a89..8516b95c 100644 --- a/pelican/tests/output/basic/feeds/cat1.atom.xml +++ b/pelican/tests/output/basic/feeds/cat1.atom.xml @@ -1,7 +1,7 @@ A Pelican Blog - cat1/2011-04-20T00:00:00+00:00A markdown powered article2011-04-20T00:00:00+00:002011-04-20T00:00:00+00:00tag:None,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:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-1.html<p>Article 1</p> -Article 22011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-2.html<p>Article 2</p> -Article 32011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-3.html<p>Article 3</p> - \ No newline at end of file +<a href="/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-1.html<p>Article 1</p> +Article 22011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-2.html<p>Article 2</p> +Article 32011-02-17T00:00:00+00:002011-02-17T00:00:00+00:00tag:None,2011-02-17:/article-3.html<p>Article 3</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 5c672e95..b9129ef7 100644 --- a/pelican/tests/output/basic/feeds/misc.atom.xml +++ b/pelican/tests/output/basic/feeds/misc.atom.xml @@ -1,7 +1,7 @@ A Pelican Blog - misc/2012-11-30T00:00:00+00:00FILENAME_METADATA example2012-11-30T00:00:00+00:002012-11-30T00:00:00+00:00tag:None,2012-11-30:/filename_metadata-example.html<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article.html<p>This is some article, in english</p> -Unbelievable !2010-10-15T20:30:00+00:002010-10-15T20:30:00+00:00tag:None,2010-10-15:/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Second article2012-02-29T00:00:00+00:002012-02-29T00:00:00+00:00tag:None,2012-02-29:/second-article.html<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00+00:002010-10-15T20:30:00+00:00tag:None,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"> @@ -45,5 +45,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+00:002010-03-14T00:00:00+00:00tag:None,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 +The baz tag2010-03-14T00:00:00+00:002010-03-14T00:00:00+00:00tag:None,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/yeah.atom.xml b/pelican/tests/output/basic/feeds/yeah.atom.xml index 3d48f4f3..6f871915 100644 --- a/pelican/tests/output/basic/feeds/yeah.atom.xml +++ b/pelican/tests/output/basic/feeds/yeah.atom.xml @@ -13,4 +13,4 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> - \ No newline at end of file + \ 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 index 12519e14..3e2f201d 100644 --- a/pelican/tests/output/custom/feeds/alexis-metaireau.atom.xml +++ b/pelican/tests/output/custom/feeds/alexis-metaireau.atom.xml @@ -1,12 +1,12 @@ Alexis' log - Alexis Métaireauhttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00A personal blog.FILENAME_METADATA example2012-11-30T00:00:00+01:002012-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:002012-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:002011-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> +Second article2012-02-29T00:00:00+01:002012-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:002011-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:002011-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:002011-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:002011-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:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported +<a href="http://blog.notmyidea.org/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-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:002011-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:002011-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:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> <p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> @@ -20,13 +20,13 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:002010-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:002010-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:002010-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:002010-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"> @@ -70,5 +70,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+01:002010-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 +The baz tag2010-03-14T00:00:00+01:002010-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 index 707097f0..e5042f26 100644 --- a/pelican/tests/output/custom/feeds/alexis-metaireau.rss.xml +++ b/pelican/tests/output/custom/feeds/alexis-metaireau.rss.xml @@ -1,20 +1,20 @@ Alexis' log - Alexis Métaireauhttp://blog.notmyidea.org/A personal blog.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> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:/filename_metadata-example.htmlmiscSecond 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.htmlmiscfoobarbazA 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 class="first last">Multi-line metadata should be supported +<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.htmlcat1Article 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.htmlcat1Article 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.htmlcat1Article 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.htmlcat1This is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> -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"> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.htmlyeahfoobarfoobarOh 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> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:/oh-yeah.htmlbarohbaryeahUnbelievable !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"> @@ -25,5 +25,5 @@ YEAH !</p> <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 …</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 +pelican.conf, it will …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/unbelievable.htmlmiscThe 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.htmlmisc \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/all-en.atom.xml b/pelican/tests/output/custom/feeds/all-en.atom.xml index d6dfd92f..ba66f3be 100644 --- a/pelican/tests/output/custom/feeds/all-en.atom.xml +++ b/pelican/tests/output/custom/feeds/all-en.atom.xml @@ -1,12 +1,12 @@ Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00A personal blog.FILENAME_METADATA example2012-11-30T00:00:00+01:002012-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:002012-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:002011-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> +Second article2012-02-29T00:00:00+01:002012-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:002011-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:002011-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:002011-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:002011-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:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported +<a href="http://blog.notmyidea.org/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-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:002011-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:002011-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:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> <p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> @@ -20,13 +20,13 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:002010-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:002010-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:002010-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:002010-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"> @@ -70,5 +70,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+01:002010-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 +The baz tag2010-03-14T00:00:00+01:002010-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-fr.atom.xml b/pelican/tests/output/custom/feeds/all-fr.atom.xml index 2cdcfba7..f380cd04 100644 --- a/pelican/tests/output/custom/feeds/all-fr.atom.xml +++ b/pelican/tests/output/custom/feeds/all-fr.atom.xml @@ -1,4 +1,4 @@ Alexis' loghttp://blog.notmyidea.org/2012-03-02T14:01:01+01:00A personal blog.Trop bien !2012-03-02T14:01:01+01:002012-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:002012-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 +Deuxième article2012-02-29T00:00:00+01:002012-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/feeds/all.atom.xml b/pelican/tests/output/custom/feeds/all.atom.xml index 2d890b99..3c6a76cb 100644 --- a/pelican/tests/output/custom/feeds/all.atom.xml +++ b/pelican/tests/output/custom/feeds/all.atom.xml @@ -1,14 +1,14 @@ Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00A personal blog.FILENAME_METADATA example2012-11-30T00:00:00+01:002012-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:002012-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:002012-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:002012-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:002011-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> +Trop bien !2012-03-02T14:01:01+01:002012-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:002012-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:002012-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:002011-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:002011-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:002011-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:002011-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:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported +<a href="http://blog.notmyidea.org/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-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:002011-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:002011-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:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> <p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> @@ -22,13 +22,13 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:002010-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:002010-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:002010-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:002010-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"> @@ -72,5 +72,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+01:002010-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 +The baz tag2010-03-14T00:00:00+01:002010-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 c20aac95..37285af5 100644 --- a/pelican/tests/output/custom/feeds/all.rss.xml +++ b/pelican/tests/output/custom/feeds/all.rss.xml @@ -1,22 +1,22 @@ Alexis' loghttp://blog.notmyidea.org/A personal blog.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.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> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:/filename_metadata-example.htmlmiscTrop 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.htmlmiscSecond 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.htmlmiscfoobarbazDeuxiè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.htmlmiscfoobarbazA 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 class="first last">Multi-line metadata should be supported +<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.htmlcat1Article 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.htmlcat1Article 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.htmlcat1Article 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.htmlcat1This is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> -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"> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.htmlyeahfoobarfoobarOh 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> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:/oh-yeah.htmlbarohbaryeahUnbelievable !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"> @@ -27,5 +27,5 @@ YEAH !</p> <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 …</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 +pelican.conf, it will …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/unbelievable.htmlmiscThe 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.htmlmisc \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/bar.atom.xml b/pelican/tests/output/custom/feeds/bar.atom.xml index 2ddcece8..002de037 100644 --- a/pelican/tests/output/custom/feeds/bar.atom.xml +++ b/pelican/tests/output/custom/feeds/bar.atom.xml @@ -5,4 +5,4 @@ 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 + \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/bar.rss.xml b/pelican/tests/output/custom/feeds/bar.rss.xml index 85aeee8d..53035e71 100644 --- a/pelican/tests/output/custom/feeds/bar.rss.xml +++ b/pelican/tests/output/custom/feeds/bar.rss.xml @@ -5,4 +5,4 @@ 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.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.htmlbarohbaryeah \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/cat1.atom.xml b/pelican/tests/output/custom/feeds/cat1.atom.xml index ac77e9ad..e8ed355b 100644 --- a/pelican/tests/output/custom/feeds/cat1.atom.xml +++ b/pelican/tests/output/custom/feeds/cat1.atom.xml @@ -1,7 +1,7 @@ Alexis' log - cat1http://blog.notmyidea.org/2011-04-20T00:00:00+02:00A personal blog.A markdown powered article2011-04-20T00:00:00+02:002011-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:002011-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:002011-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:002011-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 +<a href="http://blog.notmyidea.org/unbelievable.html">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-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:002011-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:002011-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/pelican/tests/output/custom/feeds/cat1.rss.xml b/pelican/tests/output/custom/feeds/cat1.rss.xml index 64276d5a..9951b293 100644 --- a/pelican/tests/output/custom/feeds/cat1.rss.xml +++ b/pelican/tests/output/custom/feeds/cat1.rss.xml @@ -1,7 +1,7 @@ Alexis' log - cat1http://blog.notmyidea.org/A personal blog.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> <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.html \ No newline at end of file +<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.htmlcat1Article 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.htmlcat1Article 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.htmlcat1Article 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.htmlcat1 \ 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 1678e35a..e5bd7e86 100644 --- a/pelican/tests/output/custom/feeds/misc.atom.xml +++ b/pelican/tests/output/custom/feeds/misc.atom.xml @@ -1,7 +1,7 @@ Alexis' log - mischttp://blog.notmyidea.org/2012-11-30T00:00:00+01:00A personal blog.FILENAME_METADATA example2012-11-30T00:00:00+01:002012-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:002012-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:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/unbelievable.html<p>Or completely awesome. Depends the needs.</p> +Second article2012-02-29T00:00:00+01:002012-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:002010-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"> @@ -45,5 +45,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+01:002010-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 +The baz tag2010-03-14T00:00:00+01:002010-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 389f703b..1c427eea 100644 --- a/pelican/tests/output/custom/feeds/misc.rss.xml +++ b/pelican/tests/output/custom/feeds/misc.rss.xml @@ -1,7 +1,7 @@ Alexis' log - mischttp://blog.notmyidea.org/A personal blog.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> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:/filename_metadata-example.htmlmiscSecond 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.htmlmiscfoobarbazUnbelievable !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"> @@ -12,5 +12,5 @@ <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 …</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 +pelican.conf, it will …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/unbelievable.htmlmiscThe 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.htmlmisc \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/yeah.atom.xml b/pelican/tests/output/custom/feeds/yeah.atom.xml index e0398437..127ab590 100644 --- a/pelican/tests/output/custom/feeds/yeah.atom.xml +++ b/pelican/tests/output/custom/feeds/yeah.atom.xml @@ -13,4 +13,4 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> - \ No newline at end of file + \ No newline at end of file diff --git a/pelican/tests/output/custom/feeds/yeah.rss.xml b/pelican/tests/output/custom/feeds/yeah.rss.xml index 9601e8b6..98b820ec 100644 --- a/pelican/tests/output/custom/feeds/yeah.rss.xml +++ b/pelican/tests/output/custom/feeds/yeah.rss.xml @@ -1,4 +1,4 @@ Alexis' log - yeahhttp://blog.notmyidea.org/A personal blog.Sun, 17 Nov 2013 23:29:00 +0100This is a super article !http://blog.notmyidea.org/this-is-a-super-article.html<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> -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 +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/this-is-a-super-article.htmlyeahfoobarfoobar \ 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 index e65c1498..e17ba708 100644 --- a/pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml +++ b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.atom.xml @@ -1,12 +1,12 @@ Alexis' log - Alexis Métaireauhttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:002012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:/posts/2012/novembre/30/filename_metadata-example/<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00+01:002012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:/posts/2012/février/29/second-article/<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00+02:002011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +Second article2012-02-29T00:00:00+01:002012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:/posts/2012/février/29/second-article/<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:002011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> <p><a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a root-relative link to unbelievable</a> -<a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-1/<p>Article 1</p> -Article 22011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-2/<p>Article 2</p> -Article 32011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-3/<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+01:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported +<a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-1/<p>Article 1</p> +Article 22011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-2/<p>Article 2</p> +Article 32011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-3/<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> <p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> @@ -20,13 +20,13 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:002010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/20/oh-yeah/<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+02:002010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/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:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+02:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> <div class="section" id="testing-sourcecode-directive"> @@ -70,5 +70,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+01:002010-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 +The baz tag2010-03-14T00:00:00+01:002010-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 index b2ee2199..6cbd64db 100644 --- a/pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml +++ b/pelican/tests/output/custom_locale/feeds/alexis-metaireau.rss.xml @@ -1,20 +1,20 @@ Alexis' log - Alexis Métaireauhttp://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/posts/2012/novembre/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/novembre/30/filename_metadata-example/Second articlehttp://blog.notmyidea.org/posts/2012/f%C3%A9vrier/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/février/29/second-article/foobarbazA markdown powered articlehttp://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:/posts/2012/novembre/30/filename_metadata-example/miscSecond articlehttp://blog.notmyidea.org/posts/2012/f%C3%A9vrier/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/février/29/second-article/miscfoobarbazA markdown powered articlehttp://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> <p><a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a root-relative link to unbelievable</a> -<a href="http://blog.notmyidea.org/posts/2010/octobre/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/avril/20/a-markdown-powered-article/Article 1http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-1/Article 2http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-2/Article 3http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-3/This is a super article !http://blog.notmyidea.org/posts/2010/d%C3%A9cembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported +<a href="http://blog.notmyidea.org/posts/2010/octobre/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/avril/20/a-markdown-powered-article/cat1Article 1http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-1/cat1Article 2http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-2/cat1Article 3http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-3/cat1This is a super article !http://blog.notmyidea.org/posts/2010/d%C3%A9cembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> -Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/foobarfoobarOh yeah !http://blog.notmyidea.org/posts/2010/octobre/20/oh-yeah/<div class="section" id="why-not"> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/yeahfoobarfoobarOh yeah !http://blog.notmyidea.org/posts/2010/octobre/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/octobre/20/oh-yeah/ohbaryeahUnbelievable !http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/20/oh-yeah/barohbaryeahUnbelievable !http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> <div class="section" id="testing-sourcecode-directive"> @@ -25,5 +25,5 @@ YEAH !</p> <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 …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/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 +pelican.conf, it will …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/miscThe 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.htmlmisc \ 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 index 0862627c..7e9d6a41 100644 --- a/pelican/tests/output/custom_locale/feeds/all-en.atom.xml +++ b/pelican/tests/output/custom_locale/feeds/all-en.atom.xml @@ -1,12 +1,12 @@ Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:002012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:/posts/2012/novembre/30/filename_metadata-example/<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00+01:002012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:/posts/2012/février/29/second-article/<p>This is some article, in english</p> -A markdown powered article2011-04-20T00:00:00+02:002011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +Second article2012-02-29T00:00:00+01:002012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:/posts/2012/février/29/second-article/<p>This is some article, in english</p> +A markdown powered article2011-04-20T00:00:00+02:002011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> <p><a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a root-relative link to unbelievable</a> -<a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-1/<p>Article 1</p> -Article 22011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-2/<p>Article 2</p> -Article 32011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-3/<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+01:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported +<a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-1/<p>Article 1</p> +Article 22011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-2/<p>Article 2</p> +Article 32011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-3/<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> <p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> @@ -20,13 +20,13 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:002010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/20/oh-yeah/<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+02:002010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/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:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+02:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> <div class="section" id="testing-sourcecode-directive"> @@ -70,5 +70,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+01:002010-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 +The baz tag2010-03-14T00:00:00+01:002010-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 index d76dbe0f..2bf92b1f 100644 --- a/pelican/tests/output/custom_locale/feeds/all-fr.atom.xml +++ b/pelican/tests/output/custom_locale/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:002012-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:002012-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 +Deuxième article2012-02-29T00:00:00+01:002012-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 index 5b5e6a40..db861c1b 100644 --- a/pelican/tests/output/custom_locale/feeds/all.atom.xml +++ b/pelican/tests/output/custom_locale/feeds/all.atom.xml @@ -1,14 +1,14 @@ Alexis' loghttp://blog.notmyidea.org/2013-11-17T23:29:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:002012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:/posts/2012/novembre/30/filename_metadata-example/<p>Some cool stuff!</p> -Trop bien !2012-03-02T14:01:01+01:002012-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:002012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:/posts/2012/février/29/second-article/<p>This is some article, in english</p> -Deuxième article2012-02-29T00:00:00+01:002012-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:002011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +Trop bien !2012-03-02T14:01:01+01:002012-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:002012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:/posts/2012/février/29/second-article/<p>This is some article, in english</p> +Deuxième article2012-02-29T00:00:00+01:002012-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:002011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> <p><a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a root-relative link to unbelievable</a> -<a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-1/<p>Article 1</p> -Article 22011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-2/<p>Article 2</p> -Article 32011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-3/<p>Article 3</p> -This is a super article !2010-12-02T10:14:00+01:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported +<a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-1/<p>Article 1</p> +Article 22011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-2/<p>Article 2</p> +Article 32011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-3/<p>Article 3</p> +This is a super article !2010-12-02T10:14:00+01:002013-11-17T23:29:00+01:00Alexis Métaireautag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> <p>Some content here !</p> <div class="section" id="this-is-a-simple-title"> @@ -22,13 +22,13 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> -Oh yeah !2010-10-20T10:14:00+02:002010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/20/oh-yeah/<div class="section" id="why-not"> +Oh yeah !2010-10-20T10:14:00+02:002010-10-20T10:14:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/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:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +Unbelievable !2010-10-15T20:30:00+02:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> <div class="section" id="testing-sourcecode-directive"> @@ -72,5 +72,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+01:002010-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 +The baz tag2010-03-14T00:00:00+01:002010-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 index 978ae6a6..2fac2b5d 100644 --- a/pelican/tests/output/custom_locale/feeds/all.rss.xml +++ b/pelican/tests/output/custom_locale/feeds/all.rss.xml @@ -1,22 +1,22 @@ Alexis' loghttp://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/posts/2012/novembre/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/novembre/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/f%C3%A9vrier/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/février/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/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:/posts/2012/novembre/30/filename_metadata-example/miscTrop 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.htmlmiscSecond articlehttp://blog.notmyidea.org/posts/2012/f%C3%A9vrier/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/février/29/second-article/miscfoobarbazDeuxiè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.htmlmiscfoobarbazA markdown powered articlehttp://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> <p><a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a root-relative link to unbelievable</a> -<a href="http://blog.notmyidea.org/posts/2010/octobre/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/avril/20/a-markdown-powered-article/Article 1http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-1/Article 2http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-2/Article 3http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-3/This is a super article !http://blog.notmyidea.org/posts/2010/d%C3%A9cembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported +<a href="http://blog.notmyidea.org/posts/2010/octobre/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/avril/20/a-markdown-powered-article/cat1Article 1http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-1/cat1Article 2http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-2/cat1Article 3http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-3/cat1This is a super article !http://blog.notmyidea.org/posts/2010/d%C3%A9cembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> -Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/foobarfoobarOh yeah !http://blog.notmyidea.org/posts/2010/octobre/20/oh-yeah/<div class="section" id="why-not"> +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/yeahfoobarfoobarOh yeah !http://blog.notmyidea.org/posts/2010/octobre/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/octobre/20/oh-yeah/ohbaryeahUnbelievable !http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/20/oh-yeah/barohbaryeahUnbelievable !http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> <div class="section" id="testing-sourcecode-directive"> @@ -27,5 +27,5 @@ YEAH !</p> <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 …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/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 +pelican.conf, it will …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/miscThe 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.htmlmisc \ 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 index 6b0bfb10..d4467ea7 100644 --- a/pelican/tests/output/custom_locale/feeds/bar.atom.xml +++ b/pelican/tests/output/custom_locale/feeds/bar.atom.xml @@ -5,4 +5,4 @@ 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 + \ 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 index 68c2317d..d17d7703 100644 --- a/pelican/tests/output/custom_locale/feeds/bar.rss.xml +++ b/pelican/tests/output/custom_locale/feeds/bar.rss.xml @@ -5,4 +5,4 @@ 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/octobre/20/oh-yeah/ohbaryeah \ No newline at end of file +Alexis MétaireauWed, 20 Oct 2010 10:14:00 +0200tag:blog.notmyidea.org,2010-10-20:/posts/2010/octobre/20/oh-yeah/barohbaryeah \ 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 index 7cc2f38e..87a822e5 100644 --- a/pelican/tests/output/custom_locale/feeds/cat1.atom.xml +++ b/pelican/tests/output/custom_locale/feeds/cat1.atom.xml @@ -1,7 +1,7 @@ Alexis' log - cat1http://blog.notmyidea.org/2011-04-20T00:00:00+02:00A markdown powered article2011-04-20T00:00:00+02:002011-04-20T00:00:00+02:00Alexis Métaireautag:blog.notmyidea.org,2011-04-20:/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> <p><a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a root-relative link to unbelievable</a> -<a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-1/<p>Article 1</p> -Article 22011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-2/<p>Article 2</p> -Article 32011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-3/<p>Article 3</p> - \ No newline at end of file +<a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a file-relative link to unbelievable</a></p>Article 12011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-1/<p>Article 1</p> +Article 22011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/17/article-2/<p>Article 2</p> +Article 32011-02-17T00:00:00+01:002011-02-17T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2011-02-17:/posts/2011/février/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 index c9c58e74..6b328fda 100644 --- a/pelican/tests/output/custom_locale/feeds/cat1.rss.xml +++ b/pelican/tests/output/custom_locale/feeds/cat1.rss.xml @@ -1,7 +1,7 @@ Alexis' log - cat1http://blog.notmyidea.org/Wed, 20 Apr 2011 00:00:00 +0200A markdown powered articlehttp://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/<p>You're mutually oblivious.</p> <p><a href="http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/">a root-relative link to unbelievable</a> -<a href="http://blog.notmyidea.org/posts/2010/octobre/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/avril/20/a-markdown-powered-article/Article 1http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-1/Article 2http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-2/Article 3http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-3/ \ No newline at end of file +<a href="http://blog.notmyidea.org/posts/2010/octobre/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/avril/20/a-markdown-powered-article/cat1Article 1http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-1/cat1Article 2http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-2/cat1Article 3http://blog.notmyidea.org/posts/2011/f%C3%A9vrier/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/février/17/article-3/cat1 \ 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 index f871f134..40060893 100644 --- a/pelican/tests/output/custom_locale/feeds/misc.atom.xml +++ b/pelican/tests/output/custom_locale/feeds/misc.atom.xml @@ -1,7 +1,7 @@ Alexis' log - mischttp://blog.notmyidea.org/2012-11-30T00:00:00+01:00FILENAME_METADATA example2012-11-30T00:00:00+01:002012-11-30T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-11-30:/posts/2012/novembre/30/filename_metadata-example/<p>Some cool stuff!</p> -Second article2012-02-29T00:00:00+01:002012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:/posts/2012/février/29/second-article/<p>This is some article, in english</p> -Unbelievable !2010-10-15T20:30:00+02:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +Second article2012-02-29T00:00:00+01:002012-02-29T00:00:00+01:00Alexis Métaireautag:blog.notmyidea.org,2012-02-29:/posts/2012/février/29/second-article/<p>This is some article, in english</p> +Unbelievable !2010-10-15T20:30:00+02:002010-10-15T20:30:00+02:00Alexis Métaireautag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> <div class="section" id="testing-sourcecode-directive"> @@ -45,5 +45,5 @@ pelican.conf, it will have nothing in default.</p> </pre></div> <p>Lovely.</p> </div> -The baz tag2010-03-14T00:00:00+01:002010-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 +The baz tag2010-03-14T00:00:00+01:002010-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 index dcdc18a4..041c7687 100644 --- a/pelican/tests/output/custom_locale/feeds/misc.rss.xml +++ b/pelican/tests/output/custom_locale/feeds/misc.rss.xml @@ -1,7 +1,7 @@ Alexis' log - mischttp://blog.notmyidea.org/Fri, 30 Nov 2012 00:00:00 +0100FILENAME_METADATA examplehttp://blog.notmyidea.org/posts/2012/novembre/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/novembre/30/filename_metadata-example/Second articlehttp://blog.notmyidea.org/posts/2012/f%C3%A9vrier/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/février/29/second-article/foobarbazUnbelievable !http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> +Alexis MétaireauFri, 30 Nov 2012 00:00:00 +0100tag:blog.notmyidea.org,2012-11-30:/posts/2012/novembre/30/filename_metadata-example/miscSecond articlehttp://blog.notmyidea.org/posts/2012/f%C3%A9vrier/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/février/29/second-article/miscfoobarbazUnbelievable !http://blog.notmyidea.org/posts/2010/octobre/15/unbelievable/<p>Or completely awesome. Depends the needs.</p> <p><a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a root-relative link to markdown-article</a> <a class="reference external" href="http://blog.notmyidea.org/posts/2011/avril/20/a-markdown-powered-article/">a file-relative link to markdown-article</a></p> <div class="section" id="testing-sourcecode-directive"> @@ -12,5 +12,5 @@ <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 …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/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 +pelican.conf, it will …</p></div>Alexis MétaireauFri, 15 Oct 2010 20:30:00 +0200tag:blog.notmyidea.org,2010-10-15:/posts/2010/octobre/15/unbelievable/miscThe 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.htmlmisc \ 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 index 6b774b73..6f2e5f82 100644 --- a/pelican/tests/output/custom_locale/feeds/yeah.atom.xml +++ b/pelican/tests/output/custom_locale/feeds/yeah.atom.xml @@ -13,4 +13,4 @@ as well as <strong>inline markup</strong>.</p> </pre> <p>→ And now try with some utf8 hell: ééé</p> </div> - \ No newline at end of file + \ 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 index 21e86d15..b7fb81f8 100644 --- a/pelican/tests/output/custom_locale/feeds/yeah.rss.xml +++ b/pelican/tests/output/custom_locale/feeds/yeah.rss.xml @@ -1,4 +1,4 @@ Alexis' log - yeahhttp://blog.notmyidea.org/Sun, 17 Nov 2013 23:29:00 +0100This is a super article !http://blog.notmyidea.org/posts/2010/d%C3%A9cembre/02/this-is-a-super-article/<p class="first last">Multi-line metadata should be supported as well as <strong>inline markup</strong>.</p> -Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/foobarfoobar \ No newline at end of file +Alexis MétaireauThu, 02 Dec 2010 10:14:00 +0100tag:blog.notmyidea.org,2010-12-02:/posts/2010/décembre/02/this-is-a-super-article/yeahfoobarfoobar \ No newline at end of file From 3be00060166ee23eb03d45508dd107554c0ce615 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 17 Oct 2019 10:42:59 -0700 Subject: [PATCH 077/143] Update RELEASE.md --- RELEASE.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/RELEASE.md b/RELEASE.md index 874bba5d..6b958464 100644 --- a/RELEASE.md +++ b/RELEASE.md @@ -1,3 +1,6 @@ -Release type: patch +Release type: minor -Support inline SVGs, don't treat titles in SVGs as HTML titles. Fixes #2561. +* Support inline SVGs; don't treat titles in SVGs as HTML titles +* Add category to feeds (in addition to tags) +* Improve content metadata field docs +* Add docs for including other Markdown/reST files in content From 01eb08c42b543450ee5e0e3de3854526708a6711 Mon Sep 17 00:00:00 2001 From: botpub Date: Thu, 17 Oct 2019 17:50:30 +0000 Subject: [PATCH 078/143] Release Pelican 4.2.0 --- RELEASE.md | 6 ------ docs/changelog.rst | 8 ++++++++ pyproject.toml | 2 +- setup.py | 2 +- 4 files changed, 10 insertions(+), 8 deletions(-) delete mode 100644 RELEASE.md diff --git a/RELEASE.md b/RELEASE.md deleted file mode 100644 index 6b958464..00000000 --- a/RELEASE.md +++ /dev/null @@ -1,6 +0,0 @@ -Release type: minor - -* Support inline SVGs; don't treat titles in SVGs as HTML titles -* Add category to feeds (in addition to tags) -* Improve content metadata field docs -* Add docs for including other Markdown/reST files in content diff --git a/docs/changelog.rst b/docs/changelog.rst index befe358a..febc5322 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -1,6 +1,14 @@ Release history ############### +4.2.0 - 2019-10-17 +================== + +* Support inline SVGs; don't treat titles in SVGs as HTML titles +* Add category to feeds (in addition to tags) +* Improve content metadata field docs +* Add docs for including other Markdown/reST files in content + 4.1.3 - 2019-10-09 ================== diff --git a/pyproject.toml b/pyproject.toml index 11c91c42..996570d0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "pelican" -version = "4.1.3" +version = "4.2.0" description = "Static site generator supporting Markdown and reStructuredText" authors = ["Justin Mayer "] license = "AGPLv3" diff --git a/setup.py b/setup.py index 23857608..0649bd73 100755 --- a/setup.py +++ b/setup.py @@ -7,7 +7,7 @@ from os.path import join, relpath from setuptools import setup -version = "4.1.3" +version = "4.2.0" requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', From 1c1640634f2311a7203bfd6271ca0412a33c9d7c Mon Sep 17 00:00:00 2001 From: Lucas Cimon Date: Mon, 21 Oct 2019 14:29:20 +0200 Subject: [PATCH 079/143] Update stale.yml --- .github/stale.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/stale.yml b/.github/stale.yml index d457dc02..b6991ba2 100644 --- a/.github/stale.yml +++ b/.github/stale.yml @@ -1,5 +1,11 @@ # Configuration for probot-stale - https://github.com/probot/stale +# Number of days of inactivity before an Issue or Pull Request becomes stale +daysUntilStale: 60 + +# Number of days of inactivity before an Issue or Pull Request with the stale label is closed. +daysUntilClose: 30 + # Set to true to ignore issues in a project (defaults to false) exemptProjects: true @@ -10,7 +16,7 @@ exemptMilestones: true exemptAssignees: true # Label to use when marking as stale -staleLabel: retired +staleLabel: stale # Comment to post when marking as stale. Set to `false` to disable markComment: > From 0806df606850b7f7544d99c6449dbea3a247981a Mon Sep 17 00:00:00 2001 From: kaliko Date: Fri, 25 Oct 2019 09:19:15 +0200 Subject: [PATCH 080/143] Fixed simple theme, add missing striptags filter page.title are missing striptags in title block --- pelican/themes/simple/templates/article.html | 2 +- pelican/themes/simple/templates/page.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pelican/themes/simple/templates/article.html b/pelican/themes/simple/templates/article.html index 5a1c093d..c8c9a4f7 100644 --- a/pelican/themes/simple/templates/article.html +++ b/pelican/themes/simple/templates/article.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block html_lang %}{{ article.lang }}{% endblock %} -{% block title %}{{ SITENAME }} - {{ article.title }}{% endblock %} +{% block title %}{{ SITENAME }} - {{ article.title|striptags }}{% endblock %} {% block head %} {{ super() }} diff --git a/pelican/themes/simple/templates/page.html b/pelican/themes/simple/templates/page.html index 7150d420..33344eac 100644 --- a/pelican/themes/simple/templates/page.html +++ b/pelican/themes/simple/templates/page.html @@ -1,7 +1,7 @@ {% extends "base.html" %} {% block html_lang %}{{ page.lang }}{% endblock %} -{% block title %}{{ SITENAME }} - {{ page.title }}{%endblock%} +{% block title %}{{ SITENAME }} - {{ page.title|striptags }}{%endblock%} {% block head %} {{ super() }} From ae73d063016d4de013eb3da2d0d6d4d6510cddd7 Mon Sep 17 00:00:00 2001 From: Paolo Melchiorre Date: Tue, 5 Nov 2019 21:04:56 +0100 Subject: [PATCH 081/143] Remove Python 2.7 support from settings --- .travis.yml | 1 - THANKS | 1 + pyproject.toml | 4 +--- setup.py | 2 -- tox.ini | 3 +-- 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 6641d4cc..af3a6ca8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,7 +11,6 @@ env: matrix: - TOX_ENV=docs - TOX_ENV=flake8 - - TOX_ENV=py27 - TOX_ENV=py35 - TOX_ENV=py36 matrix: diff --git a/THANKS b/THANKS index 121a8aca..625c56d3 100644 --- a/THANKS +++ b/THANKS @@ -117,6 +117,7 @@ Nico Di Rocco Nicolas Duhamel Nicolas Perriault Nicolas Steinmetz +Paolo Melchiorre Paul Asselin Pavel Puchkin Perry Roper diff --git a/pyproject.toml b/pyproject.toml index 996570d0..f2f2d0f9 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -17,8 +17,6 @@ classifiers = [ "Framework :: Pelican", "License :: OSI Approved :: GNU Affero General Public License v3", "Operating System :: OS Independent", - "Programming Language :: Python :: 2", - "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", @@ -29,7 +27,7 @@ classifiers = [ ] [tool.poetry.dependencies] -python = "~2.7 || ^3.5" +python = "^3.5" feedgenerator = "^1.9" jinja2 = "~2.10.1" pygments = "^2.4" diff --git a/setup.py b/setup.py index 0649bd73..faf28f10 100755 --- a/setup.py +++ b/setup.py @@ -71,8 +71,6 @@ setup( 'Framework :: Pelican', 'License :: OSI Approved :: GNU Affero General Public License v3', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 2', - 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', diff --git a/tox.ini b/tox.ini index 15dbaee8..b9178ac9 100644 --- a/tox.ini +++ b/tox.ini @@ -1,9 +1,8 @@ [tox] -envlist = py{27,35,36,37},docs,flake8 +envlist = py{35,36,37},docs,flake8 [testenv] basepython = - py27: python2.7 py35: python3.5 py36: python3.6 py37: python3.7 From e46b6232546a75b31f5cf3ae8f9aa9a624344915 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 9 Nov 2019 08:36:45 -0800 Subject: [PATCH 082/143] Add initial Invoke tasks.py file --- tasks.py | 81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 tasks.py diff --git a/tasks.py b/tasks.py new file mode 100644 index 00000000..7d9ff1d9 --- /dev/null +++ b/tasks.py @@ -0,0 +1,81 @@ +import os +from pathlib import Path +from shutil import which + +from invoke import task + +PKG_NAME = "pelican" +PKG_PATH = Path("pelican") +ACTIVE_VENV = os.environ.get("VIRTUAL_ENV", None) +VENV_HOME = Path(os.environ.get("WORKON_HOME", "~/virtualenvs")) +VENV_PATH = Path(ACTIVE_VENV) if ACTIVE_VENV else (VENV_HOME / PKG_NAME) +VENV = str(VENV_PATH.expanduser()) + +TOOLS = ["poetry", "pre-commit"] +POETRY = which("poetry") if which("poetry") else (VENV / Path("bin") / "poetry") +PRECOMMIT = ( + which("pre-commit") if which("pre-commit") else (VENV / Path("bin") / "pre-commit") +) + + +@task +def tests(c): + """Run the test suite""" + c.run(f"{VENV}/bin/python -Wd -m unittest discover", pty=True) + + +@task +def black(c, check=False, diff=False): + """Run Black auto-formatter, optionally with --check or --diff""" + check_flag, diff_flag = "", "" + if check: + check_flag = "--check" + if diff: + diff_flag = "--diff" + c.run(f"{VENV}/bin/black {check_flag} {diff_flag} {PKG_PATH} tasks.py") + + +@task +def isort(c, check=False, diff=False): + check_flag, diff_flag = "", "" + if check: + check_flag = "-c" + if diff: + diff_flag = "--diff" + c.run( + f"{VENV}/bin/isort {check_flag} {diff_flag} --recursive {PKG_PATH}/* tasks.py" + ) + + +@task +def flake8(c): + c.run(f"{VENV}/bin/flake8 {PKG_PATH} tasks.py") + + +@task +def lint(c): + isort(c, check=True) + black(c, check=True) + flake8(c) + + +@task +def tools(c): + """Install tools in the virtual environment if not already on PATH""" + for tool in TOOLS: + if not which(tool): + c.run(f"{VENV}/bin/pip install {tool}") + + +@task +def precommit(c): + """Install pre-commit hooks to .git/hooks/pre-commit""" + c.run(f"{PRECOMMIT} install") + + +@task +def setup(c): + c.run(f"{VENV}/bin/pip install -U pip") + tools(c) + c.run(f"{POETRY} install") + precommit(c) From d859f93c7b7ed659eee4d8653e060e309f51cc2d Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 9 Nov 2019 08:37:11 -0800 Subject: [PATCH 083/143] Add initial Pre-commit configuration file --- .pre-commit-config.yaml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..ef27cfcf --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,13 @@ +# See https://pre-commit.com/hooks.html for info on hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v2.3.0 + hooks: + - id: check-added-large-files + - id: check-ast + - id: check-toml + - id: check-yaml + - id: debug-statements + - id: detect-private-key + - id: end-of-file-fixer + - id: trailing-whitespace From 272778bc673bd10ff8a0031fd993676199cf60c9 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 9 Nov 2019 08:37:54 -0800 Subject: [PATCH 084/143] Add initial EditorConfig configuration --- .editorconfig | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .editorconfig diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 00000000..b42ca8c2 --- /dev/null +++ b/.editorconfig @@ -0,0 +1,15 @@ +root = true + +[*] +charset = utf-8 +end_of_line = lf +indent_size = 4 +indent_style = space +insert_final_newline = true +trim_trailing_whitespace = true + +[*.py] +max_line_length = 79 + +[*.yml] +indent_size = 2 From 04a602e381f8ec079482b7a87a412e02d133aa97 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 9 Nov 2019 08:40:26 -0800 Subject: [PATCH 085/143] Add Invoke as dependency in pyproject --- pyproject.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/pyproject.toml b/pyproject.toml index 996570d0..c498ef15 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,7 @@ sphinx_rtd_theme = "^0.4.3" tox = "^3.13" flake8 = "^3.7" flake8-import-order = "^0.18.1" +invoke = "^1.3" [tool.poetry.extras] markdown = ["markdown"] From 68c9ef76b2503a33bf5595069ab6d693a7eaf130 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 9 Nov 2019 09:43:55 -0800 Subject: [PATCH 086/143] Update CONTRIBUTING docs for Python 2.x removal This also updates the Contributing documentation with information on new development tooling. --- CONTRIBUTING.rst | 5 +- docs/contribute.rst | 180 +++++++++++++++++++++++++------------------- 2 files changed, 105 insertions(+), 80 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 7ae47593..ac120128 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -137,8 +137,7 @@ Contribution quality standards code/formatting can be improved. If you are relying on your editor for PEP8 compliance, note that the line length specified by PEP8 is 79 (excluding the line break). -* Ensure your code is compatible with the latest Python 2.7 and 3.x releases — see our - `compatibility cheatsheet`_ for more details. +* Ensure your code is compatible with the `officially-supported Python releases`_. * Add docs and tests for your changes. Undocumented and untested features will not be accepted. * `Run all the tests`_ **on all versions of Python supported by Pelican** to @@ -155,4 +154,4 @@ need assistance or have any questions about these guidelines. .. _`Git Tips`: https://github.com/getpelican/pelican/wiki/Git-Tips .. _`PEP8 coding standards`: https://www.python.org/dev/peps/pep-0008/ .. _`ask for help`: `How to get help`_ -.. _`compatibility cheatsheet`: https://docs.getpelican.com/en/latest/contribute.html#python-3-development-tips +.. _`officially-supported Python releases`: https://devguide.python.org/#status-of-python-branches diff --git a/docs/contribute.rst b/docs/contribute.rst index 5a314751..1e884463 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -7,72 +7,78 @@ can also help out by reviewing and commenting on `existing issues `_. Don't hesitate to fork Pelican and submit an issue or pull request on GitHub. -When doing so, please adhere to the following guidelines. +When doing so, please consider the following guidelines. .. include:: ../CONTRIBUTING.rst Setting up the development environment ====================================== -While there are many ways to set up one's development environment, we recommend -using `Virtualenv `_. This tool allows -you to set up separate environments for separate Python projects that are -isolated from one another so you can use different packages (and package -versions) for each. +While there are many ways to set up one's development environment, the following +instructions will utilize Pip_ and Poetry_. These tools facilitate managing +virtual environments for separate Python projects that are isolated from one +another, so you can use different packages (and package versions) for each. -If you don't have ``virtualenv`` installed, you can install it via:: +Please note that Python 3.6+ is required for Pelican development. - $ pip install virtualenv +*(Optional)* If you prefer to install Poetry once for use with multiple projects, +you can install it via:: -Use ``virtualenv`` to create and activate a virtual environment:: + curl -sSL https://raw.githubusercontent.com/sdispater/poetry/master/get-poetry.py | python - $ virtualenv ~/virtualenvs/pelican - $ cd ~/virtualenvs/pelican - $ . bin/activate +Point your web browser to the `Pelican repository`_ and tap the **Fork** button +at top-right. Then clone the source for your fork and add the upstream project +as a Git remote:: -Clone the Pelican source into a subfolder called ``src/pelican``:: + mkdir ~/projects + git clone https://github.com/YOUR_USERNAME/pelican.git ~/projects/pelican + cd ~/projects/pelican + git remote add upstream https://github.com/getpelican/pelican.git - $ git clone https://github.com/getpelican/pelican.git src/pelican - $ cd src/pelican +While Poetry can dynamically create and manage virtual environments, we're going +to manually create and activate a virtual environment:: -Install the development dependencies:: + mkdir ~/virtualenvs + python3 -m venv ~/virtualenvs/pelican + source ~/virtualenvs/pelican/bin/activate - $ pip install -r requirements/developer.pip +Install the needed dependencies and set up the project:: -Install Pelican and its dependencies:: + pip install -e ~/projects/pelican invoke + invoke setup - $ python setup.py develop +Your local environment should now be ready to go! -Or using ``pip``:: +.. _Pip: https://pip.pypa.io/ +.. _Poetry: https://poetry.eustace.io/docs/#installation +.. _Pelican repository: https://github.com/getpelican/pelican - $ pip install -e . +Development +=========== -To conveniently test on multiple Python versions, we also provide a ``.tox`` -file. +Once Pelican has been set up for local development, create a topic branch for +your bug fix or feature: + git checkout -b name-of-your-bugfix-or-feature -Building the docs -================= - -If you make changes to the documentation, you should preview your changes -before committing them:: - - $ pip install -r requirements/docs.pip - $ cd docs - $ make html - -Open ``_build/html/index.html`` in your browser to preview the documentation. +Now you can make changes to Pelican, its documentation, and/or other aspects of +the project. Running the test suite -====================== +---------------------- -Each time you add a feature, there are two things to do regarding tests: check -that the existing tests pass, and add tests for the new feature or bugfix. +Each time you make changes to Pelican, there are two things to do regarding +tests: check that the existing tests pass, and add tests for any new features +or bug fixes. The tests are located in ``pelican/tests``, and you can run them +via:: -The tests live in ``pelican/tests`` and you can run them using the -"discover" feature of ``unittest``:: + invoke tests - $ python -Wd -m unittest discover +In addition to running the test suite, the above invocation will also check code +style and let you know whether non-conforming patterns were found. In some cases +these linters will make the needed changes directly, while in other cases you +may need to make additional changes until ``invoke tests`` no longer reports any +code style violations. After making your changes and running the tests, you may see a test failure mentioning that "some generated files differ from the expected functional tests @@ -82,11 +88,11 @@ the nature of your changes, then you should update the output used by the functional tests. To do so, **make sure you have both** ``en_EN.utf8`` **and** ``fr_FR.utf8`` **locales installed**, and then run the following two commands:: - $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/custom/ \ + 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/ \ + LC_ALL=fr_FR.utf8 pelican -o pelican/tests/output/custom_locale/ \ -s samples/pelican.conf_FR.py samples/content/ - $ LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ + LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ samples/content/ You may also find that some tests are skipped because some dependency (e.g., @@ -101,48 +107,68 @@ environments. .. _Tox: https://tox.readthedocs.io/en/latest/ -Python 2/3 compatibility development tips -========================================= +Building the docs +----------------- -Here are some tips that may be useful for writing code that is compatible with -both Python 2.7 and Python 3: +If you make changes to the documentation, you should preview your changes +before committing them:: -- Use new syntax. For example: + cd docs + make html - - ``print .. -> print(..)`` - - ``except .., e -> except .. as e`` +Open ``_build/html/index.html`` in your browser to preview the documentation. -- Use new methods. For example: +Plugin development +------------------ - - ``dict.iteritems() -> dict.items()`` - - ``xrange(..) - > list(range(..))`` +To create a *new* Pelican plugin, please refer to the `plugin template`_ +repository for detailed instructions. -- Use ``six`` where necessary. For example: +If you want to contribute to an *existing* Pelican plugin, follow the steps +above to set up Pelican for local development, and then create a directory to +store cloned plugin repositories:: - - ``isinstance(.., basestring) -> isinstance(.., six.string_types)`` - - ``isinstance(.., unicode) -> isinstance(.., six.text_type)`` + mkdir -p ~/projects/pelican-plugins -- Assume every string and literal is Unicode: +Assuming you wanted to contribute to the Simple Footnotes plugin, you would +first browse to the `Simple Footnotes`_ repository on GitHub and tap the **Fork** +button at top-right. Then clone the source for your fork and add the upstream +project as a Git remote:: - - Use ``from __future__ import unicode_literals`` - - Do not use the prefix ``u'`` before strings. - - Do not encode/decode strings in the middle of something. Follow the code to - the source/target of a string and encode/decode at the first/last possible - point. - - In particular, write your functions to expect and to return Unicode. - - Encode/decode strings if the string is the output of a Python function that - is known to handle this badly. For example, ``strftime()`` in Python 2. - - Do not use the magic method ``__unicode()__`` in new classes. Use only - ``__str()__`` and decorate the class with ``@python_2_unicode_compatible``. + git clone https://github.com/YOUR_USERNAME/simple-footnotes.git ~/projects/pelican-plugins/simple-footnotes + cd ~/projects/pelican-plugins/simple-footnotes + git remote add upstream https://github.com/pelican-plugins/simple-footnotes.git -- ``setlocale()`` in Python 2 fails when we give the locale name as Unicode, - and since we are using ``from __future__ import unicode_literals``, we do - that everywhere! As a workaround, enclose the locale name with ``str()``; - in Python 2 this casts the name to a byte string, while in Python 3 this - should do nothing, because the locale name was already Unicode. -- Do not start integer literals with a zero. This is a syntax error in Python 3. -- Unfortunately there seems to be no octal notation that is valid in both - Python 2 and 3. Use decimal notation instead. +Install the needed dependencies and set up the project:: + + invoke setup + +After writing new tests for your plugin changes, run the plugin test suite:: + + invoke tests + +.. _plugin template: https://github.com/getpelican/cookiecutter-pelican-plugin +.. _Simple Footnotes: https://github.com/pelican-plugins/simple-footnotes + +Submitting your changes +----------------------- + +Assuming linting validation and tests pass, add a ``RELEASE.md`` file in the root +of the project that contains the release type (major, minor, patch) and a +summary of the changes that will be used as the release changelog entry. +For example:: + + Release type: patch + + Fix browser reloading upon changes to content, settings, or theme + +Commit your changes and push your topic branch:: + + git add . + git commit -m "Your detailed description of your changes" + git push origin name-of-your-bugfix-or-feature + +Finally, browse to your repository fork on GitHub and submit a pull request. Logging tips @@ -160,8 +186,8 @@ For logging messages that are not repeated, use the usual Python way:: logger.warning("A warning with %s formatting", arg_to_be_formatted) Do not format log messages yourself. Use ``%s`` formatting in messages and pass -arguments to logger. This is important, because Pelican logger will preprocess -some arguments (like Exceptions) for Py2/Py3 compatibility. +arguments to logger. This is important, because the Pelican logger will +preprocess some arguments, such as exceptions. Limiting extraneous log messages -------------------------------- From e713407f898f964f927053ffa924edb9adbcc1bb Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 10 Nov 2019 20:08:47 -0800 Subject: [PATCH 087/143] Add Pytest `filterwarnings` config section Fixes #2650 --- tox.ini | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tox.ini b/tox.ini index 15dbaee8..97f3a210 100644 --- a/tox.ini +++ b/tox.ini @@ -29,6 +29,11 @@ changedir = docs commands = sphinx-build -W -b html -d {envtmpdir}/doctrees . _build/html +[pytest] +filterwarnings = + default::DeprecationWarning + error:.*:Warning:pelican + [flake8] application-import-names = pelican import-order-style = cryptography From 2d232d15aae0af895ede1146c0f2810adc8410e1 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 10 Nov 2019 20:10:59 -0800 Subject: [PATCH 088/143] Switch `invoke tests` test runner to Pytest --- tasks.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tasks.py b/tasks.py index 7d9ff1d9..41ac2bde 100644 --- a/tasks.py +++ b/tasks.py @@ -21,7 +21,7 @@ PRECOMMIT = ( @task def tests(c): """Run the test suite""" - c.run(f"{VENV}/bin/python -Wd -m unittest discover", pty=True) + c.run(f"{VENV}/bin/pytest", pty=True) @task From dad376e0db64e583a2d7d81219c9eef48a7a4cae Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 11 Nov 2019 13:51:25 -0800 Subject: [PATCH 089/143] Switch Tox test runner from Nose to Pytest --- tox.ini | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tox.ini b/tox.ini index 97f3a210..1c20b282 100644 --- a/tox.ini +++ b/tox.ini @@ -11,14 +11,14 @@ passenv = * usedevelop=True deps = -rrequirements/test.pip - nose - nose-cov + pytest + pytest-cov coveralls pygments==2.1.3 commands = {envpython} --version - nosetests -sv --with-coverage --cover-package=pelican pelican + pytest -sv --cov=pelican pelican - coveralls [testenv:docs] From c0df11ecb80f51d63dd33202fa059727a84d5c29 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Mon, 11 Nov 2019 13:53:14 -0800 Subject: [PATCH 090/143] Remove Coveralls from Tox configuration --- tox.ini | 2 -- 1 file changed, 2 deletions(-) diff --git a/tox.ini b/tox.ini index 1c20b282..f975dd59 100644 --- a/tox.ini +++ b/tox.ini @@ -13,13 +13,11 @@ deps = -rrequirements/test.pip pytest pytest-cov - coveralls pygments==2.1.3 commands = {envpython} --version pytest -sv --cov=pelican pelican - - coveralls [testenv:docs] basepython = python3.6 From 703c28108947222e25425f9b798fb0925cbdb89a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 12 Nov 2019 07:28:55 -0800 Subject: [PATCH 091/143] Add missing colon in Contribute docs --- docs/contribute.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index 1e884463..752565f6 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -57,7 +57,7 @@ Development =========== Once Pelican has been set up for local development, create a topic branch for -your bug fix or feature: +your bug fix or feature:: git checkout -b name-of-your-bugfix-or-feature From b7368f919fdfe75dea585e13c5bad3911a34514a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 12 Nov 2019 07:40:05 -0800 Subject: [PATCH 092/143] Add Invoke task for updating functional test output --- docs/contribute.rst | 9 ++------- tasks.py | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index 752565f6..2f5ef873 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -86,14 +86,9 @@ output." If you have made changes that affect the HTML output generated by 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, **make sure you have both** ``en_EN.utf8`` **and** -``fr_FR.utf8`` **locales installed**, and then run the following two commands:: +``fr_FR.utf8`` **locales installed**, and then run the following command:: - 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.conf_FR.py samples/content/ - LC_ALL=en_US.utf8 pelican -o pelican/tests/output/basic/ \ - samples/content/ + invoke update-functional-tests You may also find that some tests are skipped because some dependency (e.g., Pandoc) is not installed. This does not automatically mean that these tests diff --git a/tasks.py b/tasks.py index 41ac2bde..8ecfc467 100644 --- a/tasks.py +++ b/tasks.py @@ -79,3 +79,17 @@ def setup(c): tools(c) c.run(f"{POETRY} install") precommit(c) + + +@task +def update_functional_tests(c): + """Update the generated functional test output""" + c.run( + f"bash -c 'LC_ALL=en_US.utf8 pelican -o {PKG_PATH}/tests/output/custom/ -s samples/pelican.conf.py samples/content/'" + ) + c.run( + f"bash -c 'LC_ALL=fr_FR.utf8 pelican -o {PKG_PATH}/tests/output/custom_locale/ -s samples/pelican.conf_FR.py samples/content/'" + ) + c.run( + f"bash -c 'LC_ALL=en_US.utf8 pelican -o {PKG_PATH}/tests/output/basic/ samples/content/'" + ) From f18429f23a2edc11e91fabea5150c06f20589b08 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 12 Nov 2019 07:45:36 -0800 Subject: [PATCH 093/143] Add Pytest as development dependency --- pyproject.toml | 7 ++++++- requirements/test.pip | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index c498ef15..a7afc595 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -46,9 +46,14 @@ BeautifulSoup4 = "^4.7" lxml = "^4.3" markdown = "~3.1.1" typogrify = "^2.0" -mock = "^3.0" sphinx = "=1.4.9" sphinx_rtd_theme = "^0.4.3" +mock = "^3.0" +pytest = "^5.2" +pytest-cov = "^2.8" +pytest-emoji = "^0.2.0" +pytest-pythonpath = "^0.7.3" +pytest-sugar = "^0.9.2" tox = "^3.13" flake8 = "^3.7" flake8-import-order = "^0.18.1" diff --git a/requirements/test.pip b/requirements/test.pip index ec4ea874..f5d09e4a 100644 --- a/requirements/test.pip +++ b/requirements/test.pip @@ -1,5 +1,6 @@ # Tests mock +pytest # Optional Packages Markdown >= 3.1 From 535df9cd9ce5ac9217828ddf480aca07c822aafe Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 12 Nov 2019 08:36:22 -0800 Subject: [PATCH 094/143] Add Invoke tasks for building and serving docs --- docs/contribute.rst | 12 +++++++----- pyproject.toml | 1 + requirements/docs.pip | 1 + tasks.py | 19 +++++++++++++++++++ 4 files changed, 28 insertions(+), 5 deletions(-) diff --git a/docs/contribute.rst b/docs/contribute.rst index 2f5ef873..a96f2d02 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -105,13 +105,15 @@ environments. Building the docs ----------------- -If you make changes to the documentation, you should preview your changes -before committing them:: +If you make changes to the documentation, you should build and inspect your +changes before committing them:: - cd docs - make html + invoke docserve -Open ``_build/html/index.html`` in your browser to preview the documentation. +Open http://localhost:8000 in your browser to review the documentation. While +the above task is running, any changes you make and save to the documentation +should automatically appear in the browser, as it live-reloads when it detects +changes to the documentation source files. Plugin development ------------------ diff --git a/pyproject.toml b/pyproject.toml index a7afc595..8b9db0c6 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,6 +48,7 @@ markdown = "~3.1.1" typogrify = "^2.0" sphinx = "=1.4.9" sphinx_rtd_theme = "^0.4.3" +livereload = "^2.6" mock = "^3.0" pytest = "^5.2" pytest-cov = "^2.8" diff --git a/requirements/docs.pip b/requirements/docs.pip index 525bdc40..acc5d5f5 100644 --- a/requirements/docs.pip +++ b/requirements/docs.pip @@ -1,2 +1,3 @@ sphinx==1.4.9 sphinx_rtd_theme +livereload diff --git a/tasks.py b/tasks.py index 8ecfc467..42642e6a 100644 --- a/tasks.py +++ b/tasks.py @@ -6,6 +6,7 @@ from invoke import task PKG_NAME = "pelican" PKG_PATH = Path("pelican") +DOCS_PORT = os.environ.get("DOCS_PORT", 8000) ACTIVE_VENV = os.environ.get("VIRTUAL_ENV", None) VENV_HOME = Path(os.environ.get("WORKON_HOME", "~/virtualenvs")) VENV_PATH = Path(ACTIVE_VENV) if ACTIVE_VENV else (VENV_HOME / PKG_NAME) @@ -18,6 +19,24 @@ PRECOMMIT = ( ) +@task +def docbuild(c): + """Build documentation""" + c.run(f"{VENV}/bin/sphinx-build docs docs/_build") + + +@task(docbuild) +def docserve(c): + """Serve docs at http://localhost:$DOCS_PORT/ (default port is 8000)""" + from livereload import Server + + server = Server() + server.watch("docs/conf.py", lambda: docbuild(c)) + server.watch("CONTRIBUTING.rst", lambda: docbuild(c)) + server.watch("docs/*.rst", lambda: docbuild(c)) + server.serve(port=DOCS_PORT, root="docs/_build") + + @task def tests(c): """Run the test suite""" From 4dc30dabab16602a0e6cf9348ecd385aab13a775 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 12 Nov 2019 14:13:43 -0800 Subject: [PATCH 095/143] Update `hub pull-request` docs in CONTRIBUTING --- CONTRIBUTING.rst | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index ac120128..5c1086a1 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -120,12 +120,13 @@ Using Git and GitHub GitHub's web UI to submit the pull request. This isn't an absolute requirement, but makes the maintainers' lives much easier! Specifically: `install hub `_ and then run - `hub pull-request `_ to - turn your GitHub issue into a pull request containing your code. -* After you have issued a pull request, Travis will run the test suite for all - supported Python versions and check for PEP8 compliance. If any of these - checks fail, you should fix them. (If tests fail on Travis but seem to pass - locally, ensure that local test runs aren't skipping any tests.) + `hub pull-request -i [ISSUE] `_ + to turn your GitHub issue into a pull request containing your code. +* After you have issued a pull request, the continuous integration (CI) system + will run the test suite for all supported Python versions and check for PEP8 + compliance. If any of these checks fail, you should fix them. (If tests fail + on the CI system but seem to pass locally, ensure that local test runs aren't + skipping any tests.) Contribution quality standards ------------------------------ From 74815af6e2ea136dd9ca6664b565ef0d0f4ab7d7 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Tue, 12 Nov 2019 14:20:50 -0800 Subject: [PATCH 096/143] Minor CONTRIBUTING fixes --- CONTRIBUTING.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst index 5c1086a1..945a5303 100644 --- a/CONTRIBUTING.rst +++ b/CONTRIBUTING.rst @@ -22,7 +22,7 @@ Before you ask for help, please make sure you do the following: 3. Try reproducing the issue in a clean environment, ensuring you are using: -* latest Pelican release (or an up-to-date git clone of Pelican master) +* latest Pelican release (or an up-to-date Git clone of Pelican master) * latest releases of libraries used by Pelican * no plugins or only those related to the issue @@ -71,7 +71,7 @@ The #pelican IRC channel * Because of differing time zones, you may not get an immediate response to your question, but please be patient and stay logged into IRC — someone will almost always respond if you wait long enough (it may take a few hours). -* If you don't have an IRC client handy, use the webchat_ for quick feedback. +* If you don't have an IRC client handy, use the webchat_. * You can direct your IRC client to the channel using this `IRC link`_ or you can manually join the ``#pelican`` IRC channel on the `freenode IRC network`_. @@ -94,7 +94,7 @@ Using Git and GitHub * `Create a new git branch`_ specific to your change (as opposed to making your commits in the master branch). * **Don't put multiple unrelated fixes/features in the same branch / pull request.** - For example, if you're hacking on a new feature and find a bugfix that + For example, if you're working on a new feature and find a bugfix that doesn't *require* your new feature, **make a new distinct branch and pull request** for the bugfix. * Add a ``RELEASE.md`` file in the root of the project that contains the From 4821ad3ce7865d74e74b63e9c21decc871657bea Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 13 Nov 2019 06:48:09 -0800 Subject: [PATCH 097/143] Remove Bumpr --- bumpr.rc | 32 -------------------------------- requirements/owner.pip | 1 - 2 files changed, 33 deletions(-) delete mode 100644 bumpr.rc diff --git a/bumpr.rc b/bumpr.rc deleted file mode 100644 index eebe4dd8..00000000 --- a/bumpr.rc +++ /dev/null @@ -1,32 +0,0 @@ -[bumpr] -file = pelican/__init__.py -vcs = git -clean = - python setup.py clean - rm -rf *egg-info build dist -tests = python -m unittest discover -publish = python setup.py sdist bdist_wheel register upload -files = - README.rst - setup.py - -[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[[:space:]]*=.*/last_stable = '{version}'/" docs/conf.py diff --git a/requirements/owner.pip b/requirements/owner.pip index 472823d4..45232fde 100644 --- a/requirements/owner.pip +++ b/requirements/owner.pip @@ -2,5 +2,4 @@ # Release issuance tox -bumpr==0.2.0 wheel From bae6de5d26646872fedbd00d37a849bba1837a3b Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 16 Nov 2019 07:37:01 -0800 Subject: [PATCH 098/143] Remove pytest-emoji from dev dependencies --- pyproject.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 8b9db0c6..43d17fb1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,7 +52,6 @@ livereload = "^2.6" mock = "^3.0" pytest = "^5.2" pytest-cov = "^2.8" -pytest-emoji = "^0.2.0" pytest-pythonpath = "^0.7.3" pytest-sugar = "^0.9.2" tox = "^3.13" From 1e0e541b575a377efa31b01bb13a60bb8c890d61 Mon Sep 17 00:00:00 2001 From: Kevin Yap Date: Tue, 5 Nov 2019 23:17:19 -0800 Subject: [PATCH 099/143] Initial pass of removing Python 2 support 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. --- .gitignore | 1 - THANKS | 1 + docs/conf.py | 1 - pelican/__init__.py | 20 +-- pelican/__main__.py | 1 - pelican/cache.py | 4 +- pelican/contents.py | 32 ++--- pelican/generators.py | 11 +- pelican/log.py | 53 +------- pelican/paginator.py | 5 +- pelican/readers.py | 24 ++-- pelican/rstdirectives.py | 5 +- pelican/server.py | 17 +-- pelican/settings.py | 13 +- pelican/signals.py | 1 - pelican/tests/default_conf.py | 1 - pelican/tests/support.py | 4 +- pelican/tests/test_cache.py | 1 - pelican/tests/test_contents.py | 25 ++-- pelican/tests/test_generators.py | 1 - pelican/tests/test_importer.py | 1 - pelican/tests/test_paginator.py | 1 - pelican/tests/test_pelican.py | 1 - pelican/tests/test_readers.py | 11 +- pelican/tests/test_rstdirectives.py | 1 - pelican/tests/test_server.py | 3 +- pelican/tests/test_settings.py | 1 - pelican/tests/test_testsuite.py | 1 - pelican/tests/test_urlwrappers.py | 1 - pelican/tests/test_utils.py | 9 +- pelican/tools/pelican_import.py | 40 ++---- pelican/tools/pelican_quickstart.py | 81 +++++------- pelican/tools/pelican_themes.py | 1 - pelican/tools/templates/pelicanconf.py.jinja2 | 1 - pelican/tools/templates/publishconf.py.jinja2 | 1 - pelican/urlwrappers.py | 16 +-- pelican/utils.py | 51 ++------ pelican/writers.py | 11 +- poetry.lock | 120 +----------------- pyproject.toml | 1 - samples/pelican.conf.py | 1 - samples/pelican.conf_FR.py | 1 - setup.py | 9 +- 43 files changed, 126 insertions(+), 459 deletions(-) diff --git a/.gitignore b/.gitignore index 45946946..c1835e10 100644 --- a/.gitignore +++ b/.gitignore @@ -11,7 +11,6 @@ tags .tox .coverage htmlcov -six-*.egg/ *.orig venv samples/output diff --git a/THANKS b/THANKS index 625c56d3..08ac7bb2 100644 --- a/THANKS +++ b/THANKS @@ -92,6 +92,7 @@ Joshua Adelman Julian Berman Justin Mayer Kevin Deldycke +Kevin Yap Kyle Fuller Laureline Guerin Leonard Huang diff --git a/docs/conf.py b/docs/conf.py index 43009cdd..f0589b84 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import os import sys diff --git a/pelican/__init__.py b/pelican/__init__.py index 499ded04..456d0691 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -1,12 +1,10 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import argparse try: import collections.abc as collections except ImportError: import collections -import locale import logging import multiprocessing import os @@ -15,8 +13,6 @@ import sys import time import traceback -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 as init_logging @@ -76,11 +72,10 @@ class Pelican(object): 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): + if isinstance(plugin, str): logger.debug("Loading plugin `%s`", plugin) try: - plugin = __import__(plugin, globals(), locals(), - str('module')) + plugin = __import__(plugin, globals(), locals(), 'module') except ImportError as e: logger.error( "Cannot load plugin `%s`\n%s", plugin, e) @@ -375,15 +370,6 @@ def get_config(args): config['BIND'] = args.bind config['DEBUG'] = args.verbosity == logging.DEBUG - # 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() - # http://mail.python.org/pipermail/python-list/2006-October/405766.html - if not six.PY3: - enc = locale.getpreferredencoding() - for key in config: - if key in ('PATH', 'OUTPUT_PATH', 'THEME'): - config[key] = config[key].decode(enc) return config @@ -397,7 +383,7 @@ def get_instance(args): settings = read_settings(config_file, override=get_config(args)) cls = settings['PELICAN_CLASS'] - if isinstance(cls, six.string_types): + if isinstance(cls, str): module, cls_name = cls.rsplit('.', 1) module = __import__(module) cls = getattr(module, cls_name) diff --git a/pelican/__main__.py b/pelican/__main__.py index 141823fc..69a5b95d 100644 --- a/pelican/__main__.py +++ b/pelican/__main__.py @@ -1,7 +1,6 @@ """ python -m pelican module entry point to run via python -m """ -from __future__ import absolute_import from . import main diff --git a/pelican/cache.py b/pelican/cache.py index e6c10cb9..0d36234a 100644 --- a/pelican/cache.py +++ b/pelican/cache.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import hashlib import logging import os - -from six.moves import cPickle as pickle +import pickle from pelican.utils import mkdir_p diff --git a/pelican/contents.py b/pelican/contents.py index a862db2d..5193061f 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -1,25 +1,20 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import copy +import datetime import locale import logging import os import re -import sys +from urllib.parse import urljoin, urlparse, urlunparse import pytz -import six -from six.moves.urllib.parse import urljoin, urlparse, urlunparse - from pelican import signals from pelican.settings import DEFAULT_CONFIG -from pelican.utils import (SafeDatetime, deprecated_attribute, memoized, - path_to_url, posixize_path, - python_2_unicode_compatible, sanitised_join, - set_date_tzinfo, slugify, strftime, - truncate_html_words) +from pelican.utils import (deprecated_attribute, memoized, path_to_url, + posixize_path, sanitised_join, set_date_tzinfo, + slugify, truncate_html_words) # Import these so that they're avalaible when you import from pelican.contents. from pelican.urlwrappers import (Author, Category, Tag, URLWrapper) # NOQA @@ -27,7 +22,6 @@ from pelican.urlwrappers import (Author, Category, Tag, URLWrapper) # NOQA logger = logging.getLogger(__name__) -@python_2_unicode_compatible class Content(object): """Represents a content. @@ -121,9 +115,6 @@ class Content(object): if isinstance(self.date_format, tuple): locale_string = self.date_format[0] - if sys.version_info < (3, ) and isinstance(locale_string, - six.text_type): - locale_string = locale_string.encode('ascii') locale.setlocale(locale.LC_ALL, locale_string) self.date_format = self.date_format[1] @@ -133,11 +124,11 @@ class Content(object): if hasattr(self, 'date'): self.date = set_date_tzinfo(self.date, timezone) - self.locale_date = strftime(self.date, self.date_format) + self.locale_date = self.date.strftime(self.date_format) if hasattr(self, 'modified'): self.modified = set_date_tzinfo(self.modified, timezone) - self.locale_modified = strftime(self.modified, self.date_format) + self.locale_modified = self.modified.strftime(self.date_format) # manage status if not hasattr(self, 'status'): @@ -213,7 +204,7 @@ class Content(object): 'path': path_to_url(path), 'slug': getattr(self, 'slug', ''), 'lang': getattr(self, 'lang', 'en'), - 'date': getattr(self, 'date', SafeDatetime.now()), + 'date': getattr(self, 'date', datetime.datetime.now()), 'author': self.author.slug if hasattr(self, 'author') else '', 'category': self.category.slug if hasattr(self, 'category') else '' }) @@ -512,22 +503,21 @@ class Article(Content): # handle WITH_FUTURE_DATES (designate article to draft based on date) if not self.settings['WITH_FUTURE_DATES'] and hasattr(self, 'date'): if self.date.tzinfo is None: - now = SafeDatetime.now() + now = datetime.datetime.now() else: - now = SafeDatetime.utcnow().replace(tzinfo=pytz.utc) + now = datetime.datetime.utcnow().replace(tzinfo=pytz.utc) if self.date > now: self.status = 'draft' # if we are a draft and there is no date provided, set max datetime if not hasattr(self, 'date') and self.status == 'draft': - self.date = SafeDatetime.max + self.date = datetime.datetime.max def _expand_settings(self, key): klass = 'draft' if self.status == 'draft' else 'article' return super(Article, self)._expand_settings(key, klass) -@python_2_unicode_compatible class Static(Content): mandatory_properties = ('title',) default_status = 'published' diff --git a/pelican/generators.py b/pelican/generators.py index ef021070..27c895e4 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import calendar import errno @@ -15,15 +14,12 @@ from operator import attrgetter 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, Page, Static from pelican.readers import Readers from pelican.utils import (DateFormatter, copy, mkdir_p, order_content, - posixize_path, process_translations, - python_2_unicode_compatible) + posixize_path, process_translations) logger = logging.getLogger(__name__) @@ -33,7 +29,6 @@ class PelicanTemplateNotFound(Exception): pass -@python_2_unicode_compatible class Generator(object): """Baseclass generator""" @@ -138,7 +133,7 @@ class Generator(object): extensions are allowed) """ # backward compatibility for older generators - if isinstance(paths, six.string_types): + if isinstance(paths, str): paths = [paths] # group the exclude dir names by parent path, for use with os.walk() @@ -513,8 +508,6 @@ class ArticlesGenerator(CachingGenerator): context["period"] = (_period,) else: 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) diff --git a/pelican/log.py b/pelican/log.py index 6f353264..c971636e 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -1,17 +1,9 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals -import locale import logging import os import sys from collections import defaultdict -try: - from collections.abc import Mapping -except ImportError: - from collections import Mapping - -import six __all__ = [ 'init' @@ -29,20 +21,17 @@ class BaseFormatter(logging.Formatter): # format multiline messages 'nicely' to make it clear they are together record.msg = record.msg.replace('\n', '\n | ') record.args = tuple(arg.replace('\n', '\n | ') if - isinstance(arg, six.string_types) else + isinstance(arg, str) else arg for arg in record.args) return super(BaseFormatter, self).format(record) def formatException(self, ei): ''' prefix traceback info for better representation ''' - # .formatException returns a bytestring in py2 and unicode in py3 - # since .format will handle unicode conversion, - # str() calls are used to normalize formatting string s = super(BaseFormatter, self).formatException(ei) # fancy format traceback - s = str('\n').join(str(' | ') + line for line in s.splitlines()) + s = '\n'.join(' | ' + line for line in s.splitlines()) # separate the traceback from the preceding lines - s = str(' |___\n{}').format(s) + s = ' |___\n{}'.format(s) return s def _get_levelname(self, name): @@ -140,41 +129,7 @@ class LimitFilter(logging.Filter): return True -class SafeLogger(logging.Logger): - """ - Base Logger which properly encodes Exceptions in Py2 - """ - _exc_encoding = locale.getpreferredencoding() - - 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): - 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) - - def _decode_arg(self, arg): - ''' - properly decode an arg for Py2 if it's Exception - - - localized systems have errors in native language if locale is set - so convert the message to unicode with the correct encoding - ''' - if isinstance(arg, Exception): - text = str('%s: %s') % (arg.__class__.__name__, arg) - if six.PY2: - text = text.decode(self._exc_encoding) - return text - else: - return arg - - -class LimitLogger(SafeLogger): +class LimitLogger(logging.Logger): """ A logger which adds LimitFilter automatically """ diff --git a/pelican/paginator.py b/pelican/paginator.py index fe63863e..61899056 100644 --- a/pelican/paginator.py +++ b/pelican/paginator.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import functools import logging @@ -7,8 +6,6 @@ import os from collections import namedtuple from math import ceil -import six - logger = logging.getLogger(__name__) PaginationRule = namedtuple( 'PaginationRule', @@ -131,7 +128,7 @@ class Page(object): prop_value = getattr(rule, key) - if not isinstance(prop_value, six.string_types): + if not isinstance(prop_value, str): logger.warning('%s is set to %s', key, prop_value) return prop_value diff --git a/pelican/readers.py b/pelican/readers.py index 52378c4f..bb4d6d81 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals +import datetime import logging import os import re from collections import OrderedDict +from html.parser import HTMLParser +from io import StringIO import docutils import docutils.core @@ -12,16 +14,11 @@ import docutils.io from docutils.parsers.rst.languages import get_language as get_docutils_lang from docutils.writers.html4css1 import HTMLTranslator, Writer -import six -from six import StringIO -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, escape_html, get_date, pelican_open, \ - posixize_path +from pelican.utils import escape_html, get_date, pelican_open, posixize_path try: from markdown import Markdown @@ -79,7 +76,7 @@ def ensure_metadata_list(text): Regardless, all list items undergo .strip() before returning, and empty items are discarded. """ - if isinstance(text, six.text_type): + if isinstance(text, str): if ';' in text: text = text.split(';') else: @@ -212,8 +209,7 @@ class RstReader(BaseReader): """ def __init__(self, *args, **kwargs): - if six.PY3: - kwargs['mode'] = kwargs.get('mode', 'r').replace('U', '') + kwargs['mode'] = kwargs.get('mode', 'r').replace('U', '') docutils.io.FileInput.__init__(self, *args, **kwargs) def __init__(self, *args, **kwargs): @@ -685,10 +681,10 @@ def default_metadata(settings=None, process=None): metadata['category'] = value if settings.get('DEFAULT_DATE', None) and \ settings['DEFAULT_DATE'] != 'fs': - if isinstance(settings['DEFAULT_DATE'], six.string_types): + if isinstance(settings['DEFAULT_DATE'], str): metadata['date'] = get_date(settings['DEFAULT_DATE']) else: - metadata['date'] = SafeDatetime(*settings['DEFAULT_DATE']) + metadata['date'] = datetime.datetime(*settings['DEFAULT_DATE']) return metadata @@ -696,7 +692,7 @@ def path_metadata(full_path, source_path, settings=None): metadata = {} if settings: if settings.get('DEFAULT_DATE', None) == 'fs': - metadata['date'] = SafeDatetime.fromtimestamp( + metadata['date'] = datetime.datetime.fromtimestamp( os.stat(full_path).st_mtime) # Apply EXTRA_PATH_METADATA for the source path and the paths of any @@ -731,7 +727,7 @@ def parse_path_metadata(source_path, settings=None, process=None): ... process=reader.process_metadata) >>> pprint.pprint(metadata) # doctest: +ELLIPSIS {'category': , - 'date': SafeDatetime(2013, 1, 1, 0, 0), + 'date': datetime.datetime(2013, 1, 1, 0, 0), 'slug': 'my-slug'} """ metadata = {} diff --git a/pelican/rstdirectives.py b/pelican/rstdirectives.py index b4f44aa1..dda0e6a7 100644 --- a/pelican/rstdirectives.py +++ b/pelican/rstdirectives.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import re @@ -10,8 +9,6 @@ from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import TextLexer, get_lexer_by_name -import six - import pelican.settings as pys @@ -49,7 +46,7 @@ class Pygments(Directive): # Fetch the defaults if pys.PYGMENTS_RST_OPTIONS is not None: - for k, v in six.iteritems(pys.PYGMENTS_RST_OPTIONS): + for k, v in pys.PYGMENTS_RST_OPTIONS.items(): # Locally set options overrides the defaults if k not in self.options: self.options[k] = v diff --git a/pelican/server.py b/pelican/server.py index 841b8e88..8434ded5 100644 --- a/pelican/server.py +++ b/pelican/server.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import argparse import logging @@ -7,16 +6,14 @@ import os import posixpath import ssl import sys +import urllib +from http import server try: from magic import from_file as magic_from_file except ImportError: magic_from_file = None -from six.moves import BaseHTTPServer -from six.moves import SimpleHTTPServer as srvmod -from six.moves import urllib - from pelican.log import init as init_logging logger = logging.getLogger(__name__) @@ -44,7 +41,7 @@ def parse_arguments(): return parser.parse_args() -class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): +class ComplexHTTPRequestHandler(server.SimpleHTTPRequestHandler): SUFFIXES = ['.html', '/index.html', '/', ''] def translate_path(self, path): @@ -76,7 +73,7 @@ class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): if not self.path: return - srvmod.SimpleHTTPRequestHandler.do_GET(self) + server.SimpleHTTPRequestHandler.do_GET(self) def get_path_that_exists(self, original_path): # Try to strip trailing slash @@ -96,7 +93,7 @@ class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): def guess_type(self, path): """Guess at the mime type for the specified file. """ - mimetype = srvmod.SimpleHTTPRequestHandler.guess_type(self, path) + mimetype = server.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: @@ -105,9 +102,9 @@ class ComplexHTTPRequestHandler(srvmod.SimpleHTTPRequestHandler): return mimetype -class RootedHTTPServer(BaseHTTPServer.HTTPServer): +class RootedHTTPServer(server.HTTPServer): def __init__(self, base_path, *args, **kwargs): - BaseHTTPServer.HTTPServer.__init__(self, *args, **kwargs) + server.HTTPServer.__init__(self, *args, **kwargs) self.RequestHandlerClass.base_path = base_path diff --git a/pelican/settings.py b/pelican/settings.py index 58e6c63c..11bad8c4 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import copy import inspect @@ -10,8 +9,6 @@ import re from os.path import isabs from posixpath import join as posix_join -import six - from pelican.log import LimitFilter @@ -278,7 +275,7 @@ def handle_deprecated_settings(settings): del settings['PLUGIN_PATH'] # PLUGIN_PATHS: str -> [str] - if isinstance(settings.get('PLUGIN_PATHS'), six.string_types): + if isinstance(settings.get('PLUGIN_PATHS'), str): logger.warning("Defining PLUGIN_PATHS setting as string " "has been deprecated (should be a list)") settings['PLUGIN_PATHS'] = [settings['PLUGIN_PATHS']] @@ -547,13 +544,13 @@ def configure_settings(settings): # standardize strings to lists for key in ['LOCALE']: - if key in settings and isinstance(settings[key], six.string_types): + if key in settings and isinstance(settings[key], str): settings[key] = [settings[key]] # check settings that must be a particular type for key, types in [ - ('OUTPUT_SOURCES_EXTENSION', six.string_types), - ('FILENAME_METADATA', six.string_types), + ('OUTPUT_SOURCES_EXTENSION', str), + ('FILENAME_METADATA', str), ]: if key in settings and not isinstance(settings[key], types): value = settings.pop(key) @@ -647,7 +644,7 @@ def configure_settings(settings): 'PAGE_PATHS', ) for PATH_KEY in filter(lambda k: k in settings, path_keys): - if isinstance(settings[PATH_KEY], six.string_types): + if isinstance(settings[PATH_KEY], str): logger.warning("Detected misconfiguration with %s setting " "(must be a list), falling back to the default", PATH_KEY) diff --git a/pelican/signals.py b/pelican/signals.py index 18a745b4..253b5fc3 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals from blinker import signal diff --git a/pelican/tests/default_conf.py b/pelican/tests/default_conf.py index a567dc10..13014572 100644 --- a/pelican/tests/default_conf.py +++ b/pelican/tests/default_conf.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals AUTHOR = 'Alexis Métaireau' SITENAME = "Alexis' log" SITEURL = 'http://blog.notmyidea.org' diff --git a/pelican/tests/support.py b/pelican/tests/support.py index 751fb5ec..86bf984f 100644 --- a/pelican/tests/support.py +++ b/pelican/tests/support.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import locale import logging @@ -10,12 +9,11 @@ import sys import unittest from contextlib import contextmanager from functools import wraps +from io import StringIO from logging.handlers import BufferingHandler from shutil import rmtree from tempfile import mkdtemp -from six import StringIO - from pelican.contents import Article from pelican.readers import default_metadata from pelican.settings import DEFAULT_CONFIG diff --git a/pelican/tests/test_cache.py b/pelican/tests/test_cache.py index ceba649e..7357cd9f 100644 --- a/pelican/tests/test_cache.py +++ b/pelican/tests/test_cache.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import os from shutil import rmtree diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index efc438c8..e9592bd4 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals +import datetime import locale import logging import os.path @@ -9,15 +9,12 @@ from sys import platform 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, get_context, get_settings, unittest) -from pelican.utils import (SafeDatetime, path_to_url, posixize_path, - truncate_html_words) +from pelican.utils import (path_to_url, posixize_path, truncate_html_words) # generate one paragraph, enclosed with

@@ -185,7 +182,7 @@ class TestPage(LoggedTestCase): def test_datetime(self): # If DATETIME is set to a tuple, it should be used to override LOCALE - dt = SafeDatetime(2015, 9, 13) + dt = datetime.datetime(2015, 9, 13) page_kwargs = self._copy_page_kwargs() @@ -286,9 +283,7 @@ class TestPage(LoggedTestCase): 'link')) def test_intrasite_link(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 = '_DummyArticle' if six.PY3 else b'_DummyArticle' + cls_name = '_DummyArticle' article = type(cls_name, (object,), {'url': 'article.html'}) args = self.page_kwargs.copy() @@ -370,9 +365,7 @@ class TestPage(LoggedTestCase): self.assertEqual(p.custom, linked) 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' + cls_name = '_DummyAsset' args = self.page_kwargs.copy() args['settings'] = get_settings() @@ -487,9 +480,7 @@ class TestPage(LoggedTestCase): ) def test_intrasite_link_markdown_spaces(self): - # Markdown introduces %20 instead of spaces, this tests that - # we support markdown doing this. - cls_name = '_DummyArticle' if six.PY3 else b'_DummyArticle' + cls_name = '_DummyArticle' article = type(cls_name, (object,), {'url': 'article-spaces.html'}) args = self.page_kwargs.copy() @@ -512,7 +503,7 @@ class TestPage(LoggedTestCase): def test_intrasite_link_source_and_generated(self): """Test linking both to the source and the generated article """ - cls_name = '_DummyAsset' if six.PY3 else b'_DummyAsset' + cls_name = '_DummyAsset' args = self.page_kwargs.copy() args['settings'] = get_settings() @@ -538,7 +529,7 @@ class TestPage(LoggedTestCase): def test_intrasite_link_to_static_content_with_filename(self): """Test linking to a static resource with deprecated {filename} """ - cls_name = '_DummyAsset' if six.PY3 else b'_DummyAsset' + cls_name = '_DummyAsset' args = self.page_kwargs.copy() args['settings'] = get_settings() diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 9ade301e..5b03b1d1 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import locale import os diff --git a/pelican/tests/test_importer.py b/pelican/tests/test_importer.py index 6eb62852..942b95fe 100644 --- a/pelican/tests/test_importer.py +++ b/pelican/tests/test_importer.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import locale import os diff --git a/pelican/tests/test_paginator.py b/pelican/tests/test_paginator.py index 4e3ef035..8080c146 100644 --- a/pelican/tests/test_paginator.py +++ b/pelican/tests/test_paginator.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, unicode_literals import locale diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index 502a45ac..0d495ac7 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals try: import collections.abc as collections diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 3f05bb4a..5b87aeac 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -1,10 +1,7 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import os -import six - from pelican import readers from pelican.tests.support import get_settings, unittest from pelican.utils import SafeDatetime @@ -64,8 +61,7 @@ class TestAssertDictHasSubset(ReaderTest): self.assertDictHasSubset(self.dictionary, self.dictionary) def test_fail_not_set(self): - six.assertRaisesRegex( - self, + self.assertRaisesRegex( AssertionError, r'Expected.*key-c.*to have value.*val-c.*but was not in Dict', self.assertDictHasSubset, @@ -73,8 +69,7 @@ class TestAssertDictHasSubset(ReaderTest): {'key-c': 'val-c'}) def test_fail_wrong_val(self): - six.assertRaisesRegex( - self, + self.assertRaisesRegex( AssertionError, r'Expected .*key-a.* to have value .*val-b.* but was .*val-a.*', self.assertDictHasSubset, @@ -445,7 +440,7 @@ class RstReaderTest(ReaderTest): def test_parse_error(self): # Verify that it raises an Exception, not nothing and not SystemExit or # some such - with six.assertRaisesRegex(self, Exception, "underline too short"): + with self.assertRaisesRegex(Exception, "underline too short"): self.read_file(path='../parse_error/parse_error.rst') diff --git a/pelican/tests/test_rstdirectives.py b/pelican/tests/test_rstdirectives.py index f6a7221f..0ff28a4a 100644 --- a/pelican/tests/test_rstdirectives.py +++ b/pelican/tests/test_rstdirectives.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals from pelican.tests.support import unittest diff --git a/pelican/tests/test_server.py b/pelican/tests/test_server.py index 8704c6b5..824e01ef 100644 --- a/pelican/tests/test_server.py +++ b/pelican/tests/test_server.py @@ -1,9 +1,8 @@ import os +from io import BytesIO from shutil import rmtree from tempfile import mkdtemp -from six import BytesIO - from pelican.server import ComplexHTTPRequestHandler from pelican.tests.support import unittest diff --git a/pelican/tests/test_settings.py b/pelican/tests/test_settings.py index 21759d40..d995527c 100644 --- a/pelican/tests/test_settings.py +++ b/pelican/tests/test_settings.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import copy import locale diff --git a/pelican/tests/test_testsuite.py b/pelican/tests/test_testsuite.py index 66c992bd..4f567516 100644 --- a/pelican/tests/test_testsuite.py +++ b/pelican/tests/test_testsuite.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import warnings diff --git a/pelican/tests/test_urlwrappers.py b/pelican/tests/test_urlwrappers.py index 8ff3d9d6..37af232e 100644 --- a/pelican/tests/test_urlwrappers.py +++ b/pelican/tests/test_urlwrappers.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals from pelican.tests.support import unittest from pelican.urlwrappers import Author, Category, Tag, URLWrapper diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index 444190d3..ad90a78e 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import absolute_import, print_function, unicode_literals import locale import logging @@ -11,8 +10,6 @@ from tempfile import mkdtemp import pytz -import six - from pelican import utils from pelican.generators import TemplatePagesGenerator from pelican.settings import read_settings @@ -720,8 +717,7 @@ class TestSanitisedJoin(unittest.TestCase): @unittest.skipIf(platform == 'win32', "Different filesystem root on Windows") def test_detect_parent_breakout(self): - with six.assertRaisesRegex( - self, + with self.assertRaisesRegex( RuntimeError, "Attempted to break out of output directory to /foo/test"): utils.sanitised_join( @@ -732,8 +728,7 @@ class TestSanitisedJoin(unittest.TestCase): @unittest.skipIf(platform == 'win32', "Different filesystem root on Windows") def test_detect_root_breakout(self): - with six.assertRaisesRegex( - self, + with self.assertRaisesRegex( RuntimeError, "Attempted to break out of output directory to /test"): utils.sanitised_join( diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index d6566e32..9b2edf4c 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -1,6 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import argparse import logging @@ -11,10 +10,9 @@ import sys import time from codecs import open from collections import defaultdict - -from six.moves.urllib.error import URLError -from six.moves.urllib.parse import quote, urlparse, urlsplit, urlunsplit -from six.moves.urllib.request import urlretrieve +from urllib.error import URLError +from urllib.parse import quote, urlparse, urlsplit, urlunsplit +from urllib.request import urlretrieve # because logging.setLoggerClass has to be called before logging.getLogger from pelican.log import init @@ -24,7 +22,7 @@ from pelican.utils import SafeDatetime, slugify try: from html import unescape # py3.5+ except ImportError: - from six.moves.html_parser import HTMLParser + from html.parser import HTMLParser unescape = HTMLParser().unescape logger = logging.getLogger(__name__) @@ -396,19 +394,8 @@ def posterous2fields(api_token, email, password): """Imports posterous posts""" import base64 from datetime import timedelta - try: - # py3k import - import json - except ImportError: - # py2 import - import simplejson as json - - try: - # py3k import - import urllib.request as urllib_request - except ImportError: - # py2 import - import urllib2 as urllib_request + import json + import urllib.request as urllib_request def get_posterous_posts(api_token, email, password, page=1): base64string = base64.encodestring( @@ -451,19 +438,8 @@ def posterous2fields(api_token, email, password): def tumblr2fields(api_key, blogname): """ Imports Tumblr posts (API v2)""" - try: - # py3k import - import json - except ImportError: - # py2 import - import simplejson as json - - try: - # py3k import - import urllib.request as urllib_request - except ImportError: - # py2 import - import urllib2 as urllib_request + import json + import urllib.request as urllib_request def get_tumblr_posts(api_key, blogname, offset=0): url = ("http://api.tumblr.com/v2/blog/%s.tumblr.com/" diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 463db900..5ff3dc33 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -1,12 +1,10 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import argparse import codecs import locale import os -import sys from jinja2 import Environment, FileSystemLoader @@ -23,8 +21,6 @@ try: except ImportError: _DEFAULT_TIMEZONE = 'Europe/Paris' -import six - from pelican import __version__ locale.setlocale(locale.LC_ALL, '') @@ -77,41 +73,24 @@ CONF = { # url for list of valid timezones _TZ_URL = 'http://en.wikipedia.org/wiki/List_of_tz_database_time_zones' -_input_compat = six.moves.input -str_compat = six.text_type - # Create a 'marked' default path, to determine if someone has supplied # a path on the command-line. -class _DEFAULT_PATH_TYPE(str_compat): +class _DEFAULT_PATH_TYPE(str): is_default_path = True _DEFAULT_PATH = _DEFAULT_PATH_TYPE(os.curdir) -def decoding_strings(f): - def wrapper(*args, **kwargs): - out = f(*args, **kwargs) - if isinstance(out, six.string_types) and not six.PY3: - # todo: make encoding configurable? - if six.PY3: - return out - else: - return out.decode(sys.stdin.encoding) - return out - return wrapper - - -@decoding_strings -def ask(question, answer=str_compat, default=None, length=None): - if answer == str_compat: +def ask(question, answer=str, default=None, length=None): + if answer == str: r = '' while True: if default: - r = _input_compat('> {0} [{1}] '.format(question, default)) + r = input('> {0} [{1}] '.format(question, default)) else: - r = _input_compat('> {0} '.format(question, default)) + r = input('> {0} '.format(question, default)) r = r.strip() @@ -133,11 +112,11 @@ def ask(question, answer=str_compat, default=None, length=None): r = None while True: if default is True: - r = _input_compat('> {0} (Y/n) '.format(question)) + r = input('> {0} (Y/n) '.format(question)) elif default is False: - r = _input_compat('> {0} (y/N) '.format(question)) + r = input('> {0} (y/N) '.format(question)) else: - r = _input_compat('> {0} (y/n) '.format(question)) + r = input('> {0} (y/n) '.format(question)) r = r.strip().lower() @@ -157,9 +136,9 @@ def ask(question, answer=str_compat, default=None, length=None): r = None while True: if default: - r = _input_compat('> {0} [{1}] '.format(question, default)) + r = input('> {0} [{1}] '.format(question, default)) else: - r = _input_compat('> {0} '.format(question)) + r = input('> {0} '.format(question)) r = r.strip() @@ -175,14 +154,14 @@ def ask(question, answer=str_compat, default=None, length=None): return r else: raise NotImplementedError( - 'Argument `answer` must be str_compat, bool, or integer') + 'Argument `answer` must be str, bool, or integer') def ask_timezone(question, default, tzurl): """Prompt for time zone and validate input""" lower_tz = [tz.lower() for tz in pytz.all_timezones] while True: - r = ask(question, str_compat, default) + r = ask(question, str, default) r = r.strip().replace(' ', '_').lower() if r in lower_tz: r = pytz.all_timezones[lower_tz.index(r)] @@ -227,20 +206,20 @@ needed by Pelican. 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))) + answer=str, default=args.path))) CONF['sitename'] = ask('What will be the title of this web site?', - answer=str_compat, default=args.title) + answer=str, default=args.title) CONF['author'] = ask('Who will be the author of this web site?', - answer=str_compat, default=args.author) + answer=str, default=args.author) CONF['lang'] = ask('What will be the default language of this web site?', - str_compat, args.lang or CONF['lang'], 2) + str, args.lang or CONF['lang'], 2) if ask('Do you want to specify a URL prefix? e.g., https://example.com ', answer=bool, default=True): CONF['siteurl'] = ask('What is your URL prefix? (see ' 'above example; no trailing slash)', - str_compat, CONF['siteurl']) + str, CONF['siteurl']) CONF['with_pagination'] = ask('Do you want to enable article pagination?', bool, bool(CONF['default_pagination'])) @@ -263,49 +242,49 @@ needed by Pelican. answer=bool, default=False): CONF['ftp'] = True, CONF['ftp_host'] = ask('What is the hostname of your FTP server?', - str_compat, CONF['ftp_host']) + str, CONF['ftp_host']) CONF['ftp_user'] = ask('What is your username on that server?', - str_compat, CONF['ftp_user']) + str, 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']) + str, CONF['ftp_target_dir']) if ask('Do you want to upload your website using SSH?', answer=bool, default=False): CONF['ssh'] = True, CONF['ssh_host'] = ask('What is the hostname of your SSH server?', - str_compat, CONF['ssh_host']) + 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_compat, CONF['ssh_user']) + str, 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']) + str, CONF['ssh_target_dir']) if ask('Do you want to upload your website using Dropbox?', answer=bool, default=False): CONF['dropbox'] = True, CONF['dropbox_dir'] = ask('Where is your Dropbox directory?', - str_compat, CONF['dropbox_dir']) + str, CONF['dropbox_dir']) if ask('Do you want to upload your website using S3?', answer=bool, default=False): CONF['s3'] = True, CONF['s3_bucket'] = ask('What is the name of your S3 bucket?', - str_compat, CONF['s3_bucket']) + str, CONF['s3_bucket']) if ask('Do you want to upload your website using ' 'Rackspace Cloud Files?', answer=bool, default=False): CONF['cloudfiles'] = True, CONF['cloudfiles_username'] = ask('What is your Rackspace ' - 'Cloud username?', str_compat, + 'Cloud username?', str, CONF['cloudfiles_username']) CONF['cloudfiles_api_key'] = ask('What is your Rackspace ' - 'Cloud API key?', str_compat, + 'Cloud API key?', str, CONF['cloudfiles_api_key']) CONF['cloudfiles_container'] = ask('What is the name of your ' 'Cloud Files container?', - str_compat, + str, CONF['cloudfiles_container']) if ask('Do you want to upload your website using GitHub Pages?', @@ -363,9 +342,7 @@ needed by Pelican. try: with codecs.open(os.path.join(CONF['basedir'], 'Makefile'), 'w', 'utf-8') as fd: - py_v = 'python' - if six.PY3: - py_v = 'python3' + py_v = 'python3' _template = _jinja_env.get_template('Makefile.jinja2') fd.write(_template.render(py_v=py_v, **CONF)) fd.close() diff --git a/pelican/tools/pelican_themes.py b/pelican/tools/pelican_themes.py index 9f9b2328..03acd9ce 100755 --- a/pelican/tools/pelican_themes.py +++ b/pelican/tools/pelican_themes.py @@ -1,6 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import argparse import os diff --git a/pelican/tools/templates/pelicanconf.py.jinja2 b/pelican/tools/templates/pelicanconf.py.jinja2 index 79f26a01..62939b6a 100644 --- a/pelican/tools/templates/pelicanconf.py.jinja2 +++ b/pelican/tools/templates/pelicanconf.py.jinja2 @@ -1,6 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -from __future__ import unicode_literals AUTHOR = {{author}} SITENAME = {{sitename}} diff --git a/pelican/tools/templates/publishconf.py.jinja2 b/pelican/tools/templates/publishconf.py.jinja2 index 913de7f1..bb18966b 100755 --- a/pelican/tools/templates/publishconf.py.jinja2 +++ b/pelican/tools/templates/publishconf.py.jinja2 @@ -1,6 +1,5 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- # -from __future__ import unicode_literals # This file is only used if you use `make publish` or # explicitly specify it as your config file. diff --git a/pelican/urlwrappers.py b/pelican/urlwrappers.py index baa8eb23..edfb11b4 100644 --- a/pelican/urlwrappers.py +++ b/pelican/urlwrappers.py @@ -1,18 +1,14 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals import functools import logging import os -import six - -from pelican.utils import python_2_unicode_compatible, slugify +from pelican.utils import slugify logger = logging.getLogger(__name__) -@python_2_unicode_compatible @functools.total_ordering class URLWrapper(object): def __init__(self, name, settings): @@ -66,26 +62,26 @@ class URLWrapper(object): def _normalize_key(self, key): subs = self.settings.get('SLUG_REGEX_SUBSTITUTIONS', []) - return six.text_type(slugify(key, regex_subs=subs)) + return str(slugify(key, regex_subs=subs)) def __eq__(self, other): if isinstance(other, self.__class__): return self.slug == other.slug - if isinstance(other, six.text_type): + if isinstance(other, str): return self.slug == self._normalize_key(other) return False def __ne__(self, other): if isinstance(other, self.__class__): return self.slug != other.slug - if isinstance(other, six.text_type): + if isinstance(other, str): return self.slug != self._normalize_key(other) return True def __lt__(self, other): if isinstance(other, self.__class__): return self.slug < other.slug - if isinstance(other, six.text_type): + if isinstance(other, str): return self.slug < self._normalize_key(other) return False @@ -105,7 +101,7 @@ class URLWrapper(object): """ setting = "%s_%s" % (self.__class__.__name__.upper(), key) value = self.settings[setting] - if not isinstance(value, six.string_types): + if not isinstance(value, str): logger.warning('%s is set to %s', setting, value) return value else: diff --git a/pelican/utils.py b/pelican/utils.py index 9629c7e0..d031503d 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals import codecs import datetime @@ -12,12 +11,15 @@ import re import shutil import sys import traceback +import urllib try: from collections.abc import Hashable except ImportError: from collections import Hashable from contextlib import contextmanager from functools import partial +from html import entities +from html.parser import HTMLParser from itertools import groupby from operator import attrgetter @@ -27,10 +29,6 @@ from jinja2 import Markup import pytz -import six -from six.moves import html_entities -from six.moves.html_parser import HTMLParser - try: from html import escape except ImportError: @@ -98,10 +96,6 @@ def strftime(date, date_format): else: formatted = date.strftime(candidate) - # convert Py2 result to unicode - if not six.PY3 and enc is not None: - formatted = formatted.decode(enc) - # strip zeros if '-' prefix is used if conversion: formatted = conversion(formatted) @@ -150,22 +144,6 @@ class DateFormatter(object): return formatted -def python_2_unicode_compatible(klass): - """ - A decorator that defines __unicode__ and __str__ methods under Python 2. - Under Python 3 it does nothing. - - To support Python 2 and 3 with a single code base, define a __str__ method - returning text and apply this decorator to the class. - - From django.utils.encoding. - """ - if not six.PY3: - klass.__unicode__ = klass.__str__ - klass.__str__ = lambda self: self.__unicode__().encode('utf-8') - return klass - - class memoized(object): """Function decorator to cache return values. @@ -214,15 +192,15 @@ def deprecated_attribute(old, new, since=None, remove=None, doc=None): content of the dummy method is ignored. """ def _warn(): - version = '.'.join(six.text_type(x) for x in since) + version = '.'.join(str(x) for x in since) message = ['{} has been deprecated since {}'.format(old, version)] if remove: - version = '.'.join(six.text_type(x) for x in remove) + version = '.'.join(str(x) for x in remove) message.append( ' 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 + logger.debug(''.join(str(x) for x in traceback.format_stack())) def fget(self): @@ -279,10 +257,8 @@ def slugify(value, regex_subs=()): # value must be unicode per se import unicodedata from unidecode import unidecode - # unidecode returns str in Py2 and 3, so in Py2 we have to make - # it unicode again value = unidecode(value) - if isinstance(value, six.binary_type): + if isinstance(value, bytes): value = value.decode('ascii') # still unicode value = unicodedata.normalize('NFKD', value) @@ -584,8 +560,8 @@ class _HTMLWordTruncator(HTMLParser): `name` is the entity ref without ampersand and semicolon (e.g. `mdash`) """ try: - codepoint = html_entities.name2codepoint[name] - char = six.unichr(codepoint) + codepoint = entities.name2codepoint[name] + char = chr(codepoint) except KeyError: char = '' self._handle_ref(name, char) @@ -602,7 +578,7 @@ class _HTMLWordTruncator(HTMLParser): codepoint = int(name[1:], 16) else: codepoint = int(name) - char = six.unichr(codepoint) + char = chr(codepoint) except (ValueError, OverflowError): char = '' self._handle_ref('#' + name, char) @@ -663,7 +639,7 @@ def process_translations(content_list, translation_id=None): if not translation_id: return content_list, [] - if isinstance(translation_id, six.string_types): + if isinstance(translation_id, str): translation_id = {translation_id} index = [] @@ -753,7 +729,7 @@ def order_content(content_list, order_by='slug'): content_list.sort(key=order_by) except Exception: logger.error('Error sorting with function %s', order_by) - elif isinstance(order_by, six.string_types): + elif isinstance(order_by, str): if order_by.startswith('reversed-'): order_reversed = True order_by = order_by.replace('reversed-', '', 1) @@ -901,8 +877,7 @@ def is_selected_for_writing(settings, path): def path_to_file_url(path): '''Convert file-system path to file:// URL''' - return six.moves.urllib_parse.urljoin( - "file://", six.moves.urllib.request.pathname2url(path)) + return urllib.parse.urljoin("file://", urllib.request.pathname2url(path)) def maybe_pluralize(count, singular, plural): diff --git a/pelican/writers.py b/pelican/writers.py index b610e2e2..daeb9dec 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -1,24 +1,18 @@ # -*- coding: utf-8 -*- -from __future__ import print_function, unicode_literals, with_statement import logging import os +from urllib.parse import urljoin from feedgenerator import Atom1Feed, Rss201rev2Feed, get_tag_uri from jinja2 import Markup -import six -from six.moves.urllib.parse import urljoin - from pelican import signals from pelican.paginator import Paginator from pelican.utils import (get_relative_path, is_selected_for_writing, path_to_url, sanitised_join, set_date_tzinfo) -if not six.PY3: - from codecs import open - logger = logging.getLogger(__name__) @@ -165,8 +159,7 @@ class Writer(object): except Exception: pass - encoding = 'utf-8' if six.PY3 else None - with self._open_w(complete_path, encoding, override_output) as fp: + with self._open_w(complete_path, 'utf-8', override_output) as fp: feed.write(fp, 'utf-8') logger.info('Writing %s', complete_path) diff --git a/poetry.lock b/poetry.lock index 971f6520..50ba33bc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -17,15 +17,6 @@ version = "2.7.0" [package.dependencies] pytz = ">=2015.7" -[[package]] -category = "dev" -description = "backports.functools_lru_cache" -marker = "python_version < \"3\"" -name = "backports.functools-lru-cache" -optional = false -python-versions = ">=2.6" -version = "1.5" - [[package]] category = "dev" description = "Screen-scraping library" @@ -54,24 +45,6 @@ optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" version = "0.4.1" -[[package]] -category = "dev" -description = "Updated configparser from Python 3.7 for Python 2.6+." -marker = "python_version < \"3.2\"" -name = "configparser" -optional = false -python-versions = ">=2.6" -version = "3.7.4" - -[[package]] -category = "dev" -description = "Backports and enhancements for the contextlib module" -marker = "python_version < \"3\"" -name = "contextlib2" -optional = false -python-versions = "*" -version = "0.5.5" - [[package]] category = "main" description = "Docutils -- Python Documentation Utilities" @@ -88,20 +61,6 @@ optional = false python-versions = ">=2.7" version = "0.3" -[package.dependencies] -[package.dependencies.configparser] -python = ">=2.7,<2.8" -version = ">=3.5" - -[[package]] -category = "dev" -description = "Python 3.4 Enum backported to 3.3, 3.2, 3.1, 2.7, 2.6, 2.5, and 2.4" -marker = "python_version < \"3.4\"" -name = "enum34" -optional = false -python-versions = "*" -version = "1.1.6" - [[package]] category = "main" description = "Standalone version of django.utils.feedgenerator" @@ -136,22 +95,6 @@ mccabe = ">=0.6.0,<0.7.0" pycodestyle = ">=2.5.0,<2.6.0" pyflakes = ">=2.1.0,<2.2.0" -[package.dependencies.configparser] -python = "<3.2" -version = "*" - -[package.dependencies.enum34] -python = "<3.4" -version = "*" - -[package.dependencies.functools32] -python = "<3.2" -version = "*" - -[package.dependencies.typing] -python = "<3.5" -version = "*" - [[package]] category = "dev" description = "Flake8 and pylama plugin that checks the ordering of import statements." @@ -164,28 +107,6 @@ version = "0.18.1" pycodestyle = "*" setuptools = "*" -[package.dependencies.enum34] -python = "<2.8" -version = "*" - -[[package]] -category = "dev" -description = "Python function signatures from PEP362 for Python 2.6, 2.7 and 3.2+" -marker = "python_version < \"3.3\"" -name = "funcsigs" -optional = false -python-versions = "*" -version = "1.0.2" - -[[package]] -category = "dev" -description = "Backport of the functools module from Python 3.2.3 for use on 2.7 and PyPy." -marker = "python_version < \"3.2\"" -name = "functools32" -optional = false -python-versions = "*" -version = "3.2.3-2" - [[package]] category = "dev" description = "Getting image size from png/jpeg/jpeg2000/gif file" @@ -205,14 +126,6 @@ version = "0.18" [package.dependencies] zipp = ">=0.5" -[package.dependencies.configparser] -python = "<3" -version = ">=3.5" - -[package.dependencies.contextlib2] -python = "<3" -version = "*" - [[package]] category = "main" description = "A small but fast and easy to use stand-alone template engine written in pure python." @@ -270,10 +183,6 @@ version = "3.0.5" [package.dependencies] six = "*" -[package.dependencies.funcsigs] -python = "<3.3" -version = ">=1" - [[package]] category = "dev" description = "Core utilities for Python packages" @@ -362,7 +271,7 @@ description = "Python 2 and 3 compatibility utilities" name = "six" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*" -version = "1.12.0" +version = "1.13.0" [[package]] category = "dev" @@ -388,11 +297,6 @@ optional = false python-versions = "*" version = "1.9.2" -[package.dependencies] -[package.dependencies."backports.functools-lru-cache"] -python = "<3" -version = "*" - [[package]] category = "dev" description = "Python documentation generator" @@ -449,15 +353,6 @@ six = ">=1.0.0,<2" toml = ">=0.9.4" virtualenv = ">=14.0.0" -[[package]] -category = "dev" -description = "Type Hints for Python" -marker = "python_version < \"3.5\"" -name = "typing" -optional = false -python-versions = "*" -version = "3.7.4" - [[package]] category = "dev" description = "Filters to enhance web typography, including support for Django & Jinja templates" @@ -497,27 +392,21 @@ version = "0.5.1" markdown = ["markdown"] [metadata] -content-hash = "d22ff0db3331186ab2f809313de1f9efef1f9c708cc354eaa1638a5111404612" -python-versions = "~2.7 || ^3.5" +content-hash = "0163177d87dca0955d111319de9481cf2ed0ef014e63a3740ffaf32a1cf07212" +python-versions = "^3.5" [metadata.hashes] alabaster = ["446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359", "a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"] babel = ["af92e6106cb7c55286b25b38ad7695f8b4efb36a90ba483d7f7a6628c46158ab", "e86135ae101e31e2c8ec20a4e0c5220f4eed12487d5cf3f78be7e98d3a57fc28"] -"backports.functools-lru-cache" = ["9d98697f088eb1b0fa451391f91afb5e3ebde16bbdb272819fd091151fda4f1a", "f0b0e4eba956de51238e17573b7087e852dfe9854afd2e9c873f73fc0ca0a6dd"] beautifulsoup4 = ["034740f6cb549b4e932ae1ab975581e6103ac8f942200a0e9759065984391858", "945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348", "ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718"] blinker = ["471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6"] colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"] -configparser = ["8be81d89d6e7b4c0d4e44bcc525845f6da25821de80cb5e06e7e0238a2899e32", "da60d0014fd8c55eb48c1c5354352e363e2d30bbf7057e5e171a468390184c75"] -contextlib2 = ["509f9419ee91cdd00ba34443217d5ca51f5a364a404e1dce9e8979cea969ca48", "f5260a6e679d2ff42ec91ec5252f4eeffdcf21053db9113bd0a8e4d953769c00"] docutils = ["02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", "51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", "7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"] entrypoints = ["589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", "c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"] -enum34 = ["2d81cbbe0e73112bdfe6ef8576f2238f2ba27dd0d55752a776c41d38b7da2850", "644837f692e5f550741432dd3f223bbb9852018674981b1664e5dc339387588a", "6bd0f6ad48ec2aa117d3d141940d484deccda84d4fcd884f5c3d93c23ecd8c79", "8ad8c4783bf61ded74527bffb48ed9b54166685e4230386a9ed9b1279e2df5b1"] feedgenerator = ["5ae05daa9cfa47fa406ee4744d0b7fa1c8a05a7a47ee0ad328ddf55327cfb106"] filelock = ["18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59", "929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"] flake8 = ["859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", "a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8"] flake8-import-order = ["90a80e46886259b9c396b578d75c749801a41ee969a235e163cfe1be7afd2543", "a28dc39545ea4606c1ac3c24e9d05c849c6e5444a50fb7e9cdd430fc94de6e92"] -funcsigs = ["330cc27ccbf7f1e992e69fef78261dc7c6569012cf397db8d3de0234e6c937ca", "a7bb0f2cf3a3fd1ab2732cb49eba4252c2af4240442415b4abce3b87022a8f50"] -functools32 = ["89d824aa6c358c421a234d7f9ee0bd75933a67c29588ce50aaa3acdf4d403fa0", "f6253dfbe0538ad2e387bd8fdfd9293c925d63553f5813c4e587745416501e6d"] imagesize = ["3f349de3eb99145973fefb7dbe38554414e5c30abd0c8e4b970a7c9d09f3a1d8", "f3832918bc3c66617f92e35f5d70729187676313caa60c187eb0f28b8fe5e3b5"] importlib-metadata = ["6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", "cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db"] jinja2 = ["065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013", "14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b"] @@ -535,7 +424,7 @@ pygments = ["71e430bc85c88a430f000ac1d9b331d2407f681d6f6aec95e8bcfbc3df5b0127", pyparsing = ["1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", "9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03"] python-dateutil = ["7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb", "c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"] pytz = ["303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda", "d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141"] -six = ["3350809f0555b11f552448330d0b52d5f24c91a322ea4a15ef22629740f3761c", "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"] +six = ["1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd", "30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66"] smartypants = ["8db97f7cbdf08d15b158a86037cd9e116b4cf37703d24e0419a0d64ca5808f0d"] snowballstemmer = ["9f3b9ffe0809d174f7047e121431acf99c89a7040f0ca84f94ba53a498e6d0c9"] soupsieve = ["72b5f1aea9101cf720a36bb2327ede866fd6f1a07b1e87c92a1cc18113cbc946", "e4e9c053d59795e440163733a7fec6c5972210e1790c507e4c7b051d6c5259de"] @@ -543,7 +432,6 @@ sphinx = ["82cd2728c906be96e307b81352d3fd9fb731869234c6b835cc25e9a3dfb4b7e4", "b sphinx-rtd-theme = ["00cf895504a7895ee433807c62094cf1e95f065843bf3acd17037c3e9a2becd4", "728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a"] toml = ["229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", "235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e", "f1db651f9657708513243e61e6cc67d101a39bad662eaa9b5546f789338e07a3"] tox = ["dab0b0160dd187b654fc33d690ee1d7bf328bd5b8dc6ef3bb3cc468969c659ba", "ee35ffce74933a6c6ac10c9a0182e41763140a5a5070e21b114feca56eaccdcd"] -typing = ["38566c558a0a94d6531012c8e917b1b8518a41e418f7f15f00e129cc80162ad3", "53765ec4f83a2b720214727e319607879fec4acde22c4fbb54fa2604e79e44ce", "84698954b4e6719e912ef9a42a2431407fe3755590831699debda6fba92aac55"] typogrify = ["8be4668cda434163ce229d87ca273a11922cb1614cb359970b7dc96eed13cb38"] unidecode = ["1d7a042116536098d05d599ef2b8616759f02985c85b4fef50c78a5aaf10822a", "2b6aab710c2a1647e928e36d69c21e76b453cd455f4e2621000e54b2a9b8cce8"] virtualenv = ["b7335cddd9260a3dd214b73a2521ffc09647bde3e9457fcca31dc3be3999d04a", "d28ca64c0f3f125f59cabf13e0a150e1c68e5eea60983cc4395d88c584495783"] diff --git a/pyproject.toml b/pyproject.toml index f2f2d0f9..50408d7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -37,7 +37,6 @@ unidecode = "^1.1" python-dateutil = "^2.8" docutils = "^0.14" markdown = {version = "~3.1.1", optional = true} -six = "^1.4" [tool.poetry.dev-dependencies] BeautifulSoup4 = "^4.7" diff --git a/samples/pelican.conf.py b/samples/pelican.conf.py index 0f67ee83..861c1f53 100755 --- a/samples/pelican.conf.py +++ b/samples/pelican.conf.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals AUTHOR = 'Alexis Métaireau' SITENAME = "Alexis' log" diff --git a/samples/pelican.conf_FR.py b/samples/pelican.conf_FR.py index b1571e8a..f87653a4 100644 --- a/samples/pelican.conf_FR.py +++ b/samples/pelican.conf_FR.py @@ -1,5 +1,4 @@ # -*- coding: utf-8 -*- -from __future__ import unicode_literals AUTHOR = 'Alexis Métaireau' SITENAME = "Alexis' log" diff --git a/setup.py b/setup.py index faf28f10..d79f055a 100755 --- a/setup.py +++ b/setup.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -import sys + from io import open from os import walk from os.path import join, relpath @@ -10,8 +10,7 @@ from setuptools import setup version = "4.2.0" requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', - 'pytz >= 0a', 'blinker', 'unidecode', 'six >= 1.4', - 'python-dateutil'] + 'pytz >= 0a', 'blinker', 'unidecode', 'python-dateutil'] entry_points = { 'console_scripts': [ @@ -25,9 +24,7 @@ entry_points = { README = open('README.rst', encoding='utf-8').read() CHANGELOG = open('docs/changelog.rst', encoding='utf-8').read() -description = u'\n'.join([README, CHANGELOG]) -if sys.version_info.major < 3: - description = description.encode('utf-8') +description = '\n'.join([README, CHANGELOG]) setup( name='pelican', From 49bc6ed47f75cb29eade8e2b1a4cf10bfaf73d92 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sun, 17 Nov 2019 19:19:37 +0300 Subject: [PATCH 100/143] Further remove python2-isms --- pelican/__init__.py | 7 ++-- pelican/generators.py | 1 - pelican/readers.py | 13 ++++---- pelican/settings.py | 19 ++++------- pelican/tests/test_generators.py | 1 - pelican/tests/test_importer.py | 1 - pelican/tests/test_pelican.py | 8 ++--- pelican/tools/pelican_import.py | 7 +--- pelican/tools/pelican_quickstart.py | 17 +++++----- pelican/urlwrappers.py | 2 +- pelican/utils.py | 50 +++++------------------------ 11 files changed, 35 insertions(+), 91 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 456d0691..83160684 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -1,10 +1,6 @@ # -*- coding: utf-8 -*- import argparse -try: - import collections.abc as collections -except ImportError: - import collections import logging import multiprocessing import os @@ -12,6 +8,7 @@ import pprint import sys import time import traceback +from collections.abc import Iterable # pelican.log has to be the first pelican module to be loaded # because logging.setLoggerClass has to be called before logging.getLogger @@ -184,7 +181,7 @@ class Pelican(object): for pair in signals.get_generators.send(self): (funct, value) = pair - if not isinstance(value, collections.Iterable): + if not isinstance(value, Iterable): value = (value, ) for v in value: diff --git a/pelican/generators.py b/pelican/generators.py index 27c895e4..8782238b 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -5,7 +5,6 @@ import errno import fnmatch import logging import os -from codecs import open from collections import defaultdict from functools import partial from itertools import chain, groupby diff --git a/pelican/readers.py b/pelican/readers.py index bb4d6d81..c650913f 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -5,6 +5,7 @@ import logging import os import re from collections import OrderedDict +from html import escape from html.parser import HTMLParser from io import StringIO @@ -18,7 +19,7 @@ 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 escape_html, get_date, pelican_open, posixize_path +from pelican.utils import get_date, pelican_open, posixize_path try: from markdown import Markdown @@ -411,7 +412,7 @@ class HTMLReader(BaseReader): self._in_body = False self._in_top_level = True elif self._in_body: - self._data_buffer += ''.format(escape_html(tag)) + self._data_buffer += ''.format(escape(tag)) def handle_startendtag(self, tag, attrs): if tag == 'meta' and self._in_head: @@ -432,16 +433,16 @@ class HTMLReader(BaseReader): self._data_buffer += '&#{};'.format(data) def build_tag(self, tag, attrs, close_tag): - result = '<{}'.format(escape_html(tag)) + result = '<{}'.format(escape(tag)) for k, v in attrs: - result += ' ' + escape_html(k) + result += ' ' + escape(k) if v is not None: # If the attribute value contains a double quote, surround # with single quotes, otherwise use double quotes. if '"' in v: - result += "='{}'".format(escape_html(v, quote=False)) + result += "='{}'".format(escape(v, quote=False)) else: - result += '="{}"'.format(escape_html(v, quote=False)) + result += '="{}"'.format(escape(v, quote=False)) if close_tag: return result + ' />' return result + '>' diff --git a/pelican/settings.py b/pelican/settings.py index 11bad8c4..a4033001 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- import copy +import importlib.util import inspect import locale import logging @@ -12,19 +13,11 @@ from posixpath import join as posix_join from pelican.log import LimitFilter -try: - # spec_from_file_location is the recommended way in Python 3.5+ - import importlib.util - - def load_source(name, path): - spec = importlib.util.spec_from_file_location(name, path) - mod = importlib.util.module_from_spec(spec) - spec.loader.exec_module(mod) - return mod -except ImportError: - # but it does not exist in Python 2.7, so fall back to imp - import imp - load_source = imp.load_source +def load_source(name, path): + spec = importlib.util.spec_from_file_location(name, path) + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod logger = logging.getLogger(__name__) diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 5b03b1d1..3ab341a3 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -2,7 +2,6 @@ import locale import os -from codecs import open from shutil import copy, rmtree from tempfile import mkdtemp diff --git a/pelican/tests/test_importer.py b/pelican/tests/test_importer.py index 942b95fe..1a6ce404 100644 --- a/pelican/tests/test_importer.py +++ b/pelican/tests/test_importer.py @@ -3,7 +3,6 @@ import locale import os import re -from codecs import open from pelican.settings import DEFAULT_CONFIG from pelican.tests.support import (mute, skipIfNoExecutable, temporary_folder, diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index 0d495ac7..5625d617 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -1,15 +1,11 @@ # -*- coding: utf-8 -*- -try: - import collections.abc as collections -except ImportError: - import collections - import locale import logging import os import subprocess import sys +from collections.abc import Sequence from shutil import rmtree from tempfile import mkdtemp @@ -94,7 +90,7 @@ class TestPelican(LoggedTestCase): generator_classes[-1] is StaticGenerator, "StaticGenerator must be the last generator, but it isn't!") self.assertIsInstance( - generator_classes, collections.Sequence, + generator_classes, Sequence, "get_generator_classes() must return a Sequence to preserve order") def test_basic_generation_works(self): diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 9b2edf4c..21122eb1 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -8,8 +8,8 @@ import re import subprocess import sys import time -from codecs import open from collections import defaultdict +from html import unescape from urllib.error import URLError from urllib.parse import quote, urlparse, urlsplit, urlunsplit from urllib.request import urlretrieve @@ -19,11 +19,6 @@ from pelican.log import init from pelican.settings import read_settings from pelican.utils import SafeDatetime, slugify -try: - from html import unescape # py3.5+ -except ImportError: - from html.parser import HTMLParser - unescape = HTMLParser().unescape logger = logging.getLogger(__name__) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 5ff3dc33..a7801866 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -2,7 +2,6 @@ # -*- coding: utf-8 -*- import argparse -import codecs import locale import os @@ -309,8 +308,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 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) @@ -322,8 +321,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 open(os.path.join(CONF['basedir'], 'publishconf.py'), + 'w', 'utf-8') as fd: _template = _jinja_env.get_template('publishconf.py.jinja2') fd.write(_template.render(**CONF)) fd.close() @@ -332,16 +331,16 @@ needed by Pelican. if automation: try: - with codecs.open(os.path.join(CONF['basedir'], 'tasks.py'), - 'w', 'utf-8') as fd: + with open(os.path.join(CONF['basedir'], 'tasks.py'), + 'w', 'utf-8') as fd: _template = _jinja_env.get_template('tasks.py.jinja2') fd.write(_template.render(**CONF)) fd.close() 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 open(os.path.join(CONF['basedir'], 'Makefile'), + 'w', 'utf-8') as fd: py_v = 'python3' _template = _jinja_env.get_template('Makefile.jinja2') fd.write(_template.render(py_v=py_v, **CONF)) diff --git a/pelican/urlwrappers.py b/pelican/urlwrappers.py index edfb11b4..6b512938 100644 --- a/pelican/urlwrappers.py +++ b/pelican/urlwrappers.py @@ -62,7 +62,7 @@ class URLWrapper(object): def _normalize_key(self, key): subs = self.settings.get('SLUG_REGEX_SUBSTITUTIONS', []) - return str(slugify(key, regex_subs=subs)) + return slugify(key, regex_subs=subs) def __eq__(self, other): if isinstance(other, self.__class__): diff --git a/pelican/utils.py b/pelican/utils.py index d031503d..6491f02e 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -1,8 +1,6 @@ # -*- coding: utf-8 -*- -import codecs import datetime -import errno import fnmatch import locale import logging @@ -12,10 +10,7 @@ import shutil import sys import traceback import urllib -try: - from collections.abc import Hashable -except ImportError: - from collections import Hashable +from collections.abc import Hashable from contextlib import contextmanager from functools import partial from html import entities @@ -29,10 +24,6 @@ from jinja2 import Markup import pytz -try: - from html import escape -except ImportError: - from cgi import escape logger = logging.getLogger(__name__) @@ -51,17 +42,11 @@ def sanitised_join(base_directory, *parts): def strftime(date, date_format): ''' - Replacement for built-in strftime - - This is necessary because of the way Py2 handles date format strings. - Specifically, Py2 strftime takes a bytestring. In the case of text output - (e.g. %b, %a, etc), the output is encoded with an encoding defined by - locale.LC_TIME. Things get messy if the formatting string has chars that - are not valid in LC_TIME defined encoding. + Enhanced replacement for built-in strftime with zero stripping This works by 'grabbing' possible format strings (those starting with %), - formatting them with the date, (if necessary) decoding the output and - replacing formatted output back. + formatting them with the date, stripping any leading zeros if - prefix is + used and replacing formatted output back. ''' def strip_zeros(x): return x.lstrip('0') or '0' @@ -74,10 +59,6 @@ def strftime(date, date_format): # replace candidates with placeholders for later % formatting template = re.sub(format_options, '%s', date_format) - # we need to convert formatted dates back to unicode in Py2 - # LC_TIME determines the encoding for built-in strftime outputs - lang_code, enc = locale.getlocale(locale.LC_TIME) - formatted_candidates = [] for candidate in candidates: # test for valid C89 directives only @@ -232,15 +213,12 @@ def get_date(string): @contextmanager -def pelican_open(filename, mode='rb', strip_crs=(sys.platform == 'win32')): +def pelican_open(filename, mode='r', strip_crs=(sys.platform == 'win32')): """Open a file and return its content""" - with codecs.open(filename, mode, encoding='utf-8') as infile: + # utf-8-sig will clear any BOM if present + with open(filename, mode, encoding='utf-8-sig') as infile: content = infile.read() - if content[:1] == codecs.BOM_UTF8.decode('utf8'): - content = content[1:] - if strip_crs: - content = content.replace('\r\n', '\n') yield content @@ -610,14 +588,6 @@ def truncate_html_words(s, num, end_text='…'): return out -def escape_html(text, quote=True): - """Escape '&', '<' and '>' to HTML-safe sequences. - - In Python 2 this uses cgi.escape and in Python 3 this uses html.escape. We - wrap here to ensure the quote argument has an identical default.""" - return escape(text, quote=quote) - - def process_translations(content_list, translation_id=None): """ Finds translations and returns them. @@ -833,11 +803,7 @@ def set_date_tzinfo(d, tz_name=None): def mkdir_p(path): - try: - os.makedirs(path) - except OSError as e: - if e.errno != errno.EEXIST or not os.path.isdir(path): - raise + os.makedirs(path, exist_ok=True) def split_all(path): From 3cc430b41814b1d7b30a3266ba6a39a6bda3fa32 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sun, 17 Nov 2019 20:30:07 +0300 Subject: [PATCH 101/143] Update docutils and remove docutils workaround --- pelican/readers.py | 13 ------------- poetry.lock | 8 ++++---- pyproject.toml | 2 +- setup.py | 5 +++-- 4 files changed, 8 insertions(+), 20 deletions(-) diff --git a/pelican/readers.py b/pelican/readers.py index c650913f..653464af 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -201,18 +201,6 @@ class RstReader(BaseReader): writer_class = PelicanHTMLWriter field_body_translator_class = _FieldBodyTranslator - class FileInput(docutils.io.FileInput): - """Patch docutils.io.FileInput to remove "U" mode in py3. - - Universal newlines is enabled by default and "U" mode is deprecated - in py3. - - """ - - def __init__(self, *args, **kwargs): - kwargs['mode'] = kwargs.get('mode', 'r').replace('U', '') - docutils.io.FileInput.__init__(self, *args, **kwargs) - def __init__(self, *args, **kwargs): super(RstReader, self).__init__(*args, **kwargs) @@ -273,7 +261,6 @@ class RstReader(BaseReader): pub = docutils.core.Publisher( writer=self.writer_class(), - source_class=self.FileInput, destination_class=docutils.io.StringOutput) pub.set_components('standalone', 'restructuredtext', 'html') pub.process_programmatic_settings(None, extra_params, None) diff --git a/poetry.lock b/poetry.lock index 50ba33bc..3b85d1d2 100644 --- a/poetry.lock +++ b/poetry.lock @@ -50,8 +50,8 @@ category = "main" description = "Docutils -- Python Documentation Utilities" name = "docutils" optional = false -python-versions = "*" -version = "0.14" +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +version = "0.15.2" [[package]] category = "dev" @@ -392,7 +392,7 @@ version = "0.5.1" markdown = ["markdown"] [metadata] -content-hash = "0163177d87dca0955d111319de9481cf2ed0ef014e63a3740ffaf32a1cf07212" +content-hash = "b8fa239ebaf9bf4bcd5c2e02cf94d065a1add4e19d8354cedf19db6378d6b848" python-versions = "^3.5" [metadata.hashes] @@ -401,7 +401,7 @@ babel = ["af92e6106cb7c55286b25b38ad7695f8b4efb36a90ba483d7f7a6628c46158ab", "e8 beautifulsoup4 = ["034740f6cb549b4e932ae1ab975581e6103ac8f942200a0e9759065984391858", "945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348", "ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718"] blinker = ["471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6"] colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"] -docutils = ["02aec4bd92ab067f6ff27a38a38a41173bf01bed8f89157768c1573f53e474a6", "51e64ef2ebfb29cae1faa133b3710143496eca21c530f3f71424d77687764274", "7a4bd47eaf6596e1295ecb11361139febe29b084a87bf005bf899f9a42edc3c6"] +docutils = ["6c4f696463b79f1fb8ba0c594b63840ebd41f059e92b31957c46b74a4599b6d0", "9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827", "a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"] entrypoints = ["589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", "c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"] feedgenerator = ["5ae05daa9cfa47fa406ee4744d0b7fa1c8a05a7a47ee0ad328ddf55327cfb106"] filelock = ["18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59", "929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"] diff --git a/pyproject.toml b/pyproject.toml index 50408d7f..41314c99 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ pytz = "^2019.1" blinker = "^1.4" unidecode = "^1.1" python-dateutil = "^2.8" -docutils = "^0.14" +docutils = "^0.15" markdown = {version = "~3.1.1", optional = true} [tool.poetry.dev-dependencies] diff --git a/setup.py b/setup.py index d79f055a..7c583da2 100755 --- a/setup.py +++ b/setup.py @@ -9,8 +9,9 @@ from setuptools import setup version = "4.2.0" -requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', 'docutils', - 'pytz >= 0a', 'blinker', 'unidecode', 'python-dateutil'] +requires = ['feedgenerator >= 1.9', 'jinja2 >= 2.7', 'pygments', + 'docutils>=0.15', 'pytz >= 0a', 'blinker', 'unidecode', + 'python-dateutil'] entry_points = { 'console_scripts': [ From 16968834ce9d72e2e51b06ffe16a1c750c224370 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Mon, 18 Nov 2019 20:28:48 +0300 Subject: [PATCH 102/143] Convert super() calls to py3 style --- pelican/cache.py | 9 +++------ pelican/contents.py | 12 ++++++------ pelican/generators.py | 8 ++++---- pelican/log.py | 12 ++++++------ pelican/readers.py | 18 ++++++------------ pelican/tests/support.py | 6 +++--- pelican/tests/test_contents.py | 4 ++-- pelican/tests/test_paginator.py | 2 +- pelican/tests/test_pelican.py | 4 ++-- pelican/urlwrappers.py | 2 +- pelican/utils.py | 17 ++++------------- 11 files changed, 38 insertions(+), 56 deletions(-) diff --git a/pelican/cache.py b/pelican/cache.py index 0d36234a..f6adbc35 100644 --- a/pelican/cache.py +++ b/pelican/cache.py @@ -80,9 +80,7 @@ class FileStampDataCacher(FileDataCacher): and base path for filestamping operations """ - super(FileStampDataCacher, self).__init__(settings, cache_name, - caching_policy, - load_policy) + super().__init__(settings, cache_name, caching_policy, load_policy) method = self.settings['CHECK_MODIFIED_METHOD'] if method == 'mtime': @@ -104,7 +102,7 @@ class FileStampDataCacher(FileDataCacher): 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)) + super().cache_data(filename, (stamp, data)) def _get_file_stamp(self, filename): """Check if the given file has been modified @@ -132,8 +130,7 @@ class FileStampDataCacher(FileDataCacher): and current file stamp. """ - stamp, data = super(FileStampDataCacher, self).get_cached_data( - filename, (None, default)) + stamp, data = super().get_cached_data(filename, (None, default)) if stamp != self._get_file_stamp(filename): return default return data diff --git a/pelican/contents.py b/pelican/contents.py index 5193061f..6edf5152 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -488,7 +488,7 @@ class Page(Content): def _expand_settings(self, key): klass = 'draft_page' if self.status == 'draft' else None - return super(Page, self)._expand_settings(key, klass) + return super()._expand_settings(key, klass) class Article(Content): @@ -498,7 +498,7 @@ class Article(Content): default_template = 'article' def __init__(self, *args, **kwargs): - super(Article, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) # handle WITH_FUTURE_DATES (designate article to draft based on date) if not self.settings['WITH_FUTURE_DATES'] and hasattr(self, 'date'): @@ -515,7 +515,7 @@ class Article(Content): def _expand_settings(self, key): klass = 'draft' if self.status == 'draft' else 'article' - return super(Article, self)._expand_settings(key, klass) + return super()._expand_settings(key, klass) class Static(Content): @@ -524,7 +524,7 @@ class Static(Content): default_template = None def __init__(self, *args, **kwargs): - super(Static, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self._output_location_referenced = False @deprecated_attribute(old='filepath', new='source_path', since=(3, 2, 0)) @@ -543,13 +543,13 @@ class Static(Content): def url(self): # Note when url has been referenced, so we can avoid overriding it. self._output_location_referenced = True - return super(Static, self).url + return super().url @property def save_as(self): # Note when save_as has been referenced, so we can avoid overriding it. self._output_location_referenced = True - return super(Static, self).save_as + return super().save_as def attach_to(self, content): """Override our output directory with that of the given content object. diff --git a/pelican/generators.py b/pelican/generators.py index 8782238b..8bd2656f 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -241,7 +241,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(CachingGenerator, self)._get_file_stamp(filename) + return super()._get_file_stamp(filename) class _FileLoader(BaseLoader): @@ -288,7 +288,7 @@ class ArticlesGenerator(CachingGenerator): self.authors = defaultdict(list) self.drafts = [] # only drafts in default language self.drafts_translations = [] - super(ArticlesGenerator, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) signals.article_generator_init.send(self) def generate_feeds(self, writer): @@ -699,7 +699,7 @@ class PagesGenerator(CachingGenerator): self.hidden_translations = [] self.draft_pages = [] self.draft_translations = [] - super(PagesGenerator, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) signals.page_generator_init.send(self) def generate_context(self): @@ -785,7 +785,7 @@ class StaticGenerator(Generator): to output""" def __init__(self, *args, **kwargs): - super(StaticGenerator, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.fallback_to_symlinks = False signals.static_generator_init.send(self) diff --git a/pelican/log.py b/pelican/log.py index c971636e..bae15b4b 100644 --- a/pelican/log.py +++ b/pelican/log.py @@ -13,7 +13,7 @@ __all__ = [ class BaseFormatter(logging.Formatter): def __init__(self, fmt=None, datefmt=None): FORMAT = '%(customlevelname)s %(message)s' - super(BaseFormatter, self).__init__(fmt=FORMAT, datefmt=datefmt) + super().__init__(fmt=FORMAT, datefmt=datefmt) def format(self, record): customlevel = self._get_levelname(record.levelname) @@ -23,11 +23,11 @@ class BaseFormatter(logging.Formatter): record.args = tuple(arg.replace('\n', '\n | ') if isinstance(arg, str) else arg for arg in record.args) - return super(BaseFormatter, self).format(record) + return super().format(record) def formatException(self, ei): ''' prefix traceback info for better representation ''' - s = super(BaseFormatter, self).formatException(ei) + s = super().formatException(ei) # fancy format traceback s = '\n'.join(' | ' + line for line in s.splitlines()) # separate the traceback from the preceding lines @@ -137,7 +137,7 @@ class LimitLogger(logging.Logger): limit_filter = LimitFilter() def __init__(self, *args, **kwargs): - super(LimitLogger, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.enable_filter() def disable_filter(self): @@ -152,12 +152,12 @@ class FatalLogger(LimitLogger): errors_fatal = False def warning(self, *args, **kwargs): - super(FatalLogger, self).warning(*args, **kwargs) + super().warning(*args, **kwargs) if FatalLogger.warnings_fatal: raise RuntimeError('Warning encountered') def error(self, *args, **kwargs): - super(FatalLogger, self).error(*args, **kwargs) + super().error(*args, **kwargs) if FatalLogger.errors_fatal: raise RuntimeError('Error encountered') diff --git a/pelican/readers.py b/pelican/readers.py index 653464af..b26bd381 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -136,7 +136,7 @@ class BaseReader(object): class _FieldBodyTranslator(HTMLTranslator): def __init__(self, document): - HTMLTranslator.__init__(self, document) + super().__init__(document) self.compact_p = None def astext(self): @@ -158,7 +158,7 @@ def render_node_to_html(document, node, field_body_translator_class): class PelicanHTMLWriter(Writer): def __init__(self): - Writer.__init__(self) + super().__init__() self.translator_class = PelicanHTMLTranslator @@ -202,7 +202,7 @@ class RstReader(BaseReader): field_body_translator_class = _FieldBodyTranslator def __init__(self, *args, **kwargs): - super(RstReader, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) lang_code = self.settings.get('DEFAULT_LANG', 'en') if get_docutils_lang(lang_code): @@ -287,7 +287,7 @@ class MarkdownReader(BaseReader): file_extensions = ['md', 'markdown', 'mkd', 'mdown'] def __init__(self, *args, **kwargs): - super(MarkdownReader, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) settings = self.settings['MARKDOWN'] settings.setdefault('extension_configs', {}) settings.setdefault('extensions', []) @@ -350,11 +350,7 @@ class HTMLReader(BaseReader): class _HTMLParser(HTMLParser): def __init__(self, settings, filename): - try: - # Python 3.5+ - HTMLParser.__init__(self, convert_charrefs=False) - except TypeError: - HTMLParser.__init__(self) + super().__init__(convert_charrefs=False) self.body = '' self.metadata = {} self.settings = settings @@ -527,9 +523,7 @@ class Readers(FileStampDataCacher): 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, - ) + super().__init__(settings, cache_name, caching_policy, load_policy) @property def extensions(self): diff --git a/pelican/tests/support.py b/pelican/tests/support.py index 86bf984f..327e672d 100644 --- a/pelican/tests/support.py +++ b/pelican/tests/support.py @@ -186,7 +186,7 @@ class LogCountHandler(BufferingHandler): """Capturing and counting logged messages.""" def __init__(self, capacity=1000): - super(LogCountHandler, self).__init__(capacity) + super().__init__(capacity) def count_logs(self, msg=None, level=None): return len([ @@ -202,13 +202,13 @@ class LoggedTestCase(unittest.TestCase): """A test case that captures log messages.""" def setUp(self): - super(LoggedTestCase, self).setUp() + super().setUp() self._logcount_handler = LogCountHandler() logging.getLogger().addHandler(self._logcount_handler) def tearDown(self): logging.getLogger().removeHandler(self._logcount_handler) - super(LoggedTestCase, self).tearDown() + super().tearDown() def assertLogCountEqual(self, count=None, msg=None, **kwargs): actual = self._logcount_handler.count_logs(msg=msg, **kwargs) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index e9592bd4..256f08bb 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -25,7 +25,7 @@ TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False) class TestPage(LoggedTestCase): def setUp(self): - super(TestPage, self).setUp() + super().setUp() self.old_locale = locale.setlocale(locale.LC_ALL) locale.setlocale(locale.LC_ALL, str('C')) self.page_kwargs = { @@ -657,7 +657,7 @@ class TestArticle(TestPage): class TestStatic(LoggedTestCase): def setUp(self): - super(TestStatic, self).setUp() + super().setUp() self.settings = get_settings( STATIC_SAVE_AS='{path}', STATIC_URL='{path}', diff --git a/pelican/tests/test_paginator.py b/pelican/tests/test_paginator.py index 8080c146..9b600a9b 100644 --- a/pelican/tests/test_paginator.py +++ b/pelican/tests/test_paginator.py @@ -17,7 +17,7 @@ TEST_SUMMARY = generate_lorem_ipsum(n=1, html=False) class TestPage(unittest.TestCase): def setUp(self): - super(TestPage, self).setUp() + super().setUp() self.old_locale = locale.setlocale(locale.LC_ALL) locale.setlocale(locale.LC_ALL, str('C')) self.page_kwargs = { diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index 5625d617..2c7a77be 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -42,7 +42,7 @@ class TestPelican(LoggedTestCase): # to run pelican in different situations and see how it behaves def setUp(self): - super(TestPelican, self).setUp() + super().setUp() self.temp_path = mkdtemp(prefix='pelicantests.') self.temp_cache = mkdtemp(prefix='pelican_cache.') self.maxDiff = None @@ -53,7 +53,7 @@ class TestPelican(LoggedTestCase): rmtree(self.temp_path) rmtree(self.temp_cache) locale.setlocale(locale.LC_ALL, self.old_locale) - super(TestPelican, self).tearDown() + super().tearDown() def assertDirsEqual(self, left_path, right_path): out, err = subprocess.Popen( diff --git a/pelican/urlwrappers.py b/pelican/urlwrappers.py index 6b512938..cc276b3f 100644 --- a/pelican/urlwrappers.py +++ b/pelican/urlwrappers.py @@ -122,7 +122,7 @@ class Category(URLWrapper): class Tag(URLWrapper): def __init__(self, name, *args, **kwargs): - super(Tag, self).__init__(name.strip(), *args, **kwargs) + super().__init__(name.strip(), *args, **kwargs) class Author(URLWrapper): diff --git a/pelican/utils.py b/pelican/utils.py index 6491f02e..4b5b7134 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -96,7 +96,7 @@ class SafeDatetime(datetime.datetime): if safe: return strftime(self, fmt) else: - return super(SafeDatetime, self).strftime(fmt) + return super().strftime(fmt) class DateFormatter(object): @@ -407,18 +407,11 @@ class _HTMLWordTruncator(HTMLParser): class TruncationCompleted(Exception): def __init__(self, truncate_at): - super(_HTMLWordTruncator.TruncationCompleted, self).__init__( - truncate_at) + super().__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. - try: - HTMLParser.__init__(self, convert_charrefs=False) - except TypeError: - # pre Python 3.3 - HTMLParser.__init__(self) + super().__init__(convert_charrefs=False) self.max_words = max_words self.words_found = 0 @@ -428,9 +421,7 @@ class _HTMLWordTruncator(HTMLParser): def feed(self, *args, **kwargs): try: - # With Python 2, super() cannot be used. - # See the comment for __init__(). - HTMLParser.feed(self, *args, **kwargs) + super().feed(*args, **kwargs) except self.TruncationCompleted as exc: self.truncate_at = exc.truncate_at else: From a2053c34c39a035a03d1fcce7a66e7ad1af885d0 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sun, 27 Oct 2019 23:51:08 +0300 Subject: [PATCH 103/143] Namespace plugin implementation * 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 --- pelican/__init__.py | 35 ++--- pelican/plugins/_utils.py | 77 +++++++++ pelican/plugins/signals.py | 52 ++++++ pelican/settings.py | 2 +- pelican/signals.py | 51 +----- .../pelican/plugins/ns_plugin/__init__.py | 5 + .../normal_plugin/normal_plugin/__init__.py | 5 + pelican/tests/test_plugins.py | 148 ++++++++++++++++++ setup.py | 5 +- 9 files changed, 307 insertions(+), 73 deletions(-) create mode 100644 pelican/plugins/_utils.py create mode 100644 pelican/plugins/signals.py create mode 100644 pelican/tests/dummy_plugins/namespace_plugin/pelican/plugins/ns_plugin/__init__.py create mode 100644 pelican/tests/dummy_plugins/normal_plugin/normal_plugin/__init__.py create mode 100644 pelican/tests/test_plugins.py diff --git a/pelican/__init__.py b/pelican/__init__.py index 83160684..3dd04ce8 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -9,6 +9,11 @@ import sys import time import traceback from collections.abc import Iterable +# Combines all paths to `pelican` package accessible from `sys.path` +# Makes it possible to install `pelican` and namespace plugins into different +# locations in the file system (e.g. pip with `-e` or `--user`) +from pkgutil import extend_path +__path__ = extend_path(__path__, __name__) # pelican.log has to be the first pelican module to be loaded # because logging.setLoggerClass has to be called before logging.getLogger @@ -17,6 +22,7 @@ from pelican import signals # noqa from pelican.generators import (ArticlesGenerator, PagesGenerator, SourceFileGenerator, StaticGenerator, TemplatePagesGenerator) +from pelican.plugins._utils import load_plugins from pelican.readers import Readers from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer from pelican.settings import read_settings @@ -62,27 +68,14 @@ class Pelican(object): sys.path.insert(0, '') def init_plugins(self): - self.plugins = [] - logger.debug('Temporarily adding PLUGIN_PATHS to system path') - _sys_path = sys.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 - if isinstance(plugin, str): - logger.debug("Loading plugin `%s`", plugin) - try: - plugin = __import__(plugin, globals(), locals(), 'module') - except ImportError as e: - logger.error( - "Cannot load plugin `%s`\n%s", plugin, e) - continue - - logger.debug("Registering plugin `%s`", plugin.__name__) - plugin.register() - self.plugins.append(plugin) - logger.debug('Restoring system path') - sys.path = _sys_path + self.plugins = load_plugins(self.settings) + for plugin in self.plugins: + logger.debug('Registering plugin `%s`', plugin.__name__) + try: + plugin.register() + except Exception as e: + logger.error('Cannot register plugin `%s`\n%s', + plugin.__name__, e) def run(self): """Run the generators and return""" diff --git a/pelican/plugins/_utils.py b/pelican/plugins/_utils.py new file mode 100644 index 00000000..c3125ab2 --- /dev/null +++ b/pelican/plugins/_utils.py @@ -0,0 +1,77 @@ +import importlib +import logging +import pkgutil +import sys + +import six + + +logger = logging.getLogger(__name__) + + +def iter_namespace(ns_pkg): + # Specifying the second argument (prefix) to iter_modules makes the + # returned name an absolute name instead of a relative one. This allows + # import_module to work without having to do additional modification to + # the name. + return pkgutil.iter_modules(ns_pkg.__path__, ns_pkg.__name__ + ".") + + +def get_namespace_plugins(ns_pkg=None): + if ns_pkg is None: + import pelican.plugins as ns_pkg + + return { + name: importlib.import_module(name) + for finder, name, ispkg + in iter_namespace(ns_pkg) + if ispkg + } + + +def list_plugins(ns_pkg=None): + from pelican.log import init as init_logging + init_logging(logging.INFO) + ns_plugins = get_namespace_plugins(ns_pkg) + if ns_plugins: + logger.info('Plugins found:\n' + '\n'.join(ns_plugins)) + else: + logger.info('No plugins are installed') + + +def load_plugins(settings): + logger.debug('Finding namespace plugins') + namespace_plugins = get_namespace_plugins() + if namespace_plugins: + logger.debug('Namespace plugins found:\n' + + '\n'.join(namespace_plugins)) + plugins = [] + if settings.get('PLUGINS') is not None: + _sys_path = sys.path[:] + + for path in settings.get('PLUGIN_PATHS', []): + sys.path.insert(0, path) + + for plugin in settings['PLUGINS']: + if isinstance(plugin, six.string_types): + logger.debug('Loading plugin `%s`', plugin) + # try to find in namespace plugins + if plugin in namespace_plugins: + plugin = namespace_plugins[plugin] + elif 'pelican.plugins.{}'.format(plugin) in namespace_plugins: + plugin = namespace_plugins['pelican.plugins.{}'.format( + plugin)] + # try to import it + else: + try: + plugin = __import__(plugin, globals(), locals(), + str('module')) + except ImportError as e: + logger.error('Cannot load plugin `%s`\n%s', plugin, e) + continue + plugins.append(plugin) + sys.path = _sys_path + else: + plugins = list(namespace_plugins.values()) + + return plugins diff --git a/pelican/plugins/signals.py b/pelican/plugins/signals.py new file mode 100644 index 00000000..18a745b4 --- /dev/null +++ b/pelican/plugins/signals.py @@ -0,0 +1,52 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, unicode_literals + +from blinker import signal + +# Run-level signals: + +initialized = signal('pelican_initialized') +get_generators = signal('get_generators') +all_generators_finalized = signal('all_generators_finalized') +get_writer = signal('get_writer') +finalized = signal('pelican_finalized') + +# Reader-level signals + +readers_init = signal('readers_init') + +# Generator-level signals + +generator_init = signal('generator_init') + +article_generator_init = signal('article_generator_init') +article_generator_pretaxonomy = signal('article_generator_pretaxonomy') +article_generator_finalized = signal('article_generator_finalized') +article_generator_write_article = signal('article_generator_write_article') +article_writer_finalized = signal('article_writer_finalized') + +page_generator_init = signal('page_generator_init') +page_generator_finalized = signal('page_generator_finalized') +page_generator_write_page = signal('page_generator_write_page') +page_writer_finalized = signal('page_writer_finalized') + +static_generator_init = signal('static_generator_init') +static_generator_finalized = signal('static_generator_finalized') + +# Page-level signals + +article_generator_preread = signal('article_generator_preread') +article_generator_context = signal('article_generator_context') + +page_generator_preread = signal('page_generator_preread') +page_generator_context = signal('page_generator_context') + +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') +feed_generated = signal('feed_generated') +feed_written = signal('feed_written') diff --git a/pelican/settings.py b/pelican/settings.py index a4033001..0cdcefc7 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -138,7 +138,7 @@ DEFAULT_CONFIG = { 'TYPOGRIFY_IGNORE_TAGS': [], 'SUMMARY_MAX_LENGTH': 50, 'PLUGIN_PATHS': [], - 'PLUGINS': [], + 'PLUGINS': None, 'PYGMENTS_RST_OPTIONS': {}, 'TEMPLATE_PAGES': {}, 'TEMPLATE_EXTENSIONS': ['.html'], diff --git a/pelican/signals.py b/pelican/signals.py index 253b5fc3..f7605f0c 100644 --- a/pelican/signals.py +++ b/pelican/signals.py @@ -1,51 +1,4 @@ # -*- coding: utf-8 -*- +# This file is for backwards compatibility -from blinker import signal - -# Run-level signals: - -initialized = signal('pelican_initialized') -get_generators = signal('get_generators') -all_generators_finalized = signal('all_generators_finalized') -get_writer = signal('get_writer') -finalized = signal('pelican_finalized') - -# Reader-level signals - -readers_init = signal('readers_init') - -# Generator-level signals - -generator_init = signal('generator_init') - -article_generator_init = signal('article_generator_init') -article_generator_pretaxonomy = signal('article_generator_pretaxonomy') -article_generator_finalized = signal('article_generator_finalized') -article_generator_write_article = signal('article_generator_write_article') -article_writer_finalized = signal('article_writer_finalized') - -page_generator_init = signal('page_generator_init') -page_generator_finalized = signal('page_generator_finalized') -page_generator_write_page = signal('page_generator_write_page') -page_writer_finalized = signal('page_writer_finalized') - -static_generator_init = signal('static_generator_init') -static_generator_finalized = signal('static_generator_finalized') - -# Page-level signals - -article_generator_preread = signal('article_generator_preread') -article_generator_context = signal('article_generator_context') - -page_generator_preread = signal('page_generator_preread') -page_generator_context = signal('page_generator_context') - -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') -feed_generated = signal('feed_generated') -feed_written = signal('feed_written') +from pelican.plugins.signals import * # noqa diff --git a/pelican/tests/dummy_plugins/namespace_plugin/pelican/plugins/ns_plugin/__init__.py b/pelican/tests/dummy_plugins/namespace_plugin/pelican/plugins/ns_plugin/__init__.py new file mode 100644 index 00000000..c514861d --- /dev/null +++ b/pelican/tests/dummy_plugins/namespace_plugin/pelican/plugins/ns_plugin/__init__.py @@ -0,0 +1,5 @@ +NAME = 'namespace plugin' + + +def register(): + pass diff --git a/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/__init__.py b/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/__init__.py new file mode 100644 index 00000000..15896087 --- /dev/null +++ b/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/__init__.py @@ -0,0 +1,5 @@ +NAME = 'normal plugin' + + +def register(): + pass diff --git a/pelican/tests/test_plugins.py b/pelican/tests/test_plugins.py new file mode 100644 index 00000000..1adbbb5c --- /dev/null +++ b/pelican/tests/test_plugins.py @@ -0,0 +1,148 @@ +# -*- coding: utf-8 -*- +from __future__ import print_function, unicode_literals + +import os +from contextlib import contextmanager + +from pelican.plugins._utils import get_namespace_plugins, load_plugins +from pelican.tests.support import unittest + + +@contextmanager +def tmp_namespace_path(path): + '''Context manager for temporarily appending namespace plugin packages + + path: path containing the `pelican` folder + + This modifies the `pelican.__path__` and lets the `pelican.plugins` + namespace package resolve it from that. + ''' + # This avoids calls to internal `pelican.plugins.__path__._recalculate()` + # as it should not be necessary + import pelican + + old_path = pelican.__path__[:] + try: + pelican.__path__.append(os.path.join(path, 'pelican')) + yield + finally: + pelican.__path__ = old_path + + +class PluginTest(unittest.TestCase): + _PLUGIN_FOLDER = os.path.join( + os.path.abspath(os.path.dirname(__file__)), + 'dummy_plugins') + _NS_PLUGIN_FOLDER = os.path.join(_PLUGIN_FOLDER, 'namespace_plugin') + _NORMAL_PLUGIN_FOLDER = os.path.join(_PLUGIN_FOLDER, 'normal_plugin') + + def test_namespace_path_modification(self): + import pelican + import pelican.plugins + old_path = pelican.__path__[:] + + # not existing path + path = os.path.join(self._PLUGIN_FOLDER, 'foo') + with tmp_namespace_path(path): + self.assertIn( + os.path.join(path, 'pelican'), + pelican.__path__) + # foo/pelican does not exist, so it won't propagate + self.assertNotIn( + os.path.join(path, 'pelican', 'plugins'), + pelican.plugins.__path__) + # verify that we restored path back + self.assertEqual(pelican.__path__, old_path) + + # existing path + with tmp_namespace_path(self._NS_PLUGIN_FOLDER): + self.assertIn( + os.path.join(self._NS_PLUGIN_FOLDER, 'pelican'), + pelican.__path__) + # /namespace_plugin/pelican exists, so it should be in + self.assertIn( + os.path.join(self._NS_PLUGIN_FOLDER, 'pelican', 'plugins'), + pelican.plugins.__path__) + self.assertEqual(pelican.__path__, old_path) + + def test_get_namespace_plugins(self): + # without plugins + ns_plugins = get_namespace_plugins() + self.assertEqual(len(ns_plugins), 0) + + # with plugin + with tmp_namespace_path(self._NS_PLUGIN_FOLDER): + ns_plugins = get_namespace_plugins() + self.assertEqual(len(ns_plugins), 1) + self.assertIn('pelican.plugins.ns_plugin', ns_plugins) + self.assertEqual( + ns_plugins['pelican.plugins.ns_plugin'].NAME, + 'namespace plugin') + + # should be back to 0 outside `with` + ns_plugins = get_namespace_plugins() + self.assertEqual(len(ns_plugins), 0) + + def test_load_plugins(self): + # no plugins + plugins = load_plugins({}) + self.assertEqual(len(plugins), 0) + + with tmp_namespace_path(self._NS_PLUGIN_FOLDER): + # with no `PLUGINS` setting, load namespace plugins + plugins = load_plugins({}) + self.assertEqual(len(plugins), 1, plugins) + self.assertEqual( + {'namespace plugin'}, + set(plugin.NAME for plugin in plugins)) + + # disable namespace plugins with `PLUGINS = []` + SETTINGS = { + 'PLUGINS': [] + } + plugins = load_plugins(SETTINGS) + self.assertEqual(len(plugins), 0, plugins) + + # using `PLUGINS` + + # normal plugin + SETTINGS = { + 'PLUGINS': ['normal_plugin'], + 'PLUGIN_PATHS': [self._NORMAL_PLUGIN_FOLDER] + } + plugins = load_plugins(SETTINGS) + self.assertEqual(len(plugins), 1, plugins) + self.assertEqual( + {'normal plugin'}, + set(plugin.NAME for plugin in plugins)) + + # namespace plugin short + SETTINGS = { + 'PLUGINS': ['ns_plugin'] + } + plugins = load_plugins(SETTINGS) + self.assertEqual(len(plugins), 1, plugins) + self.assertEqual( + {'namespace plugin'}, + set(plugin.NAME for plugin in plugins)) + + # namespace plugin long + SETTINGS = { + 'PLUGINS': ['pelican.plugins.ns_plugin'] + } + plugins = load_plugins(SETTINGS) + self.assertEqual(len(plugins), 1, plugins) + self.assertEqual( + {'namespace plugin'}, + set(plugin.NAME for plugin in plugins)) + + # normal and namespace plugin + SETTINGS = { + 'PLUGINS': ['normal_plugin', 'ns_plugin'], + 'PLUGIN_PATHS': [self._NORMAL_PLUGIN_FOLDER] + } + plugins = load_plugins(SETTINGS) + self.assertEqual(len(plugins), 2, plugins) + self.assertEqual( + {'normal plugin', 'namespace plugin'}, + set(plugin.NAME for plugin in plugins)) diff --git a/setup.py b/setup.py index 7c583da2..dc1cc527 100755 --- a/setup.py +++ b/setup.py @@ -18,7 +18,8 @@ entry_points = { 'pelican = pelican.__main__:main', 'pelican-import = pelican.tools.pelican_import:main', 'pelican-quickstart = pelican.tools.pelican_quickstart:main', - 'pelican-themes = pelican.tools.pelican_themes:main' + 'pelican-themes = pelican.tools.pelican_themes:main', + 'pelican-plugins = pelican.plugins._utils:list_plugins' ] } @@ -44,7 +45,7 @@ setup( keywords='static web site generator SSG reStructuredText Markdown', license='AGPLv3', long_description=description, - packages=['pelican', 'pelican.tools'], + packages=['pelican', 'pelican.tools', 'pelican.plugins'], 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 From 58edad6897931f21c7c2f4314cfab33c2b167680 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sun, 1 Dec 2019 18:14:13 +0300 Subject: [PATCH 104/143] remove pelican.signals in favor of pelican.plugins.signals --- pelican/__init__.py | 8 ++++---- pelican/contents.py | 2 +- pelican/generators.py | 2 +- pelican/readers.py | 2 +- pelican/signals.py | 4 ---- pelican/tests/test_contents.py | 2 +- pelican/writers.py | 2 +- 7 files changed, 9 insertions(+), 13 deletions(-) delete mode 100644 pelican/signals.py diff --git a/pelican/__init__.py b/pelican/__init__.py index 3dd04ce8..17f4f922 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -18,10 +18,10 @@ __path__ = extend_path(__path__, __name__) # 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 as init_logging -from pelican import signals # noqa -from pelican.generators import (ArticlesGenerator, PagesGenerator, - SourceFileGenerator, StaticGenerator, - TemplatePagesGenerator) +from pelican.generators import (ArticlesGenerator, # noqa: I100 + PagesGenerator, SourceFileGenerator, + StaticGenerator, TemplatePagesGenerator) +from pelican.plugins import signals from pelican.plugins._utils import load_plugins from pelican.readers import Readers from pelican.server import ComplexHTTPRequestHandler, RootedHTTPServer diff --git a/pelican/contents.py b/pelican/contents.py index 6edf5152..594cd3b5 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -10,7 +10,7 @@ from urllib.parse import urljoin, urlparse, urlunparse import pytz -from pelican import signals +from pelican.plugins import signals from pelican.settings import DEFAULT_CONFIG from pelican.utils import (deprecated_attribute, memoized, path_to_url, posixize_path, sanitised_join, set_date_tzinfo, diff --git a/pelican/generators.py b/pelican/generators.py index 8bd2656f..02667cd7 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -13,9 +13,9 @@ from operator import attrgetter from jinja2 import (BaseLoader, ChoiceLoader, Environment, FileSystemLoader, PrefixLoader, TemplateNotFound) -from pelican import signals from pelican.cache import FileStampDataCacher from pelican.contents import Article, Page, Static +from pelican.plugins import signals from pelican.readers import Readers from pelican.utils import (DateFormatter, copy, mkdir_p, order_content, posixize_path, process_translations) diff --git a/pelican/readers.py b/pelican/readers.py index b26bd381..673b637e 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -16,9 +16,9 @@ from docutils.parsers.rst.languages import get_language as get_docutils_lang from docutils.writers.html4css1 import HTMLTranslator, Writer from pelican import rstdirectives # NOQA -from pelican import signals from pelican.cache import FileStampDataCacher from pelican.contents import Author, Category, Page, Tag +from pelican.plugins import signals from pelican.utils import get_date, pelican_open, posixize_path try: diff --git a/pelican/signals.py b/pelican/signals.py deleted file mode 100644 index f7605f0c..00000000 --- a/pelican/signals.py +++ /dev/null @@ -1,4 +0,0 @@ -# -*- coding: utf-8 -*- -# This file is for backwards compatibility - -from pelican.plugins.signals import * # noqa diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 256f08bb..62608b7b 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -10,8 +10,8 @@ from sys import platform from jinja2.utils import generate_lorem_ipsum from pelican.contents import Article, Author, Category, Page, Static +from pelican.plugins.signals import content_object_init from pelican.settings import DEFAULT_CONFIG -from pelican.signals import content_object_init from pelican.tests.support import (LoggedTestCase, get_context, get_settings, unittest) from pelican.utils import (path_to_url, posixize_path, truncate_html_words) diff --git a/pelican/writers.py b/pelican/writers.py index daeb9dec..7bbd216e 100644 --- a/pelican/writers.py +++ b/pelican/writers.py @@ -8,8 +8,8 @@ from feedgenerator import Atom1Feed, Rss201rev2Feed, get_tag_uri from jinja2 import Markup -from pelican import signals from pelican.paginator import Paginator +from pelican.plugins import signals from pelican.utils import (get_relative_path, is_selected_for_writing, path_to_url, sanitised_join, set_date_tzinfo) From ed1eca160e80bebbfd5870afe1f2a111f388e0ed Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sun, 1 Dec 2019 18:33:11 +0300 Subject: [PATCH 105/143] Remove py2-isms and avoid sys.path hacks --- pelican/plugins/_utils.py | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/pelican/plugins/_utils.py b/pelican/plugins/_utils.py index c3125ab2..a3c9ee77 100644 --- a/pelican/plugins/_utils.py +++ b/pelican/plugins/_utils.py @@ -1,9 +1,8 @@ import importlib +import importlib.machinery +import importlib.util import logging import pkgutil -import sys - -import six logger = logging.getLogger(__name__) @@ -39,6 +38,20 @@ def list_plugins(ns_pkg=None): logger.info('No plugins are installed') +def load_legacy_plugin(plugin, plugin_paths): + # Try to find plugin in PLUGIN_PATHS + spec = importlib.machinery.PathFinder.find_spec(plugin, plugin_paths) + if spec is None: + # If failed, try to find it in normal importable locations + spec = importlib.util.find_spec(plugin) + if spec is None: + raise ImportError('Cannot import plugin `{}`'.format(plugin)) + else: + mod = importlib.util.module_from_spec(spec) + spec.loader.exec_module(mod) + return mod + + def load_plugins(settings): logger.debug('Finding namespace plugins') namespace_plugins = get_namespace_plugins() @@ -47,13 +60,8 @@ def load_plugins(settings): '\n'.join(namespace_plugins)) plugins = [] if settings.get('PLUGINS') is not None: - _sys_path = sys.path[:] - - for path in settings.get('PLUGIN_PATHS', []): - sys.path.insert(0, path) - for plugin in settings['PLUGINS']: - if isinstance(plugin, six.string_types): + if isinstance(plugin, str): logger.debug('Loading plugin `%s`', plugin) # try to find in namespace plugins if plugin in namespace_plugins: @@ -64,13 +72,13 @@ def load_plugins(settings): # try to import it else: try: - plugin = __import__(plugin, globals(), locals(), - str('module')) + plugin = load_legacy_plugin( + plugin, + settings.get('PLUGIN_PATHS', [])) except ImportError as e: logger.error('Cannot load plugin `%s`\n%s', plugin, e) continue plugins.append(plugin) - sys.path = _sys_path else: plugins = list(namespace_plugins.values()) From 87a5c82197c23eeddfd38525079c63856a1da030 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sun, 1 Dec 2019 19:29:41 +0300 Subject: [PATCH 106/143] Documentation update for namespace plugins --- docs/plugins.rst | 63 +++++++++++++++++++++++++++++++++++++++-------- docs/settings.rst | 2 +- 2 files changed, 54 insertions(+), 11 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 5a6f9e55..49799741 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -9,16 +9,31 @@ features to Pelican without having to directly modify the Pelican core. How to use plugins ================== -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:: +Starting with version 4.3, Pelican moved to a new plugin structure utilizing +namespace packages. Plugins supporting this structure will install under the +namespace package ``pelican.plugins`` and can be automatically discovered +by Pelican. - PLUGINS = ['package.myplugin',] +If you leave the ``PLUGINS`` setting as default (``None``), Pelican will then +collect the namespace plugins and register them. If on the other hand you +specify a ``PLUGINS`` settings as a list of plugins, this autodiscovery will +be disabled and only listed plugins will be registered and you will have to +explicitly list the namespace plugins as well. -Alternatively, another method is to import them and add them to the list:: +If you are using ``PLUGINS`` setting, you can specify plugins in two ways. +First method is using strings to the plugins. Namespace plugins can be +specified either by their full names (``pelican.plugins.myplugin``) or by +their short names (``myplugin``):: + + PLUGINS = ['package.myplugin', + 'namespace_plugin1', + 'pelican.plugins.namespace_plugin2'] + +Alternatively, you can import them in your settings file and pass the modules:: from package import myplugin - PLUGINS = [myplugin,] + from pelican.plugins import namespace_plugin1, namespace_plugin2 + PLUGINS = [myplugin, namespace_plugin1, namespace_plugin2] .. note:: @@ -36,11 +51,12 @@ the ``PLUGIN_PATHS`` list can be absolute or relative to the settings file:: Where to find plugins ===================== +Namespace plugins can be found in the `pelican-plugins organization`_ as +individual repositories. Legacy plugins are collected in the `pelican-plugins +repository`_ and they will be slowly phased out to the namespace versions. -We maintain a separate repository of plugins for people to share and use. -Please visit the `pelican-plugins`_ repository for a list of available plugins. - -.. _pelican-plugins: https://github.com/getpelican/pelican-plugins +.. _pelican-plugins organization: https://github.com/pelican-plugins +.. _pelican-plugins repository: https://github.com/getpelican/pelican-plugins Please note that while we do our best to review and maintain these plugins, they are submitted by the Pelican community and thus may have varying levels of @@ -70,6 +86,33 @@ which you map the signals to your plugin logic. Let's take a simple example:: your ``register`` callable or they will be garbage-collected before the signal is emitted. +Namespace Plugin structure +-------------------------- + +Namespace plugins must adhere to a certain structure in order to function +properly. They need to installable (i.e. contain ``setup.py`` or equivalent) +and have a folder structure as follows:: + + myplugin + ├── pelican + │   └── plugins + │   └── myplugin + │   ├── __init__.py + │   └── ... + ├── ... + └── setup.py + +It is crucial that ``pelican`` or ``pelican/plugins`` folder **should not** +contain an ``__init__.py`` file. In fact, it is best to have those folders +empty besides the listed folders in the above structure and contain your +plugin related files solely in the ``pelican/plugins/myplugin`` folder to +avoid any issues. + +For easily setting up the proper structure, a `cookiecutter template for +plugins`_ is provided. Refer to the README in the link for how to use it. + +.. _cookiecutter template for plugins: https://github.com/getpelican/cookiecutter-pelican-plugin + List of signals =============== diff --git a/docs/settings.rst b/docs/settings.rst index 5d090a62..39982315 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -194,7 +194,7 @@ Basic settings Controls the extension that will be used by the SourcesGenerator. Defaults to ``.text``. If not a valid string the default value will be used. -.. data:: PLUGINS = [] +.. data:: PLUGINS = None The list of plugins to load. See :ref:`plugins`. From 8a56e1f1fabee2f164116d5f6cd45dacea1b11b4 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Sun, 1 Dec 2019 20:21:20 +0300 Subject: [PATCH 107/143] Update namespace docs to address review --- docs/plugins.rst | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/docs/plugins.rst b/docs/plugins.rst index 49799741..4d44eea7 100644 --- a/docs/plugins.rst +++ b/docs/plugins.rst @@ -9,7 +9,7 @@ features to Pelican without having to directly modify the Pelican core. How to use plugins ================== -Starting with version 4.3, Pelican moved to a new plugin structure utilizing +Starting with version 5.0, Pelican moved to a new plugin structure utilizing namespace packages. Plugins supporting this structure will install under the namespace package ``pelican.plugins`` and can be automatically discovered by Pelican. @@ -21,8 +21,8 @@ be disabled and only listed plugins will be registered and you will have to explicitly list the namespace plugins as well. If you are using ``PLUGINS`` setting, you can specify plugins in two ways. -First method is using strings to the plugins. Namespace plugins can be -specified either by their full names (``pelican.plugins.myplugin``) or by +The first method specifies plugins as a list of strings. Namespace plugins can +be specified either by their full names (``pelican.plugins.myplugin``) or by their short names (``myplugin``):: PLUGINS = ['package.myplugin', @@ -53,7 +53,8 @@ Where to find plugins ===================== Namespace plugins can be found in the `pelican-plugins organization`_ as individual repositories. Legacy plugins are collected in the `pelican-plugins -repository`_ and they will be slowly phased out to the namespace versions. +repository`_ and they will be slowly phased out in favor of the namespace +versions. .. _pelican-plugins organization: https://github.com/pelican-plugins .. _pelican-plugins repository: https://github.com/getpelican/pelican-plugins @@ -86,11 +87,11 @@ which you map the signals to your plugin logic. Let's take a simple example:: your ``register`` callable or they will be garbage-collected before the signal is emitted. -Namespace Plugin structure +Namespace plugin structure -------------------------- Namespace plugins must adhere to a certain structure in order to function -properly. They need to installable (i.e. contain ``setup.py`` or equivalent) +properly. They need to be installable (i.e. contain ``setup.py`` or equivalent) and have a folder structure as follows:: myplugin @@ -102,11 +103,11 @@ and have a folder structure as follows:: ├── ... └── setup.py -It is crucial that ``pelican`` or ``pelican/plugins`` folder **should not** +It is crucial that ``pelican`` or ``pelican/plugins`` folder **not** contain an ``__init__.py`` file. In fact, it is best to have those folders -empty besides the listed folders in the above structure and contain your -plugin related files solely in the ``pelican/plugins/myplugin`` folder to -avoid any issues. +empty besides the listed folders in the above structure and keep your +plugin related files contained solely in the ``pelican/plugins/myplugin`` +folder to avoid any issues. For easily setting up the proper structure, a `cookiecutter template for plugins`_ is provided. Refer to the README in the link for how to use it. From 3f1d4edea339665ad12aaa78637aebdbf2813542 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Thu, 5 Dec 2019 13:37:41 -0600 Subject: [PATCH 108/143] Fix a typo in the pagination settings docs --- docs/settings.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 39982315..9bd2cbf2 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -997,7 +997,7 @@ subsequent pages at ``.../page/2/`` etc, you could set ``PAGINATION_PATTERNS`` as follows:: PAGINATION_PATTERNS = ( - (1, '{url}', '{save_as}', + (1, '{url}', '{save_as}'), (2, '{base_name}/page/{number}/', '{base_name}/page/{number}/index.html'), ) From b149a23507ba5a74f1ea6a85ddd019f094f89a2a Mon Sep 17 00:00:00 2001 From: Hong Xu Date: Wed, 25 Dec 2019 18:29:45 +0800 Subject: [PATCH 109/143] Add cross links between theme settings and pelican-themes --- docs/pelican-themes.rst | 3 ++- docs/settings.rst | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/pelican-themes.rst b/docs/pelican-themes.rst index 2802777a..e63f6a19 100644 --- a/docs/pelican-themes.rst +++ b/docs/pelican-themes.rst @@ -6,7 +6,8 @@ pelican-themes Description =========== -``pelican-themes`` is a command line tool for managing themes for Pelican. +``pelican-themes`` is a command line tool for managing themes for Pelican. See +:ref:`settings/themes` for settings related to themes. Usage diff --git a/docs/settings.rst b/docs/settings.rst index 39982315..1ab9cee3 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -1076,6 +1076,7 @@ Ordering content will sort pages by their basename. +.. _settings/themes: Themes ====== @@ -1088,7 +1089,7 @@ themes. 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). + :doc:`pelican-themes` (see below). .. data:: THEME_STATIC_DIR = 'theme' From 6a9aa1dca8bf24739aa075671f4e6c2b8e742e03 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 28 Dec 2019 09:48:07 +0100 Subject: [PATCH 110/143] Remove duplicate datetime URL in Settings docs --- docs/settings.rst | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 39982315..3ffe735e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -645,7 +645,7 @@ Time and Date the language name (``lang`` metadata in your post content) as the key. In addition to the standard C89 strftime format codes that are listed in - `Python strftime documentation`_, you can use the ``-`` character between + `Python datetime documentation`_, you can use the ``-`` character between ``%`` and the format character to remove any leading zeros. For example, ``%d/%m/%Y`` will output ``01/01/2014`` whereas ``%-d/%-m/%Y`` will result in ``1/1/2014``. @@ -696,8 +696,6 @@ Time and Date .. [#] Default is the system locale. -.. _Python strftime documentation: https://docs.python.org/library/datetime.html#strftime-strptime-behavior - .. _locales on Windows: http://msdn.microsoft.com/en-us/library/cdax410z%28VS.71%29.aspx .. _locale(1): https://linux.die.net/man/1/locale From d2c857883f8829806b4c7021bc903cf9ad092989 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 28 Dec 2019 09:52:33 +0100 Subject: [PATCH 111/143] Update Python documentation links to Python 3 --- docs/settings.rst | 2 +- docs/themes.rst | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 3ffe735e..832db001 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -369,7 +369,7 @@ and pages anywhere you want. the `Python datetime documentation`_ for more information. .. _Python datetime documentation: - https://docs.python.org/2/library/datetime.html#strftime-and-strptime-behavior + https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior Also, you can use other file metadata attributes as well: diff --git a/docs/themes.rst b/docs/themes.rst index b00d0236..ea9214fe 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -120,8 +120,8 @@ your date according to the locale given in your settings:: {{ article.date|strftime('%d %B %Y') }} -.. _datetime: https://docs.python.org/2/library/datetime.html#datetime-objects -.. _strftime: https://docs.python.org/2/library/datetime.html#strftime-strptime-behavior +.. _datetime: https://docs.python.org/3/library/datetime.html#datetime-objects +.. _strftime: https://docs.python.org/3/library/datetime.html#strftime-strptime-behavior index.html From d7795b8afde60fbc494bb3c9798ddf90c05dd0b1 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 28 Dec 2019 09:57:41 +0100 Subject: [PATCH 112/143] Move Python datetime note further down Settings docs --- docs/settings.rst | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 832db001..1242205e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -362,15 +362,6 @@ variables allow you to place your articles in a location such as example below). 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. Check - the `Python datetime documentation`_ for more information. - -.. _Python datetime documentation: - https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior - Also, you can use other file metadata attributes as well: * slug @@ -391,6 +382,15 @@ This would save your articles into something like ``/pages/about/index.html``, and render them available at URLs of ``/posts/2011/Aug/07/sample-post/`` and ``/pages/about/``, respectively. +.. 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`_ for more information. + +.. _Python datetime documentation: + https://docs.python.org/3/library/datetime.html#strftime-and-strptime-behavior + .. data:: RELATIVE_URLS = False Defines whether Pelican should use document-relative URLs or not. Only set From b8f2326fa656dc1e990c0a8ca4f6573ba3e205e5 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 28 Dec 2019 10:02:48 +0100 Subject: [PATCH 113/143] Document mirroring content & output path hierarchies --- docs/settings.rst | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/settings.rst b/docs/settings.rst index 1242205e..b4ec4761 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -362,7 +362,15 @@ variables allow you to place your articles in a location such as example below). These settings give you the flexibility to place your articles and pages anywhere you want. -Also, you can use other file metadata attributes as well: +If you don't want that flexibility and instead prefer that your generated +output paths mirror your source content's filesystem path hierarchy, try the +following settings:: + + PATH_METADATA = '(?P.*)\..*' + ARTICLE_URL = ARTICLE_SAVE_AS = PAGE_URL = PAGE_SAVE_AS = '{path_no_ext}.html' + +Otherwise, you can use a variety of file metadata attributes within URL-related +settings: * slug * date From 70c8d2a47431cc5de29b08a830d1af4f8e6f6e30 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 28 Dec 2019 10:20:19 +0100 Subject: [PATCH 114/143] Docs: Ensure plugin developers create new branch --- docs/contribute.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/contribute.rst b/docs/contribute.rst index a96f2d02..221c405b 100644 --- a/docs/contribute.rst +++ b/docs/contribute.rst @@ -140,6 +140,10 @@ Install the needed dependencies and set up the project:: invoke setup +Create a topic branch for your plugin bug fix or feature:: + + git checkout -b name-of-your-bugfix-or-feature + After writing new tests for your plugin changes, run the plugin test suite:: invoke tests From 569f8a080ec1ba55ed36a49d607bea560fad53f8 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 17 Jan 2020 15:11:42 +0100 Subject: [PATCH 115/143] Tell users they can use CTRL-C to stop web server This knowledge was heretofore assumed but is better made explicit. --- pelican/__init__.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 17f4f922..e040ca4d 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -466,8 +466,9 @@ def listen(server, port, output, excqueue=None): excqueue.put(traceback.format_exception_only(type(e), e)[-1]) return - logging.info("Serving at port %s, server %s.", port, server) try: + print("\nServing site at: {}:{} - Tap CTRL-C to stop".format( + server, port)) httpd.serve_forever() except Exception as e: if excqueue is not None: From fa719315035b38633aee88d1a10927b3ce018032 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Fri, 17 Jan 2020 15:22:12 +0100 Subject: [PATCH 116/143] Exit web server gracefully when user taps CTRL-C Users were previously met with an ugly traceback. Now `pelican --listen` invocations, when quit via CTRL-C, are followed instead by a more user-friendly message. --- pelican/__init__.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pelican/__init__.py b/pelican/__init__.py index e040ca4d..97135a62 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -475,6 +475,10 @@ def listen(server, port, output, excqueue=None): excqueue.put(traceback.format_exception_only(type(e), e)[-1]) return + except KeyboardInterrupt: + print("\nKeyboard interrupt received. Shutting down server.") + httpd.socket.close() + def main(argv=None): args = parse_arguments(argv) From bd1ab74031f3b589582848ffeb6361f3dbf6a630 Mon Sep 17 00:00:00 2001 From: LouisJackman Date: Thu, 23 Jan 2020 21:29:13 +0000 Subject: [PATCH 117/143] Add a devserver-global task for non-local dev testing The devserver target recently acquired a sane default of restricting access only to localhost. This is good for security. However, it can frustrate some usages like testing on phones on a local network or hosting the dev server within VMs (e.g. Docker for Mac) which see host OS browsers as not being 127.0.0.1. Add a new target called `devserver-global` for this case. As it's longer to type, the more svelte `devserver` will retain the more secure defaults that will suffice for most users; they can use the longer-to-type `devserver-global` target to relax the localhost-only restriction. --- pelican/tools/templates/Makefile.jinja2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pelican/tools/templates/Makefile.jinja2 b/pelican/tools/templates/Makefile.jinja2 index 91b44320..0d27defd 100644 --- a/pelican/tools/templates/Makefile.jinja2 +++ b/pelican/tools/templates/Makefile.jinja2 @@ -114,6 +114,13 @@ else $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) endif +devserver-global: +ifdef PORT + $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0 +else + $(PELICAN) -lr $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -b 0.0.0.0 +endif + publish: $(PELICAN) $(INPUTDIR) -o $(OUTPUTDIR) -s $(PUBLISHCONF) $(PELICANOPTS) From f2dbfbfcecd41c19438b22f6d1b25e9583a10867 Mon Sep 17 00:00:00 2001 From: Carlos Pereira Atencio Date: Wed, 26 Feb 2020 18:54:05 +0000 Subject: [PATCH 118/143] Docs: Add info about pelican-quickstart command path flag. (#2675) --- docs/install.rst | 7 +++++++ pelican/tools/pelican_quickstart.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docs/install.rst b/docs/install.rst index 2da7b9be..d683ed8f 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -102,6 +102,13 @@ your site:: pelican-quickstart +If run inside an activated virtual environment, ``pelican-quickstart`` will +look for an associated project path inside ``$VIRTUAL_ENV/.project``. If that +file exists and contains a valid directory path, the new Pelican project will +be saved at that location. Otherwise, the default is the current working +directory. To set the new project path on initial invocation, use: +``pelican-quickstart --path /your/desired/directory`` + 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 diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index a7801866..63b32417 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -200,7 +200,7 @@ needed by Pelican. 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.' + print('Using project associated with current virtual environment. ' 'Will save to:\n%s\n' % CONF['basedir']) else: CONF['basedir'] = os.path.abspath(os.path.expanduser( From bae37a7ae4d9b51280816d0a6d419517a9ea9c83 Mon Sep 17 00:00:00 2001 From: Nik Date: Fri, 13 Mar 2020 15:47:48 +0100 Subject: [PATCH 119/143] Make encoding a named parameter Without the name, the parameters are used in sequence and the "encoding" param is used in place of the "buffering" param, which leads to problems. --- pelican/tools/pelican_quickstart.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pelican/tools/pelican_quickstart.py b/pelican/tools/pelican_quickstart.py index 63b32417..5a622365 100755 --- a/pelican/tools/pelican_quickstart.py +++ b/pelican/tools/pelican_quickstart.py @@ -309,7 +309,7 @@ needed by Pelican. try: with open(os.path.join(CONF['basedir'], 'pelicanconf.py'), - 'w', 'utf-8') as fd: + 'w', encoding='utf-8') as fd: conf_python = dict() for key, value in CONF.items(): conf_python[key] = repr(value) @@ -322,7 +322,7 @@ needed by Pelican. try: with open(os.path.join(CONF['basedir'], 'publishconf.py'), - 'w', 'utf-8') as fd: + 'w', encoding='utf-8') as fd: _template = _jinja_env.get_template('publishconf.py.jinja2') fd.write(_template.render(**CONF)) fd.close() @@ -332,7 +332,7 @@ needed by Pelican. if automation: try: with open(os.path.join(CONF['basedir'], 'tasks.py'), - 'w', 'utf-8') as fd: + 'w', encoding='utf-8') as fd: _template = _jinja_env.get_template('tasks.py.jinja2') fd.write(_template.render(**CONF)) fd.close() @@ -340,7 +340,7 @@ needed by Pelican. print('Error: {0}'.format(e)) try: with open(os.path.join(CONF['basedir'], 'Makefile'), - 'w', 'utf-8') as fd: + 'w', encoding='utf-8') as fd: py_v = 'python3' _template = _jinja_env.get_template('Makefile.jinja2') fd.write(_template.render(py_v=py_v, **CONF)) From ab5e78db2a1fc69ad8762d6d9d675348ede47c54 Mon Sep 17 00:00:00 2001 From: Nik Date: Sat, 14 Mar 2020 08:44:34 +0100 Subject: [PATCH 120/143] Handle case of missing port in target "serve-global" Also factor out the check for the SERVER variable to avoid nested ifdefs. Fixes #2696 --- pelican/tools/templates/Makefile.jinja2 | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/pelican/tools/templates/Makefile.jinja2 b/pelican/tools/templates/Makefile.jinja2 index 91b44320..6b13a59c 100644 --- a/pelican/tools/templates/Makefile.jinja2 +++ b/pelican/tools/templates/Makefile.jinja2 @@ -50,6 +50,14 @@ ifeq ($(RELATIVE), 1) PELICANOPTS += --relative-urls endif +SERVER ?= "0.0.0.0" + +PORT ?= 0 +ifneq ($(PORT), 0) + PELICANOPTS += -p $(PORT) +endif + + help: @echo 'Makefile for a pelican Web site ' @echo ' ' @@ -100,12 +108,7 @@ else endif serve-global: -ifdef SERVER - $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b $(SERVER) -else - $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -p $(PORT) -b 0.0.0.0 -endif - + $(PELICAN) -l $(INPUTDIR) -o $(OUTPUTDIR) -s $(CONFFILE) $(PELICANOPTS) -b $(SERVER) devserver: ifdef PORT From e412657581c060a117f178d1224a4bce53bbae26 Mon Sep 17 00:00:00 2001 From: "(GalaxyMaster)" Date: Sat, 11 Apr 2020 15:35:26 +1000 Subject: [PATCH 121/143] Added support for the summary end marker configuration --- pelican/contents.py | 3 ++- pelican/settings.py | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pelican/contents.py b/pelican/contents.py index 594cd3b5..620fa304 100644 --- a/pelican/contents.py +++ b/pelican/contents.py @@ -390,7 +390,8 @@ class Content(object): return self.content return truncate_html_words(self.content, - self.settings['SUMMARY_MAX_LENGTH']) + self.settings['SUMMARY_MAX_LENGTH'], + self.settings['SUMMARY_END_MARKER']) @property def summary(self): diff --git a/pelican/settings.py b/pelican/settings.py index 0cdcefc7..7d80ba90 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -136,6 +136,7 @@ DEFAULT_CONFIG = { 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'TYPOGRIFY_IGNORE_TAGS': [], + 'SUMMARY_END_MARKER': '…', 'SUMMARY_MAX_LENGTH': 50, 'PLUGIN_PATHS': [], 'PLUGINS': None, From 4833a272436775aa44ac197e93ef4b4de3129372 Mon Sep 17 00:00:00 2001 From: "(GalaxyMaster)" Date: Sat, 11 Apr 2020 15:42:18 +1000 Subject: [PATCH 122/143] Provided the settings documentation snippet --- docs/settings.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/settings.rst b/docs/settings.rst index b4ec4761..8ad149b2 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -271,6 +271,11 @@ Basic settings does not otherwise specify a summary. Setting to ``None`` will cause the summary to be a copy of the original content. +.. data:: SUMMARY_END_MARKER = '…' + + When creating a short summary of an article and the result was truncated to + match the required word length, this will be used as the truncation marker. + .. data:: WITH_FUTURE_DATES = True If disabled, content with dates in the future will get a default status of From 56c2abe61351f520581fc70ccc8b3c4aecd38f6d Mon Sep 17 00:00:00 2001 From: "(GalaxyMaster)" Date: Sat, 11 Apr 2020 17:30:50 +1000 Subject: [PATCH 123/143] Added a test for the emd marker --- pelican/tests/test_contents.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 62608b7b..0ac69f8d 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -98,6 +98,19 @@ class TestPage(LoggedTestCase): page = Page(**page_kwargs) self.assertEqual(page.summary, '') + def test_summary_end_marker(self): + # If a :SUMMARY_END_MARKER: is set, and there is no other summary, + # generated summary should contain the specified marker at the end. + page_kwargs = self._copy_page_kwargs() + settings = get_settings() + page_kwargs['settings'] = settings + del page_kwargs['metadata']['summary'] + settings['SUMMARY_END_MARKER'] = 'test_marker' + settings['SUMMARY_MAX_LENGTH'] = 10 + page = Page(**page_kwargs) + self.assertEqual(page.summary, truncate_html_words(TEST_CONTENT, 10, + 'test_marker')) + def test_summary_get_summary_warning(self): """calling ._get_summary() should issue a warning""" page_kwargs = self._copy_page_kwargs() From 7f8726929ba4aa9cdf1276fe7c8394e03d0df9ba Mon Sep 17 00:00:00 2001 From: "(GalaxyMaster)" Date: Sun, 12 Apr 2020 05:18:29 +1000 Subject: [PATCH 124/143] Added an additional assert as requested --- pelican/tests/test_contents.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pelican/tests/test_contents.py b/pelican/tests/test_contents.py index 0ac69f8d..08d4eb73 100644 --- a/pelican/tests/test_contents.py +++ b/pelican/tests/test_contents.py @@ -110,6 +110,7 @@ class TestPage(LoggedTestCase): page = Page(**page_kwargs) self.assertEqual(page.summary, truncate_html_words(TEST_CONTENT, 10, 'test_marker')) + self.assertIn('test_marker', page.summary) def test_summary_get_summary_warning(self): """calling ._get_summary() should issue a warning""" From e06934a003e0514e35ea2b4914157d733c3554ed Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 12 Apr 2020 06:07:37 +0200 Subject: [PATCH 125/143] Update documentation copyright & attribution info --- docs/conf.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index f0589b84..2be4fbe1 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -17,7 +17,7 @@ extensions = ['sphinx.ext.autodoc', source_suffix = '.rst' master_doc = 'index' project = 'Pelican' -copyright = '2010 – present, Alexis Metaireau and contributors' +copyright = '2010 – present, Justin Mayer, Alexis Metaireau, and contributors' exclude_patterns = ['_build'] release = __version__ version = '.'.join(release.split('.')[:1]) @@ -68,14 +68,14 @@ def setup(app): # -- Options for LaTeX output ------------------------------------------------- latex_documents = [ - ('index', 'Pelican.tex', 'Pelican Documentation', 'Alexis Métaireau', + ('index', 'Pelican.tex', 'Pelican Documentation', 'Justin Mayer', 'manual'), ] # -- Options for manual page output ------------------------------------------- man_pages = [ ('index', 'pelican', 'pelican documentation', - ['Alexis Métaireau'], 1), + ['Justin Mayer'], 1), ('pelican-themes', 'pelican-themes', 'A theme manager for Pelican', ['Mickaël Raybaud'], 1), ('themes', 'pelican-theming', 'How to create themes for Pelican', From 50808f644fb70420075623c47a8e63af83684bf3 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 12 Apr 2020 09:36:20 +0200 Subject: [PATCH 126/143] Remove poetry.lock file This seems to be causing problems for some folks, without adding any noticeable benefit. --- poetry.lock | 438 ---------------------------------------------------- 1 file changed, 438 deletions(-) delete mode 100644 poetry.lock diff --git a/poetry.lock b/poetry.lock deleted file mode 100644 index 3b85d1d2..00000000 --- a/poetry.lock +++ /dev/null @@ -1,438 +0,0 @@ -[[package]] -category = "dev" -description = "A configurable sidebar-enabled Sphinx theme" -name = "alabaster" -optional = false -python-versions = "*" -version = "0.7.12" - -[[package]] -category = "dev" -description = "Internationalization utilities" -name = "babel" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "2.7.0" - -[package.dependencies] -pytz = ">=2015.7" - -[[package]] -category = "dev" -description = "Screen-scraping library" -name = "beautifulsoup4" -optional = false -python-versions = "*" -version = "4.7.1" - -[package.dependencies] -soupsieve = ">=1.2" - -[[package]] -category = "main" -description = "Fast, simple object-to-object and broadcast signaling" -name = "blinker" -optional = false -python-versions = "*" -version = "1.4" - -[[package]] -category = "dev" -description = "Cross-platform colored terminal text." -marker = "sys_platform == \"win32\"" -name = "colorama" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "0.4.1" - -[[package]] -category = "main" -description = "Docutils -- Python Documentation Utilities" -name = "docutils" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -version = "0.15.2" - -[[package]] -category = "dev" -description = "Discover and load entry points from installed packages." -name = "entrypoints" -optional = false -python-versions = ">=2.7" -version = "0.3" - -[[package]] -category = "main" -description = "Standalone version of django.utils.feedgenerator" -name = "feedgenerator" -optional = false -python-versions = "*" -version = "1.9" - -[package.dependencies] -pytz = ">=0a" -six = "*" - -[[package]] -category = "dev" -description = "A platform independent file lock." -name = "filelock" -optional = false -python-versions = "*" -version = "3.0.12" - -[[package]] -category = "dev" -description = "the modular source code checker: pep8, pyflakes and co" -name = "flake8" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "3.7.7" - -[package.dependencies] -entrypoints = ">=0.3.0,<0.4.0" -mccabe = ">=0.6.0,<0.7.0" -pycodestyle = ">=2.5.0,<2.6.0" -pyflakes = ">=2.1.0,<2.2.0" - -[[package]] -category = "dev" -description = "Flake8 and pylama plugin that checks the ordering of import statements." -name = "flake8-import-order" -optional = false -python-versions = "*" -version = "0.18.1" - -[package.dependencies] -pycodestyle = "*" -setuptools = "*" - -[[package]] -category = "dev" -description = "Getting image size from png/jpeg/jpeg2000/gif file" -name = "imagesize" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.1.0" - -[[package]] -category = "dev" -description = "Read metadata from Python packages" -name = "importlib-metadata" -optional = false -python-versions = ">=2.7,!=3.0,!=3.1,!=3.2,!=3.3" -version = "0.18" - -[package.dependencies] -zipp = ">=0.5" - -[[package]] -category = "main" -description = "A small but fast and easy to use stand-alone template engine written in pure python." -name = "jinja2" -optional = false -python-versions = "*" -version = "2.10.1" - -[package.dependencies] -MarkupSafe = ">=0.23" - -[[package]] -category = "dev" -description = "Powerful and Pythonic XML processing library combining libxml2/libxslt with the ElementTree API." -name = "lxml" -optional = false -python-versions = "*" -version = "4.3.4" - -[[package]] -category = "main" -description = "Python implementation of Markdown." -name = "markdown" -optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*" -version = "3.1.1" - -[package.dependencies] -setuptools = ">=36" - -[[package]] -category = "main" -description = "Safely add untrusted strings to HTML/XML markup." -name = "markupsafe" -optional = false -python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" -version = "1.1.1" - -[[package]] -category = "dev" -description = "McCabe checker, plugin for flake8" -name = "mccabe" -optional = false -python-versions = "*" -version = "0.6.1" - -[[package]] -category = "dev" -description = "Rolling backport of unittest.mock for all Pythons" -name = "mock" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "3.0.5" - -[package.dependencies] -six = "*" - -[[package]] -category = "dev" -description = "Core utilities for Python packages" -name = "packaging" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "19.0" - -[package.dependencies] -pyparsing = ">=2.0.2" -six = "*" - -[[package]] -category = "dev" -description = "plugin and hook calling mechanisms for python" -name = "pluggy" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "0.12.0" - -[package.dependencies] -importlib-metadata = ">=0.12" - -[[package]] -category = "dev" -description = "library with cross-python path, ini-parsing, io, code, log facilities" -name = "py" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.8.0" - -[[package]] -category = "dev" -description = "Python style guide checker" -name = "pycodestyle" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "2.5.0" - -[[package]] -category = "dev" -description = "passive checker of Python programs" -name = "pyflakes" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "2.1.1" - -[[package]] -category = "main" -description = "Pygments is a syntax highlighting package written in Python." -name = "pygments" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" -version = "2.4.2" - -[[package]] -category = "dev" -description = "Python parsing module" -name = "pyparsing" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" -version = "2.4.0" - -[[package]] -category = "main" -description = "Extensions to the standard Python datetime module" -name = "python-dateutil" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" -version = "2.8.0" - -[package.dependencies] -six = ">=1.5" - -[[package]] -category = "main" -description = "World timezone definitions, modern and historical" -name = "pytz" -optional = false -python-versions = "*" -version = "2019.1" - -[[package]] -category = "main" -description = "Python 2 and 3 compatibility utilities" -name = "six" -optional = false -python-versions = ">=2.6, !=3.0.*, !=3.1.*" -version = "1.13.0" - -[[package]] -category = "dev" -description = "Python with the SmartyPants" -name = "smartypants" -optional = false -python-versions = "*" -version = "2.0.1" - -[[package]] -category = "dev" -description = "This package provides 23 stemmers for 22 languages generated from Snowball algorithms." -name = "snowballstemmer" -optional = false -python-versions = "*" -version = "1.9.0" - -[[package]] -category = "dev" -description = "A modern CSS selector implementation for Beautiful Soup." -name = "soupsieve" -optional = false -python-versions = "*" -version = "1.9.2" - -[[package]] -category = "dev" -description = "Python documentation generator" -name = "sphinx" -optional = false -python-versions = "*" -version = "1.4.9" - -[package.dependencies] -Jinja2 = ">=2.3" -Pygments = ">=2.0" -alabaster = ">=0.7,<0.8" -babel = ">=1.3,<2.0 || >2.0" -colorama = ">=0.3.5" -docutils = ">=0.11" -imagesize = "*" -six = ">=1.5" -snowballstemmer = ">=1.1" - -[[package]] -category = "dev" -description = "Read the Docs theme for Sphinx" -name = "sphinx-rtd-theme" -optional = false -python-versions = "*" -version = "0.4.3" - -[package.dependencies] -sphinx = "*" - -[[package]] -category = "dev" -description = "Python Library for Tom's Obvious, Minimal Language" -name = "toml" -optional = false -python-versions = "*" -version = "0.10.0" - -[[package]] -category = "dev" -description = "tox is a generic virtualenv management and test command line tool" -name = "tox" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "3.13.2" - -[package.dependencies] -filelock = ">=3.0.0,<4" -importlib-metadata = ">=0.12,<1" -packaging = ">=14" -pluggy = ">=0.12.0,<1" -py = ">=1.4.17,<2" -six = ">=1.0.0,<2" -toml = ">=0.9.4" -virtualenv = ">=14.0.0" - -[[package]] -category = "dev" -description = "Filters to enhance web typography, including support for Django & Jinja templates" -name = "typogrify" -optional = false -python-versions = "*" -version = "2.0.7" - -[package.dependencies] -smartypants = ">=1.8.3" - -[[package]] -category = "main" -description = "ASCII transliterations of Unicode text" -name = "unidecode" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "1.1.1" - -[[package]] -category = "dev" -description = "Virtual Python Environment builder" -name = "virtualenv" -optional = false -python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" -version = "16.6.1" - -[[package]] -category = "dev" -description = "Backport of pathlib-compatible object wrapper for zip files" -name = "zipp" -optional = false -python-versions = ">=2.7" -version = "0.5.1" - -[extras] -markdown = ["markdown"] - -[metadata] -content-hash = "b8fa239ebaf9bf4bcd5c2e02cf94d065a1add4e19d8354cedf19db6378d6b848" -python-versions = "^3.5" - -[metadata.hashes] -alabaster = ["446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359", "a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"] -babel = ["af92e6106cb7c55286b25b38ad7695f8b4efb36a90ba483d7f7a6628c46158ab", "e86135ae101e31e2c8ec20a4e0c5220f4eed12487d5cf3f78be7e98d3a57fc28"] -beautifulsoup4 = ["034740f6cb549b4e932ae1ab975581e6103ac8f942200a0e9759065984391858", "945065979fb8529dd2f37dbb58f00b661bdbcbebf954f93b32fdf5263ef35348", "ba6d5c59906a85ac23dadfe5c88deaf3e179ef565f4898671253e50a78680718"] -blinker = ["471aee25f3992bd325afa3772f1063dbdbbca947a041b8b89466dc00d606f8b6"] -colorama = ["05eed71e2e327246ad6b38c540c4a3117230b19679b875190486ddd2d721422d", "f8ac84de7840f5b9c4e3347b3c1eaa50f7e49c2b07596221daec5edaabbd7c48"] -docutils = ["6c4f696463b79f1fb8ba0c594b63840ebd41f059e92b31957c46b74a4599b6d0", "9e4d7ecfc600058e07ba661411a2b7de2fd0fafa17d1a7f7361cd47b1175c827", "a2aeea129088da402665e92e0b25b04b073c04b2dce4ab65caaa38b7ce2e1a99"] -entrypoints = ["589f874b313739ad35be6e0cd7efde2a4e9b6fea91edcc34e58ecbb8dbe56d19", "c70dd71abe5a8c85e55e12c19bd91ccfeec11a6e99044204511f9ed547d48451"] -feedgenerator = ["5ae05daa9cfa47fa406ee4744d0b7fa1c8a05a7a47ee0ad328ddf55327cfb106"] -filelock = ["18d82244ee114f543149c66a6e0c14e9c4f8a1044b5cdaadd0f82159d6a6ff59", "929b7d63ec5b7d6b71b0fa5ac14e030b3f70b75747cef1b10da9b879fef15836"] -flake8 = ["859996073f341f2670741b51ec1e67a01da142831aa1fdc6242dbf88dffbe661", "a796a115208f5c03b18f332f7c11729812c8c3ded6c46319c59b53efd3819da8"] -flake8-import-order = ["90a80e46886259b9c396b578d75c749801a41ee969a235e163cfe1be7afd2543", "a28dc39545ea4606c1ac3c24e9d05c849c6e5444a50fb7e9cdd430fc94de6e92"] -imagesize = ["3f349de3eb99145973fefb7dbe38554414e5c30abd0c8e4b970a7c9d09f3a1d8", "f3832918bc3c66617f92e35f5d70729187676313caa60c187eb0f28b8fe5e3b5"] -importlib-metadata = ["6dfd58dfe281e8d240937776065dd3624ad5469c835248219bd16cf2e12dbeb7", "cb6ee23b46173539939964df59d3d72c3e0c1b5d54b84f1d8a7e912fe43612db"] -jinja2 = ["065c4f02ebe7f7cf559e49ee5a95fb800a9e4528727aec6f24402a5374c65013", "14dd6caf1527abb21f08f86c784eac40853ba93edb79552aa1e4b8aef1b61c7b"] -lxml = ["06c7616601430aa140a69f97e3116308fffe0848f543b639a5ec2e8920ae72fd", "177202792f9842374a8077735c69c41a4282183f7851443d2beb8ee310720819", "19317ad721ceb9e39847d11131903931e2794e447d4751ebb0d9236f1b349ff2", "36d206e62f3e5dbaafd4ec692b67157e271f5da7fd925fda8515da675eace50d", "387115b066c797c85f9861a9613abf50046a15aac16759bc92d04f94acfad082", "3ce1c49d4b4a7bc75fb12acb3a6247bb7a91fe420542e6d671ba9187d12a12c2", "4d2a5a7d6b0dbb8c37dab66a8ce09a8761409c044017721c21718659fa3365a1", "58d0a1b33364d1253a88d18df6c0b2676a1746d27c969dc9e32d143a3701dda5", "62a651c618b846b88fdcae0533ec23f185bb322d6c1845733f3123e8980c1d1b", "69ff21064e7debc9b1b1e2eee8c2d686d042d4257186d70b338206a80c5bc5ea", "7060453eba9ba59d821625c6af6a266bd68277dce6577f754d1eb9116c094266", "7d26b36a9c4bce53b9cfe42e67849ae3c5c23558bc08363e53ffd6d94f4ff4d2", "83b427ad2bfa0b9705e02a83d8d607d2c2f01889eb138168e462a3a052c42368", "923d03c84534078386cf50193057aae98fa94cace8ea7580b74754493fda73ad", "b773715609649a1a180025213f67ffdeb5a4878c784293ada300ee95a1f3257b", "baff149c174e9108d4a2fee192c496711be85534eab63adb122f93e70aa35431", "bca9d118b1014b4c2d19319b10a3ebed508ff649396ce1855e1c96528d9b2fa9", "ce580c28845581535dc6000fc7c35fdadf8bea7ccb57d6321b044508e9ba0685", "d34923a569e70224d88e6682490e24c842907ba2c948c5fd26185413cbe0cd96", "dd9f0e531a049d8b35ec5e6c68a37f1ba6ec3a591415e6804cbdf652793d15d7", "ecb805cbfe9102f3fd3d2ef16dfe5ae9e2d7a7dfbba92f4ff1e16ac9784dbfb0", "ede9aad2197a0202caff35d417b671f5f91a3631477441076082a17c94edd846", "ef2d1fc370400e0aa755aab0b20cf4f1d0e934e7fd5244f3dd4869078e4942b9", "f2fec194a49bfaef42a548ee657362af5c7a640da757f6f452a35da7dd9f923c"] -markdown = ["2e50876bcdd74517e7b71f3e7a76102050edec255b3983403f1a63e7c8a41e7a", "56a46ac655704b91e5b7e6326ce43d5ef72411376588afa1dd90e881b83c7e8c"] -markupsafe = ["00bc623926325b26bb9605ae9eae8a215691f33cae5df11ca5424f06f2d1f473", "09027a7803a62ca78792ad89403b1b7a73a01c8cb65909cd876f7fcebd79b161", "09c4b7f37d6c648cb13f9230d847adf22f8171b1ccc4d5682398e77f40309235", "1027c282dad077d0bae18be6794e6b6b8c91d58ed8a8d89a89d59693b9131db5", "24982cc2533820871eba85ba648cd53d8623687ff11cbb805be4ff7b4c971aff", "29872e92839765e546828bb7754a68c418d927cd064fd4708fab9fe9c8bb116b", "43a55c2930bbc139570ac2452adf3d70cdbb3cfe5912c71cdce1c2c6bbd9c5d1", "46c99d2de99945ec5cb54f23c8cd5689f6d7177305ebff350a58ce5f8de1669e", "500d4957e52ddc3351cabf489e79c91c17f6e0899158447047588650b5e69183", "535f6fc4d397c1563d08b88e485c3496cf5784e927af890fb3c3aac7f933ec66", "62fe6c95e3ec8a7fad637b7f3d372c15ec1caa01ab47926cfdf7a75b40e0eac1", "6dd73240d2af64df90aa7c4e7481e23825ea70af4b4922f8ede5b9e35f78a3b1", "717ba8fe3ae9cc0006d7c451f0bb265ee07739daf76355d06366154ee68d221e", "79855e1c5b8da654cf486b830bd42c06e8780cea587384cf6545b7d9ac013a0b", "7c1699dfe0cf8ff607dbdcc1e9b9af1755371f92a68f706051cc8c37d447c905", "88e5fcfb52ee7b911e8bb6d6aa2fd21fbecc674eadd44118a9cc3863f938e735", "8defac2f2ccd6805ebf65f5eeb132adcf2ab57aa11fdf4c0dd5169a004710e7d", "98c7086708b163d425c67c7a91bad6e466bb99d797aa64f965e9d25c12111a5e", "9add70b36c5666a2ed02b43b335fe19002ee5235efd4b8a89bfcf9005bebac0d", "9bf40443012702a1d2070043cb6291650a0841ece432556f784f004937f0f32c", "ade5e387d2ad0d7ebf59146cc00c8044acbd863725f887353a10df825fc8ae21", "b00c1de48212e4cc9603895652c5c410df699856a2853135b3967591e4beebc2", "b1282f8c00509d99fef04d8ba936b156d419be841854fe901d8ae224c59f0be5", "b2051432115498d3562c084a49bba65d97cf251f5a331c64a12ee7e04dacc51b", "ba59edeaa2fc6114428f1637ffff42da1e311e29382d81b339c1817d37ec93c6", "c8716a48d94b06bb3b2524c2b77e055fb313aeb4ea620c8dd03a105574ba704f", "cd5df75523866410809ca100dc9681e301e3c27567cf498077e8551b6d20e42f", "e249096428b3ae81b08327a63a485ad0878de3fb939049038579ac0ef61e17e7"] -mccabe = ["ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42", "dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"] -mock = ["83657d894c90d5681d62155c82bda9c1187827525880eda8ff5df4ec813437c3", "d157e52d4e5b938c550f39eb2fd15610db062441a9c2747d3dbfa9298211d0f8"] -packaging = ["0c98a5d0be38ed775798ece1b9727178c4469d9c3b4ada66e8e6b7849f8732af", "9e1cbf8c12b1f1ce0bb5344b8d7ecf66a6f8a6e91bcb0c84593ed6d3ab5c4ab3"] -pluggy = ["0825a152ac059776623854c1543d65a4ad408eb3d33ee114dff91e57ec6ae6fc", "b9817417e95936bf75d85d3f8767f7df6cdde751fc40aed3bb3074cbcb77757c"] -py = ["64f65755aee5b381cea27766a3a147c3f15b9b6b9ac88676de66ba2ae36793fa", "dc639b046a6e2cff5bbe40194ad65936d6ba360b52b3c3fe1d08a82dd50b5e53"] -pycodestyle = ["95a2219d12372f05704562a14ec30bc76b05a5b297b21a5dfe3f6fac3491ae56", "e40a936c9a450ad81df37f549d676d127b1b66000a6c500caa2b085bc0ca976c"] -pyflakes = ["17dbeb2e3f4d772725c777fabc446d5634d1038f234e77343108ce445ea69ce0", "d976835886f8c5b31d47970ed689944a0262b5f3afa00a5a7b4dc81e5449f8a2"] -pygments = ["71e430bc85c88a430f000ac1d9b331d2407f681d6f6aec95e8bcfbc3df5b0127", "881c4c157e45f30af185c1ffe8d549d48ac9127433f2c380c24b84572ad66297"] -pyparsing = ["1873c03321fc118f4e9746baf201ff990ceb915f433f23b395f5580d1840cb2a", "9b6323ef4ab914af344ba97510e966d64ba91055d6b9afa6b30799340e89cc03"] -python-dateutil = ["7e6584c74aeed623791615e26efd690f29817a27c73085b78e4bad02493df2fb", "c89805f6f4d64db21ed966fda138f8a5ed7a4fdbc1a8ee329ce1b74e3c74da9e"] -pytz = ["303879e36b721603cc54604edcac9d20401bdbe31e1e4fdee5b9f98d5d31dfda", "d747dd3d23d77ef44c6a3526e274af6efeb0a6f1afd5a69ba4d5be4098c8e141"] -six = ["1f1b7d42e254082a9db6279deae68afb421ceba6158efa6131de7b3003ee93fd", "30f610279e8b2578cab6db20741130331735c781b56053c59c4076da27f06b66"] -smartypants = ["8db97f7cbdf08d15b158a86037cd9e116b4cf37703d24e0419a0d64ca5808f0d"] -snowballstemmer = ["9f3b9ffe0809d174f7047e121431acf99c89a7040f0ca84f94ba53a498e6d0c9"] -soupsieve = ["72b5f1aea9101cf720a36bb2327ede866fd6f1a07b1e87c92a1cc18113cbc946", "e4e9c053d59795e440163733a7fec6c5972210e1790c507e4c7b051d6c5259de"] -sphinx = ["82cd2728c906be96e307b81352d3fd9fb731869234c6b835cc25e9a3dfb4b7e4", "b83f430200f546bfd5088c653f0c5516af708da36066dfde08d08bedb1b33a4b"] -sphinx-rtd-theme = ["00cf895504a7895ee433807c62094cf1e95f065843bf3acd17037c3e9a2becd4", "728607e34d60456d736cc7991fd236afb828b21b82f956c5ea75f94c8414040a"] -toml = ["229f81c57791a41d65e399fc06bf0848bab550a9dfd5ed66df18ce5f05e73d5c", "235682dd292d5899d361a811df37e04a8828a5b1da3115886b73cf81ebc9100e", "f1db651f9657708513243e61e6cc67d101a39bad662eaa9b5546f789338e07a3"] -tox = ["dab0b0160dd187b654fc33d690ee1d7bf328bd5b8dc6ef3bb3cc468969c659ba", "ee35ffce74933a6c6ac10c9a0182e41763140a5a5070e21b114feca56eaccdcd"] -typogrify = ["8be4668cda434163ce229d87ca273a11922cb1614cb359970b7dc96eed13cb38"] -unidecode = ["1d7a042116536098d05d599ef2b8616759f02985c85b4fef50c78a5aaf10822a", "2b6aab710c2a1647e928e36d69c21e76b453cd455f4e2621000e54b2a9b8cce8"] -virtualenv = ["b7335cddd9260a3dd214b73a2521ffc09647bde3e9457fcca31dc3be3999d04a", "d28ca64c0f3f125f59cabf13e0a150e1c68e5eea60983cc4395d88c584495783"] -zipp = ["8c1019c6aad13642199fbe458275ad6a84907634cc9f0989877ccc4a2840139d", "ca943a7e809cc12257001ccfb99e3563da9af99d52f261725e96dfe0f9275bc3"] From 4db9b944a237302b5558395038f6125a910c6a05 Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sun, 15 Dec 2019 23:53:33 -0600 Subject: [PATCH 127/143] Remove CSS references to the non-existent digg.png icon --- pelican/tests/output/basic/theme/css/main.css | 1 - pelican/tests/output/custom/theme/css/main.css | 1 - pelican/tests/output/custom_locale/theme/css/main.css | 1 - pelican/themes/notmyidea/static/css/main.css | 1 - 4 files changed, 4 deletions(-) diff --git a/pelican/tests/output/basic/theme/css/main.css b/pelican/tests/output/basic/theme/css/main.css index 2b9d96e3..5feb71ce 100644 --- a/pelican/tests/output/basic/theme/css/main.css +++ b/pelican/tests/output/basic/theme/css/main.css @@ -326,7 +326,6 @@ div.figure p.caption, figure p.caption { /* margin provided by figure */ .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'], diff --git a/pelican/tests/output/custom/theme/css/main.css b/pelican/tests/output/custom/theme/css/main.css index 2b9d96e3..5feb71ce 100644 --- a/pelican/tests/output/custom/theme/css/main.css +++ b/pelican/tests/output/custom/theme/css/main.css @@ -326,7 +326,6 @@ div.figure p.caption, figure p.caption { /* margin provided by figure */ .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'], diff --git a/pelican/tests/output/custom_locale/theme/css/main.css b/pelican/tests/output/custom_locale/theme/css/main.css index 2b9d96e3..5feb71ce 100644 --- a/pelican/tests/output/custom_locale/theme/css/main.css +++ b/pelican/tests/output/custom_locale/theme/css/main.css @@ -326,7 +326,6 @@ div.figure p.caption, figure p.caption { /* margin provided by figure */ .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'], diff --git a/pelican/themes/notmyidea/static/css/main.css b/pelican/themes/notmyidea/static/css/main.css index 2b9d96e3..5feb71ce 100644 --- a/pelican/themes/notmyidea/static/css/main.css +++ b/pelican/themes/notmyidea/static/css/main.css @@ -326,7 +326,6 @@ div.figure p.caption, figure p.caption { /* margin provided by figure */ .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'], From 5d6513c36cb7cb16a97d21e7abe0108fbdd95557 Mon Sep 17 00:00:00 2001 From: Annika Backstrom Date: Wed, 23 Nov 2016 00:13:28 -0500 Subject: [PATCH 128/143] Skip Markdown metadata parsing within metadata --- pelican/readers.py | 3 +++ .../article_with_markdown_and_nested_metadata.md | 5 +++++ pelican/tests/test_generators.py | 3 +++ pelican/tests/test_readers.py | 13 +++++++++++++ 4 files changed, 24 insertions(+) create mode 100644 pelican/tests/content/article_with_markdown_and_nested_metadata.md diff --git a/pelican/readers.py b/pelican/readers.py index 673b637e..dea11fbd 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -302,6 +302,9 @@ class MarkdownReader(BaseReader): """Return the dict containing document metadata""" formatted_fields = self.settings['FORMATTED_FIELDS'] + # prevent metadata extraction in fields + self._md.preprocessors.pop('meta', None) + output = {} for name, value in meta.items(): name = name.lower() diff --git a/pelican/tests/content/article_with_markdown_and_nested_metadata.md b/pelican/tests/content/article_with_markdown_and_nested_metadata.md new file mode 100644 index 00000000..3968027b --- /dev/null +++ b/pelican/tests/content/article_with_markdown_and_nested_metadata.md @@ -0,0 +1,5 @@ +Title: Article with markdown and nested summary metadata +Date: 2012-10-30 +Summary: Test: This metadata value looks like metadata + +This is some content. diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index 3ab341a3..1f8157a6 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -239,6 +239,8 @@ class TestArticlesGenerator(unittest.TestCase): ['Article title', 'published', 'Default', 'article'], ['Article with markdown and summary metadata multi', 'published', 'Default', 'article'], + ['Article with markdown and nested summary metadata', 'published', + 'Default', 'article'], ['Article with markdown and summary metadata single', 'published', 'Default', 'article'], ['Article with markdown containing footnotes', 'published', @@ -554,6 +556,7 @@ class TestArticlesGenerator(unittest.TestCase): 'Article title', 'Article with Nonconformant HTML meta tags', 'Article with an inline SVG', + 'Article with markdown and nested summary metadata', 'Article with markdown and summary metadata multi', 'Article with markdown and summary metadata single', 'Article with markdown containing footnotes', diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 5b87aeac..70e6da77 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -645,6 +645,19 @@ class MdReaderTest(ReaderTest): } self.assertDictHasSubset(metadata, expected) + def test_metadata_not_parsed_for_metadata(self): + settings = get_settings() + settings['FORMATTED_FIELDS'] = ['summary'] + + reader = readers.MarkdownReader(settings=settings) + content, metadata = reader.read( + _path('article_with_markdown_and_nested_metadata.md')) + expected = { + 'title': 'Article with markdown and nested summary metadata', + 'summary': '

Test: This metadata value looks like metadata

', + } + self.assertDictHasSubset(metadata, expected) + def test_empty_file(self): reader = readers.MarkdownReader(settings=get_settings()) content, metadata = reader.read( From e618becfc08934a7813b8a9832ae5105c07d0595 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 12 Apr 2020 11:37:10 +0200 Subject: [PATCH 129/143] Skip MD metadata parsing in latest Python-Markdown The syntax for unloading Python-Markdown extensions has changed to a "deregister" method on Registry objects. --- pelican/readers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pelican/readers.py b/pelican/readers.py index dea11fbd..6d9923f2 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -303,7 +303,7 @@ class MarkdownReader(BaseReader): formatted_fields = self.settings['FORMATTED_FIELDS'] # prevent metadata extraction in fields - self._md.preprocessors.pop('meta', None) + self._md.preprocessors.deregister('meta') output = {} for name, value in meta.items(): From 2a5bb109ba3ce0910b5e4ca3a19313c564f2017a Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 12 Apr 2020 15:04:22 +0200 Subject: [PATCH 130/143] Pin pytest until 5.4.x series has stabilized Version 5.4.1 is currently incompatible with pytest-sugar. --- requirements/test.pip | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/test.pip b/requirements/test.pip index f5d09e4a..5cadfafb 100644 --- a/requirements/test.pip +++ b/requirements/test.pip @@ -1,6 +1,6 @@ # Tests mock -pytest +pytest==5.3.5 # Optional Packages Markdown >= 3.1 From 88100484e0aafc17fa4a8fcd01966c9c9ca8d25d Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 12 Apr 2020 15:16:12 +0200 Subject: [PATCH 131/143] Move more test deps from CI config to requirements --- requirements/test.pip | 1 + tox.ini | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/requirements/test.pip b/requirements/test.pip index 5cadfafb..25ab14ea 100644 --- a/requirements/test.pip +++ b/requirements/test.pip @@ -1,6 +1,7 @@ # Tests mock pytest==5.3.5 +pytest-cov # Optional Packages Markdown >= 3.1 diff --git a/tox.ini b/tox.ini index 7ddcfae0..cf8b150a 100644 --- a/tox.ini +++ b/tox.ini @@ -10,8 +10,6 @@ passenv = * usedevelop=True deps = -rrequirements/test.pip - pytest - pytest-cov pygments==2.1.3 commands = From b6dc55f96c9e97b637f0b5e4720e61170d5d43fd Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 12 Apr 2020 15:21:17 +0200 Subject: [PATCH 132/143] Add poetry.lock to list of files for Git to ignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index c1835e10..b94526d6 100644 --- a/.gitignore +++ b/.gitignore @@ -15,3 +15,4 @@ htmlcov venv samples/output *.pem +poetry.lock From 18c7a9c3a1cd152d03b76dd08fb876184ab4e5de Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sun, 12 Apr 2020 15:38:17 +0200 Subject: [PATCH 133/143] Pin pytest in pyproject also --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 4d1477c0..cf79a74e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -47,7 +47,7 @@ sphinx = "=1.4.9" sphinx_rtd_theme = "^0.4.3" livereload = "^2.6" mock = "^3.0" -pytest = "^5.2" +pytest = "~5.3.5" pytest-cov = "^2.8" pytest-pythonpath = "^0.7.3" pytest-sugar = "^0.9.2" From 7bbd3dc6fbd31da5ce69a1347c5f72db73a5e6fc Mon Sep 17 00:00:00 2001 From: Kurt McKee Date: Sun, 12 Apr 2020 09:38:35 -0500 Subject: [PATCH 134/143] Update links to HTTPS and current 301 redirects in docs/templates/themes (#2661) This also updates the Tumblr API to use HTTPS as documented in the current Tumblr API docs. --- LICENSE | 6 ++-- README.rst | 4 +-- docs/content.rst | 6 ++-- docs/faq.rst | 4 +-- docs/importer.rst | 10 +++---- docs/index.rst | 2 +- docs/install.rst | 28 +++++++++---------- docs/internals.rst | 2 +- docs/publish.rst | 2 +- docs/quickstart.rst | 4 +-- docs/settings.rst | 6 ++-- docs/themes.rst | 4 +-- .../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 +-- .../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 +-- .../output/basic/drafts/a-draft-article.html | 4 +-- .../basic/filename_metadata-example.html | 4 +-- pelican/tests/output/basic/index.html | 4 +-- pelican/tests/output/basic/oh-yeah.html | 4 +-- .../tests/output/basic/override/index.html | 4 +-- .../pages/this-is-a-test-hidden-page.html | 4 +-- .../basic/pages/this-is-a-test-page.html | 4 +-- .../tests/output/basic/second-article-fr.html | 4 +-- .../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/theme/css/main.css | 4 +-- .../tests/output/basic/theme/css/reset.css | 2 +- .../output/basic/this-is-a-super-article.html | 4 +-- pelican/tests/output/basic/unbelievable.html | 4 +-- .../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 +-- .../custom/author/alexis-metaireau.html | 4 +-- .../custom/author/alexis-metaireau2.html | 4 +-- .../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 +-- .../tests/output/custom/category/cat1.html | 4 +-- .../tests/output/custom/category/misc.html | 4 +-- .../tests/output/custom/category/yeah.html | 4 +-- .../output/custom/drafts/a-draft-article.html | 4 +-- .../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 +-- .../tests/output/custom/jinja2_template.html | 4 +-- pelican/tests/output/custom/oh-yeah-fr.html | 4 +-- pelican/tests/output/custom/oh-yeah.html | 4 +-- .../tests/output/custom/override/index.html | 4 +-- .../pages/this-is-a-test-hidden-page.html | 4 +-- .../custom/pages/this-is-a-test-page.html | 4 +-- .../output/custom/second-article-fr.html | 4 +-- .../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 +-- .../tests/output/custom/theme/css/main.css | 4 +-- .../tests/output/custom/theme/css/reset.css | 2 +- .../custom/this-is-a-super-article.html | 4 +-- pelican/tests/output/custom/unbelievable.html | 4 +-- .../tests/output/custom_locale/archives.html | 4 +-- .../author/alexis-metaireau.html | 4 +-- .../author/alexis-metaireau2.html | 4 +-- .../author/alexis-metaireau3.html | 4 +-- .../tests/output/custom_locale/authors.html | 4 +-- .../output/custom_locale/categories.html | 4 +-- .../output/custom_locale/category/bar.html | 4 +-- .../output/custom_locale/category/cat1.html | 4 +-- .../output/custom_locale/category/misc.html | 4 +-- .../output/custom_locale/category/yeah.html | 4 +-- .../custom_locale/drafts/a-draft-article.html | 4 +-- pelican/tests/output/custom_locale/index.html | 4 +-- .../tests/output/custom_locale/index2.html | 4 +-- .../tests/output/custom_locale/index3.html | 4 +-- .../output/custom_locale/jinja2_template.html | 4 +-- .../output/custom_locale/oh-yeah-fr.html | 4 +-- .../output/custom_locale/override/index.html | 4 +-- .../pages/this-is-a-test-hidden-page.html | 4 +-- .../pages/this-is-a-test-page.html | 4 +-- .../02/this-is-a-super-article/index.html | 4 +-- .../2010/octobre/15/unbelievable/index.html | 4 +-- .../posts/2010/octobre/20/oh-yeah/index.html | 4 +-- .../20/a-markdown-powered-article/index.html | 4 +-- .../2011/février/17/article-1/index.html | 4 +-- .../2011/février/17/article-2/index.html | 4 +-- .../2011/février/17/article-3/index.html | 4 +-- .../2012/février/29/second-article/index.html | 4 +-- .../30/filename_metadata-example/index.html | 4 +-- .../custom_locale/second-article-fr.html | 4 +-- .../tests/output/custom_locale/tag/bar.html | 4 +-- .../tests/output/custom_locale/tag/baz.html | 4 +-- .../tests/output/custom_locale/tag/foo.html | 4 +-- .../output/custom_locale/tag/foobar.html | 4 +-- .../tests/output/custom_locale/tag/oh.html | 4 +-- .../tests/output/custom_locale/tag/yeah.html | 4 +-- pelican/tests/output/custom_locale/tags.html | 4 +-- .../output/custom_locale/theme/css/main.css | 4 +-- .../output/custom_locale/theme/css/reset.css | 2 +- pelican/tests/test_pelican.py | 3 +- pelican/themes/notmyidea/static/css/main.css | 4 +-- pelican/themes/notmyidea/static/css/reset.css | 2 +- pelican/themes/notmyidea/templates/base.html | 4 +-- pelican/themes/simple/templates/base.html | 4 +-- pelican/tools/pelican_import.py | 4 +-- pelican/tools/pelican_quickstart.py | 2 +- pelican/tools/templates/pelicanconf.py.jinja2 | 6 ++-- 128 files changed, 267 insertions(+), 266 deletions(-) diff --git a/LICENSE b/LICENSE index dba13ed2..c03a4e46 100644 --- a/LICENSE +++ b/LICENSE @@ -1,7 +1,7 @@ GNU AFFERO GENERAL PUBLIC LICENSE Version 3, 19 November 2007 - Copyright (C) 2007 Free Software Foundation, Inc. + Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. @@ -643,7 +643,7 @@ the "copyright" line and a pointer to where the full notice is found. GNU Affero General Public License for more details. You should have received a copy of the GNU Affero General Public License - along with this program. If not, see . + along with this program. If not, see . Also add information on how to contact you by electronic and paper mail. @@ -658,4 +658,4 @@ specific requirements. You should also get your employer (if you work as a programmer) or school, if any, to sign a "copyright disclaimer" for the program, if necessary. For more information on this, and how to apply and follow the GNU AGPL, see -. +. diff --git a/README.rst b/README.rst index 176dfce4..6f83188c 100644 --- a/README.rst +++ b/README.rst @@ -50,8 +50,8 @@ Why the name "Pelican"? .. _Python: https://www.python.org/ .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Markdown: https://daringfireball.net/projects/markdown/ -.. _Jinja2: http://jinja.pocoo.org/ -.. _Pygments: http://pygments.org/ +.. _Jinja2: https://palletsprojects.com/p/jinja/ +.. _Pygments: https://pygments.org/ .. _`Pelican's documentation`: https://docs.getpelican.com/ .. _`Pelican's internals`: https://docs.getpelican.com/en/latest/internals.html .. _`hosted on GitHub`: https://github.com/getpelican/pelican diff --git a/docs/content.rst b/docs/content.rst index c51e5e66..a52425a4 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -524,7 +524,7 @@ indenting both the identifier and the code:: 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 `_. +appears on the `list of available lexers `_. When using reStructuredText the following options are available in the code-block directive: @@ -565,7 +565,7 @@ tagurlformat string format for the ctag links. 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 +`Pygments documentation `_ for more details on each of the options. For example, the following code block enables line numbers, starting at 153, @@ -611,7 +611,7 @@ To publish a post when the default status is ``draft``, update the post's metadata to include ``Status: published``. .. _W3C ISO 8601: https://www.w3.org/TR/NOTE-datetime -.. _AsciiDoc: http://www.methods.co.nz/asciidoc/ +.. _AsciiDoc: https://www.methods.co.nz/asciidoc/ .. _pelican-plugins: https://github.com/getpelican/pelican-plugins .. _Markdown Extensions: https://python-markdown.github.io/extensions/ .. _CodeHilite extension: https://python-markdown.github.io/extensions/code_hilite/#syntax diff --git a/docs/faq.rst b/docs/faq.rst index d469f386..bfe51ec0 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -48,7 +48,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 @@ -167,7 +167,7 @@ I'm getting a warning about feeds generated without SITEURL being set properly ============================================================================== `RSS and Atom feeds require all URL links to be absolute -`_. In order to properly +`_. In order to properly generate links in Pelican you will need to set ``SITEURL`` to the full path of your site. diff --git a/docs/importer.rst b/docs/importer.rst index 674dd9b1..88588d17 100644 --- a/docs/importer.rst +++ b/docs/importer.rst @@ -39,8 +39,8 @@ Dependencies - *Pandoc*, see the `Pandoc site`_ for installation instructions on your operating system. -.. _Pandoc: http://johnmacfarlane.net/pandoc/ -.. _Pandoc site: http://johnmacfarlane.net/pandoc/installing.html +.. _Pandoc: https://pandoc.org/ +.. _Pandoc site: https://pandoc.org/installing.html Usage @@ -58,7 +58,7 @@ Positional arguments ============= ============================================================================ ``input`` The input file to read ``api_token`` (Posterous only) api_token can be obtained from http://posterous.com/api/ - ``api_key`` (Tumblr only) api_key can be obtained from http://www.tumblr.com/oauth/apps + ``api_key`` (Tumblr only) api_key can be obtained from https://www.tumblr.com/oauth/apps ============= ============================================================================ Optional arguments @@ -137,7 +137,7 @@ Tests To test the module, one can use sample files: -- for WordPress: http://www.wpbeginner.com/wp-themes/how-to-add-dummy-content-for-theme-development-in-wordpress/ +- for WordPress: https://www.wpbeginner.com/wp-themes/how-to-add-dummy-content-for-theme-development-in-wordpress/ - for Dotclear: http://media.dotaddict.org/tda/downloads/lorem-backup.txt -.. _more_categories: http://github.com/getpelican/pelican-plugins/tree/master/more_categories \ No newline at end of file +.. _more_categories: https://github.com/getpelican/pelican-plugins/tree/master/more_categories \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst index 678732d8..4cbe41ae 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -79,7 +79,7 @@ Documentation .. _Python: https://www.python.org/ .. _reStructuredText: http://docutils.sourceforge.net/rst.html .. _Markdown: https://daringfireball.net/projects/markdown/ -.. _Jinja2: http://jinja.pocoo.org/ +.. _Jinja2: https://palletsprojects.com/p/jinja/ .. _`Pelican documentation`: https://docs.getpelican.com/latest/ .. _`Pelican's internals`: https://docs.getpelican.com/en/latest/internals.html .. _`Pelican plugins`: https://github.com/getpelican/pelican-plugins diff --git a/docs/install.rst b/docs/install.rst index d683ed8f..03480e79 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -5,7 +5,7 @@ Pelican currently runs best on Python 2.7.x and 3.5+; earlier versions of Python are not supported. You can install Pelican via several different methods. The simplest is via -`pip `_:: +`pip `_:: pip install pelican @@ -43,7 +43,7 @@ options. For more detail, refer to the :doc:`Publish` section. Optional packages ----------------- -If you plan on using `Markdown `_ as a +If you plan on using `Markdown `_ as a markup format, you can install Pelican with Markdown support:: pip install pelican[Markdown] @@ -53,7 +53,7 @@ Or you might need to install it a posteriori:: pip install Markdown Typographical enhancements can be enabled in your settings file, but first the -requisite `Typogrify `_ library must be +requisite `Typogrify `_ library must be installed:: pip install typogrify @@ -64,22 +64,22 @@ Dependencies When Pelican is installed, the following dependent Python packages should be automatically installed without any action on your part: -* `feedgenerator `_, to generate the +* `feedgenerator `_, to generate the Atom feeds -* `jinja2 `_, for templating support -* `pygments `_, for syntax highlighting -* `docutils `_, for supporting +* `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 +* `pytz `_, for timezone definitions +* `blinker `_, an object-to-object and broadcast signaling system -* `unidecode `_, for ASCII +* `unidecode `_, for ASCII transliterations of Unicode text -* `six `_, for Python 2 and 3 compatibility +* `six `_, for Python 2 and 3 compatibility utilities -* `MarkupSafe `_, for a markup safe +* `MarkupSafe `_, for a markup safe string implementation -* `python-dateutil `_, to read +* `python-dateutil `_, to read the date metadata Upgrading @@ -126,4 +126,4 @@ content):: The next step is to begin to adding content to the *content* folder that has been created for you. -.. _virtualenv: http://www.virtualenv.org/ +.. _virtualenv: https://virtualenv.pypa.io/en/latest/ diff --git a/docs/internals.rst b/docs/internals.rst index e8d35148..5b41070e 100644 --- a/docs/internals.rst +++ b/docs/internals.rst @@ -32,7 +32,7 @@ The logic is separated into different classes and concepts: inputs. * Pelican also uses templates, so it's easy to write your own theme. The - syntax is `Jinja2 `_ and is very easy to learn, so + 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? diff --git a/docs/publish.rst b/docs/publish.rst index 489558d8..9bea8938 100644 --- a/docs/publish.rst +++ b/docs/publish.rst @@ -207,4 +207,4 @@ That's it! Your site should now be live. executables, such as ``python3``, you can set the ``PY`` and ``PELICAN`` environment variables, respectively, to override the default executable names.) -.. _Invoke: http://www.pyinvoke.org +.. _Invoke: https://www.pyinvoke.org/ diff --git a/docs/quickstart.rst b/docs/quickstart.rst index 484a318f..1f6358a7 100644 --- a/docs/quickstart.rst +++ b/docs/quickstart.rst @@ -30,7 +30,7 @@ by asking some questions about your site:: For questions that have default values denoted in brackets, feel free to use the Return key to accept those default values [#tzlocal_fn]_. When asked for your URL prefix, enter your domain name as indicated (e.g., -``http://example.com``). +``https://example.com``). Create an article ----------------- @@ -78,5 +78,5 @@ Footnotes --------- .. [#tzlocal_fn] You can help localize default fields by installing the - optional `tzlocal `_ + optional `tzlocal `_ module. diff --git a/docs/settings.rst b/docs/settings.rst index 51caad28..9ebf85c2 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -709,7 +709,7 @@ Time and Date .. [#] Default is the system locale. -.. _locales on Windows: http://msdn.microsoft.com/en-us/library/cdax410z%28VS.71%29.aspx +.. _locales on Windows: https://www.microsoft.com/en-us/download/details.aspx?id=55979 .. _locale(1): https://linux.die.net/man/1/locale @@ -1357,6 +1357,6 @@ Example settings :language: python -.. _Jinja custom filters documentation: http://jinja.pocoo.org/docs/api/#custom-filters -.. _Jinja Environment documentation: http://jinja.pocoo.org/docs/dev/api/#jinja2.Environment +.. _Jinja custom filters documentation: https://jinja.palletsprojects.com/en/master/api/#custom-filters +.. _Jinja Environment documentation: https://jinja.palletsprojects.com/en/master/api/#jinja2.Environment .. _Docutils Configuration: http://docutils.sourceforge.net/docs/user/config.html diff --git a/docs/themes.rst b/docs/themes.rst index ea9214fe..a2332615 100644 --- a/docs/themes.rst +++ b/docs/themes.rst @@ -4,7 +4,7 @@ Creating themes ############### To generate its HTML output, Pelican uses the `Jinja -`_ templating engine due to its flexibility and +`_ 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 `_. @@ -104,7 +104,7 @@ that allow them to be easily sorted by name:: If you want to sort based on different criteria, `Jinja's sort command`__ has a number of options. -__ http://jinja.pocoo.org/docs/templates/#sort +__ https://jinja.palletsprojects.com/en/master/templates/#sort Date Formatting diff --git a/pelican/tests/output/basic/a-markdown-powered-article.html b/pelican/tests/output/basic/a-markdown-powered-article.html index 9053d5fe..e08cabd8 100644 --- a/pelican/tests/output/basic/a-markdown-powered-article.html +++ b/pelican/tests/output/basic/a-markdown-powered-article.html @@ -55,10 +55,10 @@ diff --git a/pelican/tests/output/basic/archives.html b/pelican/tests/output/basic/archives.html index dcebef2c..79ad0452 100644 --- a/pelican/tests/output/basic/archives.html +++ b/pelican/tests/output/basic/archives.html @@ -58,10 +58,10 @@ diff --git a/pelican/tests/output/basic/article-1.html b/pelican/tests/output/basic/article-1.html index 758ddf06..71449b0b 100644 --- a/pelican/tests/output/basic/article-1.html +++ b/pelican/tests/output/basic/article-1.html @@ -54,10 +54,10 @@ diff --git a/pelican/tests/output/basic/article-2.html b/pelican/tests/output/basic/article-2.html index 40d2cefd..159eda1d 100644 --- a/pelican/tests/output/basic/article-2.html +++ b/pelican/tests/output/basic/article-2.html @@ -54,10 +54,10 @@ diff --git a/pelican/tests/output/basic/article-3.html b/pelican/tests/output/basic/article-3.html index 1ef6b651..4c92c35b 100644 --- a/pelican/tests/output/basic/article-3.html +++ b/pelican/tests/output/basic/article-3.html @@ -54,10 +54,10 @@ diff --git a/pelican/tests/output/basic/author/alexis-metaireau.html b/pelican/tests/output/basic/author/alexis-metaireau.html index aa19e421..0a1c5e56 100644 --- a/pelican/tests/output/basic/author/alexis-metaireau.html +++ b/pelican/tests/output/basic/author/alexis-metaireau.html @@ -98,10 +98,10 @@ YEAH !

diff --git a/pelican/tests/output/basic/authors.html b/pelican/tests/output/basic/authors.html index c2b695c0..1aad3027 100644 --- a/pelican/tests/output/basic/authors.html +++ b/pelican/tests/output/basic/authors.html @@ -40,10 +40,10 @@ diff --git a/pelican/tests/output/basic/categories.html b/pelican/tests/output/basic/categories.html index 934c224b..ecaf5669 100644 --- a/pelican/tests/output/basic/categories.html +++ b/pelican/tests/output/basic/categories.html @@ -39,10 +39,10 @@ diff --git a/pelican/tests/output/basic/category/bar.html b/pelican/tests/output/basic/category/bar.html index 2d327f5f..a4cafcaf 100644 --- a/pelican/tests/output/basic/category/bar.html +++ b/pelican/tests/output/basic/category/bar.html @@ -54,10 +54,10 @@ YEAH !

diff --git a/pelican/tests/output/basic/category/cat1.html b/pelican/tests/output/basic/category/cat1.html index 9d8a8883..bc45f1fe 100644 --- a/pelican/tests/output/basic/category/cat1.html +++ b/pelican/tests/output/basic/category/cat1.html @@ -113,10 +113,10 @@ diff --git a/pelican/tests/output/basic/category/misc.html b/pelican/tests/output/basic/category/misc.html index 0542dba1..aaa35f6d 100644 --- a/pelican/tests/output/basic/category/misc.html +++ b/pelican/tests/output/basic/category/misc.html @@ -124,10 +124,10 @@ pelican.conf, it will …

diff --git a/pelican/tests/output/basic/category/yeah.html b/pelican/tests/output/basic/category/yeah.html index 2621e587..d0fd9130 100644 --- a/pelican/tests/output/basic/category/yeah.html +++ b/pelican/tests/output/basic/category/yeah.html @@ -64,10 +64,10 @@ diff --git a/pelican/tests/output/basic/drafts/a-draft-article.html b/pelican/tests/output/basic/drafts/a-draft-article.html index 7fe1b180..081c2e75 100644 --- a/pelican/tests/output/basic/drafts/a-draft-article.html +++ b/pelican/tests/output/basic/drafts/a-draft-article.html @@ -55,10 +55,10 @@ listed anywhere else.

diff --git a/pelican/tests/output/basic/filename_metadata-example.html b/pelican/tests/output/basic/filename_metadata-example.html index 98930240..7203e648 100644 --- a/pelican/tests/output/basic/filename_metadata-example.html +++ b/pelican/tests/output/basic/filename_metadata-example.html @@ -54,10 +54,10 @@ diff --git a/pelican/tests/output/basic/index.html b/pelican/tests/output/basic/index.html index 5b037545..092a4d30 100644 --- a/pelican/tests/output/basic/index.html +++ b/pelican/tests/output/basic/index.html @@ -261,10 +261,10 @@ pelican.conf, it will …

diff --git a/pelican/tests/output/basic/oh-yeah.html b/pelican/tests/output/basic/oh-yeah.html index df378418..dba8b114 100644 --- a/pelican/tests/output/basic/oh-yeah.html +++ b/pelican/tests/output/basic/oh-yeah.html @@ -62,10 +62,10 @@ YEAH !

diff --git a/pelican/tests/output/basic/override/index.html b/pelican/tests/output/basic/override/index.html index 3b45f9e0..8084f9b4 100644 --- a/pelican/tests/output/basic/override/index.html +++ b/pelican/tests/output/basic/override/index.html @@ -39,10 +39,10 @@ at a custom location.

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 6e1bd4eb..898550bc 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 @@ -39,10 +39,10 @@ Anyone can see this page but it's not linked to anywhere!

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 ed9bce91..710f22b4 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 @@ -39,10 +39,10 @@ diff --git a/pelican/tests/output/basic/second-article-fr.html b/pelican/tests/output/basic/second-article-fr.html index 1e5f1ef9..689c3373 100644 --- a/pelican/tests/output/basic/second-article-fr.html +++ b/pelican/tests/output/basic/second-article-fr.html @@ -58,10 +58,10 @@ diff --git a/pelican/tests/output/basic/second-article.html b/pelican/tests/output/basic/second-article.html index 4485e9f8..784fdc9b 100644 --- a/pelican/tests/output/basic/second-article.html +++ b/pelican/tests/output/basic/second-article.html @@ -58,10 +58,10 @@ diff --git a/pelican/tests/output/basic/tag/bar.html b/pelican/tests/output/basic/tag/bar.html index 7e977f0e..0227a65e 100644 --- a/pelican/tests/output/basic/tag/bar.html +++ b/pelican/tests/output/basic/tag/bar.html @@ -110,10 +110,10 @@ YEAH !

diff --git a/pelican/tests/output/basic/tag/baz.html b/pelican/tests/output/basic/tag/baz.html index 48a11061..761d5b3d 100644 --- a/pelican/tests/output/basic/tag/baz.html +++ b/pelican/tests/output/basic/tag/baz.html @@ -54,10 +54,10 @@ diff --git a/pelican/tests/output/basic/tag/foo.html b/pelican/tests/output/basic/tag/foo.html index aad78781..7f1d586b 100644 --- a/pelican/tests/output/basic/tag/foo.html +++ b/pelican/tests/output/basic/tag/foo.html @@ -82,10 +82,10 @@ as well as inline markup.

diff --git a/pelican/tests/output/basic/tag/foobar.html b/pelican/tests/output/basic/tag/foobar.html index cc72782c..e558f4c2 100644 --- a/pelican/tests/output/basic/tag/foobar.html +++ b/pelican/tests/output/basic/tag/foobar.html @@ -64,10 +64,10 @@ diff --git a/pelican/tests/output/basic/tag/oh.html b/pelican/tests/output/basic/tag/oh.html index 0993e43e..d1f44c07 100644 --- a/pelican/tests/output/basic/tag/oh.html +++ b/pelican/tests/output/basic/tag/oh.html @@ -38,10 +38,10 @@ diff --git a/pelican/tests/output/basic/tag/yeah.html b/pelican/tests/output/basic/tag/yeah.html index 49d1616d..6130eff8 100644 --- a/pelican/tests/output/basic/tag/yeah.html +++ b/pelican/tests/output/basic/tag/yeah.html @@ -54,10 +54,10 @@ YEAH !

diff --git a/pelican/tests/output/basic/tags.html b/pelican/tests/output/basic/tags.html index afcd2bab..3d8d45c3 100644 --- a/pelican/tests/output/basic/tags.html +++ b/pelican/tests/output/basic/tags.html @@ -45,10 +45,10 @@ diff --git a/pelican/tests/output/basic/theme/css/main.css b/pelican/tests/output/basic/theme/css/main.css index 5feb71ce..63f5adc0 100644 --- a/pelican/tests/output/basic/theme/css/main.css +++ b/pelican/tests/output/basic/theme/css/main.css @@ -3,8 +3,8 @@ Date: July 2009 Description: Sample layout for HTML5 and CSS3 goodness. Version: 1.0 - License: MIT - Licensed by: Smashing Media GmbH + License: MIT + Licensed by: Smashing Media GmbH Original author: Enrique Ramírez */ diff --git a/pelican/tests/output/basic/theme/css/reset.css b/pelican/tests/output/basic/theme/css/reset.css index 1e217566..c88e6196 100644 --- a/pelican/tests/output/basic/theme/css/reset.css +++ b/pelican/tests/output/basic/theme/css/reset.css @@ -2,7 +2,7 @@ Name: Reset Stylesheet Description: Resets browser's default CSS Author: Eric Meyer - Author URI: http://meyerweb.com/eric/tools/css/reset/ + Author URI: https://meyerweb.com/eric/tools/css/reset/ */ /* v1.0 | 20080212 */ 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 5e6f1365..aed2ab39 100644 --- a/pelican/tests/output/basic/this-is-a-super-article.html +++ b/pelican/tests/output/basic/this-is-a-super-article.html @@ -72,10 +72,10 @@ diff --git a/pelican/tests/output/basic/unbelievable.html b/pelican/tests/output/basic/unbelievable.html index 857b1dc1..518781eb 100644 --- a/pelican/tests/output/basic/unbelievable.html +++ b/pelican/tests/output/basic/unbelievable.html @@ -86,10 +86,10 @@ pelican.conf, it will have nothing in default.

diff --git a/pelican/tests/output/custom/a-markdown-powered-article.html b/pelican/tests/output/custom/a-markdown-powered-article.html index 5c416f2f..e5fda57c 100644 --- a/pelican/tests/output/custom/a-markdown-powered-article.html +++ b/pelican/tests/output/custom/a-markdown-powered-article.html @@ -92,10 +92,10 @@