1
0
Fork 0
forked from github/pelican
Commit graph

213 commits

Author SHA1 Message Date
GiovanH
4201256a5b
Add disabled status for #3304 (#3305) 2024-09-12 13:28:51 +02:00
Justin Mayer
6a50191728 Tweak Markdown-not-installed console warnings
Adding single-quotation marks should cause 'markdown' to be highlighted
in green, presumably via Rich.
2024-06-25 10:49:07 +02:00
boxydog
f19de98b9e Log warnings about files that would have been processed by disabled readers 2024-06-17 09:30:55 -05:00
boxydog
7577dd7603 More ruff fixes in files: stop ignoring C408, UP007, PLR5501, B006 2024-05-30 13:21:12 -05:00
boxydog
6d8597addb The ruff and ruff-format fixes 2024-05-30 09:08:16 -05:00
Justin Mayer
ecd598f293 Update code base for Python 3.8 and above
Result of: pipx run pyupgrade --py38-plus pelican/**/*.py
2023-11-12 13:53:02 +01:00
Chris Rose
cabdb26cee Apply code style to project via: ruff format . 2023-10-29 22:18:29 +01:00
Deniz Turgut
8eb4be521f
use docutils.Node.findall instead of traverse
docutils.Node.traverse is being deprecated as of docutils==0.18.1
2021-11-25 23:57:09 +03:00
Jonas Borges
8849721913
Ensure _DISCARDED is not being cached. Fix #2825 (#2926)
Filtration is now being applied before caching the metadata, solving the issue where _DISCARD objects from previous runs were being retrieved from cache.
2021-10-06 10:19:17 +02:00
John T. Wodder II
18b626aa8b Lowercase metadata field name when comparing with FORMATTED_FIELDS in rST reader 2020-07-30 14:59:53 -04:00
Deniz Turgut
2e482b207b
Fix Windows tests
* Unskip passable tests
* Fix broken tests
2020-05-09 16:17:14 +03:00
(GalaxyMaster)
e6df353302
Set "modified:" from "date:" when the latter was set from the filesystem (#2748)
Sets the `modified:` metadata from `date:` if the user asked us
to use the filesystem for determining timestamps. Fixes #2497

* Added tests (ab)using the HTML reader a bit

There seems to be no way to test this generically since we need
to produce a valid document with meta information to be able to
compare, hence I used the lightest reader out there to do the
parsing of the samples.

* Fixed tests for generators since there were 4 more articles
introduced to the test content directory.
2020-05-03 17:45:25 +02:00
Justin Mayer
d43b786b30 Modernize code base to Python 3+ syntax
Replaces syntax that was relevant in earlier Python versions but that
now has modernized equivalents.
2020-04-27 09:45:31 +02:00
fancsali
f610801ee8
Add Typogrify/SmartyPants dashes config parameter (#2615) 2020-04-16 13:32:19 +02:00
Justin Mayer
e618becfc0 Skip MD metadata parsing in latest Python-Markdown
The syntax for unloading Python-Markdown extensions has changed to a
"deregister" method on Registry objects.
2020-04-12 11:40:58 +02:00
Annika Backstrom
5d6513c36c Skip Markdown metadata parsing within metadata 2020-04-12 11:40:43 +02:00
Deniz Turgut
58edad6897 remove pelican.signals in favor of pelican.plugins.signals 2019-12-01 18:14:13 +03:00
Deniz Turgut
16968834ce Convert super() calls to py3 style 2019-11-26 06:17:04 +09:00
Deniz Turgut
3cc430b418 Update docutils and remove docutils workaround 2019-11-26 06:17:04 +09:00
Deniz Turgut
49bc6ed47f Further remove python2-isms 2019-11-26 06:17:04 +09:00
Kevin Yap
1e0e541b57 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.
2019-11-26 06:16:41 +09:00
Stuart Axon
eaccca52dd Support inline SVGs (don't break on title in inline SVG). 2019-10-15 22:41:44 +01:00
Andrew Vant
ce9f3d55a3 Allow directories in EXTRA_PATH_METADATA
Metadata applied to a directory will apply to all files under
it. In case of conflicts, child paths beat parent paths, so metadata
applied to `dir/subdir/file.md` will take precedence over that applied
to `dir/subdir`, which will take precedence over just `dir`.
2019-03-06 16:21:27 -05:00
John Franey
63a72fc619 Remove Python 3.4 references
This PR removes the Python 3.4 tox task and updates references in the
code to Python 3.5+.

tox complains about Python 3.4, which is EOL after next month:

> py34 installed: DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last one supporting it. Please upgrade your Python as Python 3.4 won't be maintained after March 2019 (cf PEP 429).
2019-02-06 10:23:27 -04:00
Deniz Turgut
2afef16008 Use language_code if it is supported 2018-11-26 03:45:20 +03:00
Justin Mayer
d974ba898c
Merge branch 'master' into html_list_tags 2018-11-11 11:30:28 +01:00
Deniz Turgut
015eefe7de Let's handle reST errors in a simple and nice way, finally. 2018-11-10 23:08:10 +01:00
Justin Mayer
11de7b2e47
Merge branch 'master' into html_list_tags 2018-11-01 15:43:14 +01:00
Justin Mayer
25045e8fb8
Merge pull request #2311 from gwax/warn_rst_no_document_title
Multiple reST headers yields "could not find information about 'date'"
2018-04-06 11:51:22 -07:00
Justin Mayer
5330453579
Merge pull request #2017 from JulienPalard/master
Explicitly disallow duplications of URL and save_as
2018-04-06 11:29:37 -07:00
George Leslie-Waksman
fb6d44712b Warn on missing rst document title. Fixes #2311. 2018-03-27 10:16:29 -07:00
Mr. Senko
f62217f38e Make HTMLReader parse multiple occurences of metadata tags as list
this means you can now specify:
<meta name="custom_field" content="value_1" />
<meta name="custom_field" content="value_2" />

and the resulting object.custom_field will be ['value_1', 'value_2']
2017-12-02 13:21:46 +02:00
Vladimír Vondruš
abb91fc3be Propagate value of DEFAULT_LANG to docutils reST parser.
That way the parsed node tree gets proper information about the
language, which can be then used for e.g. language-aware smart quotes or
hyphenation.
2017-11-29 22:42:54 +01:00
Vladimír Vondruš
7336de45cb Ability to override docutils HTML writer/translator.
The RstReader class can now use user-specified writer/translator classes
instead of the hardcoded ones from docutils. This allows for far easier
overriding of the default HTML output -- in the past one would need to
override the internal _parse_metadata() and _get_publisher() functions.
With hypothetical Html5Writer and Html5FieldBodyTranslator classes,
based for example on docutils.writers.html5_polyglot.Writer and
docutils.writers.html5_polyglot.HTMLTranslator, a plugin that overrides
the default behavior would now look just like this:

    # (definition of Writer / Translator classes omitted)

    class Html5RstReader(RstReader):
        writer_class = Html5Writer
        field_body_translator_class = Html5FieldBodyTranslator

    def add_reader(readers):
        readers.reader_classes['rst'] = Html5RstReader

    def register():
        pelican.signals.readers_init.connect(add_reader)
2017-06-30 22:59:42 +02:00
derwinlu
f49037e0ca Fixup 89b28fd
We need to mark the whole doctest string as raw as it contains
regular expressions.
2017-03-29 10:46:51 +02:00
derwinlu
623eb0a4c0 Fix more python 3.6 regex DeprecationWarning's 2017-03-29 10:19:47 +02:00
derwinlu
89b28fd36b Fix warnings originating from bad regexes
Starting with python 3.6 warnings are issued for invalid escape
sequences in regular expressions. This commit corrects all
DeprecationWarning's via properly declaring the offending
regular expressions as raw strings.

Resolves #2095.
2017-03-27 16:09:08 +02:00
Tim Wienk
4917b8618a Fix setting None metadata from FILENAME_METADATA matches.
This is relevant when using optional items in the expression. E.g. if an
optional captured group is not matched, the result of
`match.groupdict()` contains the captured group with value `None`.
2017-03-15 17:07:31 +01:00
John
6f9f0def0f Fix #1325 and add test_find_empty_alt 2016-11-17 23:29:19 +00:00
Bernhard Scheirle
a445e81ae6 Make markdown extensions order non-arbitrary 2016-11-15 17:05:12 +01:00
Bernhard Scheirle
35dba138e0 Replaces MD_EXTENSIONS with MARKDOWN
MARKDOWN allows to configure the python markdown module

fixes #1024
2016-11-02 21:11:42 +01:00
Julien Palard
e07c53a09d FIX: Those keys are looked up lowercased. 2016-10-26 08:34:52 +02:00
Julien Palard
e8a87e5d3c As not allowing duplicates in processed items is counter intuitive, let's allow it.
Also it may be allowed in the future (to process multiple values).

Also @avaris think it's bad to test something twice (see
https://github.com/getpelican/pelican/pull/2017), but for me confusion
lies in the "Why is list processing forbidden?", so, in a way, our
ideas converges in "let's not disallow processed items to be lists".

This reverts commit 9e574e9d8c.
2016-10-10 12:23:26 +02:00
Julien Palard
13ac28b6d4 Merge remote-tracking branch 'upstream/master' 2016-10-10 12:23:01 +02:00
Justin Mayer
22861aa1c1 Merge pull request #2015 from jpli/improve_path_metadata_processing
Improve path metadata processing
2016-10-06 11:30:27 -06:00
Julien Palard
9e574e9d8c Just in case someone forgot the DUPLICATES_DEFINITIONS_ALLOWED but add in METADATA_PROCESSORS. 2016-09-30 15:33:05 +02:00
Julien Palard
24a1254f03 Explicitly disallow duplications of URL and save_as. 2016-09-30 15:29:14 +02:00
Justin Mayer
5cc4c9f4ab Merge pull request #1880 from allanman/patch-1
Ensure DEFAULT_DATE = 'fs' actually uses modified time
2016-09-22 16:12:46 -06:00
Li Jiapeng
0f6b98506e Revert to the old category processing order
If no category is specified in PATH_METADATA or FILENAME_METADATA,
fall back to USE_FOLDER_AS_CATEGORY, which defaults to True.
2016-09-19 18:29:58 +08:00
Li Jiapeng
9185e0b7a8 Avoid circumvention of metadata name checking
See https://github.com/getpelican/pelican/issues/2011
2016-09-19 18:28:43 +08:00