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
|
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)
|
protected function populateView($module = null)
|
||||||
{
|
{
|
||||||
$parser = new DocParser($module);
|
$parser = new DocParser($module);
|
||||||
list($html, $toc) = $parser->getDocumentation();
|
list($docHtml, $docToc) = $parser->getDocAndToc();
|
||||||
$this->view->html = $html;
|
$this->view->docHtml = $docHtml;
|
||||||
$this->view->toc = $toc;
|
$this->view->docToc = $docToc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
namespace Icinga\Module\Doc;
|
namespace Icinga\Module\Doc;
|
||||||
|
|
||||||
|
require_once 'vendor/Parsedown/Parsedown.php';
|
||||||
|
|
||||||
use RecursiveIteratorIterator;
|
use RecursiveIteratorIterator;
|
||||||
use RecursiveDirectoryIterator;
|
use RecursiveDirectoryIterator;
|
||||||
use Parsedown;
|
use Parsedown;
|
||||||
|
@ -11,8 +13,6 @@ use Icinga\Application\Icinga;
|
||||||
use Icinga\Web\Menu;
|
use Icinga\Web\Menu;
|
||||||
use Icinga\Web\Url;
|
use Icinga\Web\Url;
|
||||||
|
|
||||||
require_once 'vendor/Parsedown/Parsedown.php';
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Parser for documentation written in Markdown
|
* 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
|
* @return array
|
||||||
* @throws DocException
|
* @throws DocException
|
||||||
*/
|
*/
|
||||||
public function getDocumentation()
|
public function getDocAndToc()
|
||||||
{
|
{
|
||||||
$iter = new RecursiveIteratorIterator(
|
$iter = new RecursiveIteratorIterator(
|
||||||
new MarkdownFileIterator(
|
new MarkdownFileIterator(
|
||||||
|
|
Loading…
Reference in New Issue