Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding to MD docs Yaml meta settings #137

Merged
merged 1 commit into from
Oct 12, 2017
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