@@ -284,12 +284,33 @@ def split_metadata(self, data):
284
284
return split_result [0 ], split_result [- 1 ]
285
285
286
286
287
- class RestExtension (BasePlugin ):
287
+ class CompilerExtension (BasePlugin ):
288
+
289
+ """An extension for a Nikola compiler.
290
+
291
+ If you intend to implement those in your own compiler, you can:
292
+ (a) create a new plugin class for them; or
293
+ (b) use this class and filter them yourself.
294
+ If you choose (b), you should the compiler name to the .plugin
295
+ file in the Nikola/Compiler section and filter all plugins of
296
+ this category, getting the compiler name with:
297
+ p.details.get('Nikola', 'Compiler')
298
+ Note that not all compiler plugins have this option and you might
299
+ need to catch configparser.NoOptionError exceptions.
300
+ """
301
+
302
+ name = "dummy_compiler_extension"
303
+ compiler_name = "dummy_compiler"
304
+
305
+
306
+ class RestExtension (CompilerExtension ):
288
307
name = "dummy_rest_extension"
308
+ compiler_name = "rest"
289
309
290
310
291
- class MarkdownExtension (BasePlugin ):
311
+ class MarkdownExtension (CompilerExtension ):
292
312
name = "dummy_markdown_extension"
313
+ compiler_name = "markdown"
293
314
294
315
295
316
class SignalHandler (BasePlugin ):
0 commit comments