32 std::string DirName)
override;
36 StringRef ObjectTypeStr,
37 StringRef RelativeRootPath)
override;
46 std::string NamespaceFilePath =
51 std::vector<std::pair<StringRef, StringRef>> Partials = {
52 {
"Comments", CommentsFilePath}};
65 static const DenseMap<char, std::string> EscapeChars;
71 return Error::success();
85 StringRef RelativeRootPath) {
86 if (ObjTypeStr ==
"record") {
89 }
else if (ObjTypeStr ==
"namespace") {
92 }
else if (ObjTypeStr ==
"all_files") {
95 }
else if (ObjTypeStr ==
"index") {
99 return Error::success();
104 return Error::success();
109static GeneratorRegistry::Add<MDMustacheGenerator>
111 "Generator for mustache Markdown output.");
std::unique_ptr< T > OwnedPtr
static GeneratorRegistry::Add< MDMustacheGenerator > MDMustache(MDMustacheGenerator::Format, "Generator for mustache Markdown output.")
static OwnedPtr< MustacheTemplateFile > AllFilesTemplate
static GeneratorRegistry::Add< JSONGenerator > JSON(JSONGenerator::Format, "Generator for JSON output.")
static OwnedPtr< MustacheTemplateFile > IndexTemplate
volatile int MDMustacheGeneratorAnchorSource
static OwnedPtr< MustacheTemplateFile > RecordTemplate
static OwnedPtr< MustacheTemplateFile > NamespaceTemplate
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
llvm::StringMap< std::string > MustacheTemplates
Error setupTemplateFiles(const ClangDocContext &CDCtx) override
Initializes the template files from disk and calls setupTemplate to register partials.
Error generateDocForJSON(json::Value &JSON, raw_fd_ostream &OS, const ClangDocContext &CDCtx, StringRef ObjectTypeStr, StringRef RelativeRootPath) override
Error generateDocumentation(StringRef RootDir, StringMap< doc::OwnedPtr< doc::Info > > Infos, const ClangDocContext &CDCtx, std::string DirName) override
Error generateDocForInfo(Info *I, llvm::raw_ostream &OS, const ClangDocContext &CDCtx) override
static const char * Format
llvm::Error setupTemplate(OwnedPtr< MustacheTemplateFile > &Template, StringRef TemplatePath, std::vector< std::pair< StringRef, StringRef > > Partials)
Registers partials to templates.
llvm::Error generateDocumentation(StringRef RootDir, llvm::StringMap< doc::OwnedPtr< doc::Info > > Infos, const clang::doc::ClangDocContext &CDCtx, std::string DirName) override
The main orchestrator for Mustache-based documentation.