Skip to content

Commit 9c20b9d

Browse files
committed
feat: adoc template "See also" section
1 parent 1be3e83 commit 9c20b9d

File tree

5 files changed

+37
-5
lines changed

5 files changed

+37
-5
lines changed

include/mrdocs/Metadata/Javadoc.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -848,6 +848,7 @@ struct Overview
848848
std::vector<Param const*> params;
849849
std::vector<TParam const*> tparams;
850850
std::vector<Throws const*> exceptions;
851+
std::vector<See const*> sees;
851852
};
852853

853854
MRDOCS_DECL dom::String toString(Style style) noexcept;

share/mrdocs/addons/generator/asciidoc/partials/symbols/record.adoc.hbs

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,12 @@
2525
2626
{{/if}}
2727
28-
{{! TODO: == See Also }}
28+
{{#if symbol.doc.see}}
29+
== See Also
30+
31+
{{#each symbol.doc.see}}
32+
{{.}}
33+
34+
{{/each}}
35+
36+
{{/if}}

src/lib/Gen/adoc/AdocCorpus.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,18 @@ domCreate(
378378
return dom::Object(std::move(entries));
379379
}
380380

381+
static
382+
dom::Value
383+
domCreate(
384+
const doc::See& I,
385+
const AdocCorpus& corpus)
386+
{
387+
std::string s;
388+
DocVisitor visitor(corpus, s);
389+
visitor(static_cast<const doc::See&>(I));
390+
return s;
391+
}
392+
381393
//------------------------------------------------
382394

383395
class DomJavadoc : public dom::LazyObjectImpl
@@ -464,6 +476,7 @@ class DomJavadoc : public dom::LazyObjectImpl
464476
maybeEmplaceArray(list, "params", ov.params);
465477
maybeEmplaceArray(list, "tparams", ov.tparams);
466478
maybeEmplaceArray(list, "exceptions", ov.exceptions);
479+
maybeEmplaceArray(list, "see", ov.sees);
467480

468481
return dom::Object(std::move(list));
469482
}

src/lib/Gen/adoc/Options.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,11 @@ loadOptions(
132132
}
133133
else
134134
{
135-
// VFALCO TODO get process executable
136-
// and form a path relative to that.
135+
opt.template_dir = files::makeDirsy(files::appendPath(
136+
corpus.config->addonsDir,
137+
"generator",
138+
"asciidoc"
139+
));
137140
}
138141

139142
if(! opt.template_dir.empty())
@@ -145,8 +148,11 @@ loadOptions(
145148
}
146149
else
147150
{
148-
// VFALCO TODO get process executable
149-
// and form a path relative to that.
151+
opt.template_dir = files::makeDirsy(files::appendPath(
152+
corpus.config->addonsDir,
153+
"generator",
154+
"asciidoc"
155+
));
150156
}
151157

152158
return opt;

src/lib/Metadata/Javadoc.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,10 @@ makeOverview(
274274
ov.exceptions.push_back(static_cast<
275275
doc::Throws const*>(it->get()));
276276
break;
277+
case doc::Kind::see:
278+
ov.sees.push_back(static_cast<
279+
doc::See const*>(it->get()));
280+
break;
277281
default:
278282
if(ov.brief == it->get())
279283
break;

0 commit comments

Comments
 (0)