Gregwar\RST\Builder::build PHP Метод

build() публичный Метод

public build ( $directory, $targetDirectory = 'output', $verbose = true )
    public function build($directory, $targetDirectory = 'output', $verbose = true)
    {
        $this->verbose = $verbose;
        $this->directory = $directory;
        $this->targetDirectory = $targetDirectory;
        // Creating output directory if doesn't exists
        if (!is_dir($targetDirectory)) {
            mkdir($targetDirectory, 0755, true);
        }
        // Try to load metas, if it does not exists, create it
        $this->display('* Loading metas');
        $this->metas = new Metas($this->loadMetas());
        // Scan all the metas and the index
        $this->display('* Pre-scanning files');
        $this->scan($this->getIndexName());
        $this->scanMetas();
        // Parses all the documents
        $this->parseAll();
        // Renders all the documents
        $this->render();
        // Saving the meta
        $this->display('* Writing metas');
        $this->saveMetas();
        // Copy the files
        $this->display('* Running the copies');
        $this->doMkdir();
        $this->doCopy();
    }

Usage Example

Пример #1
0
<?php

include '../../autoload.php';
use Gregwar\RST\Builder;
use Gregwar\RST\LaTeX\Kernel;
try {
    // Build the 'input' files to the 'output' directory
    $builder = new Builder(new Kernel());
    $builder->copy('css', 'css');
    $builder->build('input', 'output');
} catch (\Exception $exception) {
    echo "\n";
    echo "Error: " . $exception->getMessage() . "\n";
}
All Usage Examples Of Gregwar\RST\Builder::build