Doxygen
Loading...
Searching...
No Matches
htmlgen.cpp File Reference
#include "htmlgen.h"
#include <functional>
#include <memory>
#include <mutex>
#include "config.h"
#include "datetime.h"
#include "diagram.h"
#include "dir.h"
#include "dotcallgraph.h"
#include "dotclassgraph.h"
#include "dotdirdeps.h"
#include "dotgfxhierarchytable.h"
#include "dotgroupcollaboration.h"
#include "dotincldepgraph.h"
#include "doxygen.h"
#include "fileinfo.h"
#include "htmldocvisitor.h"
#include "indexlist.h"
#include "language.h"
#include "layout.h"
#include "mermaid.h"
#include "message.h"
#include "outputlist.h"
#include "pagedef.h"
#include "portable.h"
#include "resourcemgr.h"
#include "stringutil.h"
#include "textstream.h"
#include "utf8.h"
#include "util.h"
#include "version.h"
#include "vhdldocgen.h"
Include dependency graph for htmlgen.cpp:

Go to the source code of this file.

Macros

#define DBG_HTML(x)

Functions

static bool useDynamicSections ()
static void writeClientSearchBox (TextStream &t, const DString &relPath)
static void writeServerSearchBox (TextStream &t, const DString &relPath, bool highlightSearch)
static DString getConvertLatexMacro ()
 Convert a set of LaTeX commands \(re)newcommand to a form readable by MathJax LaTeX syntax:
static DString getSearchBox (bool serverSide, DString relPath, bool highlightSearch)
static DString substituteHtmlKeywords (const DString &file, const DString &str, const DString &title, const DString &relPath, const DString &navPath=DString(), bool isSource=false)
static void fillColorStyleMap (const DString &definitions, StringUnorderedMap &map)
static void fillColorStyleMaps ()
static DString replaceVariables (const DString &input)
static bool hasDateReplacement (const DString &str)
static void writeDefaultStyleSheet (TextStream &t)
static void startSectionHeader (TextStream &t, const DString &relPath, int sectionCount)
static void endSectionHeader (TextStream &t)
static void startSectionSummary (TextStream &t, int sectionCount)
static void endSectionSummary (TextStream &t)
static void startSectionContent (TextStream &t, int sectionCount)
static void endSectionContent (TextStream &t)
static void startQuickIndexList (TextStream &t, bool topLevel=true)
static void endQuickIndexList (TextStream &t)
static void startQuickIndexItem (TextStream &t, const DString &l, bool hl, bool, const DString &relPath)
static void endQuickIndexItem (TextStream &t, const DString &l)
static bool quickLinkVisible (LayoutNavEntry::Kind kind)
static void renderQuickLinksAsTree (TextStream &t, const DString &relPath, LayoutNavEntry *root)
static void renderQuickLinksAsTabs (TextStream &t, const DString &relPath, LayoutNavEntry *hlEntry, LayoutNavEntry::Kind kind, bool highlightParent, bool highlightSearch)
static void writeDefaultQuickLinks (TextStream &t, HighlightedItem hli, const DString &file, const DString &relPath, bool extraTabs)

Variables

static DString g_header
static DString g_header_file
static DString g_footer_file
static DString g_footer
static DString g_mathjax_code
static DString g_latex_macro
static bool g_build_date = false
static constexpr auto hex ="0123456789ABCDEF"
static const SelectionMarkerInfo htmlMarkerInfo = { '<', "<!--BEGIN ",10,"<!--END ",8,"-->",3 }
static StringUnorderedMap g_lightMap
static StringUnorderedMap g_darkMap
static std::mutex g_indexLock

Macro Definition Documentation

◆ DBG_HTML

#define DBG_HTML ( x)

Definition at line 55 of file htmlgen.cpp.

Referenced by HtmlGenerator::endEmbeddedDoc(), HtmlGenerator::endIndent(), HtmlGenerator::endInlineMemberDoc(), HtmlGenerator::endInlineMemberName(), HtmlGenerator::endInlineMemberType(), HtmlGenerator::endLabels(), HtmlGenerator::endMemberDescription(), HtmlGenerator::endMemberDoc(), HtmlGenerator::endMemberDocList(), HtmlGenerator::endMemberDocName(), HtmlGenerator::endMemberDocPrefixItem(), HtmlGenerator::endMemberDocSimple(), HtmlGenerator::endMemberHeader(), HtmlGenerator::endMemberList(), HtmlGenerator::endMemberSections(), HtmlGenerator::endMemberSubtitle(), HtmlGenerator::endParameterExtra(), HtmlGenerator::endParameterList(), HtmlGenerator::endParameterName(), HtmlGenerator::endParameterType(), HtmlGenerator::exceptionEntry(), HtmlGenerator::insertMemberAlign(), HtmlGenerator::startEmbeddedDoc(), HtmlGenerator::startIndent(), HtmlGenerator::startInlineMemberDoc(), HtmlGenerator::startInlineMemberName(), HtmlGenerator::startInlineMemberType(), HtmlGenerator::startLabels(), HtmlGenerator::startMemberDescription(), HtmlGenerator::startMemberDoc(), HtmlGenerator::startMemberDocList(), HtmlGenerator::startMemberDocName(), HtmlGenerator::startMemberDocPrefixItem(), HtmlGenerator::startMemberDocSimple(), HtmlGenerator::startMemberHeader(), HtmlGenerator::startMemberItem(), HtmlGenerator::startMemberList(), HtmlGenerator::startMemberSections(), HtmlGenerator::startMemberSubtitle(), HtmlGenerator::startParameterExtra(), HtmlGenerator::startParameterList(), HtmlGenerator::startParameterName(), HtmlGenerator::startParameterType(), HtmlGenerator::writeInheritedSectionTitle(), and HtmlGenerator::writeLabel().

Function Documentation

◆ endQuickIndexItem()

void endQuickIndexItem ( TextStream & t,
const DString & l )
static

Definition at line 2905 of file htmlgen.cpp.

2906{
2907 t << "</span>";
2908 if (!l.empty()) t << "</a>";
2909 t << "</li>\n";
2910}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:148

References DString::empty().

Referenced by renderQuickLinksAsTabs().

◆ endQuickIndexList()

void endQuickIndexList ( TextStream & t)
static

Definition at line 2878 of file htmlgen.cpp.

2879{
2880 if (!Config_getBool(DISABLE_INDEX))
2881 {
2882 t << " </ul>\n";
2883 t << " </div>\n";
2884 }
2885 else
2886 {
2887 t << "</ul>\n";
2888 }
2889}
#define Config_getBool(name)
Definition config.h:33

References Config_getBool.

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ endSectionContent()

void endSectionContent ( TextStream & t)
static

Definition at line 2182 of file htmlgen.cpp.

2183{
2184 //t << "<!-- endSectionContent -->";
2185 t << "</div>\n";
2186}

Referenced by HtmlGenerator::endCallGraph(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endDirDepGraph(), HtmlGenerator::endDotGraph(), HtmlGenerator::endGroupCollaboration(), and HtmlGenerator::endInclDepGraph().

◆ endSectionHeader()

void endSectionHeader ( TextStream & t)
static

◆ endSectionSummary()

void endSectionSummary ( TextStream & t)
static

Definition at line 2157 of file htmlgen.cpp.

2158{
2159 //t << "<!-- endSectionSummary -->";
2160 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2161 if (dynamicSections)
2162 {
2163 t << "</div>\n";
2164 }
2165}

References Config_getBool.

Referenced by HtmlGenerator::endCallGraph(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endDirDepGraph(), HtmlGenerator::endDotGraph(), HtmlGenerator::endGroupCollaboration(), and HtmlGenerator::endInclDepGraph().

◆ fillColorStyleMap()

void fillColorStyleMap ( const DString & definitions,
StringUnorderedMap & map )
static

Definition at line 749 of file htmlgen.cpp.

750{
751 size_t p=0,i=0;
752 while ((i=definitions.find('\n',p))!=DString::npos)
753 {
754 DString line = definitions.mid(p,i-p);
755 if (line.startsWith("--"))
756 {
757 size_t separator = line.find(':');
758 ASSERT(separator!=DString::npos);
759 std::string key = line.left(separator).str();
760 size_t semi = line.rfind(';');
761 ASSERT(semi!=DString::npos);
762 std::string value = line.mid(separator+1,semi-separator-1).stripWhiteSpace().str();
763 map.emplace(key,value);
764 //printf("var(%s)=%s\n",qPrint(key),qPrint(value));
765 }
766 p=i+1;
767 }
768}
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:84
size_t rfind(char c, size_t pos=npos) const
Definition dstring.h:244
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:318
static constexpr size_t npos
value used to indicate 'not found' or 'to the end of the string', matching std::string::npos
Definition dstring.h:178
size_t find(char c, size_t pos=0) const
Definition dstring.h:239
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition dstring.h:337
DString left(size_t len) const
Definition dstring.h:306
const std::string & str() const
Definition dstring.h:645
bool startsWith(const char *s) const
Definition dstring.h:600
#define ASSERT(x)
Definition message.h:142

References ASSERT, DString::find(), DString::left(), DString::mid(), DString::npos, DString::rfind(), DString::startsWith(), DString::str(), and DString::stripWhiteSpace().

Referenced by fillColorStyleMaps().

◆ fillColorStyleMaps()

void fillColorStyleMaps ( )
static

Definition at line 770 of file htmlgen.cpp.

771{
773 auto colorStyle = Config_getEnum(HTML_COLORSTYLE);
774 if (colorStyle==HTML_COLORSTYLE_t::LIGHT)
775 {
776 fillColorStyleMap(replaceColorMarkers(mgr.getAsString("lightmode_settings.css")),g_lightMap);
777 }
778 else if (colorStyle==HTML_COLORSTYLE_t::DARK)
779 {
780 fillColorStyleMap(replaceColorMarkers(mgr.getAsString("darkmode_settings.css")),g_darkMap);
781 }
782}
Singleton for managing resources compiled into an executable.
Definition resourcemgr.h:37
static ResourceMgr & instance()
Returns the one and only instance of this class.
DString getAsString(const DString &name) const
Gets the resource data as a C string.
#define Config_getEnum(name)
Definition config.h:35
static void fillColorStyleMap(const DString &definitions, StringUnorderedMap &map)
Definition htmlgen.cpp:749
static StringUnorderedMap g_lightMap
Definition htmlgen.cpp:746
static StringUnorderedMap g_darkMap
Definition htmlgen.cpp:747
DString replaceColorMarkers(const DString &str)
Replaces any markers of the form ##AA in input string str by new markers of the form #AABBCC,...
Definition util.cpp:4574

References Config_getEnum, fillColorStyleMap(), g_darkMap, g_lightMap, ResourceMgr::getAsString(), ResourceMgr::instance(), and replaceColorMarkers().

Referenced by HtmlGenerator::init(), and HtmlGenerator::writeStyleSheetFile().

◆ getConvertLatexMacro()

DString getConvertLatexMacro ( )
static

Convert a set of LaTeX commands \(re)newcommand to a form readable by MathJax LaTeX syntax:

\newcommand{\cmd}{replacement}
or
\renewcommand{\cmd}{replacement}

MathJax syntax:

cmd: "{replacement}"

LaTeX syntax:

\newcommand{\cmd}[nr]{replacement}
or
\renewcommand{\cmd}[nr]{replacement}

MathJax syntax:

cmd: ["{replacement}",nr]

Definition at line 143 of file htmlgen.cpp.

144{
145 DString macrofile = Config_getString(FORMULA_MACROFILE);
146 if (macrofile.empty()) return "";
147 DString s = fileToString(macrofile);
148 macrofile = FileInfo(macrofile.str()).absFilePath();
149 size_t size = s.length();
150 DString result;
151 result.reserve(size+8);
152 const char *data = s.data();
153 int line = 1;
154 int cnt = 0;
155 size_t i = 0;
156 DString nr;
157 while (i < size)
158 {
159 nr = "";
160 // skip initial white space, but count lines
161 while (i < size && (data[i] == ' ' || data[i] == '\t' || data[i] == '\n'))
162 {
163 if (data[i] == '\n') line++;
164 i++;
165 }
166 if (i >= size) break;
167 // check for \newcommand or \renewcommand
168 if (data[i] != '\\')
169 {
170 warn(macrofile,line, "file contains non valid code, expected '\\' got '{:c}'",data[i]);
171 return "";
172 }
173 i++;
174 if (literal_at(data+i,"newcommand"))
175 {
176 i += strlen("newcommand");
177 }
178 else if (literal_at(data+i,"renewcommand"))
179 {
180 i += strlen("renewcommand");
181 }
182 else
183 {
184 warn(macrofile,line, "file contains non valid code, expected 'newcommand' or 'renewcommand'");
185 return "";
186 }
187 // handle {cmd}
188 if (data[i] != '{')
189 {
190 warn(macrofile,line, "file contains non valid code, expected '{{' got '{:c}'",data[i]);
191 return "";
192 }
193 i++;
194 if (data[i] != '\\')
195 {
196 warn(macrofile,line, "file contains non valid code, expected '\\' got '{:c}'",data[i]);
197 return "";
198 }
199 i++;
200 // run till }, i.e. cmd
201 result+=" ";
202 while (i < size && (data[i] != '}')) result+=data[i++];
203 if (i >= size)
204 {
205 warn(macrofile,line, "file contains non valid code, no closing '}}' for command");
206 return "";
207 }
208 result+=": ";
209 i++;
210
211 if (data[i] == '[')
212 {
213 // handle [nr]
214 // run till ]
215 result+='[';
216 i++;
217 while (i < size && (data[i] != ']')) nr += data[i++];
218 if (i >= size)
219 {
220 warn(macrofile,line, "file contains non valid code, no closing ']'");
221 return "";
222 }
223 i++;
224 }
225 else if (data[i] != '{')
226 {
227 warn(macrofile,line, "file contains non valid code, expected '[' or '{{' got '{:c}'",data[i]);
228 return "";
229 }
230 // handle {replacement}
231 // retest as the '[' part might have advanced so we can have a new '{'
232 if (data[i] != '{')
233 {
234 warn(macrofile,line, "file contains non valid code, expected '{{' got '{:c}'",data[i]);
235 return "";
236 }
237 result+="\"{";
238 i++;
239 // run till }
240 cnt = 1;
241 while (i < size && cnt)
242 {
243 switch(data[i])
244 {
245 case '\\':
246 result+="\\\\"; // need to escape it for MathJax js code
247 i++;
248 if (data[i] == '\\') // we have an escaped backslash
249 {
250 result+="\\\\";
251 i++;
252 }
253 else if (data[i] != '"') result+=data[i++]; // double quote handled separately
254 break;
255 case '{':
256 cnt++;
257 result+=data[i++];
258 break;
259 case '}':
260 cnt--;
261 if (cnt) result+=data[i];
262 i++;
263 break;
264 case '"':
265 result+='\\'; // need to escape it for MathJax js code
266 result+=data[i++];
267 break;
268 case '\n':
269 line++;
270 result+=data[i++];
271 break;
272 default:
273 result+=data[i++];
274 break;
275 }
276 }
277 if (i > size)
278 {
279 warn(macrofile,line, "file contains non valid code, no closing '}}' for replacement");
280 return "";
281 }
282 result+="}\"";
283 if (!nr.empty())
284 {
285 result+=',';
286 result+=nr;
287 result+=']';
288 }
289 result+=",\n";
290 }
291 return result;
292}
void reserve(size_t size)
Reserve space for size bytes without changing the string contents.
Definition dstring.h:217
const char * data() const
Returns a pointer to the contents of the string in the form of a 0-terminated C string.
Definition dstring.h:157
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:151
Minimal replacement for QFileInfo.
Definition fileinfo.h:26
std::string absFilePath() const
Definition fileinfo.cpp:105
#define Config_getString(name)
Definition config.h:32
#define warn(file, line, fmt,...)
Definition message.h:97
bool literal_at(const char *data, const char(&str)[N])
returns true iff data points to a substring that matches string literal str
Definition stringutil.h:101
DString fileToString(const DString &name, bool filter, bool isSourceCode)
Definition util.cpp:1058

References FileInfo::absFilePath(), Config_getString, DString::data(), DString::empty(), fileToString(), DString::length(), literal_at(), DString::reserve(), DString::str(), and warn.

Referenced by HtmlGenerator::init().

◆ getSearchBox()

DString getSearchBox ( bool serverSide,
DString relPath,
bool highlightSearch )
static

Definition at line 294 of file htmlgen.cpp.

295{
296 TextStream t;
297 if (serverSide)
298 {
299 writeServerSearchBox(t, relPath, highlightSearch);
300 }
301 else
302 {
303 writeClientSearchBox(t, relPath);
304 }
305 return t.str();
306}
Text streaming class that buffers data.
Definition textstream.h:36
std::string str() const
Return the contents of the buffer as a std::string object.
Definition textstream.h:232
static void writeServerSearchBox(TextStream &t, const DString &relPath, bool highlightSearch)
Definition htmlgen.cpp:94
static void writeClientSearchBox(TextStream &t, const DString &relPath)
Definition htmlgen.cpp:77

References TextStream::str(), writeClientSearchBox(), and writeServerSearchBox().

Referenced by substituteHtmlKeywords(), and writeDefaultQuickLinks().

◆ hasDateReplacement()

bool hasDateReplacement ( const DString & str)
static

Definition at line 1272 of file htmlgen.cpp.

1273{
1274 return (str.contains("$datetime",false) ||
1275 str.contains("$date",false) ||
1276 str.contains("$time",false) ||
1277 str.contains("$year",false)
1278 );
1279}
int contains(char c, bool cs=true) const
Definition dstring.cpp:85

References DString::contains().

Referenced by HtmlGenerator::init().

◆ quickLinkVisible()

bool quickLinkVisible ( LayoutNavEntry::Kind kind)
static

Definition at line 2912 of file htmlgen.cpp.

2913{
2914 const auto &index = Index::instance();
2915 bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
2916 bool showFiles = Config_getBool(SHOW_FILES);
2917 switch (kind)
2918 {
2919 case LayoutNavEntry::MainPage: return true;
2920 case LayoutNavEntry::User: return true;
2921 case LayoutNavEntry::UserGroup: return true;
2922 case LayoutNavEntry::Pages: return index.numIndexedPages()>0;
2923 case LayoutNavEntry::Topics: return index.numDocumentedGroups()>0;
2924 case LayoutNavEntry::Modules: return index.numDocumentedModules()>0;
2925 case LayoutNavEntry::ModuleList: return index.numDocumentedModules()>0;
2926 case LayoutNavEntry::ModuleMembers: return index.numDocumentedModuleMembers(ModuleMemberHighlight::All)>0;
2927 case LayoutNavEntry::Namespaces: return showNamespaces && index.numDocumentedNamespaces()>0;
2928 case LayoutNavEntry::NamespaceList: return showNamespaces && index.numDocumentedNamespaces()>0;
2929 case LayoutNavEntry::NamespaceMembers: return showNamespaces && index.numDocumentedNamespaceMembers(NamespaceMemberHighlight::All)>0;
2930 case LayoutNavEntry::Concepts: return index.numDocumentedConcepts()>0;
2931 case LayoutNavEntry::Classes: return index.numAnnotatedClasses()>0;
2932 case LayoutNavEntry::ClassList: return index.numAnnotatedClasses()>0;
2933 case LayoutNavEntry::ClassIndex: return index.numAnnotatedClasses()>0;
2934 case LayoutNavEntry::ClassHierarchy: return index.numHierarchyClasses()>0;
2935 case LayoutNavEntry::ClassMembers: return index.numDocumentedClassMembers(ClassMemberHighlight::All)>0;
2936 case LayoutNavEntry::Files: return showFiles && index.numDocumentedFiles()>0;
2937 case LayoutNavEntry::FileList: return showFiles && index.numDocumentedFiles()>0;
2938 case LayoutNavEntry::FileGlobals: return showFiles && index.numDocumentedFileMembers(FileMemberHighlight::All)>0;
2939 case LayoutNavEntry::Examples: return !Doxygen::exampleLinkedMap->empty();
2940 case LayoutNavEntry::Interfaces: return index.numAnnotatedInterfaces()>0;
2941 case LayoutNavEntry::InterfaceList: return index.numAnnotatedInterfaces()>0;
2942 case LayoutNavEntry::InterfaceIndex: return index.numAnnotatedInterfaces()>0;
2943 case LayoutNavEntry::InterfaceHierarchy: return index.numHierarchyInterfaces()>0;
2944 case LayoutNavEntry::Structs: return index.numAnnotatedStructs()>0;
2945 case LayoutNavEntry::StructList: return index.numAnnotatedStructs()>0;
2946 case LayoutNavEntry::StructIndex: return index.numAnnotatedStructs()>0;
2947 case LayoutNavEntry::Exceptions: return index.numAnnotatedExceptions()>0;
2948 case LayoutNavEntry::ExceptionList: return index.numAnnotatedExceptions()>0;
2949 case LayoutNavEntry::ExceptionIndex: return index.numAnnotatedExceptions()>0;
2950 case LayoutNavEntry::ExceptionHierarchy: return index.numHierarchyExceptions()>0;
2951 case LayoutNavEntry::None: // should never happen, means not properly initialized
2952 ASSERT(kind != LayoutNavEntry::None);
2953 return false;
2954 }
2955 return false;
2956}
static PageLinkedMap * exampleLinkedMap
Definition doxygen.h:91
static Index & instance()
Definition index.cpp:110
bool empty() const
Definition linkedmap.h:209

References ClassMemberHighlight::All, FileMemberHighlight::All, ModuleMemberHighlight::All, NamespaceMemberHighlight::All, ASSERT, Config_getBool, LinkedMap< T, Hash, KeyEqual, Map >::empty(), Doxygen::exampleLinkedMap, and Index::instance().

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ renderQuickLinksAsTabs()

void renderQuickLinksAsTabs ( TextStream & t,
const DString & relPath,
LayoutNavEntry * hlEntry,
LayoutNavEntry::Kind kind,
bool highlightParent,
bool highlightSearch )
static

Definition at line 2987 of file htmlgen.cpp.

2990{
2991 if (hlEntry->parent()) // first draw the tabs for the parent of hlEntry
2992 {
2993 renderQuickLinksAsTabs(t,relPath,hlEntry->parent(),kind,highlightParent,highlightSearch);
2994 }
2995 if (hlEntry->parent() && !hlEntry->parent()->children().empty()) // draw tabs for row containing hlEntry
2996 {
2997 bool topLevel = hlEntry->parent()->parent()==nullptr;
2998 int count=0;
2999 for (const auto &entry : hlEntry->parent()->children())
3000 {
3001 if (entry->visible() && quickLinkVisible(entry->kind())) count++;
3002 }
3003 if (count>0) // at least one item is visible
3004 {
3005 startQuickIndexList(t,topLevel);
3006 for (const auto &entry : hlEntry->parent()->children())
3007 {
3008 if (entry->visible() && quickLinkVisible(entry->kind()))
3009 {
3010 DString url = entry->url();
3011 startQuickIndexItem(t,url,
3012 entry.get()==hlEntry &&
3013 (!entry->children().empty() ||
3014 (entry->kind()==kind && !highlightParent)
3015 ),
3016 true,relPath);
3017 t << HtmlGenerator::fixSpaces(entry->title());
3018 endQuickIndexItem(t,url);
3019 }
3020 }
3021 if (hlEntry->parent()==LayoutDocManager::instance().rootNavEntry()) // first row is special as it contains the search box
3022 {
3023 bool searchEngine = Config_getBool(SEARCHENGINE);
3024 bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
3025 bool disableIndex = Config_getBool(DISABLE_INDEX);
3026 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3027 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3028 // case where DISABLE_INDEX=NO & GENERATE_TREEVIEW=YES & FULL_SIDEBAR=YES has search box in the side panel
3029 if (searchEngine)
3030 {
3031 t << " <li>\n";
3032 if (disableIndex || !generateTreeView || !fullSidebar)
3033 {
3034 if (!serverBasedSearch) // pure client side search
3035 {
3036 writeClientSearchBox(t,relPath);
3037 t << " </li>\n";
3038 }
3039 else // server based search
3040 {
3041 writeServerSearchBox(t,relPath,highlightSearch);
3042 if (!highlightSearch)
3043 {
3044 t << " </li>\n";
3045 }
3046 }
3047 }
3048 else
3049 {
3050 t << " </li>\n";
3051 }
3052 }
3053 if (!highlightSearch || Config_getBool(FULL_SIDEBAR))
3054 // on the search page the index will be ended by the page itself if the search box is part of the navigation bar
3055 {
3057 }
3058 }
3059 else // normal case for other rows than first one
3060 {
3062 }
3063 }
3064 }
3065}
static DString fixSpaces(const DString &s)
Definition htmlgen.cpp:3786
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1449
LayoutNavEntry * rootNavEntry() const
returns the (invisible) root of the navigation tree.
Definition layout.cpp:1460
static void endQuickIndexList(TextStream &t)
Definition htmlgen.cpp:2878
static void startQuickIndexItem(TextStream &t, const DString &l, bool hl, bool, const DString &relPath)
Definition htmlgen.cpp:2891
static void startQuickIndexList(TextStream &t, bool topLevel=true)
Definition htmlgen.cpp:2858
static void endQuickIndexItem(TextStream &t, const DString &l)
Definition htmlgen.cpp:2905
static bool quickLinkVisible(LayoutNavEntry::Kind kind)
Definition htmlgen.cpp:2912
static void renderQuickLinksAsTabs(TextStream &t, const DString &relPath, LayoutNavEntry *hlEntry, LayoutNavEntry::Kind kind, bool highlightParent, bool highlightSearch)
Definition htmlgen.cpp:2987
const LayoutNavEntryList & children() const
Definition layout.h:219
LayoutNavEntry * parent() const
Definition layout.h:211

References LayoutNavEntry::children(), Config_getBool, endQuickIndexItem(), endQuickIndexList(), HtmlGenerator::fixSpaces(), LayoutDocManager::instance(), LayoutNavEntry::parent(), quickLinkVisible(), renderQuickLinksAsTabs(), LayoutDocManager::rootNavEntry(), startQuickIndexItem(), startQuickIndexList(), writeClientSearchBox(), and writeServerSearchBox().

Referenced by renderQuickLinksAsTabs(), and writeDefaultQuickLinks().

◆ renderQuickLinksAsTree()

void renderQuickLinksAsTree ( TextStream & t,
const DString & relPath,
LayoutNavEntry * root )
static

Definition at line 2958 of file htmlgen.cpp.

2960{
2961 int count=0;
2962 for (const auto &entry : root->children())
2963 {
2964 if (entry->visible() && quickLinkVisible(entry->kind())) count++;
2965 }
2966 if (count>0) // at least one item is visible
2967 {
2969 for (const auto &entry : root->children())
2970 {
2971 if (entry->visible() && quickLinkVisible(entry->kind()))
2972 {
2973 DString url = entry->url();
2974 t << "<li><a href=\"" << relPath << url << "\"><span>";
2975 t << HtmlGenerator::fixSpaces(entry->title());
2976 t << "</span></a>\n";
2977 // recursive into child list
2978 renderQuickLinksAsTree(t,relPath,entry.get());
2979 t << "</li>";
2980 }
2981 }
2983 }
2984}
static void renderQuickLinksAsTree(TextStream &t, const DString &relPath, LayoutNavEntry *root)
Definition htmlgen.cpp:2958

References LayoutNavEntry::children(), endQuickIndexList(), HtmlGenerator::fixSpaces(), quickLinkVisible(), renderQuickLinksAsTree(), and startQuickIndexList().

Referenced by renderQuickLinksAsTree(), and writeDefaultQuickLinks().

◆ replaceVariables()

DString replaceVariables ( const DString & input)
static

Definition at line 784 of file htmlgen.cpp.

785{
786 auto doReplacements = [&input](const StringUnorderedMap &mapping) -> DString
787 {
788 DString result;
789 result.reserve(input.length());
790 size_t p=0,i=0;
791 while ((i=input.find("var(",p))!=DString::npos)
792 {
793 result+=input.mid(p,i-p);
794 size_t j=input.find(")",i+4);
796 auto it = mapping.find(input.mid(i+4,j-i-4).str()); // find variable
797 if (it==mapping.end())
798 { // should be found
799 err("failed to find value variable {}. It is not longer defined in doxygen.css\n",input.mid(i+4,j-i-4));
800 }
801 else
802 {
803 //printf("replace '%s' by '%s'\n",qPrint(input.mid(i+4,j-i-4)),qPrint(it->second));
804 result+=it->second; // add it value
805 }
806 p=j+1;
807 }
808 result+=input.mid(p,input.length()-p);
809 return result;
810 };
811
812 auto colorStyle = Config_getEnum(HTML_COLORSTYLE);
813 if (colorStyle==HTML_COLORSTYLE_t::LIGHT)
814 {
815 return doReplacements(g_lightMap);
816 }
817 else if (colorStyle==HTML_COLORSTYLE_t::DARK)
818 {
819 return doReplacements(g_darkMap);
820 }
821 else
822 {
823 return input;
824 }
825}
std::unordered_map< std::string, std::string > StringUnorderedMap
Definition containers.h:28
#define err(fmt,...)
Definition message.h:127

References ASSERT, Config_getEnum, err, DString::find(), g_darkMap, g_lightMap, DString::length(), DString::mid(), DString::npos, DString::reserve(), and DString::str().

Referenced by HtmlGenerator::getNavTreeCss(), HtmlGenerator::init(), writeDefaultStyleSheet(), and HtmlGenerator::writeSearchData().

◆ startQuickIndexItem()

void startQuickIndexItem ( TextStream & t,
const DString & l,
bool hl,
bool ,
const DString & relPath )
static

Definition at line 2891 of file htmlgen.cpp.

2894{
2895 t << " <li";
2896 if (hl)
2897 {
2898 t << " class=\"current\"";
2899 }
2900 t << ">";
2901 if (!l.empty()) t << "<a href=\"" << correctURL(l,relPath) << "\">";
2902 t << "<span>";
2903}
DString correctURL(const DString &url, const DString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:4665

References correctURL(), and DString::empty().

Referenced by renderQuickLinksAsTabs().

◆ startQuickIndexList()

void startQuickIndexList ( TextStream & t,
bool topLevel = true )
static

Definition at line 2858 of file htmlgen.cpp.

2859{
2860 if (!Config_getBool(DISABLE_INDEX))
2861 {
2862 if (topLevel)
2863 {
2864 t << " <div id=\"navrow1\" class=\"tabs\">\n";
2865 }
2866 else
2867 {
2868 t << " <div id=\"navrow2\" class=\"tabs2\">\n";
2869 }
2870 t << " <ul class=\"tablist\">\n";
2871 }
2872 else
2873 {
2874 t << "<ul>";
2875 }
2876}

References Config_getBool.

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ startSectionContent()

void startSectionContent ( TextStream & t,
int sectionCount )
static

Definition at line 2167 of file htmlgen.cpp.

2168{
2169 //t << "<!-- startSectionContent -->";
2170 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2171 if (dynamicSections)
2172 {
2173 t << "<div id=\"dynsection-" << sectionCount << "-content\" "
2174 "class=\"dyncontent hidden\">\n";
2175 }
2176 else
2177 {
2178 t << "<div class=\"dyncontent\">\n";
2179 }
2180}

References Config_getBool.

Referenced by HtmlGenerator::endCallGraph(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endDirDepGraph(), HtmlGenerator::endDotGraph(), HtmlGenerator::endGroupCollaboration(), and HtmlGenerator::endInclDepGraph().

◆ startSectionHeader()

void startSectionHeader ( TextStream & t,
const DString & relPath,
int sectionCount )
static

Definition at line 2123 of file htmlgen.cpp.

2125{
2126 //t << "<!-- startSectionHeader -->";
2127 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2128 if (dynamicSections)
2129 {
2130 t << "<div id=\"dynsection-" << sectionCount << "\" "
2131 "class=\"dynheader closed\">"
2132 "<span class=\"dynarrow\"><span class=\"arrowhead closed\"></span></span>";
2133 }
2134 else
2135 {
2136 t << "<div class=\"dynheader\">\n";
2137 }
2138}

References Config_getBool.

Referenced by HtmlGenerator::startCallGraph(), HtmlGenerator::startClassDiagram(), HtmlGenerator::startDirDepGraph(), HtmlGenerator::startDotGraph(), HtmlGenerator::startGroupCollaboration(), and HtmlGenerator::startInclDepGraph().

◆ startSectionSummary()

void startSectionSummary ( TextStream & t,
int sectionCount )
static

Definition at line 2146 of file htmlgen.cpp.

2147{
2148 //t << "<!-- startSectionSummary -->";
2149 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2150 if (dynamicSections)
2151 {
2152 t << "<div id=\"dynsection-" << sectionCount << "-summary\" "
2153 "class=\"dynsummary\">\n";
2154 }
2155}

References Config_getBool.

Referenced by HtmlGenerator::endCallGraph(), HtmlGenerator::endClassDiagram(), HtmlGenerator::endDirDepGraph(), HtmlGenerator::endDotGraph(), HtmlGenerator::endGroupCollaboration(), and HtmlGenerator::endInclDepGraph().

◆ substituteHtmlKeywords()

DString substituteHtmlKeywords ( const DString & file,
const DString & str,
const DString & title,
const DString & relPath,
const DString & navPath = DString(),
bool isSource = false )
static

Definition at line 308 of file htmlgen.cpp.

314{
315 // Build CSS/JavaScript tags depending on treeview, search engine settings
316 DString cssFile;
317 DString generatedBy;
318 DString treeViewCssJs;
319 DString searchCssJs;
320 DString searchBox;
321 DString mathJaxJs;
322 DString mermaidJs;
323 DString extraCssText;
324
325 DString projectName = Config_getString(PROJECT_NAME);
326 bool treeView = Config_getBool(GENERATE_TREEVIEW);
327 bool dynamicSections = useDynamicSections();
328 bool codeFolding = Config_getBool(HTML_CODE_FOLDING);
329 bool searchEngine = Config_getBool(SEARCHENGINE);
330 bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
331 bool mathJax = Config_getBool(USE_MATHJAX);
332 bool disableIndex = Config_getBool(DISABLE_INDEX);
333 bool hasProjectName = !projectName.empty();
334 bool hasProjectNumber = !Config_getString(PROJECT_NUMBER).empty();
335 bool hasProjectBrief = !Config_getString(PROJECT_BRIEF).empty();
336 bool hasProjectLogo = !Config_getString(PROJECT_LOGO).empty();
337 bool hasProjectIcon = !Config_getString(PROJECT_ICON).empty();
338 bool hasFullSideBar = Config_getBool(FULL_SIDEBAR) && /*disableIndex &&*/ treeView;
339 bool hasCopyClipboard = Config_getBool(HTML_COPY_CLIPBOARD);
340 bool hasCookie = treeView || searchEngine || Config_getEnum(HTML_COLORSTYLE)==HTML_COLORSTYLE_t::TOGGLE;
341 static bool titleArea = (hasProjectName || hasProjectBrief || hasProjectLogo || (disableIndex && searchEngine));
342
343 cssFile = Config_getString(HTML_STYLESHEET);
344 if (cssFile.empty())
345 {
346 cssFile = "doxygen.css";
347 }
348 else
349 {
350 if (!cssFile.startsWith("http:") && !cssFile.startsWith("https:"))
351 {
352 FileInfo cssfi(cssFile.str());
353 if (cssfi.exists())
354 {
355 cssFile = cssfi.fileName();
356 }
357 else
358 {
359 cssFile = "doxygen.css";
360 }
361 }
362 }
363
364 extraCssText = "";
365 StringVector extraCssFile = Config_getList(HTML_EXTRA_STYLESHEET);
366 for (const auto &fileName : extraCssFile)
367 {
368 if (!fileName.empty())
369 {
370 DString htmlStyleSheet = fileName;
371 if (htmlStyleSheet.startsWith("http:") || htmlStyleSheet.startsWith("https:"))
372 {
373 extraCssText += "<link href=\""+htmlStyleSheet+"\" rel=\"stylesheet\" type=\"text/css\"/>\n";
374 }
375 else
376 {
377 FileInfo fi(fileName);
378 if (fi.exists())
379 {
380 extraCssText += "<link href=\"$relpath^"+stripPath(fileName)+"\" rel=\"stylesheet\" type=\"text/css\"/>\n";
381 }
382 }
383 }
384 }
385
386 switch (Config_getEnum(TIMESTAMP))
387 {
388 case TIMESTAMP_t::NO:
389 generatedBy = theTranslator->trGeneratedBy();
390 break;
391 default:
392 generatedBy = theTranslator->trGeneratedAt("<span class=\"timestamp\"></span>",
393 convertToHtml(Config_getString(PROJECT_NAME)));
394 break;
395 }
396 if (treeView)
397 {
398 treeViewCssJs = "<link href=\"$relpath^navtree.css\" rel=\"stylesheet\" type=\"text/css\"/>\n"
399 "<script type=\"text/javascript\" src=\"$relpath^navtreedata.js\"></script>\n"
400 "<script type=\"text/javascript\" src=\"$relpath^navtree.js\"></script>\n";
401 }
402
403 if (searchEngine)
404 {
405 searchCssJs = "<link href=\"$relpath^search/search.css\" rel=\"stylesheet\" type=\"text/css\"/>\n";
406 if (!serverBasedSearch)
407 {
408 searchCssJs += "<script type=\"text/javascript\" src=\"$relpath^search/searchdata.js\"></script>\n";
409 }
410 else
411 {
412 searchCssJs += "<style type=\"text/css\">\n"
413 "@font-face {\n"
414 " font-family: 'Material Symbols Outlined';\n"
415 " font-style: normal;\n"
416 " font-weight: 400;\n"
417 " src: url($relpath^MaterialSymbolsOutlined.min.woff2) format('woff2');\n"
418 "}\n"
419 ".material-symbols-outlined {\n"
420 " font-family: 'Material Symbols Outlined';\n"
421 " font-weight: normal;\n"
422 " font-style: normal;\n"
423 " font-size: 24px;\n"
424 " line-height: 1;\n"
425 " letter-spacing: normal;\n"
426 " text-transform: none;\n"
427 " display: inline-block;\n"
428 " white-space: nowrap;\n"
429 " word-wrap: normal;\n"
430 " direction: ltr;\n"
431 " -moz-font-feature-settings: 'liga';\n"
432 " -moz-osx-font-smoothing: grayscale;\n"
433 "}\n"
434 "</style>\n";
435 }
436 searchCssJs += "<script type=\"text/javascript\" src=\"$relpath^search/search.js\"></script>\n";
437
438 if (!serverBasedSearch)
439 {
440 }
441 else
442 {
443 // OPENSEARCH_PROVIDER {
444 searchCssJs += "<link rel=\"search\" href=\"" + relPath +
445 "search_opensearch.php?v=opensearch.xml\" "
446 "type=\"application/opensearchdescription+xml\" title=\"" +
447 (hasProjectName ? projectName : DString("Doxygen")) +
448 "\"/>";
449 // OPENSEARCH_PROVIDER }
450 }
451 searchBox = getSearchBox(serverBasedSearch, relPath, false);
452 }
453
454 if (mathJax && !isSource)
455 {
456 auto mathJaxVersion = Config_getEnum(MATHJAX_VERSION);
457 DString path = Config_getString(MATHJAX_RELPATH);
458 if (path.empty() || path.startsWith("..")) // relative path
459 {
460 path.prepend(relPath);
461 }
462
463 auto writeMathJax3Packages = [&mathJaxJs](const StringVector &mathJaxExtensions)
464 {
465 mathJaxJs += " packages: ['base','configmacros'";
466 if (!g_latex_macro.empty())
467 {
468 mathJaxJs+= ",'newcommand'";
469 }
470 for (const auto &s : mathJaxExtensions)
471 {
472 mathJaxJs+= ",'"+s+"'";
473 }
474 mathJaxJs += "]\n";
475 };
476
477 auto writeMathJax4Packages = [&mathJaxJs](const StringVector &mathJaxExtensions)
478 {
479 mathJaxJs += " packages: {\n";
480 bool first = true;
481 for (const auto &s : mathJaxExtensions)
482 {
483 if (!first) mathJaxJs+= ",";
484 if (s.at(0) =='-')
485 {
486 mathJaxJs+= "\n '[-]': ['";
487 mathJaxJs+=s.data()+1;
488 mathJaxJs+="']";
489 }
490 else
491 {
492 mathJaxJs+= "\n '[+]': ['"+s+"']";
493 }
494 first = false;
495 }
496 mathJaxJs += "\n }\n";
497 };
498
499 auto writeMathJaxScript = [&path,&mathJaxJs](const DString &pathPostfix,
500 std::function<void(const StringVector&)> writePackages)
501 {
502 DString mathJaxFormat = Config_getEnumAsString(MATHJAX_FORMAT);
503 mathJaxJs += "<script type=\"text/javascript\">\n"
504 "window.MathJax = {\n"
505 " options: {\n"
506 " ignoreHtmlClass: 'tex2jax_ignore',\n"
507 " processHtmlClass: 'tex2jax_process'\n"
508 " }";
509 // MACRO / EXT
510 StringVector mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS);
511 if (!mathJaxExtensions.empty() || !g_latex_macro.empty())
512 {
513 mathJaxJs+= ",\n";
514 if (!mathJaxExtensions.empty())
515 {
516 bool first = true;
517 mathJaxJs+= " loader: {\n"
518 " load: [";
519 for (const auto &s : mathJaxExtensions)
520 {
521 if (s.at(0) !='-')
522 {
523 if (!first) mathJaxJs+= ",";
524 mathJaxJs+= "'[tex]/"+s+"'"; // packages preceded by a minus sign should not be loaded
525 first = false;
526 }
527 }
528 mathJaxJs+= "]\n"
529 " },\n";
530 }
531 mathJaxJs+= " tex: {\n"
532 " macros: {";
533 if (!g_latex_macro.empty())
534 {
535 mathJaxJs += g_latex_macro+" ";
536 }
537 mathJaxJs+="},\n";
538 writePackages(mathJaxExtensions);
539 mathJaxJs += " }\n";
540 }
541 else
542 {
543 mathJaxJs += "\n";
544 }
545 mathJaxJs += "};\n";
546 // MATHJAX_CODEFILE
547 if (!g_mathjax_code.empty())
548 {
549 mathJaxJs += g_mathjax_code;
550 mathJaxJs += "\n";
551 }
552 mathJaxJs+="</script>\n";
553 mathJaxJs += "<script type=\"text/javascript\" id=\"MathJax-script\" async=\"async\" src=\"" +
554 path + pathPostfix + "tex-" + mathJaxFormat.lower() + ".js\">";
555 mathJaxJs+="</script>\n";
556 };
557
558 switch (mathJaxVersion)
559 {
560 case MATHJAX_VERSION_t::MathJax_4:
561 writeMathJaxScript("",writeMathJax4Packages);
562 break;
563 case MATHJAX_VERSION_t::MathJax_3:
564 writeMathJaxScript("es5/",writeMathJax3Packages);
565 break;
566 case MATHJAX_VERSION_t::MathJax_2:
567 {
568 DString mathJaxFormat = Config_getEnumAsString(MATHJAX_FORMAT);
569 mathJaxJs = "<script type=\"text/x-mathjax-config\">\n"
570 "MathJax.Hub.Config({\n"
571 " extensions: [\"tex2jax.js\"";
572 StringVector mathJaxExtensions = Config_getList(MATHJAX_EXTENSIONS);
573 for (const auto &s : mathJaxExtensions)
574 {
575 mathJaxJs+= ", \""+DString(s)+".js\"";
576 }
577 if (mathJaxFormat.empty())
578 {
579 mathJaxFormat = "HTML-CSS";
580 }
581 mathJaxJs += "],\n"
582 " jax: [\"input/TeX\",\"output/"+mathJaxFormat+"\"],\n";
583 if (!g_latex_macro.empty())
584 {
585 mathJaxJs += " TeX: { Macros: {\n";
586 mathJaxJs += g_latex_macro;
587 mathJaxJs += "\n"
588 " } }\n";
589 }
590 mathJaxJs += "});\n";
591 if (!g_mathjax_code.empty())
592 {
593 mathJaxJs += g_mathjax_code;
594 mathJaxJs += "\n";
595 }
596 mathJaxJs += "</script>\n";
597 mathJaxJs += "<script type=\"text/javascript\" async=\"async\" src=\"" + path + "MathJax.js\"></script>\n";
598 }
599 break;
600 }
601 }
602
603 DString darkModeJs;
604 if (Config_getEnum(HTML_COLORSTYLE)==HTML_COLORSTYLE_t::TOGGLE)
605 {
606 darkModeJs="<script type=\"text/javascript\" src=\"$relpath^darkmode_toggle.js\"></script>\n";
607 }
608
609 if (MermaidManager::instance().hasInlineDiagrams())
610 {
611 DString mermaidJsUrl = Config_getString(MERMAID_JS_URL);
612 mermaidJs = "<script type=\"module\">\n"
613 "import mermaid from '" + mermaidJsUrl + "';\n";
614 switch(Config_getEnum(HTML_COLORSTYLE))
615 {
616 case HTML_COLORSTYLE_t::LIGHT:
617 mermaidJs += "const theme = 'default';\n";
618 break;
619 case HTML_COLORSTYLE_t::DARK:
620 mermaidJs += "const theme = 'dark';\n";
621 break;
622 case HTML_COLORSTYLE_t::AUTO_LIGHT:
623 case HTML_COLORSTYLE_t::AUTO_DARK:
624 mermaidJs += "const theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'default';\n";
625 break;
626 case HTML_COLORSTYLE_t::TOGGLE:
627 mermaidJs += "const theme = DarkModeToggle.darkModeEnabled ? 'dark' : 'default'\n";
628 break;
629 }
630 mermaidJs += "mermaid.initialize({ startOnLoad: true, theme: theme });\n";
631 if (Config_getEnum(HTML_COLORSTYLE)==HTML_COLORSTYLE_t::TOGGLE)
632 {
633 mermaidJs +=
634 "(function() {\n"
635 " const elementCode = '.mermaid';\n"
636 " const loadMermaid = function(theme) {\n"
637 " mermaid.initialize({theme})\n"
638 " mermaid.init({theme}, document.querySelectorAll(elementCode))\n"
639 " }\n"
640 " const saveOriginalData = function() {\n"
641 " return new Promise((resolve, reject) => {\n"
642 " try {\n"
643 " var els = document.querySelectorAll(elementCode), count = els.length;\n"
644 " els.forEach(element => {\n"
645 " element.setAttribute('data-original-code', element.innerHTML)\n"
646 " count--\n"
647 " if (count == 0) { resolve() }\n"
648 " });\n"
649 " } catch (error) { reject(error) }\n"
650 " })\n"
651 " }\n"
652 " const resetProcessed = function(){\n"
653 " return new Promise((resolve, reject) => {\n"
654 " try {\n"
655 " var els = document.querySelectorAll(elementCode), count = els.length;\n"
656 " els.forEach(element => {\n"
657 " if (element.getAttribute('data-original-code') != null) {\n"
658 " element.removeAttribute('data-processed')\n"
659 " element.innerHTML = element.getAttribute('data-original-code')\n"
660 " }\n"
661 " count--\n"
662 " if(count == 0) { resolve() }\n"
663 " });\n"
664 " } catch (error) { reject(error) }\n"
665 " })\n"
666 " }\n"
667 " saveOriginalData()\n"
668 " const original = DarkModeToggle.enableDarkMode.bind(DarkModeToggle);\n"
669 " DarkModeToggle.enableDarkMode = function(enable) {\n"
670 " original(enable);\n"
671 " resetProcessed().then(loadMermaid(enable ? 'dark' : 'default')).catch(console.error)\n"
672 " };\n"
673 "})();\n";
674 }
675 mermaidJs += "</script>\n";
676 }
677
678 if (hasCookie) // extend the $treeview tag to avoid breaking old files used with HTML_HEADER
679 {
680 treeViewCssJs+="<script type=\"text/javascript\" src=\"$relpath^cookie.js\"></script>\n";
681 }
682
683 DString projName = convertToHtml(Config_getString(PROJECT_NAME)),
684
685 // first substitute generic keywords then do the HTML specific keywords
686 result = substituteKeywords(file,str,
687 {
688 // keyword value getter
689 { "$title", [&]() { return !title.empty() ? title : projName; } },
690 { "$doxygenversion", [&]() { return getDoxygenVersion(); } },
691 { "$projectname", [&]() { return projName; } },
692 { "$projectnumber", [&]() { return convertToHtml(Config_getString(PROJECT_NUMBER)); } },
693 { "$projectbrief", [&]() { return convertToHtml(Config_getString(PROJECT_BRIEF)); } },
694 { "$projectlogo", [&]() { return stripPath(projectLogoFile()); } },
695 { "$logosize", [&]() { return projectLogoSize(); } },
696 { "$projecticon", [&]() { return stripPath(Config_getString(PROJECT_ICON)); } },
697 { "$langISO", [&]() { return theTranslator->trISOLang(); } },
698 { "$showdate", [&](const DString &fmt) { return showDate(fmt); } },
699
700 // keyword value getter
701 { "$datetime", [&]() -> DString { return "<span class=\"datetime\"></span>"; } },
702 { "$date", [&]() -> DString { return "<span class=\"date\"></span>"; } },
703 { "$time", [&]() -> DString { return "<span class=\"time\"></span>"; } },
704 { "$year", [&]() -> DString { return "<span class=\"year\"></span>"; } },
705 { "$navpath", [&]() -> DString { return navPath; } },
706 { "$stylesheet", [&]() -> DString { return cssFile; } },
707 { "$treeview", [&]() -> DString { return treeViewCssJs; } },
708 { "$searchbox", [&]() -> DString { return searchBox; } },
709 { "$search", [&]() -> DString { return searchCssJs; } },
710 { "$mathjax", [&]() -> DString { return mathJaxJs; } },
711 { "$mermaidjs", [&]() -> DString { return mermaidJs; } },
712 { "$darkmode", [&]() -> DString { return darkModeJs; } },
713 { "$generatedby", [&]() -> DString { return generatedBy; } },
714 { "$extrastylesheet",[&]() -> DString { return extraCssText; } },
715 { "$relpath$", [&]() -> DString { return relPath; } } //<-- obsolete: for backwards compatibility only
716 });
717
718 result = substitute(result,"$relpath^",relPath); //<-- must be done after the previous substitutions
719
720 // remove conditional blocks
721 result = selectBlocks(result,
722 {
723 // keyword, is enabled
724 { "FULL_SIDEBAR", hasFullSideBar },
725 { "DISABLE_INDEX", disableIndex },
726 { "GENERATE_TREEVIEW", treeView },
727 { "SEARCHENGINE", searchEngine },
728 { "TITLEAREA", titleArea },
729 { "PROJECT_NAME", hasProjectName },
730 { "PROJECT_NUMBER", hasProjectNumber },
731 { "PROJECT_BRIEF", hasProjectBrief },
732 { "PROJECT_LOGO", hasProjectLogo },
733 { "PROJECT_ICON", hasProjectIcon },
734 { "COPY_CLIPBOARD", hasCopyClipboard },
735 { "HTML_CODE_FOLDING", codeFolding },
736 { "HTML_DYNAMIC_SECTIONS", dynamicSections},
738
739 result = removeEmptyLines(result.str());
740
741 return result;
742}
DString lower() const
Definition dstring.h:326
DString & prepend(const char *s)
Definition dstring.h:515
static MermaidManager & instance()
Definition mermaid.cpp:38
virtual DString trGeneratedAt(const DString &date, const DString &projName)=0
virtual DString trISOLang()=0
virtual DString trGeneratedBy()=0
#define Config_getList(name)
Definition config.h:38
#define Config_getEnumAsString(name)
Definition config.h:36
std::vector< std::string > StringVector
Definition containers.h:33
DString substitute(const DString &s, const DString &src, const DString &dst)
substitute all occurrences of src in s by dst
Definition dstring.cpp:485
static DString getSearchBox(bool serverSide, DString relPath, bool highlightSearch)
Definition htmlgen.cpp:294
static bool useDynamicSections()
Definition htmlgen.cpp:70
static const SelectionMarkerInfo htmlMarkerInfo
Definition htmlgen.cpp:66
static DString g_latex_macro
Definition htmlgen.cpp:62
static DString g_mathjax_code
Definition htmlgen.cpp:61
Translator * theTranslator
Definition language.cpp:76
Definition message.h:146
std::string removeEmptyLines(const std::string &s)
Definition stringutil.h:193
DString selectBlocks(const DString &s, const SelectionBlockList &blockList, const SelectionMarkerInfo &markerInfo)
remove disabled blocks and all block markers from s and return the result as a string
Definition util.cpp:5022
DString showDate(const DString &fmt)
Definition util.cpp:2573
DString convertToHtml(const DString &s, bool keepEntities)
Definition util.cpp:3297
DString substituteKeywords(const DString &file, const DString &s, const KeywordSubstitutionList &keywords)
Definition util.cpp:2500
DString projectLogoFile()
Definition util.cpp:2586
DString projectLogoSize()
Definition util.cpp:2605
DString stripPath(const DString &s)
Definition util.cpp:3966

References Config_getBool, Config_getEnum, Config_getEnumAsString, Config_getList, Config_getString, convertToHtml(), DString::data(), DString::empty(), FileInfo::exists(), FileInfo::fileName(), g_latex_macro, g_mathjax_code, getSearchBox(), htmlMarkerInfo, MermaidManager::instance(), DString::lower(), DString::prepend(), projectLogoFile(), projectLogoSize(), removeEmptyLines(), selectBlocks(), showDate(), DString::startsWith(), DString::str(), stripPath(), substitute(), substituteKeywords(), theTranslator, Translator::trGeneratedAt(), Translator::trGeneratedBy(), Translator::trISOLang(), and useDynamicSections().

Referenced by HtmlGenerator::init(), HtmlGenerator::startFile(), HtmlGenerator::writeExternalSearchPage(), HtmlGenerator::writePageFooter(), and HtmlGenerator::writeSearchPage().

◆ useDynamicSections()

bool useDynamicSections ( )
inlinestatic

Definition at line 70 of file htmlgen.cpp.

71{
72 return Config_getBool(HTML_DYNAMIC_SECTIONS) ||
73 (Config_getBool(OBFUSCATE_EMAILS) && !Config_getBool(GENERATE_HTMLHELP)) ||
74 (Config_getBool(SOURCE_BROWSER) && Config_getBool(SOURCE_TOOLTIPS));
75}

References Config_getBool.

Referenced by HtmlGenerator::init(), substituteHtmlKeywords(), and HtmlGenerator::writeStyleInfo().

◆ writeClientSearchBox()

void writeClientSearchBox ( TextStream & t,
const DString & relPath )
static

Definition at line 77 of file htmlgen.cpp.

78{
79 t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
80 t << " <span class=\"left\">\n";
81 t << " <span id=\"MSearchSelect\" class=\"search-icon\">";
82 t << "<span class=\"search-icon-dropdown\"></span></span>\n";
83 t << " <input type=\"text\" id=\"MSearchField\" value=\"\" placeholder=\""
84 << theTranslator->trSearch() << "\" accesskey=\"S\"/>\n";
85 t << " </span><span class=\"right\">\n";
86 t << " <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\">"
87 << "<div id=\"MSearchCloseImg\" class=\"close-icon\"></div></a>\n";
88 t << " </span>\n";
89 t << " </div>\n";
90}
virtual DString trSearch()=0

References theTranslator, and Translator::trSearch().

Referenced by getSearchBox(), and renderQuickLinksAsTabs().

◆ writeDefaultQuickLinks()

void writeDefaultQuickLinks ( TextStream & t,
HighlightedItem hli,
const DString & file,
const DString & relPath,
bool extraTabs )
static

Definition at line 3067 of file htmlgen.cpp.

3072{
3073 bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
3074 bool searchEngine = Config_getBool(SEARCHENGINE);
3075 bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
3076 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3077 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3078 bool disableIndex = Config_getBool(DISABLE_INDEX);
3079 bool dynamicMenus = Config_getBool(HTML_DYNAMIC_MENUS);
3081 LayoutNavEntry::Kind kind = LayoutNavEntry::None;
3082 LayoutNavEntry::Kind altKind = LayoutNavEntry::None; // fall back for the old layout file
3083 bool highlightParent=false;
3084 switch (hli) // map HLI enums to LayoutNavEntry::Kind enums
3085 {
3086 case HighlightedItem::Main: kind = LayoutNavEntry::MainPage; break;
3087 case HighlightedItem::Topics: kind = LayoutNavEntry::Topics; break;
3088 case HighlightedItem::Modules: kind = LayoutNavEntry::ModuleList; altKind = LayoutNavEntry::Modules; break;
3089 case HighlightedItem::Namespaces: kind = LayoutNavEntry::NamespaceList; altKind = LayoutNavEntry::Namespaces; break;
3090 case HighlightedItem::ClassHierarchy: kind = LayoutNavEntry::ClassHierarchy; break;
3091 case HighlightedItem::InterfaceHierarchy: kind = LayoutNavEntry::InterfaceHierarchy; break;
3092 case HighlightedItem::ExceptionHierarchy: kind = LayoutNavEntry::ExceptionHierarchy; break;
3093 case HighlightedItem::Classes: kind = LayoutNavEntry::ClassIndex; altKind = LayoutNavEntry::Classes; break;
3094 case HighlightedItem::Concepts: kind = LayoutNavEntry::Concepts; break;
3095 case HighlightedItem::Interfaces: kind = LayoutNavEntry::InterfaceIndex; altKind = LayoutNavEntry::Interfaces; break;
3096 case HighlightedItem::Structs: kind = LayoutNavEntry::StructIndex; altKind = LayoutNavEntry::Structs; break;
3097 case HighlightedItem::Exceptions: kind = LayoutNavEntry::ExceptionIndex; altKind = LayoutNavEntry::Exceptions; break;
3098 case HighlightedItem::AnnotatedClasses: kind = LayoutNavEntry::ClassList; altKind = LayoutNavEntry::Classes; break;
3099 case HighlightedItem::AnnotatedInterfaces: kind = LayoutNavEntry::InterfaceList; altKind = LayoutNavEntry::Interfaces; break;
3100 case HighlightedItem::AnnotatedStructs: kind = LayoutNavEntry::StructList; altKind = LayoutNavEntry::Structs; break;
3101 case HighlightedItem::AnnotatedExceptions: kind = LayoutNavEntry::ExceptionList; altKind = LayoutNavEntry::Exceptions; break;
3102 case HighlightedItem::Files: kind = LayoutNavEntry::FileList; altKind = LayoutNavEntry::Files; break;
3103 case HighlightedItem::NamespaceMembers: kind = LayoutNavEntry::NamespaceMembers; break;
3104 case HighlightedItem::ModuleMembers: kind = LayoutNavEntry::ModuleMembers; break;
3105 case HighlightedItem::Functions: kind = LayoutNavEntry::ClassMembers; break;
3106 case HighlightedItem::Globals: kind = LayoutNavEntry::FileGlobals; break;
3107 case HighlightedItem::Pages: kind = LayoutNavEntry::Pages; break;
3108 case HighlightedItem::Examples: kind = LayoutNavEntry::Examples; break;
3109 case HighlightedItem::UserGroup: kind = LayoutNavEntry::UserGroup; break;
3110 case HighlightedItem::ClassVisible: kind = LayoutNavEntry::ClassList; altKind = LayoutNavEntry::Classes;
3111 highlightParent = true; break;
3112 case HighlightedItem::ConceptVisible: kind = LayoutNavEntry::Concepts;
3113 highlightParent = true; break;
3114 case HighlightedItem::ModuleVisible: kind = LayoutNavEntry::ModuleList; altKind = LayoutNavEntry::Modules;
3115 highlightParent = true; break;
3116 case HighlightedItem::InterfaceVisible: kind = LayoutNavEntry::InterfaceList; altKind = LayoutNavEntry::Interfaces;
3117 highlightParent = true; break;
3118 case HighlightedItem::StructVisible: kind = LayoutNavEntry::StructList; altKind = LayoutNavEntry::Structs;
3119 highlightParent = true; break;
3120 case HighlightedItem::ExceptionVisible: kind = LayoutNavEntry::ExceptionList; altKind = LayoutNavEntry::Exceptions;
3121 highlightParent = true; break;
3122 case HighlightedItem::NamespaceVisible: kind = LayoutNavEntry::NamespaceList; altKind = LayoutNavEntry::Namespaces;
3123 highlightParent = true; break;
3124 case HighlightedItem::FileVisible: kind = LayoutNavEntry::FileList; altKind = LayoutNavEntry::Files;
3125 highlightParent = true; break;
3126 case HighlightedItem::None: break;
3127 case HighlightedItem::Search: break;
3128 }
3129
3130 if (!disableIndex && dynamicMenus)
3131 {
3132 DString searchPage;
3133 if (externalSearch)
3134 {
3135 searchPage = "search" + Doxygen::htmlFileExtension;
3136 }
3137 else
3138 {
3139 searchPage = "search.php";
3140 }
3141 t << "<script type=\"text/javascript\" src=\"" << relPath << "menudata.js\"></script>\n";
3142 t << "<script type=\"text/javascript\" src=\"" << relPath << "menu.js\"></script>\n";
3143 t << "<div id=\"main-nav-mobile\">\n";
3144 if (searchEngine && !fullSidebar)
3145 {
3146 t << "<div class=\"sm sm-dox\"><input id=\"main-menu-state\" type=\"checkbox\"/>\n";
3147 t << "<label class=\"main-menu-btn\" for=\"main-menu-state\">\n";
3148 t << "<span class=\"main-menu-btn-icon\"></span> Toggle main menu visibility</label>\n";
3149 t << "<span id=\"searchBoxPos1\">";
3150 t << "</span>\n";
3151 t << "</div>\n";
3152 }
3153 t << "</div><!-- main-nav-mobile -->\n";
3154 t << "<div id=\"main-nav\">\n";
3155 t << " <ul class=\"sm sm-dox\" id=\"main-menu\">\n";
3156 t << " <li id=\"searchBoxPos2\">\n";
3157 if (searchEngine && !(generateTreeView && fullSidebar))
3158 {
3159 t << getSearchBox(serverBasedSearch,relPath,false);
3160 }
3161 t << " </li>\n";
3162 t << " </ul>\n";
3163 t << "</div><!-- main-nav -->\n";
3164 }
3165 else if (!disableIndex) // && !Config_getBool(HTML_DYNAMIC_MENUS)
3166 {
3167 // find highlighted index item
3168 LayoutNavEntry *hlEntry = root->find(kind,kind==LayoutNavEntry::UserGroup ? file : DString());
3169 if (!hlEntry && altKind!=LayoutNavEntry::None) { hlEntry=root->find(altKind); kind=altKind; }
3170 if (!hlEntry) // highlighted item not found in the index! -> just show the level 1 index...
3171 {
3172 highlightParent=true;
3173 hlEntry = root->children().front().get();
3174 if (hlEntry==nullptr)
3175 {
3176 return; // argl, empty index!
3177 }
3178 }
3179 if (kind==LayoutNavEntry::UserGroup)
3180 {
3181 LayoutNavEntry *e = hlEntry->children().front().get();
3182 if (e)
3183 {
3184 hlEntry = e;
3185 }
3186 }
3187 t << "<div id=\"main-nav\">\n";
3188 renderQuickLinksAsTabs(t,relPath,hlEntry,kind,highlightParent,hli==HighlightedItem::Search);
3189 if (!extraTabs)
3190 {
3191 t << "</div><!-- main-nav -->\n";
3192 }
3193 }
3194 else if (!generateTreeView)
3195 {
3196 renderQuickLinksAsTree(t,relPath,root);
3197 }
3198 if (generateTreeView && !disableIndex && fullSidebar && !extraTabs)
3199 {
3200 t << "<div id=\"container\"><div id=\"doc-content\">\n";
3201 }
3202}
static DString htmlFileExtension
Definition doxygen.h:115
@ AnnotatedExceptions
Definition index.h:75
@ InterfaceVisible
Definition index.h:88
@ InterfaceHierarchy
Definition index.h:65
@ AnnotatedInterfaces
Definition index.h:73
@ NamespaceMembers
Definition index.h:77
@ AnnotatedClasses
Definition index.h:72
@ AnnotatedStructs
Definition index.h:74
@ ExceptionVisible
Definition index.h:90
@ NamespaceVisible
Definition index.h:91
@ ExceptionHierarchy
Definition index.h:66
Base class for the layout of a navigation item at the top of the HTML pages.
Definition layout.h:155
LayoutNavEntry * find(LayoutNavEntry::Kind k, const DString &file=DString()) const
Definition layout.cpp:135
Kind
Definition layout.h:192

References AnnotatedClasses, AnnotatedExceptions, AnnotatedInterfaces, AnnotatedStructs, LayoutNavEntry::children(), Classes, ClassHierarchy, ClassVisible, Concepts, ConceptVisible, Config_getBool, Examples, ExceptionHierarchy, Exceptions, ExceptionVisible, Files, FileVisible, LayoutNavEntry::find(), Functions, getSearchBox(), Globals, Doxygen::htmlFileExtension, LayoutDocManager::instance(), InterfaceHierarchy, Interfaces, InterfaceVisible, Main, ModuleMembers, Modules, ModuleVisible, NamespaceMembers, Namespaces, NamespaceVisible, None, Pages, renderQuickLinksAsTabs(), renderQuickLinksAsTree(), LayoutDocManager::rootNavEntry(), Search, Structs, StructVisible, Topics, and UserGroup.

Referenced by HtmlGenerator::writeExternalSearchPage(), HtmlGenerator::writeQuickLinks(), and HtmlGenerator::writeSearchPage().

◆ writeDefaultStyleSheet()

void writeDefaultStyleSheet ( TextStream & t)
static

Definition at line 1506 of file htmlgen.cpp.

1507{
1508 t << "/* The standard CSS for doxygen " << getDoxygenVersion() << "*/\n\n";
1509 switch (Config_getEnum(HTML_COLORSTYLE))
1510 {
1511 case HTML_COLORSTYLE_t::LIGHT:
1512 case HTML_COLORSTYLE_t::DARK:
1513 /* variables will be resolved while writing to the CSS file */
1514 break;
1515 case HTML_COLORSTYLE_t::AUTO_LIGHT:
1516 case HTML_COLORSTYLE_t::TOGGLE:
1517 t << "html {\n";
1518 t << replaceColorMarkers(ResourceMgr::instance().getAsString("lightmode_settings.css"));
1519 t << "}\n\n";
1520 break;
1521 case HTML_COLORSTYLE_t::AUTO_DARK:
1522 t << "html {\n";
1523 t << replaceColorMarkers(ResourceMgr::instance().getAsString("darkmode_settings.css"));
1524 t << "}\n\n";
1525 break;
1526 }
1527 if (Config_getEnum(HTML_COLORSTYLE)==HTML_COLORSTYLE_t::AUTO_LIGHT)
1528 {
1529 t << "@media (prefers-color-scheme: dark) {\n";
1530 t << " html:not(.dark-mode) {\n";
1531 t << " color-scheme: dark;\n\n";
1532 t << replaceColorMarkers(ResourceMgr::instance().getAsString("darkmode_settings.css"));
1533 t << "}}\n";
1534 }
1535 else if (Config_getEnum(HTML_COLORSTYLE)==HTML_COLORSTYLE_t::AUTO_DARK)
1536 {
1537 t << "@media (prefers-color-scheme: light) {\n";
1538 t << " html:not(.light-mode) {\n";
1539 t << " color-scheme: light;\n\n";
1540 t << replaceColorMarkers(ResourceMgr::instance().getAsString("lightmode_settings.css"));
1541 t << "}}\n";
1542 }
1543 else if (Config_getEnum(HTML_COLORSTYLE)==HTML_COLORSTYLE_t::TOGGLE)
1544 {
1545 t << "html.dark-mode {\n";
1546 t << replaceColorMarkers(ResourceMgr::instance().getAsString("darkmode_settings.css"));
1547 t << "}\n\n";
1548 }
1549
1550 DString cssStr = ResourceMgr::instance().getAsString("doxygen.css");
1551 bool hasFullSidebar = Config_getBool(FULL_SIDEBAR) && Config_getBool(GENERATE_TREEVIEW);
1552 if (hasFullSidebar)
1553 {
1554 cssStr+="\n"
1555 "#titlearea {\n"
1556 " border-bottom: none;\n"
1557 " background-color: var(--nav-background-color);\n"
1558 " border-right: 1px solid var(--nav-border-color);\n"
1559 "}\n";
1560 }
1561 t << replaceVariables(cssStr);
1562
1563 bool addTimestamp = Config_getEnum(TIMESTAMP)!=TIMESTAMP_t::NO;
1564 if (g_build_date || addTimestamp)
1565 {
1566 t << "\nhtml {\n";
1567
1568 if (addTimestamp)
1569 {
1570 DString timeStampStr;
1571 switch (Config_getEnum(TIMESTAMP))
1572 {
1573 case TIMESTAMP_t::YES:
1574 case TIMESTAMP_t::DATETIME:
1575 timeStampStr = dateToString(DateTimeType::DateTime);
1576 break;
1577 case TIMESTAMP_t::DATE:
1578 timeStampStr = dateToString(DateTimeType::Date);
1579 break;
1580 default:
1581 break;
1582 }
1583 t << "--timestamp: '" << timeStampStr << "';\n";
1584 }
1585 if (g_build_date)
1586 {
1587 t << "--datetime: '" << dateToString(DateTimeType::DateTime) << "';\n";
1588 t << "--date: '" << dateToString(DateTimeType::Date) << "';\n";
1589 t << "--time: '" << dateToString(DateTimeType::Time) << "';\n";
1590 t << "--year: '" << yearToString() << "';\n";
1591 }
1592 t << "}\n";
1593
1594 if (addTimestamp)
1595 {
1596 t << "span.timestamp { content: ' '; }\n";
1597 t << "span.timestamp:before { content: var(--timestamp); }\n\n";
1598 }
1599 if (g_build_date)
1600 {
1601 t << "span.datetime { content: ' '; }\n";
1602 t << "span.datetime:before { content: var(--datetime); }\n\n";
1603 t << "span.date { content: ' '; }\n";
1604 t << "span.date:before { content: var(--date); }\n\n";
1605 t << "span.time { content: ' '; }\n";
1606 t << "span.time:before { content: var(--time); }\n\n";
1607 t << "span.year { content: ' '; }\n";
1608 t << "span.year:before { content: var(--year); }\n\n";
1609 }
1610 }
1611
1612 // For Webkit based the scrollbar styling cannot be overruled (bug in chromium?).
1613 // To allow the user to style the scrollbars differently we should only add it in case
1614 // the user did not specify any extra stylesheets.
1615 bool addScrollbarStyling = Config_getList(HTML_EXTRA_STYLESHEET).empty();
1616 if (addScrollbarStyling)
1617 {
1618 t << replaceVariables(ResourceMgr::instance().getAsString("scrollbar.css"));
1619 }
1620
1621}
DString yearToString()
Returns the current year as a string.
Definition datetime.cpp:77
DString dateToString(DateTimeType includeTime)
Returns the current date, when includeTime is set also the time is provided.
Definition datetime.cpp:64
static bool g_build_date
Definition htmlgen.cpp:63
static DString replaceVariables(const DString &input)
Definition htmlgen.cpp:784

References Config_getBool, Config_getEnum, Config_getList, Date, DateTime, dateToString(), g_build_date, ResourceMgr::getAsString(), ResourceMgr::instance(), replaceColorMarkers(), replaceVariables(), Time, and yearToString().

Referenced by HtmlGenerator::writeStyleInfo(), and HtmlGenerator::writeStyleSheetFile().

◆ writeServerSearchBox()

void writeServerSearchBox ( TextStream & t,
const DString & relPath,
bool highlightSearch )
static

Definition at line 94 of file htmlgen.cpp.

95{
96 bool externalSearch = Config_getBool(EXTERNAL_SEARCH);
97 t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
98 t << " <div class=\"left\">\n";
99 t << " <form id=\"FSearchBox\" action=\"" << relPath;
100 if (externalSearch)
101 {
102 t << "search" << Doxygen::htmlFileExtension;
103 }
104 else
105 {
106 t << "search.php";
107 }
108 t << "\" method=\"get\">\n";
109 t << " <span id=\"MSearchSelectExt\" class=\"search-icon\"></span>\n";
110 if (!highlightSearch || !Config_getBool(HTML_DYNAMIC_MENUS))
111 {
112 t << " <input type=\"text\" id=\"MSearchField\" name=\"query\" value=\"\" placeholder=\""
113 << theTranslator->trSearch() << "\" size=\"20\" accesskey=\"S\"/>\n";
114 t << " </form>\n";
115 t << " </div><div class=\"right\"></div>\n";
116 t << " </div>\n";
117 }
118}

References Config_getBool, Doxygen::htmlFileExtension, theTranslator, and Translator::trSearch().

Referenced by getSearchBox(), and renderQuickLinksAsTabs().

Variable Documentation

◆ g_build_date

bool g_build_date = false
static

Definition at line 63 of file htmlgen.cpp.

Referenced by HtmlGenerator::init(), and writeDefaultStyleSheet().

◆ g_darkMap

StringUnorderedMap g_darkMap
static

Definition at line 747 of file htmlgen.cpp.

Referenced by fillColorStyleMaps(), and replaceVariables().

◆ g_footer

DString g_footer
static

Definition at line 60 of file htmlgen.cpp.

Referenced by HtmlGenerator::init(), and HtmlGenerator::writePageFooter().

◆ g_footer_file

DString g_footer_file
static

Definition at line 59 of file htmlgen.cpp.

Referenced by HtmlGenerator::init(), and HtmlGenerator::writePageFooter().

◆ g_header

◆ g_header_file

◆ g_indexLock

std::mutex g_indexLock
static

Definition at line 1641 of file htmlgen.cpp.

Referenced by HtmlGenerator::startFile().

◆ g_latex_macro

DString g_latex_macro
static

Definition at line 62 of file htmlgen.cpp.

Referenced by HtmlGenerator::init(), and substituteHtmlKeywords().

◆ g_lightMap

StringUnorderedMap g_lightMap
static

Definition at line 746 of file htmlgen.cpp.

Referenced by fillColorStyleMaps(), and replaceVariables().

◆ g_mathjax_code

DString g_mathjax_code
static

Definition at line 61 of file htmlgen.cpp.

Referenced by HtmlGenerator::init(), and substituteHtmlKeywords().

◆ hex

auto hex ="0123456789ABCDEF"
staticconstexpr

Definition at line 64 of file htmlgen.cpp.

Referenced by HtmlCodeGenerator::codify().

◆ htmlMarkerInfo

const SelectionMarkerInfo htmlMarkerInfo = { '<', "<!--BEGIN ",10,"<!--END ",8,"-->",3 }
static

Definition at line 66 of file htmlgen.cpp.

Referenced by HtmlGenerator::init(), and substituteHtmlKeywords().