================ @@ -74,7 +75,51 @@ static std::unique_ptr<MustacheTemplateFile> NamespaceTemplate = nullptr; static std::unique_ptr<MustacheTemplateFile> RecordTemplate = nullptr; +static Error +setupTemplate(std::unique_ptr<MustacheTemplateFile> &Template, + StringRef TemplatePath, + std::vector<std::pair<StringRef, StringRef>> Partials) { + auto T = MustacheTemplateFile::createMustacheFile(TemplatePath); + if (Error Err = T.takeError()) + return Err; + Template = std::move(T.get()); + for (const auto [Name, FileName] : Partials) { + if (auto Err = Template->registerPartialFile(Name, FileName)) + return Err; + } + return Error::success(); +} + static Error setupTemplateFiles(const clang::doc::ClangDocContext &CDCtx) { + // Template files need to use the native path when they're opened, + // but have to be used in Posix style when used in HTML. ---------------- mysterymath wrote:
nit: POSIX https://github.com/llvm/llvm-project/pull/138062 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits