mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Refactor readers and remove MARKUP
Add a `Readers` class which contains a dict of file extensions / `Reader`
instances. This dict can be overwritten with a `READERS` settings, for instance
to avoid processing *.html files:
READERS = {'html': None}
Or to add a custom reader for the `foo` extension:
READERS = {'foo': FooReader}
This dict is no storing the Reader classes as it was done before with
`EXTENSIONS`. It stores the instances of the Reader classes to avoid instancing
for each file reading.
This commit is contained in:
parent
c3aa85831f
commit
4bc4b1500c
7 changed files with 201 additions and 203 deletions
|
|
@ -353,12 +353,13 @@ class TestDateFormatter(unittest.TestCase):
|
|||
'French locale needed')
|
||||
def test_french_locale(self):
|
||||
settings = read_settings(
|
||||
override = {'LOCALE': locale.normalize('fr_FR.UTF-8'),
|
||||
'TEMPLATE_PAGES': {'template/source.html':
|
||||
'generated/file.html'}})
|
||||
override={'LOCALE': locale.normalize('fr_FR.UTF-8'),
|
||||
'TEMPLATE_PAGES': {'template/source.html':
|
||||
'generated/file.html'}})
|
||||
|
||||
generator = TemplatePagesGenerator({'date': self.date}, settings,
|
||||
self.temp_content, '', self.temp_output, None)
|
||||
generator = TemplatePagesGenerator(
|
||||
{'date': self.date}, settings,
|
||||
self.temp_content, '', self.temp_output)
|
||||
generator.env.filters.update({'strftime': utils.DateFormatter()})
|
||||
|
||||
writer = Writer(self.temp_output, settings=settings)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue