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

Go to the source code of this file.

Macros

#define DBG_HTML(x)

Functions

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

Variables

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

Macro Definition Documentation

◆ DBG_HTML

#define DBG_HTML ( x)

Definition at line 55 of file htmlgen.cpp.

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

Function Documentation

◆ endQuickIndexItem()

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

Definition at line 2881 of file htmlgen.cpp.

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

References DString::empty().

Referenced by renderQuickLinksAsTabs().

◆ endQuickIndexList()

void endQuickIndexList ( TextStream & t)
static

Definition at line 2854 of file htmlgen.cpp.

2855{
2856 if (!Config_getBool(DISABLE_INDEX))
2857 {
2858 t << " </ul>\n";
2859 t << " </div>\n";
2860 }
2861 else
2862 {
2863 t << "</ul>\n";
2864 }
2865}
#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 2158 of file htmlgen.cpp.

2159{
2160 //t << "<!-- endSectionContent -->";
2161 t << "</div>\n";
2162}

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

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

References Config_getBool.

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

◆ fillColorStyleMap()

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

Definition at line 743 of file htmlgen.cpp.

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

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

Referenced by fillColorStyleMaps().

◆ fillColorStyleMaps()

void fillColorStyleMaps ( )
static

Definition at line 764 of file htmlgen.cpp.

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

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

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

◆ getConvertLatexMacro()

DString getConvertLatexMacro ( )
static

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

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

MathJax syntax:

cmd: "{replacement}"

LaTeX syntax:

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

MathJax syntax:

cmd: ["{replacement}",nr]

Definition at line 136 of file htmlgen.cpp.

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

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

Referenced by HtmlGenerator::init().

◆ getSearchBox()

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

Definition at line 287 of file htmlgen.cpp.

288{
289 TextStream t;
290 if (serverSide)
291 {
292 writeServerSearchBox(t, relPath, highlightSearch);
293 }
294 else
295 {
296 writeClientSearchBox(t, relPath);
297 }
298 return t.str();
299}
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:87
static void writeClientSearchBox(TextStream &t, const DString &relPath)
Definition htmlgen.cpp:70

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

Referenced by substituteHtmlKeywords(), and writeDefaultQuickLinks().

◆ hasDateReplacement()

bool hasDateReplacement ( const DString & str)
static

Definition at line 1266 of file htmlgen.cpp.

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

References DString::contains().

Referenced by HtmlGenerator::init().

◆ quickLinkVisible()

bool quickLinkVisible ( LayoutNavEntry::Kind kind)
static

Definition at line 2888 of file htmlgen.cpp.

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

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

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ renderQuickLinksAsTabs()

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

Definition at line 2963 of file htmlgen.cpp.

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

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

Referenced by renderQuickLinksAsTabs(), and writeDefaultQuickLinks().

◆ renderQuickLinksAsTree()

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

Definition at line 2934 of file htmlgen.cpp.

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

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

Referenced by renderQuickLinksAsTree(), and writeDefaultQuickLinks().

◆ replaceVariables()

DString replaceVariables ( const DString & input)
static

Definition at line 778 of file htmlgen.cpp.

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

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

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

◆ startQuickIndexItem()

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

Definition at line 2867 of file htmlgen.cpp.

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

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

Referenced by renderQuickLinksAsTabs().

◆ startQuickIndexList()

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

Definition at line 2834 of file htmlgen.cpp.

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

References Config_getBool.

Referenced by renderQuickLinksAsTabs(), and renderQuickLinksAsTree().

◆ startSectionContent()

void startSectionContent ( TextStream & t,
int sectionCount )
static

Definition at line 2143 of file htmlgen.cpp.

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

References Config_getBool.

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

◆ startSectionHeader()

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

Definition at line 2099 of file htmlgen.cpp.

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

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

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

References Config_getBool.

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

◆ substituteHtmlKeywords()

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

Definition at line 301 of file htmlgen.cpp.

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

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

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

◆ writeClientSearchBox()

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

Definition at line 70 of file htmlgen.cpp.

71{
72 t << " <div id=\"MSearchBox\" class=\"MSearchBoxInactive\">\n";
73 t << " <span class=\"left\">\n";
74 t << " <span id=\"MSearchSelect\" class=\"search-icon\">";
75 t << "<span class=\"search-icon-dropdown\"></span></span>\n";
76 t << " <input type=\"text\" id=\"MSearchField\" value=\"\" placeholder=\""
77 << theTranslator->trSearch() << "\" accesskey=\"S\"/>\n";
78 t << " </span><span class=\"right\">\n";
79 t << " <a id=\"MSearchClose\" href=\"javascript:searchBox.CloseResultsWindow()\">"
80 << "<div id=\"MSearchCloseImg\" class=\"close-icon\"></div></a>\n";
81 t << " </span>\n";
82 t << " </div>\n";
83}
virtual DString trSearch()=0

References theTranslator, and Translator::trSearch().

Referenced by getSearchBox(), and renderQuickLinksAsTabs().

◆ writeDefaultQuickLinks()

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

Definition at line 3043 of file htmlgen.cpp.

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

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

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

◆ writeDefaultStyleSheet()

void writeDefaultStyleSheet ( TextStream & t)
static

Definition at line 1500 of file htmlgen.cpp.

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

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

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

◆ writeServerSearchBox()

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

Definition at line 87 of file htmlgen.cpp.

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

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

Referenced by getSearchBox(), and renderQuickLinksAsTabs().

Variable Documentation

◆ g_build_date

bool g_build_date = false
static

Definition at line 63 of file htmlgen.cpp.

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

◆ g_darkMap

StringUnorderedMap g_darkMap
static

Definition at line 741 of file htmlgen.cpp.

Referenced by fillColorStyleMaps(), and replaceVariables().

◆ g_footer

DString g_footer
static

Definition at line 60 of file htmlgen.cpp.

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

◆ g_footer_file

DString g_footer_file
static

Definition at line 59 of file htmlgen.cpp.

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

◆ g_header

◆ g_header_file

◆ g_indexLock

std::mutex g_indexLock
static

Definition at line 1635 of file htmlgen.cpp.

Referenced by HtmlGenerator::startFile().

◆ g_latex_macro

DString g_latex_macro
static

Definition at line 62 of file htmlgen.cpp.

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

◆ g_lightMap

StringUnorderedMap g_lightMap
static

Definition at line 740 of file htmlgen.cpp.

Referenced by fillColorStyleMaps(), and replaceVariables().

◆ g_mathjax_code

DString g_mathjax_code
static

Definition at line 61 of file htmlgen.cpp.

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

◆ hex

auto hex ="0123456789ABCDEF"
staticconstexpr

Definition at line 64 of file htmlgen.cpp.

Referenced by HtmlCodeGenerator::codify().

◆ htmlMarkerInfo

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

Definition at line 66 of file htmlgen.cpp.

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