Skip to content

Commit 29f55cc

Browse files
authoredOct 13, 2017
Implementing Pattern Type (ie atoms) Documentation (#141)
* Implementing Pattern Type (ie atoms) Documentation * Enabling patternType docs in "All" as well
1 parent 75914bd commit 29f55cc

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed
 

Diff for: ‎src/PatternLab/PatternData/Exporters/PatternPartialsExporter.php

+19-2
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,25 @@ public function run($type = "", $subtype = "") {
101101
$patternPartials[] = $patternPartialData;
102102

103103
}
104-
105-
}
104+
105+
} else if (($patternStoreData["category"] == "pattern") && (isset($patternStoreData["full"]) && ($type === $patternStoreData["full"] || $type === ""))) {
106+
// This is for `patternType` docs. Given this structure:
107+
// - _patterns/
108+
// - atoms/
109+
// - forms/
110+
// - atoms.md
111+
// This will take the contents of `atoms.md` and place at top of "Atoms > View All"
112+
113+
$patternPartialData = array();
114+
// Getting the name from md's `title: My Name` works here, as does the link, but it doesn't make sense to link to the view you are already on. Plus you can just do the title in the MD doc. Keeping here for now in case it's wanted later.
115+
// $patternPartialData["patternName"] = isset($patternStoreData["nameClean"]) ? $patternStoreData["nameClean"] : '';
116+
// $patternPartialData["patternLink"] = $patternStoreData["full"] . "/index.html";
117+
118+
$patternPartialData["patternSectionSubtype"] = true;
119+
$patternPartialData["patternDesc"] = isset($patternStoreData["desc"]) ? $patternStoreData["desc"] : "";
120+
121+
$patternPartials[] = $patternPartialData;
122+
}
106123

107124
}
108125

0 commit comments

Comments
 (0)
Please sign in to comment.