Doxygen
Loading...
Searching...
No Matches
htmlgen.cpp File Reference
#include <stdlib.h>
#include <assert.h>
#include <mutex>
#include "message.h"
#include "htmlgen.h"
#include "config.h"
#include "util.h"
#include "doxygen.h"
#include "diagram.h"
#include "version.h"
#include "dot.h"
#include "dotcallgraph.h"
#include "dotclassgraph.h"
#include "dotdirdeps.h"
#include "dotgfxhierarchytable.h"
#include "dotgroupcollaboration.h"
#include "dotincldepgraph.h"
#include "language.h"
#include "htmlhelp.h"
#include "docparser.h"
#include "docnode.h"
#include "htmldocvisitor.h"
#include "searchindex.h"
#include "pagedef.h"
#include "debug.h"
#include "dirdef.h"
#include "vhdldocgen.h"
#include "layout.h"
#include "image.h"
#include "ftvhelp.h"
#include "resourcemgr.h"
#include "tooltip.h"
#include "fileinfo.h"
#include "dir.h"
#include "utf8.h"
#include "textstream.h"
#include "indexlist.h"
#include "datetime.h"
#include "portable.h"
#include "outputlist.h"
#include "stringutil.h"
#include "mermaid.h"
Include dependency graph for htmlgen.cpp:

Go to the source code of this file.

Macros

#define DBG_HTML(x)

Functions

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 62 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 2880 of file htmlgen.cpp.

2881{
2882 t << "</span>";
2883 if (!l.empty()) t << "</a>";
2884 t << "</li>\n";
2885}
bool empty() const
Returns true iff the string is empty (std::string compatible alias for isEmpty()).
Definition dstring.h:153

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

Referenced by endQuickIndexItem(), and renderQuickLinksAsTabs().

◆ endQuickIndexList()

void endQuickIndexList ( TextStream & t)
static

Definition at line 2853 of file htmlgen.cpp.

2854{
2855 if (!Config_getBool(DISABLE_INDEX))
2856 {
2857 t << " </ul>\n";
2858 t << " </div>\n";
2859 }
2860 else
2861 {
2862 t << "</ul>\n";
2863 }
2864}
#define Config_getBool(name)
Definition config.h:33

References Config_getBool, and endQuickIndexList().

Referenced by endQuickIndexList(), renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ endSectionContent()

void endSectionContent ( TextStream & t)
static

◆ endSectionHeader()

void endSectionHeader ( TextStream & t)
static

◆ endSectionSummary()

void endSectionSummary ( TextStream & t)
static

Definition at line 2132 of file htmlgen.cpp.

2133{
2134 //t << "<!-- endSectionSummary -->";
2135 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2136 if (dynamicSections)
2137 {
2138 t << "</div>\n";
2139 }
2140}

References Config_getBool, and endSectionSummary().

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

◆ fillColorStyleMap()

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

Definition at line 742 of file htmlgen.cpp.

743{
744 size_t p=0,i=0;
745 while ((i=definitions.find('\n',p))!=DString::npos)
746 {
747 DString line = definitions.mid(p,i-p);
748 if (line.startsWith("--"))
749 {
750 size_t separator = line.find(':');
751 assert(separator!=DString::npos);
752 std::string key = line.left(separator).str();
753 size_t semi = line.rfind(';');
754 assert(semi!=DString::npos);
755 std::string value = line.mid(separator+1,semi-separator-1).stripWhiteSpace().str();
756 map.emplace(key,value);
757 //printf("var(%s)=%s\n",qPrint(key),qPrint(value));
758 }
759 p=i+1;
760 }
761}
A String class for use with Doxygen wrapping std::string and adding some additional functionality off...
Definition dstring.h:89
size_t rfind(char c, size_t pos=npos) const
Definition dstring.h:249
DString mid(size_t index, size_t len=npos) const
Definition dstring.h:323
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:183
size_t find(char c, size_t pos=0) const
Definition dstring.h:244
DString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition dstring.h:342
DString left(size_t len) const
Definition dstring.h:311
const std::string & str() const
Definition dstring.h:634
bool startsWith(const char *s) const
Definition dstring.h:589

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

Referenced by fillColorStyleMap(), and fillColorStyleMaps().

◆ fillColorStyleMaps()

void fillColorStyleMaps ( )
static

Definition at line 763 of file htmlgen.cpp.

764{
766 auto colorStyle = Config_getEnum(HTML_COLORSTYLE);
767 if (colorStyle==HTML_COLORSTYLE_t::LIGHT)
768 {
769 fillColorStyleMap(replaceColorMarkers(mgr.getAsString("lightmode_settings.css")),g_lightMap);
770 }
771 else if (colorStyle==HTML_COLORSTYLE_t::DARK)
772 {
773 fillColorStyleMap(replaceColorMarkers(mgr.getAsString("darkmode_settings.css")),g_darkMap);
774 }
775}
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:742
static StringUnorderedMap g_lightMap
Definition htmlgen.cpp:739
static StringUnorderedMap g_darkMap
Definition htmlgen.cpp:740
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:5850

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

Referenced by fillColorStyleMaps(), 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:222
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:162
size_t length() const
Returns the length of the string, not counting the 0-terminator.
Definition dstring.h:156
FileInfo(const std::string &name)
Definition fileinfo.h:25
#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:98
DString fileToString(const DString &name, bool filter, bool isSourceCode)
Definition util.cpp:1496

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

Referenced by getConvertLatexMacro(), and 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 getSearchBox(), TextStream::str(), writeClientSearchBox(), and writeServerSearchBox().

Referenced by getSearchBox(), substituteHtmlKeywords(), and writeDefaultQuickLinks().

◆ hasDateReplacement()

bool hasDateReplacement ( const DString & str)
static

Definition at line 1265 of file htmlgen.cpp.

1266{
1267 return (str.contains("$datetime",false) ||
1268 str.contains("$date",false) ||
1269 str.contains("$time",false) ||
1270 str.contains("$year",false)
1271 );
1272}
int contains(char c, bool cs=true) const
Definition dstring.cpp:76

References DString::contains(), and hasDateReplacement().

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

◆ quickLinkVisible()

bool quickLinkVisible ( LayoutNavEntry::Kind kind)
static

Definition at line 2887 of file htmlgen.cpp.

2888{
2889 const auto &index = Index::instance();
2890 bool showNamespaces = Config_getBool(SHOW_NAMESPACES);
2891 bool showFiles = Config_getBool(SHOW_FILES);
2892 switch (kind)
2893 {
2894 case LayoutNavEntry::MainPage: return true;
2895 case LayoutNavEntry::User: return true;
2896 case LayoutNavEntry::UserGroup: return true;
2897 case LayoutNavEntry::Pages: return index.numIndexedPages()>0;
2898 case LayoutNavEntry::Topics: return index.numDocumentedGroups()>0;
2899 case LayoutNavEntry::Modules: return index.numDocumentedModules()>0;
2900 case LayoutNavEntry::ModuleList: return index.numDocumentedModules()>0;
2901 case LayoutNavEntry::ModuleMembers: return index.numDocumentedModuleMembers(ModuleMemberHighlight::All)>0;
2902 case LayoutNavEntry::Namespaces: return showNamespaces && index.numDocumentedNamespaces()>0;
2903 case LayoutNavEntry::NamespaceList: return showNamespaces && index.numDocumentedNamespaces()>0;
2904 case LayoutNavEntry::NamespaceMembers: return showNamespaces && index.numDocumentedNamespaceMembers(NamespaceMemberHighlight::All)>0;
2905 case LayoutNavEntry::Concepts: return index.numDocumentedConcepts()>0;
2906 case LayoutNavEntry::Classes: return index.numAnnotatedClasses()>0;
2907 case LayoutNavEntry::ClassList: return index.numAnnotatedClasses()>0;
2908 case LayoutNavEntry::ClassIndex: return index.numAnnotatedClasses()>0;
2909 case LayoutNavEntry::ClassHierarchy: return index.numHierarchyClasses()>0;
2910 case LayoutNavEntry::ClassMembers: return index.numDocumentedClassMembers(ClassMemberHighlight::All)>0;
2911 case LayoutNavEntry::Files: return showFiles && index.numDocumentedFiles()>0;
2912 case LayoutNavEntry::FileList: return showFiles && index.numDocumentedFiles()>0;
2913 case LayoutNavEntry::FileGlobals: return showFiles && index.numDocumentedFileMembers(FileMemberHighlight::All)>0;
2914 case LayoutNavEntry::Examples: return !Doxygen::exampleLinkedMap->empty();
2915 case LayoutNavEntry::Interfaces: return index.numAnnotatedInterfaces()>0;
2916 case LayoutNavEntry::InterfaceList: return index.numAnnotatedInterfaces()>0;
2917 case LayoutNavEntry::InterfaceIndex: return index.numAnnotatedInterfaces()>0;
2918 case LayoutNavEntry::InterfaceHierarchy: return index.numHierarchyInterfaces()>0;
2919 case LayoutNavEntry::Structs: return index.numAnnotatedStructs()>0;
2920 case LayoutNavEntry::StructList: return index.numAnnotatedStructs()>0;
2921 case LayoutNavEntry::StructIndex: return index.numAnnotatedStructs()>0;
2922 case LayoutNavEntry::Exceptions: return index.numAnnotatedExceptions()>0;
2923 case LayoutNavEntry::ExceptionList: return index.numAnnotatedExceptions()>0;
2924 case LayoutNavEntry::ExceptionIndex: return index.numAnnotatedExceptions()>0;
2925 case LayoutNavEntry::ExceptionHierarchy: return index.numHierarchyExceptions()>0;
2926 case LayoutNavEntry::None: // should never happen, means not properly initialized
2927 assert(kind != LayoutNavEntry::None);
2928 return false;
2929 }
2930 return false;
2931}
static PageLinkedMap * exampleLinkedMap
Definition doxygen.h:98
static Index & instance()
Definition index.cpp:108
bool empty() const
Definition linkedmap.h:209

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

Referenced by quickLinkVisible(), renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ renderQuickLinksAsTabs()

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

Definition at line 2962 of file htmlgen.cpp.

2965{
2966 if (hlEntry->parent()) // first draw the tabs for the parent of hlEntry
2967 {
2968 renderQuickLinksAsTabs(t,relPath,hlEntry->parent(),kind,highlightParent,highlightSearch);
2969 }
2970 if (hlEntry->parent() && !hlEntry->parent()->children().empty()) // draw tabs for row containing hlEntry
2971 {
2972 bool topLevel = hlEntry->parent()->parent()==nullptr;
2973 int count=0;
2974 for (const auto &entry : hlEntry->parent()->children())
2975 {
2976 if (entry->visible() && quickLinkVisible(entry->kind())) count++;
2977 }
2978 if (count>0) // at least one item is visible
2979 {
2980 startQuickIndexList(t,topLevel);
2981 for (const auto &entry : hlEntry->parent()->children())
2982 {
2983 if (entry->visible() && quickLinkVisible(entry->kind()))
2984 {
2985 DString url = entry->url();
2986 startQuickIndexItem(t,url,
2987 entry.get()==hlEntry &&
2988 (!entry->children().empty() ||
2989 (entry->kind()==kind && !highlightParent)
2990 ),
2991 true,relPath);
2992 t << fixSpaces(entry->title());
2993 endQuickIndexItem(t,url);
2994 }
2995 }
2996 if (hlEntry->parent()==LayoutDocManager::instance().rootNavEntry()) // first row is special as it contains the search box
2997 {
2998 bool searchEngine = Config_getBool(SEARCHENGINE);
2999 bool serverBasedSearch = Config_getBool(SERVER_BASED_SEARCH);
3000 bool disableIndex = Config_getBool(DISABLE_INDEX);
3001 bool generateTreeView = Config_getBool(GENERATE_TREEVIEW);
3002 bool fullSidebar = Config_getBool(FULL_SIDEBAR);
3003 // case where DISABLE_INDEX=NO & GENERATE_TREEVIEW=YES & FULL_SIDEBAR=YES has search box in the side panel
3004 if (searchEngine)
3005 {
3006 t << " <li>\n";
3007 if (disableIndex || !generateTreeView || !fullSidebar)
3008 {
3009 if (!serverBasedSearch) // pure client side search
3010 {
3011 writeClientSearchBox(t,relPath);
3012 t << " </li>\n";
3013 }
3014 else // server based search
3015 {
3016 writeServerSearchBox(t,relPath,highlightSearch);
3017 if (!highlightSearch)
3018 {
3019 t << " </li>\n";
3020 }
3021 }
3022 }
3023 else
3024 {
3025 t << " </li>\n";
3026 }
3027 }
3028 if (!highlightSearch || Config_getBool(FULL_SIDEBAR))
3029 // on the search page the index will be ended by the page itself if the search box is part of the navigation bar
3030 {
3032 }
3033 }
3034 else // normal case for other rows than first one
3035 {
3037 }
3038 }
3039 }
3040}
static LayoutDocManager & instance()
Returns a reference to this singleton.
Definition layout.cpp:1435
LayoutNavEntry * rootNavEntry() const
returns the (invisible) root of the navigation tree.
Definition layout.cpp:1446
static void endQuickIndexList(TextStream &t)
Definition htmlgen.cpp:2853
static void startQuickIndexItem(TextStream &t, const DString &l, bool hl, bool, const DString &relPath)
Definition htmlgen.cpp:2866
static void startQuickIndexList(TextStream &t, bool topLevel=true)
Definition htmlgen.cpp:2833
static void endQuickIndexItem(TextStream &t, const DString &l)
Definition htmlgen.cpp:2880
static bool quickLinkVisible(LayoutNavEntry::Kind kind)
Definition htmlgen.cpp:2887
static void renderQuickLinksAsTabs(TextStream &t, const DString &relPath, LayoutNavEntry *hlEntry, LayoutNavEntry::Kind kind, bool highlightParent, bool highlightSearch)
Definition htmlgen.cpp:2962
const LayoutNavEntryList & children() const
Definition layout.h:219
LayoutNavEntry * parent() const
Definition layout.h:212
DString fixSpaces(const DString &s)
Definition util.h:522

References LayoutNavEntry::children(), Config_getBool, endQuickIndexItem(), endQuickIndexList(), 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 2933 of file htmlgen.cpp.

2935{
2936 int count=0;
2937 for (const auto &entry : root->children())
2938 {
2939 if (entry->visible() && quickLinkVisible(entry->kind())) count++;
2940 }
2941 if (count>0) // at least one item is visible
2942 {
2944 for (const auto &entry : root->children())
2945 {
2946 if (entry->visible() && quickLinkVisible(entry->kind()))
2947 {
2948 DString url = entry->url();
2949 t << "<li><a href=\"" << relPath << url << "\"><span>";
2950 t << fixSpaces(entry->title());
2951 t << "</span></a>\n";
2952 // recursive into child list
2953 renderQuickLinksAsTree(t,relPath,entry.get());
2954 t << "</li>";
2955 }
2956 }
2958 }
2959}
static void renderQuickLinksAsTree(TextStream &t, const DString &relPath, LayoutNavEntry *root)
Definition htmlgen.cpp:2933

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

Referenced by renderQuickLinksAsTree(), and writeDefaultQuickLinks().

◆ replaceVariables()

DString replaceVariables ( const DString & input)
static

Definition at line 777 of file htmlgen.cpp.

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

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

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

◆ startQuickIndexItem()

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

Definition at line 2866 of file htmlgen.cpp.

2869{
2870 t << " <li";
2871 if (hl)
2872 {
2873 t << " class=\"current\"";
2874 }
2875 t << ">";
2876 if (!l.empty()) t << "<a href=\"" << correctURL(l,relPath) << "\">";
2877 t << "<span>";
2878}
DString correctURL(const DString &url, const DString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:5969

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

Referenced by renderQuickLinksAsTabs(), and startQuickIndexItem().

◆ startQuickIndexList()

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

Definition at line 2833 of file htmlgen.cpp.

2834{
2835 if (!Config_getBool(DISABLE_INDEX))
2836 {
2837 if (topLevel)
2838 {
2839 t << " <div id=\"navrow1\" class=\"tabs\">\n";
2840 }
2841 else
2842 {
2843 t << " <div id=\"navrow2\" class=\"tabs2\">\n";
2844 }
2845 t << " <ul class=\"tablist\">\n";
2846 }
2847 else
2848 {
2849 t << "<ul>";
2850 }
2851}

References Config_getBool, and startQuickIndexList().

Referenced by renderQuickLinksAsTabs(), renderQuickLinksAsTree(), and startQuickIndexList().

◆ startSectionContent()

void startSectionContent ( TextStream & t,
int sectionCount )
static

Definition at line 2142 of file htmlgen.cpp.

2143{
2144 //t << "<!-- startSectionContent -->";
2145 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2146 if (dynamicSections)
2147 {
2148 t << "<div id=\"dynsection-" << sectionCount << "-content\" "
2149 "class=\"dyncontent hidden\">\n";
2150 }
2151 else
2152 {
2153 t << "<div class=\"dyncontent\">\n";
2154 }
2155}

References Config_getBool, and startSectionContent().

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

◆ startSectionHeader()

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

Definition at line 2098 of file htmlgen.cpp.

2100{
2101 //t << "<!-- startSectionHeader -->";
2102 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2103 if (dynamicSections)
2104 {
2105 t << "<div id=\"dynsection-" << sectionCount << "\" "
2106 "class=\"dynheader closed\">"
2107 "<span class=\"dynarrow\"><span class=\"arrowhead closed\"></span></span>";
2108 }
2109 else
2110 {
2111 t << "<div class=\"dynheader\">\n";
2112 }
2113}

References Config_getBool, and startSectionHeader().

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

◆ startSectionSummary()

void startSectionSummary ( TextStream & t,
int sectionCount )
static

Definition at line 2121 of file htmlgen.cpp.

2122{
2123 //t << "<!-- startSectionSummary -->";
2124 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2125 if (dynamicSections)
2126 {
2127 t << "<div id=\"dynsection-" << sectionCount << "-summary\" "
2128 "class=\"dynsummary\">\n";
2129 }
2130}

References Config_getBool, and startSectionSummary().

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

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

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

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

◆ 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, Translator::trSearch(), and writeClientSearchBox().

Referenced by getSearchBox(), renderQuickLinksAsTabs(), and writeClientSearchBox().

◆ writeDefaultQuickLinks()

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

Definition at line 3042 of file htmlgen.cpp.

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

References AnnotatedClasses, AnnotatedExceptions, AnnotatedInterfaces, AnnotatedStructs, LayoutNavEntry::children(), Classes, ClassHierarchy, ClassVisible, Concepts, ConceptVisible, Config_getBool, DString::DString(), 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, UserGroup, and writeDefaultQuickLinks().

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

◆ writeDefaultStyleSheet()

void writeDefaultStyleSheet ( TextStream & t)
static

Definition at line 1499 of file htmlgen.cpp.

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

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

Referenced by writeDefaultStyleSheet(), 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, Translator::trSearch(), and writeServerSearchBox().

Referenced by getSearchBox(), renderQuickLinksAsTabs(), and writeServerSearchBox().

Variable Documentation

◆ g_build_date

bool g_build_date = false
static

Definition at line 70 of file htmlgen.cpp.

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

◆ g_darkMap

StringUnorderedMap g_darkMap
static

Definition at line 740 of file htmlgen.cpp.

Referenced by fillColorStyleMaps(), and replaceVariables().

◆ g_footer

DString g_footer
static

Definition at line 67 of file htmlgen.cpp.

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

◆ g_footer_file

DString g_footer_file
static

Definition at line 66 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 1634 of file htmlgen.cpp.

Referenced by HtmlGenerator::startFile().

◆ g_latex_macro

DString g_latex_macro
static

Definition at line 69 of file htmlgen.cpp.

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

◆ g_lightMap

StringUnorderedMap g_lightMap
static

Definition at line 739 of file htmlgen.cpp.

Referenced by fillColorStyleMaps(), and replaceVariables().

◆ g_mathjax_code

DString g_mathjax_code
static

Definition at line 68 of file htmlgen.cpp.

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

◆ hex

auto hex ="0123456789ABCDEF"
staticconstexpr

Definition at line 71 of file htmlgen.cpp.

Referenced by HtmlCodeGenerator::codify().

◆ htmlMarkerInfo

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

Definition at line 73 of file htmlgen.cpp.

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