/** * handle * * @param \Codex\Core\Project $project */ public function handle(Project $project, Menu $menu) { if (!$project->hasEnabledHook('sassdoc')) { return; } $node = $menu->add('sassdoc', $project->config('hooks.sassdoc.menu_name')); $node->setMeta('icon', $project->config('hooks.sassdoc.menu_icon')); $node->setAttribute('href', route('codex.hooks.sassdoc', ['projectName' => $project->getName(), 'ref' => $project->getRef()])); }
public function __construct(Codex $codex, Project $project, Filesystem $files, Container $container, Cache $cache) { ini_set('memory_limit', '2G'); $path = $project->path($project->config('hooks.sassdoc.path')); $pathName = 'sassdoc'; parent::__construct($codex, $project, $files, $container, $path, $pathName); $this->mergeAttributes($project->config('hooks.sassdoc')); $this->setPath($path); $this->cache = $cache; }
/** * Render the document. * * This will run all document:render hooks and then return the * output. Should be called within a view. * * @return string */ public function render() { $this->runHook('document:render', [$this]); $fsettings = $this->project->config('filters'); $filters = Extensions::getFilters($this->project->config('filters.enabled')); if (count($filters) > 0) { foreach ($filters as $name => $filter) { if ($filter instanceof \Closure) { call_user_func_array($filter, [$this, isset($fsettings[$name]) ? $fsettings[$name] : []]); } else { $instance = app()->make($filter); call_user_func_array([$instance, 'handle'], [$this, isset($fsettings[$name]) ? $fsettings[$name] : []]); } } } return $this->content; }
protected function setting($key, $default = null) { return array_get($this->project->config('hooks.git'), $key, $default); }