initializePage($title, $content); } public function setFile(Content $file) { $this->file = $file; } public function getFile() { return $this->file; } public function setParams(Config $params) { $this->params = $params; } protected function getMarkdownConverter() { return $this->converter; } protected function convertPage($content) { return $this->getMarkdownConverter()->convertToHtml($content); } protected function generatePage() { return $this->convertPage($this->content); } public static function fromFile(Content $file, $params, CommonMarkConverter $converter) { $page = new static($file->getTitle(), $file->getContent()); $page->setFile($file); $page->setParams($params); $page->converter = $converter; return $page; } }