Repository: getnikola/nikola

Issue:
Some features should be moved to plugins
Specially features that are not widely used, or "bad" for some reason. Feel free to add more ;-)
- [x] Annotations via annotateit.org (removed)
- [x] Post password-protection (removed)
- [ ] Tag cloud
- [x] Slides


Discussion:
:+1:

The tag cloud JSON file is now written by a dedicated plugin `render_tag_cloud` (since PR #2535). Moving to to https://github.com/getnikola/plugins should be straightforward.
Moving the post encryption feature into a plugin should be no problem by adding a signal handler for the `compiled` signal emitted by `Post.compile`.
The commenting systems could probably be carved out as plugins as well. That way you could install the one you want and never consider the rest.
You don’t need to care about other comment systems. Those templates will simply be ignored, and won’t ever appear in output (plus making them plugins would be hard).
I care about the commenting systems less from the perspective of using nikola and more from the perspective of theme development; they are annoyingly entangled with the rest of the base templates. Though, maybe that can be better solved by rearranging the base templates slightly.
It is a major refactor to move comments into their own plugins (its been requested before)

Resolving patch:
diff --git a/nikola/nikola.py b/nikola/nikola.py
--- a/nikola/nikola.py
+++ b/nikola/nikola.py
@@ -282,7 +282,7 @@
     "render_archive": ["classify_archive"],
     "render_authors": ["classify_authors"],
     "render_indexes": ["classify_page_index", "classify_sections"],  # "classify_indexes" removed from list (see #2591 and special-case logic below)
-    "render_tags": ["classify_categories", "render_tag_cloud", "classify_tags"],
+    "render_tags": ["classify_categories", "classify_tags"],
 }
 
 
@@ -540,7 +540,6 @@ def __init__(self, **config):
             'USE_TAG_METADATA': True,
             'TIMEZONE': 'UTC',
             'WARN_ABOUT_TAG_METADATA': True,
-            'WRITE_TAG_CLOUD': False,
             'DEPLOY_DRAFTS': True,
             'DEPLOY_FUTURE': False,
             'SCHEDULE_ALL': False,
diff --git a/nikola/plugins/task/tagcloud.py b/nikola/plugins/task/tagcloud.py
deleted file mode 100644
--- a/nikola/plugins/task/tagcloud.py
+++ /dev/null
@@ -1,78 +0,0 @@
-# -*- coding: utf-8 -*-
-
-# Copyright © 2012-2018 Roberto Alsina and others.
-
-# Permission is hereby granted, free of charge, to any
-# person obtaining a copy of this software and associated
-# documentation files (the "Software"), to deal in the
-# Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the
-# Software, and to permit persons to whom the Software is
-# furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice
-# shall be included in all copies or substantial portions of
-# the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
-# KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
-# WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
-# PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS
-# OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
-# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
-# OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-"""Render the tag cloud."""
-
-import json
-import os
-
-from nikola.plugin_categories import Task
-from nikola import utils
-
-
-class RenderTagCloud(Task):
-    """Classify the posts by tags."""
-
-    name = "render_tag_cloud"
-
-    def gen_tasks(self):
-        """Render the tag cloud."""
-        self.site.scan_posts()
-        yield self.group_task()
-
-        # Tag cloud json file
-        tag_cloud_data = {}
-        for tag, posts in self.site.posts_per_tag.items():
-            if tag in self.site.config['HIDDEN_TAGS']:
-                continue
-            tag_posts = dict(posts=[{'title': post.meta[post.default_lang]['title'],
-                                     'date': post.date.strftime('%m/%d/%Y'),
-                                     'isodate': post.date.isoformat(),
-                                     'url': post.permalink(post.default_lang)}
-                                    for post in reversed(sorted(self.site.timeline, key=lambda post: post.date))
-                                    if tag in post.alltags])
-            tag_cloud_data[tag] = [len(posts), self.site.link(
-                'tag', tag, self.site.config['DEFAULT_LANG']), tag_posts]
-        output_name = os.path.join(self.site.config['OUTPUT_FOLDER'],
-                                   'assets', 'js', 'tag_cloud_data.json')
-
-        def write_tag_data(data):
-            """Write tag data into JSON file, for use in tag clouds."""
-            utils.makedirs(os.path.dirname(output_name))
-            with open(output_name, 'w+') as fd:
-                json.dump(data, fd, sort_keys=True)
-
-        if self.site.config['WRITE_TAG_CLOUD']:
-            task = {
-                'basename': str(self.name),
-                'name': str(output_name)
-            }
-
-            task['uptodate'] = [utils.config_changed(tag_cloud_data, 'nikola.plugins.task.tags:tagdata')]
-            task['targets'] = [output_name]
-            task['actions'] = [(write_tag_data, [tag_cloud_data])]
-            task['clean'] = True
-            yield utils.apply_filters(task, self.site.config['FILTERS'])


Test patch: