original_string: protected function generateStyleguide() {
  
  		// set-up the dispatcher
  		$dispatcherInstance = Dispatcher::getInstance();
  
  		// note the beginning of the operation
  		$dispatcherInstance->dispatch("builder.generateStyleguideStart");
  
  		// default var
  		$publicDir = Config::getOption("publicDir");
  
  		// load the pattern loader
  		$ppdExporter             = new PatternPathSrcExporter();
  		$patternPathSrc          = $ppdExporter->run();
  		$options                 = array();
  		$options["patternPaths"] = $patternPathSrc;
  		$patternEngineBasePath   = PatternEngine::getInstance()->getBasePath();
  		$patternLoaderClass      = $patternEngineBasePath."\Loaders\PatternLoader";
  		$patternLoader           = new $patternLoaderClass($options);
  
  		// check directories i need
  		if (!is_dir($publicDir."/styleguide/")) {
  			mkdir($publicDir."/styleguide/");
  		}
  
  		if (!is_dir($publicDir."/styleguide/html/")) {
  			mkdir($publicDir."/styleguide/html/");
  		}
  
  		// grab the partials into a data object for the style guide
  		$ppExporter                   = new PatternPartialsExporter();
  		$partials                     = $ppExporter->run();
  
  		// add the pattern data so it can be exported
  		$patternData = array();
  
  		// add the pattern lab specific mark-up
  		$filesystemLoader             = Template::getFilesystemLoader();
  		$stringLoader                 = Template::getStringLoader();
  
  		$globalData                   = Data::get();
  		$globalData["patternLabHead"] = $stringLoader->render(array("string" => Template::getHTMLHead(), "data" => array("cacheBuster" => $partials["cacheBuster"])));
  		$globalData["patternLabFoot"] = $stringLoader->render(array("string" => Template::getHTMLFoot(), "data" => array("cacheBuster" => $partials["cacheBuster"], "patternData" => json_encode($patternData))));
  		$globalData["viewall"]        = true;
  
  		$header                       = $patternLoader->render(array("pattern" => Template::getPatternHead(), "data" => $globalData));
  		$code                         = $filesystemLoader->render(array("template" => "viewall", "data" => $partials));
  		$footer                       = $patternLoader->render(array("pattern" => Template::getPatternFoot(), "data" => $globalData));
  
  		$styleGuidePage               = $header.$code.$footer;
  
  		file_put_contents($publicDir."/styleguide/html/styleguide.html",$styleGuidePage);
  
  		// note the end of the operation
  		$dispatcherInstance->dispatch("builder.generateStyleguideEnd");
  
  	}
code: protected function generateStyleguide() {
  
  		// set-up the dispatcher
  		$dispatcherInstance = Dispatcher::getInstance();
  
  		// note the beginning of the operation
  		$dispatcherInstance->dispatch("builder.generateStyleguideStart");
  
  		// default var
  		$publicDir = Config::getOption("publicDir");
  
  		// load the pattern loader
  		$ppdExporter             = new PatternPathSrcExporter();
  		$patternPathSrc          = $ppdExporter->run();
  		$options                 = array();
  		$options["patternPaths"] = $patternPathSrc;
  		$patternEngineBasePath   = PatternEngine::getInstance()->getBasePath();
  		$patternLoaderClass      = $patternEngineBasePath."\Loaders\PatternLoader";
  		$patternLoader           = new $patternLoaderClass($options);
  
  		// check directories i need
  		if (!is_dir($publicDir."/styleguide/")) {
  			mkdir($publicDir."/styleguide/");
  		}
  
  		if (!is_dir($publicDir."/styleguide/html/")) {
  			mkdir($publicDir."/styleguide/html/");
  		}
  
  		// grab the partials into a data object for the style guide
  		$ppExporter                   = new PatternPartialsExporter();
  		$partials                     = $ppExporter->run();
  
  		// add the pattern data so it can be exported
  		$patternData = array();
  
  		// add the pattern lab specific mark-up
  		$filesystemLoader             = Template::getFilesystemLoader();
  		$stringLoader                 = Template::getStringLoader();
  
  		$globalData                   = Data::get();
  		$globalData["patternLabHead"] = $stringLoader->render(array("string" => Template::getHTMLHead(), "data" => array("cacheBuster" => $partials["cacheBuster"])));
  		$globalData["patternLabFoot"] = $stringLoader->render(array("string" => Template::getHTMLFoot(), "data" => array("cacheBuster" => $partials["cacheBuster"], "patternData" => json_encode($patternData))));
  		$globalData["viewall"]        = true;
  
  		$header                       = $patternLoader->render(array("pattern" => Template::getPatternHead(), "data" => $globalData));
  		$code                         = $filesystemLoader->render(array("template" => "viewall", "data" => $partials));
  		$footer                       = $patternLoader->render(array("pattern" => Template::getPatternFoot(), "data" => $globalData));
  
  		$styleGuidePage               = $header.$code.$footer;
  
  		file_put_contents($publicDir."/styleguide/html/styleguide.html",$styleGuidePage);
  
  		// note the end of the operation
  		$dispatcherInstance->dispatch("builder.generateStyleguideEnd");
  
  	}
code_tokens: protected function generateStyleguide ( ) { // set-up the dispatcher $ dispatcherInstance = Dispatcher :: getInstance ( ) ; // note the beginning of the operation $ dispatcherInstance -> dispatch ( "builder.generateStyleguideStart" ) ; // default var $ publicDir = Config :: getOption ( "publicDir" ) ; // load the pattern loader $ ppdExporter = new PatternPathSrcExporter ( ) ; $ patternPathSrc = $ ppdExporter -> run ( ) ; $ options = array ( ) ; $ options [ "patternPaths" ] = $ patternPathSrc ; $ patternEngineBasePath = PatternEngine :: getInstance ( ) -> getBasePath ( ) ; $ patternLoaderClass = $ patternEngineBasePath . "\Loaders\PatternLoader" ; $ patternLoader = new $ patternLoaderClass ( $ options ) ; // check directories i need if ( ! is_dir ( $ publicDir . "/styleguide/" ) ) { mkdir ( $ publicDir . "/styleguide/" ) ; } if ( ! is_dir ( $ publicDir . "/styleguide/html/" ) ) { mkdir ( $ publicDir . "/styleguide/html/" ) ; } // grab the partials into a data object for the style guide $ ppExporter = new PatternPartialsExporter ( ) ; $ partials = $ ppExporter -> run ( ) ; // add the pattern data so it can be exported $ patternData = array ( ) ; // add the pattern lab specific mark-up $ filesystemLoader = Template :: getFilesystemLoader ( ) ; $ stringLoader = Template :: getStringLoader ( ) ; $ globalData = Data :: get ( ) ; $ globalData [ "patternLabHead" ] = $ stringLoader -> render ( array ( "string" => Template :: getHTMLHead ( ) , "data" => array ( "cacheBuster" => $ partials [ "cacheBuster" ] ) ) ) ; $ globalData [ "patternLabFoot" ] = $ stringLoader -> render ( array ( "string" => Template :: getHTMLFoot ( ) , "data" => array ( "cacheBuster" => $ partials [ "cacheBuster" ] , "patternData" => json_encode ( $ patternData ) ) ) ) ; $ globalData [ "viewall" ] = true ; $ header = $ patternLoader -> render ( array ( "pattern" => Template :: getPatternHead ( ) , "data" => $ globalData ) ) ; $ code = $ filesystemLoader -> render ( array ( "template" => "viewall" , "data" => $ partials ) ) ; $ footer = $ patternLoader -> render ( array ( "pattern" => Template :: getPatternFoot ( ) , "data" => $ globalData ) ) ; $ styleGuidePage = $ header . $ code . $ footer ; file_put_contents ( $ publicDir . "/styleguide/html/styleguide.html" , $ styleGuidePage ) ; // note the end of the operation $ dispatcherInstance -> dispatch ( "builder.generateStyleguideEnd" ) ; }
docstring: Generates the style guide view
docstring_tokens: Generates the style guide view