@@ 62-72 (lines=11) @@ | ||
59 | /** |
|
60 | * {@inheritDocs} |
|
61 | */ |
|
62 | public function getContent($path) |
|
63 | { |
|
64 | $file = $this->getFilePath($path); |
|
65 | $content = file_get_contents($file->getPathname()); |
|
66 | $properties = $this->readProperties($content); |
|
67 | $content = $this->removeProperties($content); |
|
68 | $c = new Content(); |
|
69 | $c->setContent($content); |
|
70 | $c->setProperties(new ArrayCollection(array_merge($c->getProperties()->toArray(), $properties))); |
|
71 | return $c; |
|
72 | } |
|
73 | ||
74 | protected function readProperties($markdown) |
|
75 | { |
@@ 70-80 (lines=11) @@ | ||
67 | * |
|
68 | * @return Page |
|
69 | */ |
|
70 | protected function transformContent(Content $c, $path) |
|
71 | { |
|
72 | $markdown = $c->getContent(); |
|
73 | $markdown = $this->removeProperties($markdown); |
|
74 | $html = $this->parser->transformMarkdown($markdown); |
|
75 | $html = $this->fixLinks($html, $path); |
|
76 | $page = new Page(); |
|
77 | $page->setContent($html); |
|
78 | $page->setProperties(new ArrayCollection(array_merge($page->getProperties()->toArray(), $c->getProperties()->toArray()))); |
|
79 | return $page; |
|
80 | } |
|
81 | ||
82 | protected function fixLinks($html, $page) |
|
83 | { |