Skip to content

Commit

Permalink
Implementing Pattern Type (ie atoms) Documentation (#141)
Browse files Browse the repository at this point in the history
* Implementing Pattern Type (ie atoms) Documentation

* Enabling patternType docs in "All" as well
  • Loading branch information
EvanLovely committed Oct 13, 2017
1 parent 75914bd commit 29f55cc
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions src/PatternLab/PatternData/Exporters/PatternPartialsExporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -101,8 +101,25 @@ public function run($type = "", $subtype = "") {
$patternPartials[] = $patternPartialData;

}

}

} else if (($patternStoreData["category"] == "pattern") && (isset($patternStoreData["full"]) && ($type === $patternStoreData["full"] || $type === ""))) {
// This is for `patternType` docs. Given this structure:
// - _patterns/
// - atoms/
// - forms/
// - atoms.md
// This will take the contents of `atoms.md` and place at top of "Atoms > View All"

$patternPartialData = array();
// 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.
// $patternPartialData["patternName"] = isset($patternStoreData["nameClean"]) ? $patternStoreData["nameClean"] : '';
// $patternPartialData["patternLink"] = $patternStoreData["full"] . "/index.html";

$patternPartialData["patternSectionSubtype"] = true;
$patternPartialData["patternDesc"] = isset($patternStoreData["desc"]) ? $patternStoreData["desc"] : "";

$patternPartials[] = $patternPartialData;
}

}

Expand Down

0 comments on commit 29f55cc

Please sign in to comment.