================
@@ -182,23 +261,11 @@ Example usage for a project using a compile commands
database:
{"index.js", "index_json.js"}};
if (Format == "html") {
- void *MainAddr = (void *)(intptr_t)GetExecutablePath;
- std::string ClangDocPath = GetExecutablePath(argv[0], MainAddr);
- llvm::SmallString<128> NativeClangDocPath;
- llvm::sys::path::native(ClangDocPath, NativeClangDocPath);
- llvm::SmallString<128> AssetsPath;
- AssetsPath = llvm::sys::path::parent_path(NativeClangDocPath);
- llvm::sys::path::append(AssetsPath, "..", "share", "clang");
- llvm::SmallString<128> DefaultStylesheet;
- llvm::sys::path::native(AssetsPath, DefaultStylesheet);
- llvm::sys::path::append(DefaultStylesheet,
- "clang-doc-default-stylesheet.css");
- llvm::SmallString<128> IndexJS;
- llvm::sys::path::native(AssetsPath, IndexJS);
- llvm::sys::path::append(IndexJS, "index.js");
- CDCtx.UserStylesheets.insert(CDCtx.UserStylesheets.begin(),
- std::string(DefaultStylesheet));
- CDCtx.FilesToCopy.emplace_back(IndexJS.str());
+ auto Err = GetHTMLAssetFiles(argv[0], CDCtx);
+ if (Err) {
+ llvm::errs() << toString(std::move(Err)) << "\n";
+ return 1;
+ }
----------------
PeterChou1 wrote:
I based off the code off of a similar pattern code snippet here:
https://github.com/llvm/llvm-project/blob/main/clang-tools-extra/clang-doc/tool/ClangDocMain.cpp#L301
I think its correct?
https://github.com/llvm/llvm-project/pull/94717
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits