Skip to content

Commit

Permalink
Merge pull request #35 from FriendsOfREDAXO/aeberhard-patch-1
Browse files Browse the repository at this point in the history
README.md mit TOC
  • Loading branch information
schuer authored Dec 13, 2022
2 parents aea6205 + 0c2cb92 commit eefdd68
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pages/install.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,25 @@
$supportPage = $package->getSupportPage();

if (is_readable($package->getPath('README.'. rex_i18n::getLanguage() .'.md'))) {
[$readmeToc, $readmeContent] = rex_markdown::factory()->parseWithToc(rex_file::require($package->getPath('README.'. rex_i18n::getLanguage() .'.md')), 2, 3, [
rex_markdown::SOFT_LINE_BREAKS => false,
rex_markdown::HIGHLIGHT_PHP => true,
]);
$fragment = new rex_fragment();
$fragment->setVar('content', rex_markdown::factory()->parse(rex_file::get($package->getPath('README.'. rex_i18n::getLanguage() .'.md'))), false);
$fragment->setVar('content', $readmeContent, false);
$fragment->setVar('toc', $readmeToc, false);
$content .= $fragment->parse('core/page/docs.php');
} elseif (is_readable($package->getPath('README.md'))) {
[$readmeToc, $readmeContent] = rex_markdown::factory()->parseWithToc(rex_file::require($package->getPath('README.md')), 2, 3, [
rex_markdown::SOFT_LINE_BREAKS => false,
rex_markdown::HIGHLIGHT_PHP => true,
]);
$fragment = new rex_fragment();
$fragment->setVar('content', rex_markdown::factory()->parse(rex_file::get($package->getPath('README.md'))), false);
$fragment->setVar('content', $readmeContent, false);
$fragment->setVar('toc', $readmeToc, false);
$content .= $fragment->parse('core/page/docs.php');
} else {
$content .= rex_view::info(rex_i18n::msg('package_no_help_file'));
}

if (!empty($content)) {
Expand Down

0 comments on commit eefdd68

Please sign in to comment.