protected function generatePatterns($options = array()) {

		// set-up the dispatcher
		$dispatcherInstance = Dispatcher::getInstance();

		// note the beginning of the operation
		$dispatcherInstance->dispatch("builder.generatePatternsStart");

		// set-up common vars
		$exportFiles      = (isset($options["exportFiles"]) && $options["exportFiles"]);
		$exportDir        = Config::getOption("exportDir");
		$patternPublicDir = !$exportFiles ? Config::getOption("patternPublicDir") : Config::getOption("patternExportDir");
		$patternSourceDir = Config::getOption("patternSourceDir");
		$patternExtension = Config::getOption("patternExtension");
		$suffixRendered   =	Config::getOption("outputFileSuffixes.rendered");
		$suffixRaw        = Config::getOption("outputFileSuffixes.rawTemplate");
		$suffixMarkupOnly = Config::getOption("outputFileSuffixes.markupOnly");

		// make sure the export dir exists
		if ($exportFiles && !is_dir($exportDir)) {
			mkdir($exportDir);
		}

		// make sure patterns exists
		if (!is_dir($patternPublicDir)) {
			mkdir($patternPublicDir);
		}

		// loop over the pattern data store to render the individual patterns
		$store = PatternData::get();
		foreach ($store as $patternStoreKey => $patternStoreData) {

			if (($patternStoreData["category"] == "pattern") && isset($patternStoreData["hidden"]) && (!$patternStoreData["hidden"])) {

				$path          = $patternStoreData["pathDash"];
				$pathName      = (isset($patternStoreData["pseudo"])) ? $patternStoreData["pathOrig"] : $patternStoreData["pathName"];

				// modify the pattern mark-up
				$markup        = $patternStoreData["code"];
				$markupFull    = $patternStoreData["header"].$markup.$patternStoreData["footer"];
				$markupEngine  = file_get_contents($patternSourceDir."/".$pathName.".".$patternExtension);

				// if the pattern directory doesn't exist create it
				if (!is_dir($patternPublicDir."/".$path)) {
					mkdir($patternPublicDir."/".$path);
				}

				// write out the various pattern files
				file_put_contents($patternPublicDir."/".$path."/".$path.$suffixRendered.".html",$markupFull);
				if (!$exportFiles) {
					file_put_contents($patternPublicDir."/".$path."/".$path.$suffixMarkupOnly.".html",$markup);
					file_put_contents($patternPublicDir."/".$path."/".$path.$suffixRaw.".".$patternExtension,$markupEngine);
				}

			}

		}

		// note the end of the operation
		$dispatcherInstance->dispatch("builder.generatePatternsEnd");

	}