public function renderDebug($source)
    {
        $template = end($this->__stack);

        if($this->getObject('filter.path')->validate($template)) {
            $path = $this->locateSource($template);
        } else {
            $path = '';
        }

        //Render debug comments
        if($this->isDebug())
        {
            $type  = $this->getIdentifier()->getName();
            $path = str_replace(rtrim(\Kodekit::getInstance()->getRootPath(), '/').'/', '', $path);

            $format  = PHP_EOL.'<!--BEGIN '.$type.':render '.$path.' -->'.PHP_EOL;
            $format .= '%s';
            $format .= PHP_EOL.'<!--END '.$type.':render '.$path.' -->'.PHP_EOL;

            $source = sprintf($format, trim($source));
        }

        return $source;
    }