Library/Documentation/Theme.php
public function drawFile(AbstractFile $file)
    {
        $outputFile = ltrim($file->getOutputFile(), '/');

        $output = pathinfo($this->outputDir.'/'.$outputFile);
        $outputDirname = $output['dirname'];
        $outputBasename = $output['basename'];
        $outputFilename = $outputDirname.'/'.$outputBasename;

        // todo : check if writable
        if (!file_exists($outputDirname)) {
            mkdir($outputDirname, 0777, true);
        }

        $subDirNumber = \count(explode('/', $outputFile)) - 1;

        if ($subDirNumber > 0) {
            $pathToRoot = str_repeat('../', $subDirNumber);
        } else {
            $pathToRoot = './';
        }

        $template = new Template($this, $file->getData(), $file->getTemplateName());
        $template->setPathToRoot($pathToRoot);
        $template->setThemeOptions($this->options);
        $template->setProjectConfig($this->projectConfig);

        touch($outputFilename);
        $template->write($outputFilename);
    }
public function drawFile(AbstractFile $file)
    {
        $outputFile = ltrim($file->getOutputFile(), '/');

        $output = pathinfo($this->outputDir.'/'.$outputFile);
        $outputDirname = $output['dirname'];
        $outputBasename = $output['basename'];
        $outputFilename = $outputDirname.'/'.$outputBasename;

        // todo : check if writable
        if (!file_exists($outputDirname)) {
            mkdir($outputDirname, 0777, true);
        }

        $subDirNumber = \count(explode('/', $outputFile)) - 1;

        if ($subDirNumber > 0) {
            $pathToRoot = str_repeat('../', $subDirNumber);
        } else {
            $pathToRoot = './';
        }

        $template = new Template($this, $file->getData(), $file->getTemplateName());
        $template->setPathToRoot($pathToRoot);
        $template->setThemeOptions($this->options);
        $template->setProjectConfig($this->projectConfig);

        touch($outputFilename);
        $template->write($outputFilename);
    }
public function drawFile ( AbstractFile $ file ) { $ outputFile = ltrim ( $ file -> getOutputFile ( ) , '/' ) ; $ output = pathinfo ( $ this -> outputDir . '/' . $ outputFile ) ; $ outputDirname = $ output [ 'dirname' ] ; $ outputBasename = $ output [ 'basename' ] ; $ outputFilename = $ outputDirname . '/' . $ outputBasename ; // todo : check if writable if ( ! file_exists ( $ outputDirname ) ) { mkdir ( $ outputDirname , 0777 , true ) ; } $ subDirNumber = \ count ( explode ( '/' , $ outputFile ) ) - 1 ; if ( $ subDirNumber > 0 ) { $ pathToRoot = str_repeat ( '../' , $ subDirNumber ) ; } else { $ pathToRoot = './' ; } $ template = new Template ( $ this , $ file -> getData ( ) , $ file -> getTemplateName ( ) ) ; $ template -> setPathToRoot ( $ pathToRoot ) ; $ template -> setThemeOptions ( $ this -> options ) ; $ template -> setProjectConfig ( $ this -> projectConfig ) ; touch ( $ outputFilename ) ; $ template -> write ( $ outputFilename ) ; }
Parse and draw the specified file.

@param AbstractFile $file

@throws Exception
Parse and draw the specified file .