Пример #1
0
 /**
  * Sets the Scrybe-specific options, registers the roles and directives and loads the file.
  *
  * @param ConverterInterface $converter
  * @param File $file
  */
 public function __construct(ConverterInterface $converter, File $file)
 {
     parent::__construct();
     $this->options->xhtmlVisitor = 'phpDocumentor\\Plugin\\Scrybe\\Converter\\RestructuredText\\Visitors\\Creator';
     $this->options->errorReporting = E_PARSE | E_ERROR;
     $this->registerDirective('code-block', 'phpDocumentor\\Plugin\\Scrybe\\Converter\\RestructuredText\\Directives\\CodeBlock');
     $this->registerDirective('toctree', 'phpDocumentor\\Plugin\\Scrybe\\Converter\\RestructuredText\\Directives\\Toctree');
     $this->registerDirective('image', 'phpDocumentor\\Plugin\\Scrybe\\Converter\\RestructuredText\\Directives\\Image');
     $this->registerDirective('figure', 'phpDocumentor\\Plugin\\Scrybe\\Converter\\RestructuredText\\Directives\\Figure');
     $this->registerRole('doc', 'phpDocumentor\\Plugin\\Scrybe\\Converter\\RestructuredText\\Roles\\Doc');
     $this->file = $file;
     $this->converter = $converter;
     $this->loadString($file->fread());
 }
Пример #2
0
 /**
  * Returns the filename used for the output path.
  *
  * @param File $file
  *
  * @return string
  */
 protected function getDestinationFilename(File $file)
 {
     return $this->definition->getOutputFormat()->convertFilename($file->getRealPath());
 }