Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Improving documentation and getting rid of site.bad_compilers.
  • Loading branch information
felixfontein committed Apr 2, 2017
1 parent e3eb204 commit 53e5f6e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions nikola/nikola.py
Expand Up @@ -1041,13 +1041,13 @@ def init_plugins(self, commands_only=False, load_all=False):
candidate = utils.get_translation_candidate(self.config, "f" + ext, lang)
compilers[compiler].add(candidate)

# Avoid redundant compilers
# Remove compilers that match nothing in POSTS/PAGES
# And put them in "bad compilers"
# Avoid redundant compilers (if load_all is False):
# Remove compilers (and corresponding compiler extensions) that are not marked as
# needed by any PostScanner plugin and put them into self.disabled_compilers
# (respectively self.disabled_compiler_extensions).
self.config['COMPILERS'] = {}
self.disabled_compilers = {}
self.disabled_compiler_extensions = defaultdict(list)
self.bad_compilers = set(compilers.keys())

self.plugin_manager.getPluginLocator().setPluginPlaces(self._plugin_places)
self.plugin_manager.locatePlugins()
Expand Down Expand Up @@ -1095,7 +1095,6 @@ def init_plugins(self, commands_only=False, load_all=False):
for k, v in compilers.items():
if file_extensions is None or file_extensions.intersection(v):
self.config['COMPILERS'][k] = sorted(list(v))
self.bad_compilers.remove(k)
p = self.disabled_compilers.pop(k, None)
if p:
to_add.append(p)
Expand Down
2 changes: 1 addition & 1 deletion nikola/plugins/command/new_post.py
Expand Up @@ -544,6 +544,6 @@ def print_compilers(self):
More compilers are available in the Plugins Index.
Compilers marked with ! and ~ require additional configuration:
! not in the PAGES/POSTS tuples (unused)

This comment has been minimized.

Copy link
@Kwpolska

Kwpolska Apr 2, 2017

Member

Too verbose, and emphasises the wrong part. Post scanners are relevant only to a few people, while POSTS/PAGES apply to everyone.

! not in the POSTS/PAGES tuples and any post scanners (unused)

This comment has been minimized.

Copy link
@felixfontein

felixfontein Apr 2, 2017

Author Contributor

Fixed.

! not used by any post scanner plugin (i.e. not in the PAGES/POSTS tuples for default plugin) (unused)
~ not in the COMPILERS dict (disabled)
Read more: {0}""".format(COMPILERS_DOC_LINK))

0 comments on commit 53e5f6e

Please sign in to comment.