New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allowing to configure executables for filters (fixes #2615). #2638
Conversation
@@ -562,6 +562,29 @@ GITHUB_COMMIT_SOURCE = True | |||
# ".jpg": ["jpegoptim --strip-all -m75 -v %s"], | |||
# } | |||
|
|||
# The executable for the filter "yui_compressor" from nikola.filters can |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I’d prefer something else (matches how we describe other settings):
# Executable for the "yui_compressor" filter (defaults to 'yui-compressor').
And perhaps name those settings *_EXECUTABLE
. With YUI Compressor, we should be prepared to take this:
java -jar ~/yui-compressor.jar
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since YUI_COMPRESSOR
is simply inserted in the command line, it can also be java -jar ~/yui-compressor.jar
.
About the naming: I'll adjust that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also adjusted the comments in conf.py.in
.
|
||
# The executable for the filter "jpegoptim" from nikola.filters can be | ||
# configured here: | ||
# JPEG_OPTIM = 'jpegoptim' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JPEGOPTIM_EXECUTABLE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
@@ -45,6 +45,19 @@ | |||
from .utils import req_missing, LOGGER | |||
|
|||
|
|||
class configurable_filter(object): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A better name would be _ConfigurableFilter
, because we don’t want this to be considered public.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -925,6 +926,17 @@ def __init__(self, **config): | |||
utils.LOGGER.warn('The STORY_INDEX option is deprecated, use PAGE_INDEX instead.') | |||
self.config['PAGE_INDEX'] = config['STORY_INDEX'] | |||
|
|||
# Configure filters | |||
for _, actions in self.config['FILTERS'].items(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for actions in self.config['FILTERS'].values():
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
As discussed in #2615.