Reapply [clang-doc] Add --asset option to clang-doc (#96358)
Reapply https://github.com/llvm/llvm-project/pull/94717 Adds a new option --asset which allows users to specified the asset folder for the html output of clang-doc. This patch adds a better test for --asset option + fixes bug where clang-doc assumes that user supplied js file is assume to be index.js
This commit is contained in:
parent
868b90df07
commit
f14ad74478
@ -289,9 +289,18 @@ genStylesheetsHTML(StringRef InfoPath, const ClangDocContext &CDCtx) {
|
|||||||
static std::vector<std::unique_ptr<TagNode>>
|
static std::vector<std::unique_ptr<TagNode>>
|
||||||
genJsScriptsHTML(StringRef InfoPath, const ClangDocContext &CDCtx) {
|
genJsScriptsHTML(StringRef InfoPath, const ClangDocContext &CDCtx) {
|
||||||
std::vector<std::unique_ptr<TagNode>> Out;
|
std::vector<std::unique_ptr<TagNode>> Out;
|
||||||
|
|
||||||
|
// index_json.js is part of every generated HTML file
|
||||||
|
SmallString<128> IndexJSONPath = computeRelativePath("", InfoPath);
|
||||||
|
auto IndexJSONNode = std::make_unique<TagNode>(HTMLTag::TAG_SCRIPT);
|
||||||
|
llvm::sys::path::append(IndexJSONPath, "index_json.js");
|
||||||
|
llvm::sys::path::native(IndexJSONPath, llvm::sys::path::Style::posix);
|
||||||
|
IndexJSONNode->Attributes.emplace_back("src", std::string(IndexJSONPath));
|
||||||
|
Out.emplace_back(std::move(IndexJSONNode));
|
||||||
|
|
||||||
for (const auto &FilePath : CDCtx.JsScripts) {
|
for (const auto &FilePath : CDCtx.JsScripts) {
|
||||||
auto ScriptNode = std::make_unique<TagNode>(HTMLTag::TAG_SCRIPT);
|
|
||||||
SmallString<128> ScriptPath = computeRelativePath("", InfoPath);
|
SmallString<128> ScriptPath = computeRelativePath("", InfoPath);
|
||||||
|
auto ScriptNode = std::make_unique<TagNode>(HTMLTag::TAG_SCRIPT);
|
||||||
llvm::sys::path::append(ScriptPath, llvm::sys::path::filename(FilePath));
|
llvm::sys::path::append(ScriptPath, llvm::sys::path::filename(FilePath));
|
||||||
// Paths in HTML must be in posix-style
|
// Paths in HTML must be in posix-style
|
||||||
llvm::sys::path::native(ScriptPath, llvm::sys::path::Style::posix);
|
llvm::sys::path::native(ScriptPath, llvm::sys::path::Style::posix);
|
||||||
@ -1069,7 +1078,7 @@ llvm::Error HTMLGenerator::createResources(ClangDocContext &CDCtx) {
|
|||||||
if (Err)
|
if (Err)
|
||||||
return Err;
|
return Err;
|
||||||
}
|
}
|
||||||
for (const auto &FilePath : CDCtx.FilesToCopy) {
|
for (const auto &FilePath : CDCtx.JsScripts) {
|
||||||
Err = CopyFile(FilePath, CDCtx.OutDirectory);
|
Err = CopyFile(FilePath, CDCtx.OutDirectory);
|
||||||
if (Err)
|
if (Err)
|
||||||
return Err;
|
return Err;
|
||||||
|
@ -368,11 +368,9 @@ ClangDocContext::ClangDocContext(tooling::ExecutionContext *ECtx,
|
|||||||
StringRef ProjectName, bool PublicOnly,
|
StringRef ProjectName, bool PublicOnly,
|
||||||
StringRef OutDirectory, StringRef SourceRoot,
|
StringRef OutDirectory, StringRef SourceRoot,
|
||||||
StringRef RepositoryUrl,
|
StringRef RepositoryUrl,
|
||||||
std::vector<std::string> UserStylesheets,
|
std::vector<std::string> UserStylesheets)
|
||||||
std::vector<std::string> JsScripts)
|
|
||||||
: ECtx(ECtx), ProjectName(ProjectName), PublicOnly(PublicOnly),
|
: ECtx(ECtx), ProjectName(ProjectName), PublicOnly(PublicOnly),
|
||||||
OutDirectory(OutDirectory), UserStylesheets(UserStylesheets),
|
OutDirectory(OutDirectory), UserStylesheets(UserStylesheets) {
|
||||||
JsScripts(JsScripts) {
|
|
||||||
llvm::SmallString<128> SourceRootDir(SourceRoot);
|
llvm::SmallString<128> SourceRootDir(SourceRoot);
|
||||||
if (SourceRoot.empty())
|
if (SourceRoot.empty())
|
||||||
// If no SourceRoot was provided the current path is used as the default
|
// If no SourceRoot was provided the current path is used as the default
|
||||||
|
@ -482,8 +482,7 @@ struct ClangDocContext {
|
|||||||
ClangDocContext(tooling::ExecutionContext *ECtx, StringRef ProjectName,
|
ClangDocContext(tooling::ExecutionContext *ECtx, StringRef ProjectName,
|
||||||
bool PublicOnly, StringRef OutDirectory, StringRef SourceRoot,
|
bool PublicOnly, StringRef OutDirectory, StringRef SourceRoot,
|
||||||
StringRef RepositoryUrl,
|
StringRef RepositoryUrl,
|
||||||
std::vector<std::string> UserStylesheets,
|
std::vector<std::string> UserStylesheets);
|
||||||
std::vector<std::string> JsScripts);
|
|
||||||
tooling::ExecutionContext *ECtx;
|
tooling::ExecutionContext *ECtx;
|
||||||
std::string ProjectName; // Name of project clang-doc is documenting.
|
std::string ProjectName; // Name of project clang-doc is documenting.
|
||||||
bool PublicOnly; // Indicates if only public declarations are documented.
|
bool PublicOnly; // Indicates if only public declarations are documented.
|
||||||
@ -498,8 +497,6 @@ struct ClangDocContext {
|
|||||||
std::vector<std::string> UserStylesheets;
|
std::vector<std::string> UserStylesheets;
|
||||||
// JavaScript files that will be imported in allHTML file.
|
// JavaScript files that will be imported in allHTML file.
|
||||||
std::vector<std::string> JsScripts;
|
std::vector<std::string> JsScripts;
|
||||||
// Other files that should be copied to OutDirectory, besides UserStylesheets.
|
|
||||||
std::vector<std::string> FilesToCopy;
|
|
||||||
Index Idx;
|
Index Idx;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -81,6 +81,12 @@ static llvm::cl::list<std::string> UserStylesheets(
|
|||||||
llvm::cl::desc("CSS stylesheets to extend the default styles."),
|
llvm::cl::desc("CSS stylesheets to extend the default styles."),
|
||||||
llvm::cl::cat(ClangDocCategory));
|
llvm::cl::cat(ClangDocCategory));
|
||||||
|
|
||||||
|
static llvm::cl::opt<std::string> UserAssetPath(
|
||||||
|
"asset",
|
||||||
|
llvm::cl::desc("User supplied asset path to "
|
||||||
|
"override the default css and js files for html output"),
|
||||||
|
llvm::cl::cat(ClangDocCategory));
|
||||||
|
|
||||||
static llvm::cl::opt<std::string> SourceRoot("source-root", llvm::cl::desc(R"(
|
static llvm::cl::opt<std::string> SourceRoot("source-root", llvm::cl::desc(R"(
|
||||||
Directory where processed files are stored.
|
Directory where processed files are stored.
|
||||||
Links to definition locations will only be
|
Links to definition locations will only be
|
||||||
@ -127,10 +133,78 @@ std::string getFormatString() {
|
|||||||
// GetMainExecutable (since some platforms don't support taking the
|
// GetMainExecutable (since some platforms don't support taking the
|
||||||
// address of main, and some platforms can't implement GetMainExecutable
|
// address of main, and some platforms can't implement GetMainExecutable
|
||||||
// without being given the address of a function in the main executable).
|
// without being given the address of a function in the main executable).
|
||||||
std::string GetExecutablePath(const char *Argv0, void *MainAddr) {
|
std::string getExecutablePath(const char *Argv0, void *MainAddr) {
|
||||||
return llvm::sys::fs::getMainExecutable(Argv0, MainAddr);
|
return llvm::sys::fs::getMainExecutable(Argv0, MainAddr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
llvm::Error getAssetFiles(clang::doc::ClangDocContext &CDCtx) {
|
||||||
|
using DirIt = llvm::sys::fs::directory_iterator;
|
||||||
|
std::error_code FileErr;
|
||||||
|
llvm::SmallString<128> FilePath(UserAssetPath);
|
||||||
|
for (DirIt DirStart = DirIt(UserAssetPath, FileErr),
|
||||||
|
DirEnd;
|
||||||
|
!FileErr && DirStart != DirEnd; DirStart.increment(FileErr)) {
|
||||||
|
FilePath = DirStart->path();
|
||||||
|
if (llvm::sys::fs::is_regular_file(FilePath)) {
|
||||||
|
if (llvm::sys::path::extension(FilePath) == ".css")
|
||||||
|
CDCtx.UserStylesheets.insert(CDCtx.UserStylesheets.begin(),
|
||||||
|
std::string(FilePath));
|
||||||
|
else if (llvm::sys::path::extension(FilePath) == ".js")
|
||||||
|
CDCtx.JsScripts.emplace_back(FilePath.str());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (FileErr)
|
||||||
|
return llvm::createFileError(FilePath, FileErr);
|
||||||
|
return llvm::Error::success();
|
||||||
|
}
|
||||||
|
|
||||||
|
llvm::Error getDefaultAssetFiles(const char *Argv0,
|
||||||
|
clang::doc::ClangDocContext &CDCtx) {
|
||||||
|
void *MainAddr = (void *)(intptr_t)getExecutablePath;
|
||||||
|
std::string ClangDocPath = getExecutablePath(Argv0, 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-doc");
|
||||||
|
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");
|
||||||
|
|
||||||
|
if (!llvm::sys::fs::is_regular_file(IndexJS))
|
||||||
|
return llvm::createStringError(llvm::inconvertibleErrorCode(),
|
||||||
|
"default index.js file missing at " +
|
||||||
|
IndexJS + "\n");
|
||||||
|
|
||||||
|
if (!llvm::sys::fs::is_regular_file(DefaultStylesheet))
|
||||||
|
return llvm::createStringError(
|
||||||
|
llvm::inconvertibleErrorCode(),
|
||||||
|
"default clang-doc-default-stylesheet.css file missing at " +
|
||||||
|
DefaultStylesheet + "\n");
|
||||||
|
|
||||||
|
CDCtx.UserStylesheets.insert(CDCtx.UserStylesheets.begin(),
|
||||||
|
std::string(DefaultStylesheet));
|
||||||
|
CDCtx.JsScripts.emplace_back(IndexJS.str());
|
||||||
|
|
||||||
|
return llvm::Error::success();
|
||||||
|
}
|
||||||
|
|
||||||
|
llvm::Error getHtmlAssetFiles(const char *Argv0,
|
||||||
|
clang::doc::ClangDocContext &CDCtx) {
|
||||||
|
if (!UserAssetPath.empty() &&
|
||||||
|
!llvm::sys::fs::is_directory(std::string(UserAssetPath)))
|
||||||
|
llvm::outs() << "Asset path supply is not a directory: " << UserAssetPath
|
||||||
|
<< " falling back to default\n";
|
||||||
|
if (llvm::sys::fs::is_directory(std::string(UserAssetPath)))
|
||||||
|
return getAssetFiles(CDCtx);
|
||||||
|
return getDefaultAssetFiles(Argv0, CDCtx);
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, const char **argv) {
|
int main(int argc, const char **argv) {
|
||||||
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
|
llvm::sys::PrintStackTraceOnErrorSignal(argv[0]);
|
||||||
std::error_code OK;
|
std::error_code OK;
|
||||||
@ -178,27 +252,14 @@ Example usage for a project using a compile commands database:
|
|||||||
OutDirectory,
|
OutDirectory,
|
||||||
SourceRoot,
|
SourceRoot,
|
||||||
RepositoryUrl,
|
RepositoryUrl,
|
||||||
{UserStylesheets.begin(), UserStylesheets.end()},
|
{UserStylesheets.begin(), UserStylesheets.end()}
|
||||||
{"index.js", "index_json.js"}};
|
};
|
||||||
|
|
||||||
if (Format == "html") {
|
if (Format == "html") {
|
||||||
void *MainAddr = (void *)(intptr_t)GetExecutablePath;
|
if (auto Err = getHtmlAssetFiles(argv[0], CDCtx)) {
|
||||||
std::string ClangDocPath = GetExecutablePath(argv[0], MainAddr);
|
llvm::errs() << toString(std::move(Err)) << "\n";
|
||||||
llvm::SmallString<128> NativeClangDocPath;
|
return 1;
|
||||||
llvm::sys::path::native(ClangDocPath, NativeClangDocPath);
|
}
|
||||||
llvm::SmallString<128> AssetsPath;
|
|
||||||
AssetsPath = llvm::sys::path::parent_path(NativeClangDocPath);
|
|
||||||
llvm::sys::path::append(AssetsPath, "..", "share", "clang-doc");
|
|
||||||
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());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Mapping phase
|
// Mapping phase
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
body {
|
||||||
|
padding: 0;
|
||||||
|
}
|
@ -0,0 +1 @@
|
|||||||
|
console.log("Hello, world!");
|
22
clang-tools-extra/test/clang-doc/assets.cpp
Normal file
22
clang-tools-extra/test/clang-doc/assets.cpp
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// RUN: rm -rf %t && mkdir %t
|
||||||
|
// RUN: clang-doc --format=html --output=%t --asset=%S/Inputs/test-assets --executor=standalone %s
|
||||||
|
// RUN: FileCheck %s -input-file=%t/index.html -check-prefix=INDEX
|
||||||
|
// RUN: FileCheck %s -input-file=%t/test.css -check-prefix=CSS
|
||||||
|
// RUN: FileCheck %s -input-file=%t/test.js -check-prefix=JS
|
||||||
|
|
||||||
|
// INDEX: <!DOCTYPE html>
|
||||||
|
// INDEX-NEXT: <meta charset="utf-8"/>
|
||||||
|
// INDEX-NEXT: <title>Index</title>
|
||||||
|
// INDEX-NEXT: <link rel="stylesheet" href="test.css"/>
|
||||||
|
// INDEX-NEXT: <script src="index_json.js"></script>
|
||||||
|
// INDEX-NEXT: <script src="test.js"></script>
|
||||||
|
// INDEX-NEXT: <header id="project-title"></header>
|
||||||
|
// INDEX-NEXT: <main>
|
||||||
|
// INDEX-NEXT: <div id="sidebar-left" path="" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left" style="flex: 0 100%;"></div>
|
||||||
|
// INDEX-NEXT: </main>
|
||||||
|
|
||||||
|
// CSS: body {
|
||||||
|
// CSS-NEXT: padding: 0;
|
||||||
|
// CSS-NEXT: }
|
||||||
|
|
||||||
|
// JS: console.log("Hello, world!");
|
@ -57,8 +57,8 @@
|
|||||||
// HTML-SHAPE-NEXT: <meta charset="utf-8"/>
|
// HTML-SHAPE-NEXT: <meta charset="utf-8"/>
|
||||||
// HTML-SHAPE-NEXT: <title>class Shape</title>
|
// HTML-SHAPE-NEXT: <title>class Shape</title>
|
||||||
// HTML-SHAPE-NEXT: <link rel="stylesheet" href="../clang-doc-default-stylesheet.css"/>
|
// HTML-SHAPE-NEXT: <link rel="stylesheet" href="../clang-doc-default-stylesheet.css"/>
|
||||||
// HTML-SHAPE-NEXT: <script src="../index.js"></script>
|
// HTML-SHAPE-NEXT: <script src="{{.*}}index_json.js"></script>
|
||||||
// HTML-SHAPE-NEXT: <script src="../index_json.js"></script>
|
// HTML-SHAPE-NEXT: <script src="{{.*}}index.js"></script>
|
||||||
// HTML-SHAPE-NEXT: <header id="project-title"></header>
|
// HTML-SHAPE-NEXT: <header id="project-title"></header>
|
||||||
// HTML-SHAPE-NEXT: <main>
|
// HTML-SHAPE-NEXT: <main>
|
||||||
// HTML-SHAPE-NEXT: <div id="sidebar-left" path="GlobalNamespace" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"></div>
|
// HTML-SHAPE-NEXT: <div id="sidebar-left" path="GlobalNamespace" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"></div>
|
||||||
@ -122,8 +122,8 @@
|
|||||||
// HTML-CALC-NEXT: <meta charset="utf-8"/>
|
// HTML-CALC-NEXT: <meta charset="utf-8"/>
|
||||||
// HTML-CALC-NEXT: <title>class Calculator</title>
|
// HTML-CALC-NEXT: <title>class Calculator</title>
|
||||||
// HTML-CALC-NEXT: <link rel="stylesheet" href="{{.*}}clang-doc-default-stylesheet.css"/>
|
// HTML-CALC-NEXT: <link rel="stylesheet" href="{{.*}}clang-doc-default-stylesheet.css"/>
|
||||||
// HTML-CALC-NEXT: <script src="{{.*}}index.js"></script>
|
|
||||||
// HTML-CALC-NEXT: <script src="{{.*}}index_json.js"></script>
|
// HTML-CALC-NEXT: <script src="{{.*}}index_json.js"></script>
|
||||||
|
// HTML-CALC-NEXT: <script src="{{.*}}index.js"></script>
|
||||||
// HTML-CALC-NEXT: <header id="project-title"></header>
|
// HTML-CALC-NEXT: <header id="project-title"></header>
|
||||||
// HTML-CALC-NEXT: <main>
|
// HTML-CALC-NEXT: <main>
|
||||||
// HTML-CALC-NEXT: <div id="sidebar-left" path="GlobalNamespace" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"></div>
|
// HTML-CALC-NEXT: <div id="sidebar-left" path="GlobalNamespace" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"></div>
|
||||||
@ -200,8 +200,8 @@
|
|||||||
// HTML-RECTANGLE-NEXT: <meta charset="utf-8"/>
|
// HTML-RECTANGLE-NEXT: <meta charset="utf-8"/>
|
||||||
// HTML-RECTANGLE-NEXT: <title>class Rectangle</title>
|
// HTML-RECTANGLE-NEXT: <title>class Rectangle</title>
|
||||||
// HTML-RECTANGLE-NEXT: <link rel="stylesheet" href="{{.*}}clang-doc-default-stylesheet.css"/>
|
// HTML-RECTANGLE-NEXT: <link rel="stylesheet" href="{{.*}}clang-doc-default-stylesheet.css"/>
|
||||||
// HTML-RECTANGLE-NEXT: <script src="{{.*}}index.js"></script>
|
|
||||||
// HTML-RECTANGLE-NEXT: <script src="{{.*}}index_json.js"></script>
|
// HTML-RECTANGLE-NEXT: <script src="{{.*}}index_json.js"></script>
|
||||||
|
// HTML-RECTANGLE-NEXT: <script src="{{.*}}index.js"></script>
|
||||||
// HTML-RECTANGLE-NEXT: <header id="project-title"></header>
|
// HTML-RECTANGLE-NEXT: <header id="project-title"></header>
|
||||||
// HTML-RECTANGLE-NEXT: <main>
|
// HTML-RECTANGLE-NEXT: <main>
|
||||||
// HTML-RECTANGLE-NEXT: <div id="sidebar-left" path="GlobalNamespace" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"></div>
|
// HTML-RECTANGLE-NEXT: <div id="sidebar-left" path="GlobalNamespace" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"></div>
|
||||||
@ -281,8 +281,8 @@
|
|||||||
// HTML-CIRCLE-NEXT: <meta charset="utf-8"/>
|
// HTML-CIRCLE-NEXT: <meta charset="utf-8"/>
|
||||||
// HTML-CIRCLE-NEXT: <title>class Circle</title>
|
// HTML-CIRCLE-NEXT: <title>class Circle</title>
|
||||||
// HTML-CIRCLE-NEXT: <link rel="stylesheet" href="{{.*}}clang-doc-default-stylesheet.css"/>
|
// HTML-CIRCLE-NEXT: <link rel="stylesheet" href="{{.*}}clang-doc-default-stylesheet.css"/>
|
||||||
// HTML-CIRCLE-NEXT: <script src="{{.*}}index.js"></script>
|
|
||||||
// HTML-CIRCLE-NEXT: <script src="{{.*}}index_json.js"></script>
|
// HTML-CIRCLE-NEXT: <script src="{{.*}}index_json.js"></script>
|
||||||
|
// HTML-CIRCLE-NEXT: <script src="{{.*}}index.js"></script>
|
||||||
// HTML-CIRCLE-NEXT: <header id="project-title"></header>
|
// HTML-CIRCLE-NEXT: <header id="project-title"></header>
|
||||||
// HTML-CIRCLE-NEXT: <main>
|
// HTML-CIRCLE-NEXT: <main>
|
||||||
// HTML-CIRCLE-NEXT: <div id="sidebar-left" path="GlobalNamespace" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"></div>
|
// HTML-CIRCLE-NEXT: <div id="sidebar-left" path="GlobalNamespace" class="col-xs-6 col-sm-3 col-md-2 sidebar sidebar-offcanvas-left"></div>
|
||||||
|
@ -30,7 +30,7 @@ ClangDocContext
|
|||||||
getClangDocContext(std::vector<std::string> UserStylesheets = {},
|
getClangDocContext(std::vector<std::string> UserStylesheets = {},
|
||||||
StringRef RepositoryUrl = "") {
|
StringRef RepositoryUrl = "") {
|
||||||
ClangDocContext CDCtx{
|
ClangDocContext CDCtx{
|
||||||
{}, "test-project", {}, {}, {}, RepositoryUrl, UserStylesheets, {}};
|
{}, "test-project", {}, {}, {}, RepositoryUrl, UserStylesheets};
|
||||||
CDCtx.UserStylesheets.insert(
|
CDCtx.UserStylesheets.insert(
|
||||||
CDCtx.UserStylesheets.begin(),
|
CDCtx.UserStylesheets.begin(),
|
||||||
"../share/clang/clang-doc-default-stylesheet.css");
|
"../share/clang/clang-doc-default-stylesheet.css");
|
||||||
@ -66,6 +66,7 @@ TEST(HTMLGeneratorTest, emitNamespaceHTML) {
|
|||||||
<title>namespace Namespace</title>
|
<title>namespace Namespace</title>
|
||||||
<link rel="stylesheet" href="../clang-doc-default-stylesheet.css"/>
|
<link rel="stylesheet" href="../clang-doc-default-stylesheet.css"/>
|
||||||
<link rel="stylesheet" href="../user-provided-stylesheet.css"/>
|
<link rel="stylesheet" href="../user-provided-stylesheet.css"/>
|
||||||
|
<script src="../index_json.js"></script>
|
||||||
<script src="../index.js"></script>
|
<script src="../index.js"></script>
|
||||||
<header id="project-title">test-project</header>
|
<header id="project-title">test-project</header>
|
||||||
<main>
|
<main>
|
||||||
@ -176,6 +177,7 @@ TEST(HTMLGeneratorTest, emitRecordHTML) {
|
|||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<title>class r</title>
|
<title>class r</title>
|
||||||
<link rel="stylesheet" href="../../../clang-doc-default-stylesheet.css"/>
|
<link rel="stylesheet" href="../../../clang-doc-default-stylesheet.css"/>
|
||||||
|
<script src="../../../index_json.js"></script>
|
||||||
<script src="../../../index.js"></script>
|
<script src="../../../index.js"></script>
|
||||||
<header id="project-title">test-project</header>
|
<header id="project-title">test-project</header>
|
||||||
<main>
|
<main>
|
||||||
@ -290,6 +292,7 @@ TEST(HTMLGeneratorTest, emitFunctionHTML) {
|
|||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<title></title>
|
<title></title>
|
||||||
<link rel="stylesheet" href="clang-doc-default-stylesheet.css"/>
|
<link rel="stylesheet" href="clang-doc-default-stylesheet.css"/>
|
||||||
|
<script src="index_json.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
<header id="project-title">test-project</header>
|
<header id="project-title">test-project</header>
|
||||||
<main>
|
<main>
|
||||||
@ -337,6 +340,7 @@ TEST(HTMLGeneratorTest, emitEnumHTML) {
|
|||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<title></title>
|
<title></title>
|
||||||
<link rel="stylesheet" href="clang-doc-default-stylesheet.css"/>
|
<link rel="stylesheet" href="clang-doc-default-stylesheet.css"/>
|
||||||
|
<script src="index_json.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
<header id="project-title">test-project</header>
|
<header id="project-title">test-project</header>
|
||||||
<main>
|
<main>
|
||||||
@ -422,6 +426,7 @@ TEST(HTMLGeneratorTest, emitCommentHTML) {
|
|||||||
<meta charset="utf-8"/>
|
<meta charset="utf-8"/>
|
||||||
<title></title>
|
<title></title>
|
||||||
<link rel="stylesheet" href="clang-doc-default-stylesheet.css"/>
|
<link rel="stylesheet" href="clang-doc-default-stylesheet.css"/>
|
||||||
|
<script src="index_json.js"></script>
|
||||||
<script src="index.js"></script>
|
<script src="index.js"></script>
|
||||||
<header id="project-title">test-project</header>
|
<header id="project-title">test-project</header>
|
||||||
<main>
|
<main>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user