Skip to content

Commit

Permalink
Merge pull request #94 from sitegeist/feature/enhance-cli-rendering
Browse files Browse the repository at this point in the history
FEATURE: Enhance cli rendering
  • Loading branch information
grebaldi authored Jan 18, 2019
2 parents 33e6b50 + ff28dbb commit 82335cd
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,12 @@ public function itemsCommand($format = 'json', $packageKey = null)
*
* @param string $prototypeName The prototype name of the component
* @param string $packageKey site-package (defaults to first found)
* @param string $propSet The propSet used for the preview
* @param string $props Custom props for the preview
* @param string $locales Custom locales for the preview
* @return void
*/
public function renderCommand($prototypeName, $packageKey = null)
public function renderCommand($prototypeName, $packageKey = null, $propSet = '__default', $props = '', $locales = '')
{
$sitePackageKey = $packageKey ?: $this->getDefaultSitePackageKey();

Expand All @@ -90,7 +93,10 @@ public function renderCommand($prototypeName, $packageKey = null)
$fusionView->setFusionPath($prototypePreviewRenderPath);
$fusionView->setPackageKey($sitePackageKey);

$this->output($fusionView->renderStyleguidePrototype($prototypeName));
$convertedProps = json_decode($props, true);
$convertedLocales = json_decode($locales, true);

print($fusionView->renderStyleguidePrototype($prototypeName, $propSet, $convertedProps, $convertedLocales));
}

protected function outputData($data, $format)
Expand Down

0 comments on commit 82335cd

Please sign in to comment.