From e6abe21fb8bb2ec444e9432a012abfbf3a9af457 Mon Sep 17 00:00:00 2001 From: Eric Lippmann Date: Fri, 23 May 2014 09:36:14 +0200 Subject: [PATCH] modules/doc: Rename DocParser::getDocumentation() to getDocAndToc() refs #4820 --- modules/doc/library/Doc/Controller.php | 14 +++++++------- modules/doc/library/Doc/DocParser.php | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/modules/doc/library/Doc/Controller.php b/modules/doc/library/Doc/Controller.php index 3f7b1da4e..840011150 100644 --- a/modules/doc/library/Doc/Controller.php +++ b/modules/doc/library/Doc/Controller.php @@ -9,15 +9,15 @@ use Icinga\Web\Controller\ActionController; class Controller extends ActionController { /** - * Set HTML and toc + * Publish doc HTML and toc to the view * - * @param string $module + * @param string $module Name of the module for which to populate doc and toc. `null` for Icinga Web 2's doc */ protected function populateView($module = null) { - $parser = new DocParser($module); - list($html, $toc) = $parser->getDocumentation(); - $this->view->html = $html; - $this->view->toc = $toc; + $parser = new DocParser($module); + list($docHtml, $docToc) = $parser->getDocAndToc(); + $this->view->docHtml = $docHtml; + $this->view->docToc = $docToc; } -} \ No newline at end of file +} diff --git a/modules/doc/library/Doc/DocParser.php b/modules/doc/library/Doc/DocParser.php index 945a96eea..ac3c58ea6 100644 --- a/modules/doc/library/Doc/DocParser.php +++ b/modules/doc/library/Doc/DocParser.php @@ -4,6 +4,8 @@ namespace Icinga\Module\Doc; +require_once 'vendor/Parsedown/Parsedown.php'; + use RecursiveIteratorIterator; use RecursiveDirectoryIterator; use Parsedown; @@ -11,8 +13,6 @@ use Icinga\Application\Icinga; use Icinga\Web\Menu; use Icinga\Web\Url; -require_once 'vendor/Parsedown/Parsedown.php'; - /** * Parser for documentation written in Markdown */ @@ -51,12 +51,12 @@ class DocParser } /** - * Retrieve table of contents and HTML converted from markdown files sorted by filename + * Retrieve doc as HTML converted from markdown files sorted by filename and the table of contents * * @return array * @throws DocException */ - public function getDocumentation() + public function getDocAndToc() { $iter = new RecursiveIteratorIterator( new MarkdownFileIterator(