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 MDGenerator::generateDocumentation(
79 StringRef RootDir, StringMap<Info *> Infos,
80 const clang::doc::ClangDocContext &CDCtx, std::string Dirname) {
85Error MDGenerator::generateDocForJSON(json::Value &
JSON, raw_fd_ostream &OS,
86 const ClangDocContext &CDCtx,
88 StringRef RelativeRootPath) {
89 if (ObjTypeStr ==
"record") {
92 }
else if (ObjTypeStr ==
"namespace") {
95 }
else if (ObjTypeStr ==
"all_files") {
98 }
else if (ObjTypeStr ==
"index") {
102 return Error::success();
105Error MDGenerator::generateDocForInfo(Info *I, raw_ostream &OS,
106 const ClangDocContext &CDCtx) {
107 return Error::success();
110const char *MDGenerator::Format =
"md";
112static GeneratorRegistry::Add<MDGenerator>
MD(MDGenerator::Format,
113 "Generator for Markdown output.");
static GeneratorRegistry::Add< JSONGenerator > JSON(JSONGenerator::Format, "Generator for JSON output.")
static std::unique_ptr< MustacheTemplateFile > RecordTemplate
static std::unique_ptr< MustacheTemplateFile > NamespaceTemplate
static std::unique_ptr< MustacheTemplateFile > IndexTemplate
static GeneratorRegistry::Add< MDGenerator > MD(MDGenerator::Format, "Generator for Markdown output.")
static std::unique_ptr< MustacheTemplateFile > AllFilesTemplate
volatile int MDGeneratorAnchorSource
===– 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.