File tree Expand file tree Collapse file tree 6 files changed +24
-29
lines changed
Expand file tree Collapse file tree 6 files changed +24
-29
lines changed Original file line number Diff line number Diff line change @@ -66,10 +66,13 @@ Error HTMLGenerator::setupTemplateFiles(const ClangDocContext &CDCtx) {
6666 ConvertToNative (CDCtx.MustacheTemplates .lookup (" function-template" ));
6767 std::string EnumFilePath =
6868 ConvertToNative (CDCtx.MustacheTemplates .lookup (" enum-template" ));
69+ std::string HeadFilePath =
70+ ConvertToNative (CDCtx.MustacheTemplates .lookup (" head-template" ));
6971 std::vector<std::pair<StringRef, StringRef>> Partials = {
7072 {" Comments" , CommentFilePath},
7173 {" FunctionPartial" , FunctionFilePath},
72- {" EnumPartial" , EnumFilePath}};
74+ {" EnumPartial" , EnumFilePath},
75+ {" HeadPartial" , HeadFilePath}};
7376
7477 if (Error Err = setupTemplate (NamespaceTemplate, NamespaceFilePath, Partials))
7578 return Err;
Original file line number Diff line number Diff line change 77} }
88<!DOCTYPE html>
99<html lang =" en-US" >
10- <head >
11- <meta charset =" utf-8" />
12- <title >{ {Name} }</title >
13- { {#Stylesheets} }
14- <link rel =" stylesheet" type =" text/css" href =" { { .} } " />
15- { {/Stylesheets} }
16- { {#Scripts} }
17- <script src =" { { .} } " ></script >
18- { {/Scripts} }
19- { {! Highlight.js dependency for syntax highlighting } }
20- <link rel =" stylesheet" href =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" >
21- <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" ></script >
22- <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/cpp.min.js" ></script >
23- </head >
10+ { {> HeadPartial} }
2411<body >
2512 <nav class =" navbar" >
2613 <div class =" navbar__container" >
Original file line number Diff line number Diff line change 1+ <head >
2+ <meta charset =" utf-8" />
3+ <title >{ {Name} }</title >
4+ { {#Stylesheets} }
5+ <link rel =" stylesheet" type =" text/css" href =" { { .} } " />
6+ { {/Stylesheets} }
7+ { {#Scripts} }
8+ <script src =" { { .} } " ></script >
9+ { {/Scripts} }
10+ { {! Highlight.js dependency for syntax highlighting } }
11+ <link rel =" stylesheet" href =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" >
12+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" ></script >
13+ <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/cpp.min.js" ></script >
14+ </head >
Original file line number Diff line number Diff line change 77} }
88<!DOCTYPE html>
99<html lang =" en-US" >
10- <head >
11- <meta charset =" utf-8" />
12- <title >{ {NamespaceTitle} }</title >
13- { {#Stylesheets} }
14- <link rel =" stylesheet" type =" text/css" href =" { { .} } " />
15- { {/Stylesheets} }
16- { {#Scripts} }
17- <script src =" { { .} } " ></script >
18- { {/Scripts} }
19- { {! Highlight.js dependency for syntax highlighting } }
20- <link rel =" stylesheet" href =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/default.min.css" >
21- <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js" ></script >
22- <script src =" https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/cpp.min.js" ></script >
23- </head >
10+ { {> HeadPartial} }
2411<body >
2512 <nav class =" navbar" >
2613 <div class =" navbar__container" >
Original file line number Diff line number Diff line change @@ -56,6 +56,8 @@ void getHtmlFiles(StringRef AssetsPath, clang::doc::ClangDocContext &CDCtx) {
5656 appendPathPosix (AssetsPath, " function-template.mustache" );
5757 SmallString<128 > CommentTemplate =
5858 appendPathPosix (AssetsPath, " comment-template.mustache" );
59+ SmallString<128 > HeadTemplate =
60+ appendPathPosix (AssetsPath, " head-template.mustache" );
5961
6062 CDCtx.MustacheTemplates .insert (
6163 {" namespace-template" , NamespaceTemplate.c_str ()});
@@ -64,4 +66,5 @@ void getHtmlFiles(StringRef AssetsPath, clang::doc::ClangDocContext &CDCtx) {
6466 CDCtx.MustacheTemplates .insert (
6567 {" function-template" , FunctionTemplate.c_str ()});
6668 CDCtx.MustacheTemplates .insert ({" comment-template" , CommentTemplate.c_str ()});
69+ CDCtx.MustacheTemplates .insert ({" head-template" , HeadTemplate.c_str ()});
6770}
Original file line number Diff line number Diff line change @@ -31,6 +31,7 @@ set(assets
3131 function -template.mustache
3232 namespace-template.mustache
3333 template.mustache
34+ head-template.mustache
3435)
3536
3637set (asset_dir "${CMAKE_CURRENT_SOURCE_DIR} /../assets" )
You can’t perform that action at this time.
0 commit comments