Skip to content
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

Merged
merged 7 commits into from Jan 15, 2017

Conversation

@felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Jan 15, 2017

As discussed in #2615.

@@ -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
Copy link
Member

@Kwpolska Kwpolska Jan 15, 2017

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

Loading

Copy link
Contributor Author

@felixfontein felixfontein Jan 15, 2017

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.

Loading

Copy link
Contributor Author

@felixfontein felixfontein Jan 15, 2017

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.

Loading


# The executable for the filter "jpegoptim" from nikola.filters can be
# configured here:
# JPEG_OPTIM = 'jpegoptim'
Copy link
Member

@Kwpolska Kwpolska Jan 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JPEGOPTIM_EXECUTABLE

Loading

Copy link
Contributor Author

@felixfontein felixfontein Jan 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Loading

@@ -45,6 +45,19 @@
from .utils import req_missing, LOGGER


class configurable_filter(object):
Copy link
Member

@Kwpolska Kwpolska Jan 15, 2017

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.

Loading

Copy link
Contributor Author

@felixfontein felixfontein Jan 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Loading

@@ -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():
Copy link
Member

@Kwpolska Kwpolska Jan 15, 2017

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():

Loading

Copy link
Contributor Author

@felixfontein felixfontein Jan 15, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

Loading

@felixfontein felixfontein merged commit 741a5df into master Jan 15, 2017
2 of 5 checks passed
Loading
@felixfontein felixfontein deleted the configurable-filters branch Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants