modules/doc: Rename DocParser::getDocumentation() to getDocAndToc()
refs #4820
This commit is contained in:
parent
83c12cfb2e
commit
e6abe21fb8
|
@ -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;
|
||||
list($docHtml, $docToc) = $parser->getDocAndToc();
|
||||
$this->view->docHtml = $docHtml;
|
||||
$this->view->docToc = $docToc;
|
||||
}
|
||||
}
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue