Skip to content

Commit

Permalink
Merge pull request #613 from jaapio/fix/section-author
Browse files Browse the repository at this point in the history
Fix section author markup
  • Loading branch information
SenseException authored Sep 25, 2024
2 parents 0f3745f + 45fc3fa commit f818db4
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
8 changes: 8 additions & 0 deletions lib/Docs/RST/RSTCopier.php
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,14 @@ private function fixRSTSyntax(Project $project, string $content): string
// get rid of .. include:: toc.rst
$content = str_replace('.. include:: toc.rst', '', $content);

$content = preg_replace(
'/.. sectionauthor:: ([^\(]+) \(([^\)]+)\)/',
'.. sectionauthor:: $1 <$2>',
$content,
);

assert(is_string($content));

// replace \n::\n with \n.. code-block::\n
// this corrects code blocks that don't render properly.
// we should update the docs code but this makes old docs code render properly.
Expand Down
3 changes: 3 additions & 0 deletions templates/guides/body/author.html.twig
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="alert section-author bg-light text-dark border"><p class="author font-weight-bold">
<i class="fas fa-pencil-alt"></i> Written by <a href="mailto:{{ node.email }}">{{ node.value }}</a></p>
</div>

0 comments on commit f818db4

Please sign in to comment.