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 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 QCString &relPath)
static void writeServerSearchBox (TextStream &t, const QCString &relPath, bool highlightSearch)
static QCString getConvertLatexMacro ()
 Convert a set of LaTeX commands \(re)newcommand to a form readable by MathJax LaTeX syntax:
static QCString getSearchBox (bool serverSide, QCString relPath, bool highlightSearch)
static QCString substituteHtmlKeywords (const QCString &file, const QCString &str, const QCString &title, const QCString &relPath, const QCString &navPath=QCString(), bool isSource=false)
static void fillColorStyleMap (const QCString &definitions, StringUnorderedMap &map)
static void fillColorStyleMaps ()
static QCString replaceVariables (const QCString &input)
static bool hasDateReplacement (const QCString &str)
static void writeDefaultStyleSheet (TextStream &t)
static void startSectionHeader (TextStream &t, const QCString &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 QCString &l, bool hl, bool, const QCString &relPath)
static void endQuickIndexItem (TextStream &t, const QCString &l)
static bool quickLinkVisible (LayoutNavEntry::Kind kind)
static void renderQuickLinksAsTree (TextStream &t, const QCString &relPath, LayoutNavEntry *root)
static void renderQuickLinksAsTabs (TextStream &t, const QCString &relPath, LayoutNavEntry *hlEntry, LayoutNavEntry::Kind kind, bool highlightParent, bool highlightSearch)
static void writeDefaultQuickLinks (TextStream &t, HighlightedItem hli, const QCString &file, const QCString &relPath, bool extraTabs)

Variables

static QCString g_header
static QCString g_header_file
static QCString g_footer_file
static QCString g_footer
static QCString g_mathjax_code
static QCString 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 61 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 QCString & l )
static

Definition at line 2870 of file htmlgen.cpp.

2871{
2872 t << "</span>";
2873 if (!l.isEmpty()) t << "</a>";
2874 t << "</li>\n";
2875}
bool isEmpty() const
Returns TRUE iff the string is empty.
Definition qcstring.h:163

References QCString::isEmpty().

Referenced by renderQuickLinksAsTabs().

◆ endQuickIndexList()

void endQuickIndexList ( TextStream & t)
static

Definition at line 2843 of file htmlgen.cpp.

2844{
2845 if (!Config_getBool(DISABLE_INDEX))
2846 {
2847 t << " </ul>\n";
2848 t << " </div>\n";
2849 }
2850 else
2851 {
2852 t << "</ul>\n";
2853 }
2854}
#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 2147 of file htmlgen.cpp.

2148{
2149 //t << "<!-- endSectionContent -->";
2150 t << "</div>\n";
2151}

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

2122{
2123 //t << "<!-- endSectionSummary -->";
2124 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2125 if (dynamicSections)
2126 {
2127 t << "</div>\n";
2128 }
2129}

References Config_getBool.

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

◆ fillColorStyleMap()

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

Definition at line 737 of file htmlgen.cpp.

738{
739 int p=0,i=0;
740 while ((i=definitions.find('\n',p))!=-1)
741 {
742 QCString line = definitions.mid(p,i-p);
743 if (line.startsWith("--"))
744 {
745 int separator = line.find(':');
746 assert(separator!=-1);
747 std::string key = line.left(separator).str();
748 int semi = line.findRev(';');
749 assert(semi!=-1);
750 std::string value = line.mid(separator+1,semi-separator-1).stripWhiteSpace().str();
751 map.emplace(key,value);
752 //printf("var(%s)=%s\n",qPrint(key),qPrint(value));
753 }
754 p=i+1;
755 }
756}
This is an alternative implementation of QCString.
Definition qcstring.h:101
int find(char c, int index=0, bool cs=TRUE) const
Definition qcstring.cpp:43
bool startsWith(const char *s) const
Definition qcstring.h:507
QCString mid(size_t index, size_t len=static_cast< size_t >(-1)) const
Definition qcstring.h:241
QCString stripWhiteSpace() const
returns a copy of this string with leading and trailing whitespace removed
Definition qcstring.h:260
const std::string & str() const
Definition qcstring.h:552
int findRev(char c, int index=-1, bool cs=TRUE) const
Definition qcstring.cpp:96
QCString left(size_t len) const
Definition qcstring.h:229

References QCString::find(), QCString::findRev(), QCString::left(), QCString::mid(), QCString::startsWith(), QCString::str(), and QCString::stripWhiteSpace().

Referenced by fillColorStyleMaps().

◆ fillColorStyleMaps()

void fillColorStyleMaps ( )
static

Definition at line 758 of file htmlgen.cpp.

759{
761 auto colorStyle = Config_getEnum(HTML_COLORSTYLE);
762 if (colorStyle==HTML_COLORSTYLE_t::LIGHT)
763 {
764 fillColorStyleMap(replaceColorMarkers(mgr.getAsString("lightmode_settings.css")),g_lightMap);
765 }
766 else if (colorStyle==HTML_COLORSTYLE_t::DARK)
767 {
768 fillColorStyleMap(replaceColorMarkers(mgr.getAsString("darkmode_settings.css")),g_darkMap);
769 }
770}
Singleton for managing resources compiled into an executable.
Definition resourcemgr.h:37
static ResourceMgr & instance()
Returns the one and only instance of this class.
QCString getAsString(const QCString &name) const
Gets the resource data as a C string.
#define Config_getEnum(name)
Definition config.h:35
static void fillColorStyleMap(const QCString &definitions, StringUnorderedMap &map)
Definition htmlgen.cpp:737
static StringUnorderedMap g_lightMap
Definition htmlgen.cpp:734
static StringUnorderedMap g_darkMap
Definition htmlgen.cpp:735
QCString replaceColorMarkers(const QCString &str)
Replaces any markers of the form ##AA in input string str by new markers of the form #AABBCC,...
Definition util.cpp:5836

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

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

◆ getConvertLatexMacro()

QCString 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 149 of file htmlgen.cpp.

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

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

Referenced by HtmlGenerator::init().

◆ getSearchBox()

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

Definition at line 300 of file htmlgen.cpp.

301{
302 TextStream t;
303 if (serverSide)
304 {
305 writeServerSearchBox(t, relPath, highlightSearch);
306 }
307 else
308 {
309 writeClientSearchBox(t, relPath);
310 }
311 return t.str();
312}
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:216
static void writeServerSearchBox(TextStream &t, const QCString &relPath, bool highlightSearch)
Definition htmlgen.cpp:98
static void writeClientSearchBox(TextStream &t, const QCString &relPath)
Definition htmlgen.cpp:76

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

Referenced by substituteHtmlKeywords(), and writeDefaultQuickLinks().

◆ hasDateReplacement()

bool hasDateReplacement ( const QCString & str)
static

Definition at line 1260 of file htmlgen.cpp.

1261{
1262 return (str.contains("$datetime",false) ||
1263 str.contains("$date",false) ||
1264 str.contains("$time",false) ||
1265 str.contains("$year",false)
1266 );
1267}
int contains(char c, bool cs=TRUE) const
Definition qcstring.cpp:148

References QCString::contains().

Referenced by HtmlGenerator::init().

◆ quickLinkVisible()

bool quickLinkVisible ( LayoutNavEntry::Kind kind)
static

Definition at line 2877 of file htmlgen.cpp.

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

References ClassMemberHighlight::All, FileMemberHighlight::All, ModuleMemberHighlight::All, NamespaceMemberHighlight::All, Config_getBool, Doxygen::exampleLinkedMap, FALSE, Index::instance(), and TRUE.

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ renderQuickLinksAsTabs()

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

Definition at line 2952 of file htmlgen.cpp.

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

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

Referenced by renderQuickLinksAsTabs(), and writeDefaultQuickLinks().

◆ renderQuickLinksAsTree()

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

Definition at line 2923 of file htmlgen.cpp.

2925{
2926 int count=0;
2927 for (const auto &entry : root->children())
2928 {
2929 if (entry->visible() && quickLinkVisible(entry->kind())) count++;
2930 }
2931 if (count>0) // at least one item is visible
2932 {
2934 for (const auto &entry : root->children())
2935 {
2936 if (entry->visible() && quickLinkVisible(entry->kind()))
2937 {
2938 QCString url = entry->url();
2939 t << "<li><a href=\"" << relPath << url << "\"><span>";
2940 t << fixSpaces(entry->title());
2941 t << "</span></a>\n";
2942 // recursive into child list
2943 renderQuickLinksAsTree(t,relPath,entry.get());
2944 t << "</li>";
2945 }
2946 }
2948 }
2949}
static void renderQuickLinksAsTree(TextStream &t, const QCString &relPath, LayoutNavEntry *root)
Definition htmlgen.cpp:2923

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

Referenced by renderQuickLinksAsTree(), and writeDefaultQuickLinks().

◆ replaceVariables()

QCString replaceVariables ( const QCString & input)
static

Definition at line 772 of file htmlgen.cpp.

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

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

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

◆ startQuickIndexItem()

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

Definition at line 2856 of file htmlgen.cpp.

2859{
2860 t << " <li";
2861 if (hl)
2862 {
2863 t << " class=\"current\"";
2864 }
2865 t << ">";
2866 if (!l.isEmpty()) t << "<a href=\"" << correctURL(l,relPath) << "\">";
2867 t << "<span>";
2868}
QCString correctURL(const QCString &url, const QCString &relPath)
Corrects URL url according to the relative path relPath.
Definition util.cpp:5955

References correctURL(), and QCString::isEmpty().

Referenced by renderQuickLinksAsTabs().

◆ startQuickIndexList()

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

Definition at line 2823 of file htmlgen.cpp.

2824{
2825 if (!Config_getBool(DISABLE_INDEX))
2826 {
2827 if (topLevel)
2828 {
2829 t << " <div id=\"navrow1\" class=\"tabs\">\n";
2830 }
2831 else
2832 {
2833 t << " <div id=\"navrow2\" class=\"tabs2\">\n";
2834 }
2835 t << " <ul class=\"tablist\">\n";
2836 }
2837 else
2838 {
2839 t << "<ul>";
2840 }
2841}

References Config_getBool, and TRUE.

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ startSectionContent()

void startSectionContent ( TextStream & t,
int sectionCount )
static

Definition at line 2131 of file htmlgen.cpp.

2132{
2133 //t << "<!-- startSectionContent -->";
2134 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2135 if (dynamicSections)
2136 {
2137 t << "<div id=\"dynsection-" << sectionCount << "-content\" "
2138 "class=\"dyncontent\" "
2139 "style=\"display:none;\">\n";
2140 }
2141 else
2142 {
2143 t << "<div class=\"dyncontent\">\n";
2144 }
2145}

References Config_getBool.

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

◆ startSectionHeader()

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

Definition at line 2084 of file htmlgen.cpp.

2086{
2087 //t << "<!-- startSectionHeader -->";
2088 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2089 if (dynamicSections)
2090 {
2091 t << "<div id=\"dynsection-" << sectionCount << "\" "
2092 "onclick=\"return dynsection.toggleVisibility(this)\" "
2093 "class=\"dynheader closed\" "
2094 "style=\"cursor:pointer;\">"
2095 "<span class=\"dynarrow\"><span class=\"arrowhead closed\"></span></span>";
2096 }
2097 else
2098 {
2099 t << "<div class=\"dynheader\">\n";
2100 }
2101}

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

2110{
2111 //t << "<!-- startSectionSummary -->";
2112 bool dynamicSections = Config_getBool(HTML_DYNAMIC_SECTIONS);
2113 if (dynamicSections)
2114 {
2115 t << "<div id=\"dynsection-" << sectionCount << "-summary\" "
2116 "class=\"dynsummary\" "
2117 "style=\"display:block;\">\n";
2118 }
2119}

References Config_getBool.

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

◆ substituteHtmlKeywords()

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

Definition at line 314 of file htmlgen.cpp.

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

References codeFolding(), Config_getBool, Config_getEnum, Config_getEnumAsString, Config_getList, Config_getString, convertToHtml(), QCString::data(), FileInfo::exists(), FALSE, FileInfo::fileName(), g_latex_macro, g_mathjax_code, getSearchBox(), htmlMarkerInfo, QCString::isEmpty(), QCString::lower(), QCString::prepend(), removeEmptyLines(), selectBlocks(), QCString::startsWith(), QCString::str(), stripPath(), substitute(), substituteKeywords(), and theTranslator.

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

◆ writeClientSearchBox()

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

Definition at line 76 of file htmlgen.cpp.

77{
78 t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
79 t << " <span class=\"left\">\n";
80 t << " <span id=\"MSearchSelect\" class=\"search-icon\" ";
81 t << "onmouseover=\"return searchBox.OnSearchSelectShow()\" ";
82 t << "onmouseout=\"return searchBox.OnSearchSelectHide()\">";
83 t << "<span class=\"search-icon-dropdown\"></span></span>\n";
84 t << " <input type=\"text\" id=\"MSearchField\" value=\"\" placeholder=\""
85 << theTranslator->trSearch() << "\" accesskey=\"S\"\n";
86 t << " onfocus=\"searchBox.OnSearchFieldFocus(true)\" \n";
87 t << " onblur=\"searchBox.OnSearchFieldFocus(false)\" \n";
88 t << " onkeyup=\"searchBox.OnSearchFieldChange(event)\"/>\n";
89 t << " </span><span class=\"right\">\n";
90 t << " <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\">"
91 << "<div id=\"MSearchCloseImg\" class=\"close-icon\"></div></a>\n";
92 t << " </span>\n";
93 t << " </div>\n";
94}

References theTranslator.

Referenced by getSearchBox(), and renderQuickLinksAsTabs().

◆ writeDefaultQuickLinks()

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

Definition at line 3032 of file htmlgen.cpp.

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

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, TRUE, and UserGroup.

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

◆ writeDefaultStyleSheet()

void writeDefaultStyleSheet ( TextStream & t)
static

Definition at line 1483 of file htmlgen.cpp.

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

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(), LatexGenerator::writeStyleInfo(), HtmlGenerator::writeStyleSheetFile(), and LatexGenerator::writeStyleSheetFile().

◆ writeServerSearchBox()

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

Definition at line 98 of file htmlgen.cpp.

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

References Config_getBool, Doxygen::htmlFileExtension, and theTranslator.

Referenced by getSearchBox(), and renderQuickLinksAsTabs().

Variable Documentation

◆ g_build_date

bool g_build_date = false
static

Definition at line 69 of file htmlgen.cpp.

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

◆ g_darkMap

StringUnorderedMap g_darkMap
static

Definition at line 735 of file htmlgen.cpp.

Referenced by fillColorStyleMaps(), and replaceVariables().

◆ g_footer

◆ g_footer_file

◆ g_header

◆ g_header_file

◆ g_indexLock

std::mutex g_indexLock
static

Definition at line 1618 of file htmlgen.cpp.

Referenced by HtmlGenerator::startFile().

◆ g_latex_macro

QCString g_latex_macro
static

Definition at line 68 of file htmlgen.cpp.

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

◆ g_lightMap

StringUnorderedMap g_lightMap
static

Definition at line 734 of file htmlgen.cpp.

Referenced by fillColorStyleMaps(), and replaceVariables().

◆ g_mathjax_code

QCString g_mathjax_code
static

Definition at line 67 of file htmlgen.cpp.

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

◆ hex

auto hex ="0123456789ABCDEF"
staticconstexpr

Definition at line 70 of file htmlgen.cpp.

◆ htmlMarkerInfo

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

Definition at line 72 of file htmlgen.cpp.

72{ '<', "<!--BEGIN ",10,"<!--END ",8,"-->",3 };

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