public static function render($source, $rules = array(), $directory = null) {
        if (!$directory)
            $directory = getcwd();
        
        return self::fromSpecification(
            fphp\Specification\TemplateSpecification::fromArrayAndSettings(
                array(
                    "source" => $source,
                    "rules" => $rules
                ), fphp\Settings::inDirectory($directory))
        )->getContent()->getSummary();
    }