From 126f72e1cdebbd6117b069260672df41511ee5b8 Mon Sep 17 00:00:00 2001 From: Eklavya Sharma Date: Tue, 9 Jul 2019 23:50:17 +0530 Subject: [PATCH 001/111] Only use relative paths in StaticGenerator Previously some paths were relative and some were absolute, which lead to multiple Content objects for the same static file in self.staticfiles. --- pelican/generators.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pelican/generators.py b/pelican/generators.py index 75eca388..994bd74f 100644 --- a/pelican/generators.py +++ b/pelican/generators.py @@ -800,8 +800,7 @@ class StaticGenerator(Generator): def generate_context(self): self.staticfiles = [] - linked_files = {os.path.join(self.path, path) - for path in self.context['static_links']} + linked_files = set(self.context['static_links']) found_files = self.get_files(self.settings['STATIC_PATHS'], exclude=self.settings['STATIC_EXCLUDES'], extensions=False) From 2ee423017bb444e1370b50862340559012bda739 Mon Sep 17 00:00:00 2001 From: MinchinWeb Date: Tue, 20 Aug 2019 19:01:39 -0600 Subject: [PATCH 002/111] 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

@@ -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 7f4e614bb8f7f43b8419c896ee0cd1bedd4e0a9c Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Sat, 21 Sep 2019 10:57:35 -0600 Subject: [PATCH 003/111] 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 Date: Mon, 23 Sep 2019 19:38:18 +0200 Subject: [PATCH 004/111] 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 Date: Mon, 23 Sep 2019 17:48:56 +0200 Subject: [PATCH 005/111] 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 Date: Mon, 23 Sep 2019 18:21:15 +0000 Subject: [PATCH 006/111] 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 "] 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 Date: Tue, 24 Sep 2019 22:07:01 +0200 Subject: [PATCH 007/111] 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 --- 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 Date: Sat, 28 Sep 2019 13:45:58 -0700 Subject: [PATCH 008/111] 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 Date: Sat, 28 Sep 2019 13:51:20 -0700 Subject: [PATCH 009/111] 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 Date: Fri, 4 Oct 2019 22:28:24 +0200 Subject: [PATCH 010/111] 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 Date: Sat, 5 Oct 2019 15:25:31 +0200 Subject: [PATCH 011/111] 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 Date: Wed, 9 Oct 2019 11:08:39 +0200 Subject: [PATCH 012/111] 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 `_ 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 Date: Wed, 9 Oct 2019 11:17:44 -0700 Subject: [PATCH 013/111] 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 Date: Wed, 9 Oct 2019 11:28:53 -0700 Subject: [PATCH 014/111] 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 Date: Wed, 9 Oct 2019 18:45:18 +0000 Subject: [PATCH 015/111] 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 "] 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 Date: Fri, 11 Oct 2019 00:29:00 +0100 Subject: [PATCH 016/111] 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 @@ + + + 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 017/111] 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 018/111] 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 019/111] 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 020/111] 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 021/111] 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 022/111] 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 023/111] 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 024/111] 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 025/111] 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 026/111] 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 027/111] 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 028/111] 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 029/111] 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 030/111] 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 031/111] 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 032/111] 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 033/111] 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 034/111] 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 035/111] 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 036/111] 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 037/111] 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 038/111] 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 039/111] 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 040/111] 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 041/111] 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 042/111] 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 043/111] 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 044/111] 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 045/111] 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 046/111] 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 047/111] 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 048/111] 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 049/111] 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 050/111] 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 051/111] 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 052/111] 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 053/111] 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 054/111] 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 055/111] 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 056/111] 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 057/111] 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 058/111] 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 059/111] 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 060/111] 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 061/111] 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 062/111] 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 063/111] 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 064/111] 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 065/111] 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 066/111] 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 067/111] 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 068/111] 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 069/111] 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 070/111] 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 071/111] 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 072/111] 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 073/111] 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 074/111] 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 075/111] 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 076/111] 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 077/111] 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 078/111] 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 079/111] 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 080/111] 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 @@ + + \ No newline at end of file diff --git a/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html b/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html new file mode 100644 index 00000000..327d6460 --- /dev/null +++ b/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html @@ -0,0 +1,97 @@ + + + + + + A draft article without date + + + + + + + +Fork me on GitHub + + +
+ +
+
+ + +
+ + + + + + \ No newline at end of file diff --git a/samples/content/draft_article without_date.rst b/samples/content/draft_article without_date.rst new file mode 100644 index 00000000..5ac62034 --- /dev/null +++ b/samples/content/draft_article without_date.rst @@ -0,0 +1,7 @@ +A draft article without date +############################ + +:status: draft + +This is a draft article, it should live under the /drafts/ folder and not be +listed anywhere else. From 9eb259af82567a568b0c5a57e97859d04c1a8ec8 Mon Sep 17 00:00:00 2001 From: David Zaslavsky Date: Wed, 15 Apr 2020 01:35:04 -0700 Subject: [PATCH 099/111] Wrong path for attached static content urls (#2158) * Document _URL/_SAVE_AS path matching req. Fix #2158 This commit addresses the fact that some URLs (primarily {attach}) are based on the *_SAVE_AS path instead of the *_URL path. It updates the documentation to point out that the paths of corresponding _URL and _SAVE_AS settings should match, and that the OUTPUT directory should correspond to the web server's document root, in order to avoid producing these incorrect URLs. * Clarify {attach} and *_URL / *_SAVE_AS caveat Co-authored-by: Justin Mayer --- docs/content.rst | 4 ++++ docs/settings.rst | 10 +++++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/docs/content.rst b/docs/content.rst index a52425a4..6affecce 100644 --- a/docs/content.rst +++ b/docs/content.rst @@ -370,6 +370,10 @@ of ``{attach}``, and letting the file's location be determined by the project's ``STATIC_SAVE_AS`` and ``STATIC_URL`` settings. (Per-file ``save_as`` and ``url`` overrides can still be set in ``EXTRA_PATH_METADATA``.) +.. note:: + When using ``{attach}``, any parent directory in ``*_URL`` / ``*_SAVE_AS`` + settings should match each other. See also: :ref:`url-settings` + Linking to authors, categories, index and tags ---------------------------------------------- diff --git a/docs/settings.rst b/docs/settings.rst index befb6f05..bb673ec0 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -168,7 +168,8 @@ Basic settings .. data:: OUTPUT_PATH = 'output/' - Where to output the generated files. + Where to output the generated files. This should correspond to your web + server's virtual host root directory. .. data:: PATH @@ -358,6 +359,7 @@ Basic settings The IP to which to bind the HTTP server. +.. _url-settings: URL settings ============ @@ -378,6 +380,12 @@ 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 a ``*_SAVE_AS`` setting contains a parent directory that doesn't match + the parent directory inside the corresponding ``*_URL`` setting, this may + cause Pelican to generate unexpected URLs in a few cases, such as when + using the ``{attach}`` syntax. + 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:: From 7e52b61934b0fd2fa830125bfb1fedbddf08f11d Mon Sep 17 00:00:00 2001 From: Cropse Date: Wed, 15 Apr 2020 16:42:21 +0800 Subject: [PATCH 100/111] Enhance JINJA_FILTERS setting docs (#2126) --- docs/settings.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/settings.rst b/docs/settings.rst index bb673ec0..75bd6827 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -98,7 +98,10 @@ Basic settings should map the filtername to the filter function. Example:: + import sys + sys.path.append('to/your/path') + from custom_filter import urlencode_filter JINJA_FILTERS = {'urlencode': urlencode_filter} See: `Jinja custom filters documentation`_. From 9d10abaed4c3fd208dee98ed431ab6ddfbb0d6fa Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 15 Apr 2020 14:55:41 +0200 Subject: [PATCH 101/111] Fix output directory deletion logic The intention was to prevent accidental source content data loss by skipping output directory deletion if the output directory is a parent of the source content directory. But the previous implementation did so by checking path *strings*, resulting in scenarios where the following settings would erroneously skip deletion of the output directory: PATH = "/repo/docs-src/content" OUTPUT_PATH = "/repo/docs" The output directory should have been deleted but wasn't because the PATH string contains "/repo/docs". This change eschews string comparison and instead compares actual paths to ensure that the output path is not a parent of the source content directory. --- pelican/__init__.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pelican/__init__.py b/pelican/__init__.py index 97135a62..e19644e0 100644 --- a/pelican/__init__.py +++ b/pelican/__init__.py @@ -99,10 +99,11 @@ class Pelican(object): ) for cls in self.get_generator_classes() ] - # erase the directory if it is not the source and if that's - # explicitly asked - if (self.delete_outputdir and not - os.path.realpath(self.path).startswith(self.output_path)): + # Delete the output directory if (1) the appropriate setting is True + # and (2) that directory is not the parent of the source directory + if (self.delete_outputdir + and os.path.commonpath([self.output_path]) != + os.path.commonpath([self.output_path, self.path])): clean_output_dir(self.output_path, self.output_retention) for p in generators: From d536cd223957cc2591cbc0b1307007d07deba50c Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 15 Apr 2020 16:54:17 +0200 Subject: [PATCH 102/111] Put summary in notmyidea "description" HTML metadata --- pelican/themes/notmyidea/templates/article.html | 7 +++++++ pelican/themes/notmyidea/templates/base.html | 2 ++ 2 files changed, 9 insertions(+) diff --git a/pelican/themes/notmyidea/templates/article.html b/pelican/themes/notmyidea/templates/article.html index 98c91bbc..6abcb09d 100644 --- a/pelican/themes/notmyidea/templates/article.html +++ b/pelican/themes/notmyidea/templates/article.html @@ -1,5 +1,12 @@ {% extends "base.html" %} {% block html_lang %}{{ article.lang }}{% endblock %} +{% block head -%} + {{ super() -}} + {% if article.summary %} + + {% endif %} +{% endblock %} + {% block title %}{{ article.title|striptags }}{% endblock %} {% block extra_head %} diff --git a/pelican/themes/notmyidea/templates/base.html b/pelican/themes/notmyidea/templates/base.html index 34ed4e97..6be5f1d8 100644 --- a/pelican/themes/notmyidea/templates/base.html +++ b/pelican/themes/notmyidea/templates/base.html @@ -1,6 +1,7 @@ + {% block head %} {% block title %}{{ SITENAME }}{%endblock%} @@ -12,6 +13,7 @@ {% endif %} {% block extra_head %}{% endblock extra_head %} + {% endblock head %} From 540c06b2b8b678992b22e4df29e5671f93851fda Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 15 Apr 2020 16:58:03 +0200 Subject: [PATCH 103/111] Update test output with "description" metadata tag --- pelican/tests/output/basic/a-markdown-powered-article.html | 1 + pelican/tests/output/basic/article-1.html | 1 + pelican/tests/output/basic/article-2.html | 1 + pelican/tests/output/basic/article-3.html | 1 + .../tests/output/basic/drafts/a-draft-article-without-date.html | 1 + pelican/tests/output/basic/drafts/a-draft-article.html | 1 + pelican/tests/output/basic/filename_metadata-example.html | 1 + pelican/tests/output/basic/oh-yeah-fr.html | 1 + pelican/tests/output/basic/oh-yeah.html | 1 + pelican/tests/output/basic/second-article-fr.html | 1 + pelican/tests/output/basic/second-article.html | 1 + pelican/tests/output/basic/tag/baz.html | 1 + pelican/tests/output/basic/this-is-a-super-article.html | 1 + pelican/tests/output/basic/unbelievable.html | 1 + pelican/tests/output/custom/a-markdown-powered-article.html | 1 + pelican/tests/output/custom/article-1.html | 1 + pelican/tests/output/custom/article-2.html | 1 + pelican/tests/output/custom/article-3.html | 1 + .../tests/output/custom/drafts/a-draft-article-without-date.html | 1 + pelican/tests/output/custom/drafts/a-draft-article.html | 1 + pelican/tests/output/custom/filename_metadata-example.html | 1 + pelican/tests/output/custom/oh-yeah-fr.html | 1 + pelican/tests/output/custom/oh-yeah.html | 1 + pelican/tests/output/custom/second-article-fr.html | 1 + pelican/tests/output/custom/second-article.html | 1 + pelican/tests/output/custom/tag/baz.html | 1 + pelican/tests/output/custom/this-is-a-super-article.html | 1 + pelican/tests/output/custom/unbelievable.html | 1 + .../custom_locale/drafts/a-draft-article-without-date.html | 1 + pelican/tests/output/custom_locale/drafts/a-draft-article.html | 1 + pelican/tests/output/custom_locale/oh-yeah-fr.html | 1 + .../posts/2010/décembre/02/this-is-a-super-article/index.html | 1 + .../custom_locale/posts/2010/octobre/15/unbelievable/index.html | 1 + .../custom_locale/posts/2010/octobre/20/oh-yeah/index.html | 1 + .../posts/2011/avril/20/a-markdown-powered-article/index.html | 1 + .../custom_locale/posts/2011/février/17/article-1/index.html | 1 + .../custom_locale/posts/2011/février/17/article-2/index.html | 1 + .../custom_locale/posts/2011/février/17/article-3/index.html | 1 + .../posts/2012/février/29/second-article/index.html | 1 + .../posts/2012/novembre/30/filename_metadata-example/index.html | 1 + pelican/tests/output/custom_locale/second-article-fr.html | 1 + pelican/tests/output/custom_locale/tag/baz.html | 1 + 42 files changed, 42 insertions(+) diff --git a/pelican/tests/output/basic/a-markdown-powered-article.html b/pelican/tests/output/basic/a-markdown-powered-article.html index 1e080c8f..894fb8c9 100644 --- a/pelican/tests/output/basic/a-markdown-powered-article.html +++ b/pelican/tests/output/basic/a-markdown-powered-article.html @@ -6,6 +6,7 @@ A markdown powered article + diff --git a/pelican/tests/output/basic/article-1.html b/pelican/tests/output/basic/article-1.html index 63cc0170..5e1196b7 100644 --- a/pelican/tests/output/basic/article-1.html +++ b/pelican/tests/output/basic/article-1.html @@ -6,6 +6,7 @@ Article 1 + diff --git a/pelican/tests/output/basic/article-2.html b/pelican/tests/output/basic/article-2.html index cde9dce1..7dab6907 100644 --- a/pelican/tests/output/basic/article-2.html +++ b/pelican/tests/output/basic/article-2.html @@ -6,6 +6,7 @@ Article 2 + diff --git a/pelican/tests/output/basic/article-3.html b/pelican/tests/output/basic/article-3.html index 4887ecc8..ba934652 100644 --- a/pelican/tests/output/basic/article-3.html +++ b/pelican/tests/output/basic/article-3.html @@ -6,6 +6,7 @@ Article 3 + diff --git a/pelican/tests/output/basic/drafts/a-draft-article-without-date.html b/pelican/tests/output/basic/drafts/a-draft-article-without-date.html index 5187afab..039f2187 100644 --- a/pelican/tests/output/basic/drafts/a-draft-article-without-date.html +++ b/pelican/tests/output/basic/drafts/a-draft-article-without-date.html @@ -6,6 +6,7 @@ A draft article without date + diff --git a/pelican/tests/output/basic/drafts/a-draft-article.html b/pelican/tests/output/basic/drafts/a-draft-article.html index 3e6ed5f0..068b414a 100644 --- a/pelican/tests/output/basic/drafts/a-draft-article.html +++ b/pelican/tests/output/basic/drafts/a-draft-article.html @@ -6,6 +6,7 @@ A draft article + diff --git a/pelican/tests/output/basic/filename_metadata-example.html b/pelican/tests/output/basic/filename_metadata-example.html index 29aabac3..6a6ee389 100644 --- a/pelican/tests/output/basic/filename_metadata-example.html +++ b/pelican/tests/output/basic/filename_metadata-example.html @@ -6,6 +6,7 @@ FILENAME_METADATA example + diff --git a/pelican/tests/output/basic/oh-yeah-fr.html b/pelican/tests/output/basic/oh-yeah-fr.html index e605ac2e..58b933aa 100644 --- a/pelican/tests/output/basic/oh-yeah-fr.html +++ b/pelican/tests/output/basic/oh-yeah-fr.html @@ -8,6 +8,7 @@ + diff --git a/pelican/tests/output/basic/oh-yeah.html b/pelican/tests/output/basic/oh-yeah.html index d01a631e..1b8077f8 100644 --- a/pelican/tests/output/basic/oh-yeah.html +++ b/pelican/tests/output/basic/oh-yeah.html @@ -8,6 +8,7 @@ + diff --git a/pelican/tests/output/basic/second-article-fr.html b/pelican/tests/output/basic/second-article-fr.html index f3c39ca4..87b95cc4 100644 --- a/pelican/tests/output/basic/second-article-fr.html +++ b/pelican/tests/output/basic/second-article-fr.html @@ -8,6 +8,7 @@ + diff --git a/pelican/tests/output/basic/second-article.html b/pelican/tests/output/basic/second-article.html index a7ea7780..3e0c5296 100644 --- a/pelican/tests/output/basic/second-article.html +++ b/pelican/tests/output/basic/second-article.html @@ -8,6 +8,7 @@ + diff --git a/pelican/tests/output/basic/tag/baz.html b/pelican/tests/output/basic/tag/baz.html index 259b17fe..c891121e 100644 --- a/pelican/tests/output/basic/tag/baz.html +++ b/pelican/tests/output/basic/tag/baz.html @@ -6,6 +6,7 @@ The baz tag + 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 220817d3..bd1472e4 100644 --- a/pelican/tests/output/basic/this-is-a-super-article.html +++ b/pelican/tests/output/basic/this-is-a-super-article.html @@ -6,6 +6,7 @@ This is a super article ! + diff --git a/pelican/tests/output/basic/unbelievable.html b/pelican/tests/output/basic/unbelievable.html index 8cdc892c..e0836d70 100644 --- a/pelican/tests/output/basic/unbelievable.html +++ b/pelican/tests/output/basic/unbelievable.html @@ -6,6 +6,7 @@ Unbelievable ! + diff --git a/pelican/tests/output/custom/a-markdown-powered-article.html b/pelican/tests/output/custom/a-markdown-powered-article.html index e797c35a..00aa18e8 100644 --- a/pelican/tests/output/custom/a-markdown-powered-article.html +++ b/pelican/tests/output/custom/a-markdown-powered-article.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/article-1.html b/pelican/tests/output/custom/article-1.html index a2954757..cc15ba5c 100644 --- a/pelican/tests/output/custom/article-1.html +++ b/pelican/tests/output/custom/article-1.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/article-2.html b/pelican/tests/output/custom/article-2.html index 5a964cdb..cc331a4d 100644 --- a/pelican/tests/output/custom/article-2.html +++ b/pelican/tests/output/custom/article-2.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/article-3.html b/pelican/tests/output/custom/article-3.html index ef656391..8b180180 100644 --- a/pelican/tests/output/custom/article-3.html +++ b/pelican/tests/output/custom/article-3.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/drafts/a-draft-article-without-date.html b/pelican/tests/output/custom/drafts/a-draft-article-without-date.html index 3c61b23c..03aecc56 100644 --- a/pelican/tests/output/custom/drafts/a-draft-article-without-date.html +++ b/pelican/tests/output/custom/drafts/a-draft-article-without-date.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/drafts/a-draft-article.html b/pelican/tests/output/custom/drafts/a-draft-article.html index 3316df7c..87be8bec 100644 --- a/pelican/tests/output/custom/drafts/a-draft-article.html +++ b/pelican/tests/output/custom/drafts/a-draft-article.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/filename_metadata-example.html b/pelican/tests/output/custom/filename_metadata-example.html index 765b06c1..2fcbe562 100644 --- a/pelican/tests/output/custom/filename_metadata-example.html +++ b/pelican/tests/output/custom/filename_metadata-example.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/oh-yeah-fr.html b/pelican/tests/output/custom/oh-yeah-fr.html index b5504212..bb7eb44e 100644 --- a/pelican/tests/output/custom/oh-yeah-fr.html +++ b/pelican/tests/output/custom/oh-yeah-fr.html @@ -9,6 +9,7 @@ + diff --git a/pelican/tests/output/custom/oh-yeah.html b/pelican/tests/output/custom/oh-yeah.html index dff78a30..f7afb399 100644 --- a/pelican/tests/output/custom/oh-yeah.html +++ b/pelican/tests/output/custom/oh-yeah.html @@ -9,6 +9,7 @@ + diff --git a/pelican/tests/output/custom/second-article-fr.html b/pelican/tests/output/custom/second-article-fr.html index 4c6894d3..8e360e9c 100644 --- a/pelican/tests/output/custom/second-article-fr.html +++ b/pelican/tests/output/custom/second-article-fr.html @@ -9,6 +9,7 @@ + diff --git a/pelican/tests/output/custom/second-article.html b/pelican/tests/output/custom/second-article.html index 3004b068..5001f0d0 100644 --- a/pelican/tests/output/custom/second-article.html +++ b/pelican/tests/output/custom/second-article.html @@ -9,6 +9,7 @@ + diff --git a/pelican/tests/output/custom/tag/baz.html b/pelican/tests/output/custom/tag/baz.html index 3bcda170..ef53c34c 100644 --- a/pelican/tests/output/custom/tag/baz.html +++ b/pelican/tests/output/custom/tag/baz.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/this-is-a-super-article.html b/pelican/tests/output/custom/this-is-a-super-article.html index da602d45..55053cb2 100644 --- a/pelican/tests/output/custom/this-is-a-super-article.html +++ b/pelican/tests/output/custom/this-is-a-super-article.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom/unbelievable.html b/pelican/tests/output/custom/unbelievable.html index 024d428f..0132162c 100644 --- a/pelican/tests/output/custom/unbelievable.html +++ b/pelican/tests/output/custom/unbelievable.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html b/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html index 327d6460..c289ec72 100644 --- a/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html +++ b/pelican/tests/output/custom_locale/drafts/a-draft-article-without-date.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/drafts/a-draft-article.html b/pelican/tests/output/custom_locale/drafts/a-draft-article.html index 1a7e9427..a166efdf 100644 --- a/pelican/tests/output/custom_locale/drafts/a-draft-article.html +++ b/pelican/tests/output/custom_locale/drafts/a-draft-article.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/oh-yeah-fr.html b/pelican/tests/output/custom_locale/oh-yeah-fr.html index 01188766..58859a3a 100644 --- a/pelican/tests/output/custom_locale/oh-yeah-fr.html +++ b/pelican/tests/output/custom_locale/oh-yeah-fr.html @@ -9,6 +9,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html b/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html index 9a376c44..dee44f28 100644 --- a/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html +++ b/pelican/tests/output/custom_locale/posts/2010/décembre/02/this-is-a-super-article/index.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html b/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html index c31cdfab..e42c70f6 100644 --- a/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html +++ b/pelican/tests/output/custom_locale/posts/2010/octobre/15/unbelievable/index.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html b/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html index fdc8efde..1bf74b57 100644 --- a/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html +++ b/pelican/tests/output/custom_locale/posts/2010/octobre/20/oh-yeah/index.html @@ -9,6 +9,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html b/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html index db3d04d2..0f35847a 100644 --- a/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html +++ b/pelican/tests/output/custom_locale/posts/2011/avril/20/a-markdown-powered-article/index.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html index 1c153b0f..05418036 100644 --- a/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-1/index.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html index 9ee6269f..8cb67749 100644 --- a/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-2/index.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html b/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html index e1374f0c..62423814 100644 --- a/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html +++ b/pelican/tests/output/custom_locale/posts/2011/février/17/article-3/index.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html b/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html index ba8b3ee0..615a7f30 100644 --- a/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html +++ b/pelican/tests/output/custom_locale/posts/2012/février/29/second-article/index.html @@ -9,6 +9,7 @@ + diff --git a/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html b/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html index 7f15782e..2213d174 100644 --- a/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html +++ b/pelican/tests/output/custom_locale/posts/2012/novembre/30/filename_metadata-example/index.html @@ -7,6 +7,7 @@ + diff --git a/pelican/tests/output/custom_locale/second-article-fr.html b/pelican/tests/output/custom_locale/second-article-fr.html index b0c92d9f..3c21ef75 100644 --- a/pelican/tests/output/custom_locale/second-article-fr.html +++ b/pelican/tests/output/custom_locale/second-article-fr.html @@ -9,6 +9,7 @@ + diff --git a/pelican/tests/output/custom_locale/tag/baz.html b/pelican/tests/output/custom_locale/tag/baz.html index 8896bad3..9554bdd6 100644 --- a/pelican/tests/output/custom_locale/tag/baz.html +++ b/pelican/tests/output/custom_locale/tag/baz.html @@ -7,6 +7,7 @@ + From 8ba00dd9f12f59f67be88175f25b0109f2039a61 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Wed, 15 Apr 2020 20:42:21 +0200 Subject: [PATCH 104/111] Preserve category case in importer Adds a `preserve_case` parameter to the `slugify()` function and uses it to preserve capital letters in category names when using the Pelican importer. --- pelican/tests/test_importer.py | 6 +++--- pelican/tests/test_utils.py | 6 ++++++ pelican/tools/pelican_import.py | 6 ++++-- pelican/utils.py | 5 +++-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/pelican/tests/test_importer.py b/pelican/tests/test_importer.py index 1a6ce404..f7346b9a 100644 --- a/pelican/tests/test_importer.py +++ b/pelican/tests/test_importer.py @@ -1,4 +1,4 @@ -# -*- coding: utf-8 -*- +# -*- coding: utf-8 -*- import locale import os @@ -138,7 +138,7 @@ class TestWordpressXmlImporter(unittest.TestCase): index = 0 for post in test_posts: name = post[2] - category = slugify(post[5][0], regex_subs=subs) + category = slugify(post[5][0], regex_subs=subs, preserve_case=True) name += '.md' filename = os.path.join(category, name) out_name = fnames[index] @@ -215,7 +215,7 @@ class TestWordpressXmlImporter(unittest.TestCase): for post in test_posts: name = post[2] kind = post[8] - category = slugify(post[5][0], regex_subs=subs) + category = slugify(post[5][0], regex_subs=subs, preserve_case=True) name += '.md' filename = os.path.join(kind, category, name) out_name = fnames[index] diff --git a/pelican/tests/test_utils.py b/pelican/tests/test_utils.py index ad90a78e..3a8c4bd8 100644 --- a/pelican/tests/test_utils.py +++ b/pelican/tests/test_utils.py @@ -122,6 +122,12 @@ class TestUtils(LoggedTestCase): for value, expected in samples: self.assertEqual(utils.slugify(value, regex_subs=subs), expected) + self.assertEqual(utils.slugify('Cat', regex_subs=subs), 'cat') + self.assertEqual( + utils.slugify('Cat', regex_subs=subs, preserve_case=False), 'cat') + self.assertEqual( + utils.slugify('Cat', regex_subs=subs, preserve_case=True), 'Cat') + def test_slugify_substitute(self): samples = (('C++ is based on C', 'cpp-is-based-on-c'), diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 335f1953..bb3b8fc3 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -634,7 +634,8 @@ def get_out_filename(output_path, filename, ext, kind, typename = '' kind = 'article' if dircat and (len(categories) > 0): - catname = slugify(categories[0], regex_subs=slug_subs) + catname = slugify( + categories[0], regex_subs=slug_subs, preserve_case=True) else: catname = '' out_filename = os.path.join(output_path, typename, @@ -643,7 +644,8 @@ def get_out_filename(output_path, filename, ext, kind, os.makedirs(os.path.join(output_path, typename, catname)) # option to put files in directories with categories names elif dircat and (len(categories) > 0): - catname = slugify(categories[0], regex_subs=slug_subs) + catname = slugify( + categories[0], regex_subs=slug_subs, preserve_case=True) out_filename = os.path.join(output_path, catname, filename + ext) if not os.path.isdir(os.path.join(output_path, catname)): os.mkdir(os.path.join(output_path, catname)) diff --git a/pelican/utils.py b/pelican/utils.py index 4b5b7134..b1536de8 100644 --- a/pelican/utils.py +++ b/pelican/utils.py @@ -222,7 +222,7 @@ def pelican_open(filename, mode='r', strip_crs=(sys.platform == 'win32')): yield content -def slugify(value, regex_subs=()): +def slugify(value, regex_subs=(), preserve_case=False): """ Normalizes string, converts to lowercase, removes non-alpha characters, and converts spaces to hyphens. @@ -245,7 +245,8 @@ def slugify(value, regex_subs=()): value = re.sub(src, dst, value, flags=re.IGNORECASE) # convert to lowercase - value = value.lower() + if not preserve_case: + value = value.lower() # we want only ASCII chars value = value.encode('ascii', 'ignore').strip() From 5365a1cdb3ae57e92b89e7c2d8c0915bbeaf05c4 Mon Sep 17 00:00:00 2001 From: Tim Janik Date: Wed, 18 Apr 2018 23:10:34 +0200 Subject: [PATCH 105/111] PELICAN: pelican_import.py: add support for pelican-import -m asciidoc Signed-off-by: Tim Janik --- pelican/tools/pelican_import.py | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index bb3b8fc3..77226cd3 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -571,6 +571,29 @@ def build_header(title, date, author, categories, tags, slug, header += '\n' return header +def build_asciidoc_header(title, date, author, categories, tags, slug, + status=None, attachments=None): + """Build a header from a list of fields""" + + from docutils.utils import column_width + + header = '= %s\n' % title + if author: + header += '%s\n' % author + if date: + header += '%s\n' % date + if categories: + header += ':category: %s\n' % ', '.join(categories) + if tags: + header += ':tags: %s\n' % ', '.join(tags) + if slug: + header += ':slug: %s\n' % slug + if status: + header += ':status: %s\n' % status + if attachments: + header += ':attachments: %s\n' % ', '.join(attachments) + header += '\n' + return header def build_markdown_header(title, date, author, categories, tags, slug, status=None, attachments=None): @@ -595,7 +618,9 @@ def build_markdown_header(title, date, author, categories, tags, def get_ext(out_markup, in_markup='html'): - if in_markup == 'markdown' or out_markup == 'markdown': + if out_markup == 'asciidoc': + ext = '.adoc' + elif in_markup == 'markdown' or out_markup == 'markdown': ext = '.md' else: ext = '.rst' @@ -775,7 +800,10 @@ def fields2pelican( links = None ext = get_ext(out_markup, in_markup) - if ext == '.md': + if ext == '.adoc': + header = build_asciidoc_header(title, date, author, categories, + tags, slug, status, attached_files) + elif ext == '.md': header = build_markdown_header( title, date, author, categories, tags, slug, status, links.values() if links else None) From 86ff02541f41702304297ff93f4e6bc007604743 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Apr 2020 08:01:10 +0200 Subject: [PATCH 106/111] Fix building asciidoc headers in importer & add docs --- docs/importer.rst | 6 +++--- pelican/tools/pelican_import.py | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/importer.rst b/docs/importer.rst index 88588d17..b8313f49 100644 --- a/docs/importer.rst +++ b/docs/importer.rst @@ -74,8 +74,8 @@ Optional arguments -o OUTPUT, --output OUTPUT Output path (default: content) -m MARKUP, --markup MARKUP - Output markup format (supports rst & markdown) - (default: rst) + Output markup format: ``rst``, ``markdown``, or ``asciidoc`` + (default: ``rst``) --dir-cat Put files in directories with categories name (default: False) --dir-page Put files recognised as pages in "pages/" sub- @@ -140,4 +140,4 @@ To test the module, one can use sample files: - 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: https://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 diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index 77226cd3..f9a53dbd 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -571,12 +571,11 @@ def build_header(title, date, author, categories, tags, slug, header += '\n' return header + def build_asciidoc_header(title, date, author, categories, tags, slug, status=None, attachments=None): """Build a header from a list of fields""" - from docutils.utils import column_width - header = '= %s\n' % title if author: header += '%s\n' % author @@ -802,7 +801,7 @@ def fields2pelican( ext = get_ext(out_markup, in_markup) if ext == '.adoc': header = build_asciidoc_header(title, date, author, categories, - tags, slug, status, attached_files) + tags, slug, status, attachments) elif ext == '.md': header = build_markdown_header( title, date, author, categories, tags, slug, From fc031174bb1123cf177ff2fbf9b287902b0fc7ac Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Apr 2020 08:10:30 +0200 Subject: [PATCH 107/111] Flake8 fix --- pelican/tools/pelican_import.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index f9a53dbd..b8a8a5c6 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -594,6 +594,7 @@ def build_asciidoc_header(title, date, author, categories, tags, slug, header += '\n' return header + def build_markdown_header(title, date, author, categories, tags, slug, status=None, attachments=None): """Build a header from a list of fields""" From e18c9d2c60195b25049ad5660e57253410096dc2 Mon Sep 17 00:00:00 2001 From: Justin Mayer Date: Thu, 16 Apr 2020 08:26:09 +0200 Subject: [PATCH 108/111] Remove Piwik from theme and settings docs Name has been changed, and rather than fix it, it makes more sense to deprecate analytics in Pelican core and relegate them to plugins/themes. --- docs/settings.rst | 14 -------------- .../themes/notmyidea/templates/analytics.html | 19 ------------------- 2 files changed, 33 deletions(-) diff --git a/docs/settings.rst b/docs/settings.rst index 75bd6827..af8d627e 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -1219,20 +1219,6 @@ Feel free to use them in your themes as well. A list of tuples (Title, URL) for additional menu items to appear at the beginning of the main menu. -.. data:: PIWIK_URL - - URL to your Piwik server - without 'http://' at the beginning. - -.. data:: PIWIK_SSL_URL - - If the SSL-URL differs from the normal Piwik-URL you have to include this - setting too. (optional) - -.. data:: PIWIK_SITE_ID - - ID for the monitored website. You can find the ID in the Piwik admin - interface > Settings > Websites. - .. data:: LINKS A list of tuples (Title, URL) for links to appear on the header. diff --git a/pelican/themes/notmyidea/templates/analytics.html b/pelican/themes/notmyidea/templates/analytics.html index a966c4c2..071c77f7 100644 --- a/pelican/themes/notmyidea/templates/analytics.html +++ b/pelican/themes/notmyidea/templates/analytics.html @@ -24,22 +24,3 @@ })(); {% endif %} -{% if PIWIK_URL and PIWIK_SITE_ID %} - -{% endif %} From d13108b03a0d403f641fbb6f803499e2c7ffa147 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Thu, 16 Apr 2020 11:11:24 +0300 Subject: [PATCH 109/111] Reset global state set by tests in test_pelican Calling read_settings to clear the options put into pelican.settings.PYGMENTS_RST_OPTIONS in tearDown so that tests that are run after are not affected --- pelican/tests/test_pelican.py | 1 + 1 file changed, 1 insertion(+) diff --git a/pelican/tests/test_pelican.py b/pelican/tests/test_pelican.py index da23cb0a..88122846 100644 --- a/pelican/tests/test_pelican.py +++ b/pelican/tests/test_pelican.py @@ -50,6 +50,7 @@ class TestPelican(LoggedTestCase): locale.setlocale(locale.LC_ALL, str('C')) def tearDown(self): + read_settings() # cleanup PYGMENTS_RST_OPTIONS rmtree(self.temp_path) rmtree(self.temp_cache) locale.setlocale(locale.LC_ALL, self.old_locale) From f610801ee8c67df5ed7e3223fe54a2578347b88e Mon Sep 17 00:00:00 2001 From: fancsali Date: Thu, 16 Apr 2020 12:32:19 +0100 Subject: [PATCH 110/111] Add Typogrify/SmartyPants dashes config parameter (#2615) --- docs/settings.rst | 11 +++ pelican/readers.py | 8 +++ pelican/settings.py | 1 + .../content/article_with_typogrify_dashes.md | 3 + .../content/article_with_typogrify_dashes.rst | 4 ++ pelican/tests/test_generators.py | 6 ++ pelican/tests/test_readers.py | 68 +++++++++++++++++++ 7 files changed, 101 insertions(+) create mode 100644 pelican/tests/content/article_with_typogrify_dashes.md create mode 100644 pelican/tests/content/article_with_typogrify_dashes.rst diff --git a/docs/settings.rst b/docs/settings.rst index af8d627e..48344076 100644 --- a/docs/settings.rst +++ b/docs/settings.rst @@ -279,6 +279,17 @@ Basic settings ``pre`` and ``code`` tags. This requires that Typogrify version 2.0.4 or later is installed +.. data:: TYPOGRIFY_DASHES = 'default' + + This setting controls how Typogrify sets up the Smartypants filter to + interpret multiple dash/hyphen/minus characters. A single ASCII dash + character (``-``) is always rendered as a hyphen. The ``default`` setting + does not handle en-dashes and converts double-hyphens into em-dashes. The + ``oldschool`` setting renders both en-dashes and em-dashes when it sees two + (``--``) and three (``---``) hyphen characters, respectively. The + ``oldschool_inverted`` setting turns two hyphens into an em-dash and three + hyphens into an en-dash. + .. data:: SUMMARY_MAX_LENGTH = 50 When creating a short summary of an article, this will be the default length diff --git a/pelican/readers.py b/pelican/readers.py index 6d9923f2..fe53558d 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -585,6 +585,14 @@ class Readers(FileStampDataCacher): from typogrify.filters import typogrify import smartypants + typogrify_dashes = self.settings['TYPOGRIFY_DASHES'] + if typogrify_dashes == 'oldschool': + smartypants.Attr.default = smartypants.Attr.set2 + elif typogrify_dashes == 'oldschool_inverted': + smartypants.Attr.default = smartypants.Attr.set3 + else: + smartypants.Attr.default = smartypants.Attr.set1 + # Tell `smartypants` to also replace " HTML entities with # smart quotes. This is necessary because Docutils has already # replaced double quotes with said entities by the time we run diff --git a/pelican/settings.py b/pelican/settings.py index c3b29ca5..77aea059 100644 --- a/pelican/settings.py +++ b/pelican/settings.py @@ -138,6 +138,7 @@ DEFAULT_CONFIG = { 'ARTICLE_PERMALINK_STRUCTURE': '', 'TYPOGRIFY': False, 'TYPOGRIFY_IGNORE_TAGS': [], + 'TYPOGRIFY_DASHES': 'default', 'SUMMARY_END_MARKER': '…', 'SUMMARY_MAX_LENGTH': 50, 'PLUGIN_PATHS': [], diff --git a/pelican/tests/content/article_with_typogrify_dashes.md b/pelican/tests/content/article_with_typogrify_dashes.md new file mode 100644 index 00000000..2914b2df --- /dev/null +++ b/pelican/tests/content/article_with_typogrify_dashes.md @@ -0,0 +1,3 @@ +Title: One -, two --, three --- dashes! + +One: -; Two: --; Three: --- diff --git a/pelican/tests/content/article_with_typogrify_dashes.rst b/pelican/tests/content/article_with_typogrify_dashes.rst new file mode 100644 index 00000000..90064c5d --- /dev/null +++ b/pelican/tests/content/article_with_typogrify_dashes.rst @@ -0,0 +1,4 @@ +One -, two --, three --- dashes! +################################ + +One: -; Two: --; Three: --- diff --git a/pelican/tests/test_generators.py b/pelican/tests/test_generators.py index fdc1b937..d559cec9 100644 --- a/pelican/tests/test_generators.py +++ b/pelican/tests/test_generators.py @@ -248,6 +248,10 @@ class TestArticlesGenerator(unittest.TestCase): ['Article with template', 'published', 'Default', 'custom'], ['Metadata tags as list!', 'published', 'Default', 'article'], ['Rst with filename metadata', 'published', 'yeah', 'article'], + ['One -, two --, three --- dashes!', 'published', 'Default', + 'article'], + ['One -, two --, three --- dashes!', 'published', 'Default', + 'article'], ['Test Markdown extensions', 'published', 'Default', 'article'], ['Test markdown File', 'published', 'test', 'article'], ['Test md File', 'published', 'test', 'article'], @@ -562,6 +566,8 @@ class TestArticlesGenerator(unittest.TestCase): 'Article with markdown containing footnotes', 'Article with template', 'Metadata tags as list!', + 'One -, two --, three --- dashes!', + 'One -, two --, three --- dashes!', 'Rst with filename metadata', 'Test Markdown extensions', 'Test markdown File', diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index 70e6da77..07590012 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -443,6 +443,40 @@ class RstReaderTest(ReaderTest): with self.assertRaisesRegex(Exception, "underline too short"): self.read_file(path='../parse_error/parse_error.rst') + def test_typogrify_dashes_config(self): + # Test default config + page = self.read_file( + path='article_with_typogrify_dashes.rst', + TYPOGRIFY=True, + TYPOGRIFY_DASHES='default') + expected = "

One: -; Two: —; Three: —-

\n" + expected_title = "One -, two —, three —- dashes!" + + self.assertEqual(page.content, expected) + self.assertEqual(page.title, expected_title) + + # Test 'oldschool' variant + page = self.read_file( + path='article_with_typogrify_dashes.rst', + TYPOGRIFY=True, + TYPOGRIFY_DASHES='oldschool') + expected = "

One: -; Two: –; Three: —

\n" + expected_title = "One -, two –, three — dashes!" + + self.assertEqual(page.content, expected) + self.assertEqual(page.title, expected_title) + + # Test 'oldschool_inverted' variant + page = self.read_file( + path='article_with_typogrify_dashes.rst', + TYPOGRIFY=True, + TYPOGRIFY_DASHES='oldschool_inverted') + expected = "

One: -; Two: —; Three: –

\n" + expected_title = "One -, two —, three – dashes!" + + self.assertEqual(page.content, expected) + self.assertEqual(page.title, expected_title) + @unittest.skipUnless(readers.Markdown, "markdown isn't installed") class MdReaderTest(ReaderTest): @@ -674,6 +708,40 @@ class MdReaderTest(ReaderTest): self.assertEqual(metadata, {}) self.assertEqual(content, '') + def test_typogrify_dashes_config(self): + # Test default config + page = self.read_file( + path='article_with_typogrify_dashes.md', + TYPOGRIFY=True, + TYPOGRIFY_DASHES='default') + expected = "

One: -; Two: —; Three: —-

" + expected_title = "One -, two —, three —- dashes!" + + self.assertEqual(page.content, expected) + self.assertEqual(page.title, expected_title) + + # Test 'oldschool' variant + page = self.read_file( + path='article_with_typogrify_dashes.md', + TYPOGRIFY=True, + TYPOGRIFY_DASHES='oldschool') + expected = "

One: -; Two: –; Three: —

" + expected_title = "One -, two –, three — dashes!" + + self.assertEqual(page.content, expected) + self.assertEqual(page.title, expected_title) + + # Test 'oldschool_inverted' variant + page = self.read_file( + path='article_with_typogrify_dashes.md', + TYPOGRIFY=True, + TYPOGRIFY_DASHES='oldschool_inverted') + expected = "

One: -; Two: —; Three: –

" + expected_title = "One -, two —, three – dashes!" + + self.assertEqual(page.content, expected) + self.assertEqual(page.title, expected_title) + class HTMLReaderTest(ReaderTest): def test_article_with_comments(self): From 46e1ec4f99be225d3f6f487de02832b97a26bc23 Mon Sep 17 00:00:00 2001 From: Deniz Turgut Date: Fri, 17 Apr 2020 20:08:41 +0300 Subject: [PATCH 111/111] Fix legacy plugin loading --- pelican/plugins/_utils.py | 18 +++++++++++++++++- .../normal_plugin/normal_plugin/__init__.py | 2 ++ .../normal_plugin/normal_plugin/submodule.py | 2 ++ 3 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 pelican/tests/dummy_plugins/normal_plugin/normal_plugin/submodule.py diff --git a/pelican/plugins/_utils.py b/pelican/plugins/_utils.py index a3c9ee77..78c19e54 100644 --- a/pelican/plugins/_utils.py +++ b/pelican/plugins/_utils.py @@ -3,6 +3,7 @@ import importlib.machinery import importlib.util import logging import pkgutil +import sys logger = logging.getLogger(__name__) @@ -47,8 +48,23 @@ def load_legacy_plugin(plugin, plugin_paths): if spec is None: raise ImportError('Cannot import plugin `{}`'.format(plugin)) else: + # create module object from spec mod = importlib.util.module_from_spec(spec) - spec.loader.exec_module(mod) + # place it into sys.modules cache + # necessary if module imports itself at some point (e.g. packages) + sys.modules[spec.name] = mod + try: + # try to execute it inside module object + spec.loader.exec_module(mod) + except Exception: # problem with import + try: + # remove module from sys.modules since it can't be loaded + del sys.modules[spec.name] + except KeyError: + pass + raise + + # if all went well, we have the plugin module return mod diff --git a/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/__init__.py b/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/__init__.py index 15896087..5838a835 100644 --- a/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/__init__.py +++ b/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/__init__.py @@ -1,3 +1,5 @@ +from .submodule import noop # noqa: F401 + NAME = 'normal plugin' diff --git a/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/submodule.py b/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/submodule.py new file mode 100644 index 00000000..ba9c8f94 --- /dev/null +++ b/pelican/tests/dummy_plugins/normal_plugin/normal_plugin/submodule.py @@ -0,0 +1,2 @@ +def noop(): + pass