Compare commits
4 Commits
9e0019a728
...
b597cccb6b
Author | SHA1 | Date | |
---|---|---|---|
b597cccb6b | |||
2e5dd7b996 | |||
b271b3ed55 | |||
288c5aeba0 |
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
__pycache__/
|
||||
*.py[cod]
|
@ -17,6 +17,7 @@ from pelican.readers import BaseReader
|
||||
from pelican.generators import Generator
|
||||
from pelican import signals
|
||||
import os
|
||||
import os.path
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
@ -139,12 +140,13 @@ class AsciiDoctorPdfGenerator(Generator):
|
||||
filename = "{id_file}.pdf".format(id_file=content.slug)
|
||||
filepath = os.path.join(output_dir, filename)
|
||||
|
||||
check_call([cmd] + self.settings.get('ASCIIDOCTOR_EXTRA_OPTIONS', []) +
|
||||
['--require', 'asciidoctor-pdf', '--backend', 'pdf'] +
|
||||
['--doctype=article'] +
|
||||
['--out-file', filepath, content.source_path])
|
||||
|
||||
logger.info("[ok] writing {filepath}".format(filepath=filepath))
|
||||
if ((not os.path.isfile(filepath)) or
|
||||
(os.path.getmtime(filepath) < os.path.getmtime(content.source_path))):
|
||||
check_call([cmd] + self.settings.get('ASCIIDOCTOR_EXTRA_OPTIONS', []) +
|
||||
['--require', 'asciidoctor-pdf', '--backend', 'pdf'] +
|
||||
['--doctype=article'] +
|
||||
['--out-file', filepath, content.source_path])
|
||||
logger.info("[ok] writing {filepath}".format(filepath=filepath))
|
||||
|
||||
def generate_output(self, writer=None):
|
||||
"""Generate files for each articles and pages.
|
||||
|
Reference in New Issue
Block a user