mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-09-21 08:57:40 +02:00
parent
a63dd58b6a
commit
313a02d9f0
@ -16,6 +16,20 @@ use RecursiveIteratorIterator;
|
|||||||
*/
|
*/
|
||||||
class DocTocRenderer extends DocRenderer
|
class DocTocRenderer extends DocRenderer
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* CSS class for the HTML list element
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
const CSS_CLASS = 'toc';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tag for the HTML list element
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
const HTML_LIST_TAG = 'ol';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Content to render
|
* Content to render
|
||||||
*
|
*
|
||||||
@ -38,7 +52,7 @@ class DocTocRenderer extends DocRenderer
|
|||||||
*/
|
*/
|
||||||
public function beginIteration()
|
public function beginIteration()
|
||||||
{
|
{
|
||||||
$this->content[] = '<nav role="navigation"><ul class="toc">';
|
$this->content[] = sprintf('<nav role="navigation"><%s class="%s">', static::HTML_LIST_TAG, static::CSS_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -46,7 +60,7 @@ class DocTocRenderer extends DocRenderer
|
|||||||
*/
|
*/
|
||||||
public function endIteration()
|
public function endIteration()
|
||||||
{
|
{
|
||||||
$this->content[] = '</ul></nav>';
|
$this->content[] = sprintf('</%s></nav>', static::HTML_LIST_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -54,7 +68,7 @@ class DocTocRenderer extends DocRenderer
|
|||||||
*/
|
*/
|
||||||
public function beginChildren()
|
public function beginChildren()
|
||||||
{
|
{
|
||||||
$this->content[] = '<ul class="toc">';
|
$this->content[] = sprintf('<%s class="%s">', static::HTML_LIST_TAG, static::CSS_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -62,7 +76,7 @@ class DocTocRenderer extends DocRenderer
|
|||||||
*/
|
*/
|
||||||
public function endChildren()
|
public function endChildren()
|
||||||
{
|
{
|
||||||
$this->content[] = '</ul>';
|
$this->content[] = sprintf('</%s>', static::HTML_LIST_TAG);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -81,7 +81,7 @@ pre > code {
|
|||||||
color: inherit;
|
color: inherit;
|
||||||
}
|
}
|
||||||
|
|
||||||
ul.toc {
|
.toc {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 0 0 0 1em;
|
padding: 0 0 0 1em;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user