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
3 changes: 3 additions & 0 deletions example/external/url/mrdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ see-below:
- 'boost::urls::grammar::see_below'
- 'boost::urls::string_token::see_below'

# Metadata Extraction
private-bases: false

# Generator
generate: adoc
base-url: https://www.github.com/boostorg/url/blob/develop/include/ # boost/url/url_view.hpp
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{{#if id}}[#{{{id}}}]
{{/if}}
={{{select level (repeat "=" level) (select @root.config.multipage "==" "=")}}} {{> @partial-block }}
={{{select level (repeat "=" level) (select @root.config.multipage "==" "=")}}} {{> @partial-block }}
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,15 @@
{{! Member name, linked to its documentation }}
{{#>markup/a href=url}}{{#>markup/code}}{{>symbol/name . nolink=true}}{{/markup/code}}{{/markup/a}} {{>symbol/special-function-suffix .}}
{{~/markup/td}}
{{#if (eq includeBrief true)}}
{{#>markup/td}}
{{#if (ne kind "overloads")~}}
{{{~doc.brief}}}
{{else~}}
{{#each (unique (pluck (pluck members "doc") "brief"))~}}
{{{.}}}
{{/each~}}
{{/if~}}
{{~/markup/td~}}
{{/if}}
{{~/markup/td}}
{{~/markup/tr}}
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
--}}
{{#if (any_of_by members "isRegular" "isSeeBelow")}}
{{#>markup/h level=(select @root.config.multipage 1 2)}}{{title}}{{/markup/h}}
{{#if (any_of_by members "doc")}}
{{#>markup/table cols=2}}
{{#>markup/thead}}
{{#>markup/tr~}}
Expand All @@ -22,8 +23,22 @@
{{/markup/thead}}
{{#>markup/tbody}}
{{#each (filter_by (sort_by members "name") "isRegular" "isSeeBelow")}}
{{> symbol/detail/members-table-row .}}
{{> symbol/detail/members-table-row . includeBrief=true}}
{{/each}}
{{/markup/tbody}}
{{/markup/table}}
{{else}}
{{#>markup/table cols=1}}
{{#>markup/thead}}
{{#>markup/tr~}}
{{#>markup/th}}Name{{/markup/th}}
{{/markup/tr}}
{{/markup/thead}}
{{#>markup/tbody}}
{{#each (filter_by (sort_by members "name") "isRegular" "isSeeBelow")}}
{{> symbol/detail/members-table-row . includeBrief=false}}
{{/each}}
{{/markup/tbody}}
{{/markup/table}}
{{/if}}
{{/if}}
4 changes: 2 additions & 2 deletions src/lib/AST/ASTVisitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -896,14 +896,14 @@ populate(

// Extract direct bases. D->bases() will get the bases
// from whichever declaration is the definition (if any)
if(D->hasDefinition())
if(D->hasDefinition() && I.Bases.empty())
{
for (const CXXBaseSpecifier& B : D->bases())
{
AccessSpecifier const access = B.getAccessSpecifier();

if (!config_->privateBases &&
access == AccessSpecifier::AS_private)
access == AS_private)
{
continue;
}
Expand Down
29 changes: 23 additions & 6 deletions src/lib/Lib/TagfileWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#include "../Gen/xml/CXXTags.hpp"
#include "TagfileWriter.hpp"
#include "lib/Gen/hbs/VisitorHelpers.hpp"
#include "lib/Lib/ConfigImpl.hpp"
#include "lib/Support/RawOstream.hpp"

Expand Down Expand Up @@ -92,6 +93,14 @@ void
TagfileWriter::
operator()(T const& I)
{
if constexpr (std::derived_from<T, Info>)
{
if (!hbs::shouldGenerate(I))
{
return;
}
}

if constexpr (T::isNamespace())
{
// Namespaces are compound elements with members
Expand Down Expand Up @@ -119,12 +128,15 @@ writeNamespace(
bool onlyNamespaces = true;
corpus_->traverse(I, [&](Info const& I)
{
if (!hbs::shouldGenerate(I))
{
return;
}

if (I.Kind != InfoKind::Namespace)
{
onlyNamespaces = false;
return false;
}
return true;
});

// Write the compound element for this namespace
Expand All @@ -138,8 +150,13 @@ writeNamespace(
tags_.write("filename", generateFilename(I));

// Write the class-like members of this namespace
corpus_->traverse(I, [this]<typename U>(U const& J)
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
{
if (!hbs::shouldGenerate(J))
{
return;
}

if (!U::isNamespace() && !U::isFunction())
{
tags_.write(
Expand All @@ -150,7 +167,7 @@ writeNamespace(
});

// Write the function-like members of this namespace
corpus_->traverse(I, [this]<typename U>(U const& J)
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
{
if constexpr (U::isFunction())
{
Expand All @@ -162,7 +179,7 @@ writeNamespace(
}

// Write compound elements for the members of this namespace
corpus_->traverse(I, [this]<typename U>(U const& J)
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
{
this->operator()(J);
});
Expand All @@ -183,7 +200,7 @@ writeClassLike(
if constexpr (T::isRecord())
{
// Write the function-like members of this record
corpus_->traverse(I, [this]<typename U>(U const& J)
corpus_->orderedTraverse(I, [this]<typename U>(U const& J)
{
if constexpr (U::isFunction())
{
Expand Down
17 changes: 13 additions & 4 deletions test-files/golden-tests/core/libcxx.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
[#index]
== Global namespace


=== Namespaces
[cols=2]

[cols=1]
|===
| Name | Description
| Name

| <<std,`std`>>
|

|===
=== Functions

[cols=2]
|===
| Name | Description
Expand All @@ -29,15 +30,18 @@
== std



[#sqrt]
== sqrt


Computes the square root of an integral value&period;



=== Synopsis


Declared in `&lt;libcxx&period;cpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
Expand All @@ -49,13 +53,15 @@ sqrt(T value);

=== Description


This function calculates the square root of a
given integral value using bit manipulation&period;



=== Exceptions


|===
| Name | Thrown on

Expand All @@ -67,12 +73,14 @@ given integral value using bit manipulation&period;

=== Return Value


The square root of the input value&period;



=== Template Parameters


|===
| Name | Description

Expand All @@ -84,6 +92,7 @@ The square root of the input value&period;

=== Parameters


|===
| Name | Description

Expand Down
5 changes: 2 additions & 3 deletions test-files/golden-tests/core/libcxx.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ <h2>Namespaces</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th><th>Description</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#std"><code>std</code></a> </td><td>
</td></tr>
<td><a href="#std"><code>std</code></a> </td></tr>
</tbody>
</table>
<h2>Functions</h2>
Expand Down
10 changes: 6 additions & 4 deletions test-files/golden-tests/core/utf-8.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@
[#index]
== Global namespace


=== Functions
[cols=2]

[cols=1]
|===
| Name | Description
| Name

| <<Христос_воскрес,`Христос&lowbar;воскрес`>>
|

|===

[#Христос_воскрес]
== Христос&lowbar;воскрес


=== Synopsis


Declared in `&lt;utf&hyphen;8&period;cpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
Expand Down
5 changes: 2 additions & 3 deletions test-files/golden-tests/core/utf-8.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ <h2>Functions</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th><th>Description</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#Христос_воскрес"><code>Христос_воскрес</code></a> </td><td>
</td></tr>
<td><a href="#Христос_воскрес"><code>Христос_воскрес</code></a> </td></tr>
</tbody>
</table>
</div>
Expand Down
1 change: 1 addition & 0 deletions test-files/golden-tests/filters/file/exclude-self.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@




[.small]#Created with https://www.mrdocs.com[MrDocs]#
18 changes: 10 additions & 8 deletions test-files/golden-tests/filters/file/include-self.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,36 @@
[#index]
== Global namespace


=== Namespaces
[cols=2]

[cols=1]
|===
| Name | Description
| Name

| <<TEST,`TEST`>>
|

|===

[#TEST]
== TEST


=== Types
[cols=2]

[cols=1]
|===
| Name | Description
| Name

| <<TEST-SUCCESS,`SUCCESS`>>
|

|===

[#TEST-SUCCESS]
== <<TEST,TEST>>::SUCCESS


=== Synopsis


Declared in `&lt;include&hyphen;self&period;cpp&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
Expand Down
10 changes: 4 additions & 6 deletions test-files/golden-tests/filters/file/include-self.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,12 @@ <h2>Namespaces</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th><th>Description</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#TEST"><code>TEST</code></a> </td><td>
</td></tr>
<td><a href="#TEST"><code>TEST</code></a> </td></tr>
</tbody>
</table>
</div>
Expand All @@ -31,13 +30,12 @@ <h2>Types</h2>
<table style="table-layout: fixed; width: 100%;">
<thead>
<tr>
<th>Name</th><th>Description</th>
<th>Name</th>
</tr>
</thead>
<tbody>
<tr>
<td><a href="#TEST-SUCCESS"><code>SUCCESS</code></a> </td><td>
</td></tr>
<td><a href="#TEST-SUCCESS"><code>SUCCESS</code></a> </td></tr>
</tbody>
</table>
</div>
Expand Down
Loading
Loading