-
Notifications
You must be signed in to change notification settings - Fork 106
/
Copy pathhdoc.patch
65 lines (62 loc) · 2.95 KB
/
hdoc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
diff --git a/src/serde/HTMLWriter.cpp b/src/serde/HTMLWriter.cpp
index f9bf5a9..d2b5a9f 100644
--- a/src/serde/HTMLWriter.cpp
+++ b/src/serde/HTMLWriter.cpp
@@ -18,6 +18,23 @@
#include "support/StringUtils.hpp"
#include "types/Symbols.hpp"
+static bool isMcapInternal(const hdoc::types::Symbol& symbol, const hdoc::types::Index& index) {
+ const auto* current = &symbol;
+ while (true) {
+ if (index.namespaces.contains(current->parentNamespaceID)) {
+ current = &index.namespaces.entries.at(current->parentNamespaceID);
+ } else if (index.records.contains(current->parentNamespaceID)) {
+ current = &index.records.entries.at(current->parentNamespaceID);
+ } else {
+ break;
+ }
+ if (current->name == std::string("internal")) {
+ return true;
+ }
+ }
+ return false;
+}
+
/// Implementation of to_string() for Clang member variable access specifier
static std::string to_string(const clang::AccessSpecifier& access) {
switch (access) {
@@ -206,7 +223,6 @@ static void printNewPage(const hdoc::types::Config& cfg,
if (cfg.gitRepoURL != "") {
menuUL.AddChild(CTML::Node("li").AddChild(CTML::Node("a", "Repository").SetAttr("href", cfg.gitRepoURL)));
}
- menuUL.AddChild(CTML::Node("li").AddChild(CTML::Node("a", "Made with hdoc").SetAttr("href", "https://hdoc.io")));
// Add paths to markdown pages converted to HTML, if any were provided
if (cfg.mdPaths.size() > 0) {
@@ -238,7 +254,7 @@ static void printNewPage(const hdoc::types::Config& cfg,
"p", "Documentation for " + cfg.projectName + (cfg.projectVersion == "" ? "." : " " + cfg.projectVersion + "."));
CTML::Node p2 = CTML::Node("p", "Generated by ")
.AddChild(CTML::Node("a", "hdoc").SetAttr("href", "https://hdoc.io/"))
- .AppendText(" version " + cfg.hdocVersion + " on " + cfg.timestamp + ".");
+ .AppendText(" version " + cfg.hdocVersion + ".");
CTML::Node p3 = CTML::Node("p.has-text-grey-light", "19AD43E11B2996");
html.AppendNodeToBody(CTML::Node("footer.footer").AddChild(p1).AddChild(p2).AddChild(p3));
@@ -549,6 +565,9 @@ void hdoc::serde::HTMLWriter::printFunctions() const {
CTML::Node ul("ul");
for (const auto& id : getSortedIDs(map2vec(this->index->functions), this->index->functions)) {
const auto& f = this->index->functions.entries.at(id);
+ if (isMcapInternal(f, *this->index)) {
+ continue;
+ }
if (f.isRecordMember) {
continue;
}
@@ -837,6 +856,9 @@ void hdoc::serde::HTMLWriter::printRecords() const {
CTML::Node ul("ul");
for (const auto& id : getSortedIDs(map2vec(this->index->records), this->index->records)) {
const auto& c = this->index->records.entries.at(id);
+ if (isMcapInternal(c, *this->index)) {
+ continue;
+ }
ul.AddChild(CTML::Node("li")
.AddChild(CTML::Node("a.is-family-code", c.type + " " + c.name).SetAttr("href", c.url()))
.AppendText(getSymbolBlurb(c)));