static function init($context) { if ($context !== 'rebuild') { return false; } foreach (array('md', 'markdown', 'mdown') as $ext) { gb_cfilter::add('post-reload-GBExposedContent.' . $ext, array(__CLASS__, 'reloadExposedObject'), 10); } # setup the MD parser self::$parser = new GBMarkdownParser(); self::$parser->use_codeblocks = gb::plugin_check_enabled($context, 'code_blocks'); gb_cfilter::add('body.md', array(self::$parser, 'transform'), 10); return true; }