32 static const char *Format;
33 Error generateDocumentation(StringRef RootDir, StringMap<Info *> Infos,
35 std::string DirName)
override;
37 Error generateDocForJSON(json::Value &
JSON, raw_fd_ostream &OS,
39 StringRef ObjectTypeStr,
40 StringRef RelativeRootPath)
override;
43 Error generateDocForInfo(
Info *I, llvm::raw_ostream &OS,
50 std::string NamespaceFilePath =
55 std::vector<std::pair<StringRef, StringRef>> Partials = {
56 {
"Comments", CommentsFilePath}};
58 if (Error Err = setupTemplate(
RecordTemplate, ClassFilePath, Partials))
64 if (Error Err = setupTemplate(
IndexTemplate, IndexFilePath, Partials))
69 static const DenseMap<char, std::string> EscapeChars;
75 return Error::success();
78Error MDMustacheGenerator::generateDocumentation(
79 StringRef RootDir, StringMap<Info *> Infos,
80 const clang::doc::ClangDocContext &CDCtx, std::string Dirname) {
85Error MDMustacheGenerator::generateDocForJSON(json::Value &
JSON,
87 const ClangDocContext &CDCtx,
89 StringRef RelativeRootPath) {
90 if (ObjTypeStr ==
"record") {
93 }
else if (ObjTypeStr ==
"namespace") {
96 }
else if (ObjTypeStr ==
"all_files") {
99 }
else if (ObjTypeStr ==
"index") {
103 return Error::success();
106Error MDMustacheGenerator::generateDocForInfo(Info *I, raw_ostream &OS,
107 const ClangDocContext &CDCtx) {
108 return Error::success();
111const char *MDMustacheGenerator::Format =
"md_mustache";
113static GeneratorRegistry::Add<MDMustacheGenerator>
115 "Generator for mustache Markdown output.");
static GeneratorRegistry::Add< JSONGenerator > JSON(JSONGenerator::Format, "Generator for JSON output.")
static GeneratorRegistry::Add< MDMustacheGenerator > MDMustache(MDMustacheGenerator::Format, "Generator for mustache Markdown output.")
static std::unique_ptr< MustacheTemplateFile > RecordTemplate
static std::unique_ptr< MustacheTemplateFile > NamespaceTemplate
static std::unique_ptr< MustacheTemplateFile > IndexTemplate
static std::unique_ptr< MustacheTemplateFile > AllFilesTemplate
volatile int MDMustacheGeneratorAnchorSource
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Some operations such as code completion produce a set of candidates.
llvm::StringMap< std::string > MustacheTemplates
llvm::Error generateDocumentation(StringRef RootDir, llvm::StringMap< doc::Info * > Infos, const clang::doc::ClangDocContext &CDCtx, std::string DirName) override
The main orchestrator for Mustache-based documentation.