Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/mrdocs/ADT/Optional.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,8 @@ class Optional<T&> {
constexpr
bool
/** Return true because Optional<T&> never allocates storage.

@return `true` always.
Comment thread
gennaroprota marked this conversation as resolved.
*/
is_inlined() noexcept
{
Expand Down
19 changes: 19 additions & 0 deletions include/mrdocs/Metadata/DocComment.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,16 @@ requires std::same_as<T, doc::Block> || std::same_as<T, doc::Inline>
void
traverseImpl(T& baseNode, F&& func);

template <bool bottomUp, class F>
void
traverseImpl(doc::ListItem& item, F&& func)
{
for (auto& block : item.blocks)
{
traverseImpl<bottomUp>(block, func);
}
}

// Traverse a derived node
template <bool bottomUp, DocCommentNode NodeTy, class F>
requires(!std::same_as<NodeTy, doc::Block> && !std::same_as<NodeTy, doc::Inline>)
Expand Down Expand Up @@ -255,6 +265,15 @@ traverseImpl(NodeTy& N, F&& func)
{
traverseImpl<bottomUp>(N.exception, func);
}

if constexpr (std::same_as<NodeTy, doc::ListBlock>)
{
for (auto& item: N.items)
{
traverseImpl<bottomUp>(item, func);
}
}

if constexpr (bottomUp && std::invocable<F, NodeTy&>)
{
func(N);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{#each items}}
* {{#each blocks}}{{#unless @first}}
{{{repeat "*" (or ../depth 1)}}} {{#each blocks}}{{#unless @first}}

+
{{/unless}}
{{#if (eq kind "paragraph")}}{{> doc/inline-container }}{{else}}{{> doc/block }}{{/if}}
{{#if (eq kind "paragraph")}}{{> doc/inline-container }}{{else if (eq kind "list")}}{{> doc/block/list depth=(add (or ../../depth 1) 1) }}{{else}}{{> doc/block }}{{/if}}
{{/each}}
{{/each}}

Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<code class="language-{{ or info "cpp" }}">
<pre><code class="language-{{ or info "cpp" }}">
{{{ replace (replace (replace literal "&" "&amp;") ">" "&gt;") "<" "&lt;" }}}
</code>
</code></pre>
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{{~#if (eq kind "text")~}}{{> doc/inline/text}}{{~/if~}}
{{~#if (eq kind "strong")~}}{{> doc/inline/strong}}{{~/if~}}
{{~#if (eq kind "emph")~}}{{> doc/inline/emph}}{{~/if~}}
{{~#if (eq kind "code")~}}{{> doc/inline/code}}{{~/if~}}
{{~#if (eq kind "link")~}}{{> doc/inline/link}}{{~/if~}}
{{~#if (eq kind "reference")~}}{{> doc/inline/reference}}{{~/if~}}
{{~#if (eq kind "copy-details")~}}{{> doc/inline/copy-details}}{{~/if~}}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<strong>{{> @partial-block }}</strong>
Loading
Loading