diff --git a/templates/helper.php b/templates/helper.php index 2b6b1cf..4b47a96 100644 --- a/templates/helper.php +++ b/templates/helper.php @@ -3,6 +3,9 @@ /** * Render a nested list of elements as HTML list item. The function calls itself in case * of nested elements (identified by the key 'nested'). + * + * Adds a level- css class to aid in indentation. Thanks to prooph (getprooph.org) + * for the code. * @param array $elements * @param Aura\View\View $context */ @@ -11,7 +14,7 @@ function renderTocList(array $elements, Aura\View\View $context) foreach ($elements as $entry) { $entryObj = new Bookdown\Bookdown\Content\Heading($entry['number'], $entry['title'], $entry['href'], $entry['id']); - echo '
  • '; + echo '
  • '; echo '
    '; echo '
    ' . '' . "{$entryObj->getNumber()}" . '
    '; echo '
    ' . $context->anchorRaw($entryObj->getHref(), $entryObj->getTitle()) . '
    '; @@ -57,4 +60,4 @@ function tocEntriesToNestedList(array $entries, $nestLevel) $nestedEntries[$parent]['nested'][] = $entry->asArray(); } return $nestedEntries; -} \ No newline at end of file +} diff --git a/templates/style.php b/templates/style.php index 71f4b65..8a29da6 100644 --- a/templates/style.php +++ b/templates/style.php @@ -174,6 +174,18 @@ font-weight: bold; padding: 0; } + + .list-toc .list-group-item.level-2 { + padding-left: 20px; + } + + .list-toc .list-group-item.level-3 { + padding-left: 40px; + } + + .list-toc .list-group-item.level-4 { + padding-left: 60px; + } .list-toc .list-group-item .row { padding: 7px 0;