diff --git a/src/PatternLab/PatternData/Rules/DocumentationRule.php b/src/PatternLab/PatternData/Rules/DocumentationRule.php index e38499f8..528925fb 100644 --- a/src/PatternLab/PatternData/Rules/DocumentationRule.php +++ b/src/PatternLab/PatternData/Rules/DocumentationRule.php @@ -80,12 +80,24 @@ public function run($depth, $ext, $path, $pathName, $name) { "meta" => $yaml, "full" => $doc); + // can set `title: My Cool Pattern` instead of lifting from file name if (isset($title)) { $patternStoreData["nameClean"] = $title; } - if (isset($yaml["state"])) { - $patternStoreData["state"] = $yaml["state"]; + $availableKeys = [ + 'state', // can use `state: inprogress` instead of `button@inprogress.mustache` + 'hidden', // setting to `true`, removes from menu and viewall, which is same as adding `_` prefix + 'noviewall', // setting to `true`, removes from view alls but keeps in menu, which is same as adding `-` prefix + 'order', // @todo implement order + 'tags', // not implemented, awaiting spec approval and integration with styleguide kit. adding to be in sync with Node version. + 'links', // not implemented, awaiting spec approval and integration with styleguide kit. adding to be in sync with Node version. + ]; + + foreach ($availableKeys as $key) { + if (isset($yaml[$key])) { + $patternStoreData[$key] = $yaml[$key]; + } } // if the pattern data store already exists make sure this data overwrites it