clang-tools 22.0.0git
clang::doc::MustacheHTMLGenerator Class Reference
Inheritance diagram for clang::doc::MustacheHTMLGenerator:
[legend]

Public Member Functions

Error createResources (ClangDocContext &CDCtx) override
Error generateDocForInfo (Info *I, raw_ostream &OS, const ClangDocContext &CDCtx) override
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 ObjTypeStr, StringRef RelativeRootPath) override
Error setupTemplateResources (const ClangDocContext &CDCtx, json::Value &V, SmallString< 128 > RelativeRootPath)
llvm::Error generateDocumentation (StringRef RootDir, llvm::StringMap< std::unique_ptr< doc::Info > > Infos, const ClangDocContext &CDCtx, std::string DirName) override
 The main orchestrator for Mustache-based documentation.
Public Member Functions inherited from clang::doc::MustacheGenerator
Expected< std::string > getInfoTypeStr (llvm::json::Object *Info, StringRef Filename)
SmallString< 128 > getRelativePathToRoot (StringRef PathToFile, StringRef DocsRootPath)
 Used to find the relative path from the file to the format's docs root.
virtual ~MustacheGenerator ()=default
virtual llvm::Error generateDocForJSON (llvm::json::Value &JSON, llvm::raw_fd_ostream &OS, const ClangDocContext &CDCtx, StringRef ObjectTypeStr, StringRef RelativeRootPath)=0
 Populates templates with data from JSON and calls any specifics for the format.
llvm::Error setupTemplate (std::unique_ptr< MustacheTemplateFile > &Template, StringRef TemplatePath, std::vector< std::pair< StringRef, StringRef > > Partials)
 Registers partials to templates.
Public Member Functions inherited from clang::doc::Generator
virtual ~Generator ()=default
virtual llvm::Error generateDocForInfo (Info *I, llvm::raw_ostream &OS, const ClangDocContext &CDCtx)=0

Static Public Attributes

static const char * Format = "mustache"

Additional Inherited Members

Static Public Member Functions inherited from clang::doc::Generator
static void addInfoToIndex (Index &Idx, const doc::Info *Info)

Detailed Description

Definition at line 32 of file HTMLMustacheGenerator.cpp.

Member Function Documentation

◆ createResources()

Error clang::doc::MustacheHTMLGenerator::createResources ( ClangDocContext & CDCtx)
overridevirtual

◆ generateDocForInfo()

Error clang::doc::MustacheHTMLGenerator::generateDocForInfo ( Info * I,
raw_ostream & OS,
const ClangDocContext & CDCtx )
override

◆ generateDocForJSON()

Error clang::doc::MustacheHTMLGenerator::generateDocForJSON ( json::Value & JSON,
raw_fd_ostream & OS,
const ClangDocContext & CDCtx,
StringRef ObjTypeStr,
StringRef RelativeRootPath )
override

◆ generateDocumentation()

Error clang::doc::MustacheHTMLGenerator::generateDocumentation ( StringRef RootDir,
llvm::StringMap< std::unique_ptr< doc::Info > > Infos,
const ClangDocContext & CDCtx,
std::string DirName )
overridevirtual

The main orchestrator for Mustache-based documentation.

  1. Initializes templates files from disk by calling setupTemplateFiles.
  2. Calls the JSON generator to write JSON to disk.
  3. Iterates over the JSON files, recreates the directory structure from JSON, and calls generateDocForJSON for each file.
  4. A file of the desired format is created.

Reimplemented from clang::doc::MustacheGenerator.

Definition at line 161 of file HTMLMustacheGenerator.cpp.

References clang::doc::MustacheGenerator::generateDocumentation().

◆ setupTemplateFiles()

Error clang::doc::MustacheHTMLGenerator::setupTemplateFiles ( const ClangDocContext & CDCtx)
overridevirtual

Initializes the template files from disk and calls setupTemplate to register partials.

Implements clang::doc::MustacheGenerator.

Definition at line 50 of file HTMLMustacheGenerator.cpp.

References clang::doc::ClangDocContext::MustacheTemplates, clang::doc::NamespaceTemplate, clang::doc::RecordTemplate, and clang::doc::MustacheGenerator::setupTemplate().

◆ setupTemplateResources()

Error clang::doc::MustacheHTMLGenerator::setupTemplateResources ( const ClangDocContext & CDCtx,
json::Value & V,
SmallString< 128 > RelativeRootPath )

Member Data Documentation

◆ Format

const char * clang::doc::MustacheHTMLGenerator::Format = "mustache"
static

Definition at line 34 of file HTMLMustacheGenerator.cpp.

Referenced by clang::doc::MHTML().


The documentation for this class was generated from the following file: