================
@@ -419,12 +421,25 @@ static void serializeReference(const Reference &Ref,
Object &ReferenceObj) {
}
}
+static void serializeMDReference(const Reference &Ref, Object &ReferenceObj,
+ StringRef BasePath) {
+ serializeReference(Ref, ReferenceObj);
+ SmallString<64> Path = Ref.getRelativeFilePath(BasePath);
+ sys::path::native(Path, sys::path::Style::posix);
+ sys::path::append(Path, sys::path::Style::posix,
+ Ref.getFileBaseName() + ".md");
+ ReferenceObj["BasePath"] = Path;
+}
+
+typedef std::function<void(const Reference &, Object &)> ReferenceFunc;
+
// Although namespaces and records both have ScopeChildren, they serialize them
// differently. Only enums, records, and typedefs are handled here.
-static void
-serializeCommonChildren(const ScopeChildren &Children, json::Object &Obj,
- const std::optional<StringRef> RepositoryUrl,
- const std::optional<StringRef> RepositoryLinePrefix) {
+static void serializeCommonChildren(
+ const ScopeChildren &Children, json::Object &Obj,
+ const std::optional<StringRef> RepositoryUrl,
+ const std::optional<StringRef> RepositoryLinePrefix,
+ std::optional<ReferenceFunc> MDReferenceLambda = std::nullopt) {
----------------
evelez7 wrote:
This is kind of complicated since the lambda needs to capture a variable
specific to Markdown documentation, so it can't just be local or else we'd need
to pass that variable here too.
https://github.com/llvm/llvm-project/pull/177221
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits