anon-iclr-submission/benchname-bug-localization huggingface dataset:
Repository: getnikola/plugins
Issue: Shortcode name conflicts with rest_html5 plugin

I'm using rest_html5 plugin but I can't use the `chart directive` because there are some conflicts with Shortcode names.

Steps to reproduce:
1. `nikola init --demo demo`
2. `cd demo`
3. `nikola plugin -i rest_html5`
4. Include conf.py.sample contents in conf.py
5. `nikola build`

Error messages:
[2016-05-22T21:01:30Z] WARNING: Nikola: Shortcode name conflict: media
[2016-05-22T21:01:30Z] WARNING: Nikola: Shortcode name conflict: post-list
[2016-05-22T21:01:30Z] WARNING: Nikola: Shortcode name conflict: chart

Is there a workaround?


Changed files:
v7/rest_html5/rest_html5.py

diff --git a/v7/rest_html5/rest_html5.py b/v7/rest_html5/rest_html5.py
index 576b1dd..0e34f8a 100644
--- a/v7/rest_html5/rest_html5.py
+++ b/v7/rest_html5/rest_html5.py
@@ -46,7 +46,7 @@ except ImportError:
     has_rst2html5 = False
 
 from nikola.plugin_categories import PageCompiler
-from nikola.utils import get_logger, makedirs, req_missing, write_metadata
+from nikola.utils import get_logger, makedirs, write_metadata, STDERR_HANDLER, req_missing
 
 
 class CompileRestHTML5(PageCompiler):
@@ -135,22 +135,24 @@ class CompileRestHTML5(PageCompiler):
             fd.write(content)
 
     def set_site(self, site):
+        """Set Nikola site."""
+        super(CompileRestHTML5, self).set_site(site)
         self.config_dependencies = []
-        for plugin_info in site.plugin_manager.getPluginsOfCategory("RestExtension"):
-            if plugin_info.name in site.config['DISABLED_PLUGINS']:
-                site.plugin_manager.removePluginFromCategory(plugin_info, "RestExtension")
-                continue
-
-            site.plugin_manager.activatePluginByName(plugin_info.name)
+        for plugin_info in self.get_compiler_extensions():
             self.config_dependencies.append(plugin_info.name)
-            plugin_info.plugin_object.set_site(site)
             plugin_info.plugin_object.short_help = plugin_info.description
 
-        self.logger = get_logger('compile_rest', site.loghandlers)
+        self.logger = get_logger('compile_rest', STDERR_HANDLER)
         if not site.debug:
             self.logger.level = 4
 
-        return super(CompileRestHTML5, self).set_site(site)
+    def get_compiler_extensions(self):
+        """This plugin uses rest compiler extensions."""
+        plugins = []
+        for plugin_info in self.site.compiler_extensions:
+            if plugin_info.plugin_object.compiler_name == 'rest':
+                plugins.append(plugin_info)
+        return plugins
 
 
 def get_observer(settings):