Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions src/PatternLab/PatternData/Rules/DocumentationRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 `[email protected]`
'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
Expand Down