Example #1
0
File: wiki.php Project: bmdevel/ezc
 /**
  * Return document compiled to the docbook format
  *
  * The internal document structure is compiled to the docbook format and
  * the resulting docbook document is returned.
  *
  * This method is required for all formats to have one central format, so
  * that each format can be compiled into each other format using docbook as
  * an intermediate format.
  *
  * You may of course just call an existing converter for this conversion.
  *
  * @return ezcDocumentDocbook
  */
 public function getAsDocbook()
 {
     $tokenizer = $this->options->tokenizer;
     $parser = new ezcDocumentWikiParser();
     $parser->options->errorReporting = $this->options->errorReporting;
     $this->ast = $parser->parse($tokenizer->tokenizeString($this->contents));
     $document = new ezcDocumentDocbook();
     $visitor = new ezcDocumentWikiDocbookVisitor($this, $this->path);
     $document->setDomDocument($visitor->visit($this->ast, $this->path));
     $document->setPath($this->path);
     // Merge errors from converter
     $this->errors = array_merge($this->errors, $parser->getErrors(), $visitor->getErrors());
     return $document;
 }