Basic dark mode for main docs and MultiUser

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7323 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2021-09-13 23:21:37 +00:00
parent c7516acf94
commit 4d26045274
9 changed files with 122 additions and 90 deletions

View file

@ -1,34 +1,39 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html lang="en">
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="color-scheme" content="light dark">
<title>Multi-User Header File (MultiUser.nsh)</title> <title>Multi-User Header File (MultiUser.nsh)</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<style type="text/css"> <style type="text/css">
html, body { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; background-color: #fefefe; color: #050505; } :root { color-scheme: light dark; }
html { font-size: 0.9em; } html, body { font-family: Verdana, Arial, Helvetica, sans-serif; font-weight: normal; color: #050505; background-color: #fefefe; }
body { font-size: 1em; font-size: 1rem; } html { font-size: 0.9em; }
pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; } body { font-size: 1em; font-size: 1rem; }
code { background-color: #f6f6f6; } pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }
pre { background-color: inherit; } pre, pre code {background-color: #f6f6f6; }
tr:nth-child(odd) { background-color: #fafafa; } tr:nth-child(odd) { background-color: #fafafa; }
table, tr, td { border: 1px solid #dddddd; border-collapse: collapse; } table, tr, td { border: 1px solid #dddddd; border-collapse: collapse; }
td { padding: 0.3em; vertical-align: top; } td { padding: 0.3em; vertical-align: top; }
@media (prefers-color-scheme: dark) {
html, body { color: #eeeeee; background-color: #161616; }
a, a:link, a:visited, a:active { color: #79b; } a:hover { color: #3ad; }
pre, pre code {background-color: #202020; }
table, tr, td { border-color: #202020; }
tr:nth-child(odd) { background-color: #181818; }
}
</style> </style>
</head> </head>
<body> <body>
<h1> <h1>Multi-User Header File (MultiUser.nsh)</h1>
Multi-User Header File (MultiUser.nsh)</h1> <p><i>Installer configuration for multi-user Windows environments</i></p>
<p> <h2>Table of Contents</h2>
<i>Installer configuration for multi-user Windows environments</i></p>
<h2>
Table of Contents</h2>
<ul> <ul>
<li><a href="#introduction">Introduction</a></li> <li><a href="#introduction">Introduction</a></li>
<li><a href="#executionlevel">Initalization and Execution Level</a> <li><a href="#executionlevel">Initalization and Execution Level</a>
<li><a href="#installationmode">Installation Mode</a></ul> <li><a href="#installationmode">Installation Mode</a></ul>
<h2> <h2><a name="introduction"></a>Introduction</h2>
<a name="introduction"></a>Introduction</h2>
<p> <p>
Modern Windows versions support multiple users accounts on a single computer, each Modern Windows versions support multiple users accounts on a single computer, each
with different privileges. For security reasons, the privileges of applications with different privileges. For security reasons, the privileges of applications
@ -43,8 +48,7 @@
<p> <p>
Note that all settings need to be set before including the MultiUser.nsh header Note that all settings need to be set before including the MultiUser.nsh header
file.</p> file.</p>
<h2> <h2>Initialization and <a name="executionlevel"></a>Execution Level&nbsp;</h2>
Initialization and <a name="executionlevel"></a>Execution Level&nbsp;</h2>
<p> <p>
Before the MultiUser.nsh file is included, the MULTIUSER_EXECUTIONLEVEL define should Before the MultiUser.nsh file is included, the MULTIUSER_EXECUTIONLEVEL define should
be set to one of the following values depending on the execution level that is required:</p> be set to one of the following values depending on the execution level that is required:</p>
@ -76,7 +80,7 @@
Power Power
</td> </td>
<td> <td>
Power User privileges are required<br /> Power User privileges are required<br>
(Power Users no longer exist in Windows Vista. For Vista this is equivalent to Admin) (Power Users no longer exist in Windows Vista. For Vista this is equivalent to Admin)
</td> </td>
<td> <td>
@ -111,8 +115,7 @@
Insert the MULTIUSER_INIT and MULTIUSER_UNINT macros in the .onInit and un.onInit Insert the MULTIUSER_INIT and MULTIUSER_UNINT macros in the .onInit and un.onInit
function to verify these privileges. If no uninstaller is created in the script, function to verify these privileges. If no uninstaller is created in the script,
define MULTIUSER_NOUNINSTALL.</p> define MULTIUSER_NOUNINSTALL.</p>
<code> <pre><code>!define MULTIUSER_EXECUTIONLEVEL Highest
<pre>!define MULTIUSER_EXECUTIONLEVEL Highest
;!define MULTIUSER_NOUNINSTALL ;Uncomment if no uninstaller is created ;!define MULTIUSER_NOUNINSTALL ;Uncomment if no uninstaller is created
!include MultiUser.nsh !include MultiUser.nsh
@ -124,8 +127,7 @@ FunctionEnd
Function un.onInit Function un.onInit
!insertmacro MULTIUSER_UNINIT !insertmacro MULTIUSER_UNINIT
FunctionEnd</pre> FunctionEnd</code></pre>
</code>
<p> <p>
Whether the required privileges can be obtained depends on the user that starts Whether the required privileges can be obtained depends on the user that starts
the installer:</p> the installer:</p>
@ -152,10 +154,8 @@ FunctionEnd</pre>
The following additional settings are available to customize the initialization:</p> The following additional settings are available to customize the initialization:</p>
<table> <table>
<tr> <tr>
<td> <td><b>Setting</b></td>
<b>Setting<td> <td><b>Description</b></td>
<b>Description</b>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
@ -193,7 +193,7 @@ FunctionEnd</pre>
</tr> </tr>
<tr> <tr>
<td> <td>
MULTIUSER_INIT_FUNCTIONQUIT<br /> MULTIUSER_INIT_FUNCTIONQUIT<br>
MULTIUSER_INIT_UNFUNCTIONQUIT MULTIUSER_INIT_UNFUNCTIONQUIT
</td> </td>
<td> <td>
@ -202,8 +202,7 @@ FunctionEnd</pre>
</td> </td>
</tr> </tr>
</table> </table>
<h2> <h2><a name="installationmode"></a>Installation Mode</h2>
<a name="installationmode"></a>Installation Mode</h2>
<p> <p>
As mentioned before, applications can both be installed for a single users or for As mentioned before, applications can both be installed for a single users or for
all users on a computer. Applications for all users are typically installed in the all users on a computer. Applications for all users are typically installed in the
@ -220,13 +219,8 @@ FunctionEnd</pre>
The following settings are available to change the default installation mode: The following settings are available to change the default installation mode:
<table> <table>
<tr> <tr>
<td> <td><b>Setting</b></td>
<b>Setting</b> <td><b>Description</b></td>
</td>
<td>
<b>Description</b>
</td>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>
@ -252,8 +246,7 @@ FunctionEnd</pre>
After initialization, the variable $MultiUser.InstallMode will contain the current After initialization, the variable $MultiUser.InstallMode will contain the current
installation mode (AllUsers or CurrentUser). installation mode (AllUsers or CurrentUser).
</p> </p>
<h3> <h3>Mixed-Mode Installation</h3>
Mixed-Mode Installation</h3>
<p> <p>
For the Admin and Power levels, both a per-machine as well as a per-user installation For the Admin and Power levels, both a per-machine as well as a per-user installation
is possible. If the Highest level is set and the user is an Administrator or Power is possible. If the Highest level is set and the user is an Administrator or Power
@ -264,7 +257,7 @@ FunctionEnd</pre>
installation mode. To use this page, define MULTIUSER_MUI before including User.nsh. installation mode. To use this page, define MULTIUSER_MUI before including User.nsh.
Then, the MULTIUSER_PAGE_INSTALLMODE macro can be used just like a normal Modern Then, the MULTIUSER_PAGE_INSTALLMODE macro can be used just like a normal Modern
UI page (this page will automatically be skipped when running Windows 95/98/Me):</p> UI page (this page will automatically be skipped when running Windows 95/98/Me):</p>
<code><pre>!define MULTIUSER_EXECUTIONLEVEL Highest <pre><code>!define MULTIUSER_EXECUTIONLEVEL Highest
<b>!define MULTIUSER_MUI</b> <b>!define MULTIUSER_MUI</b>
!define MULTIUSER_INSTALLMODE_COMMANDLINE !define MULTIUSER_INSTALLMODE_COMMANDLINE
!include MultiUser.nsh !include MultiUser.nsh
@ -284,8 +277,7 @@ FunctionEnd
Function un.onInit Function un.onInit
!insertmacro MULTIUSER_UNINIT !insertmacro MULTIUSER_UNINIT
FunctionEnd FunctionEnd</code></pre>
</pre></code>
<p> <p>
The MULTIUSER_INSTALLMODE_COMMANDLINE setting that also appears in this example The MULTIUSER_INSTALLMODE_COMMANDLINE setting that also appears in this example
enables the installation mode to be set using the /AllUsers or /CurrentUser command enables the installation mode to be set using the /AllUsers or /CurrentUser command
@ -315,8 +307,7 @@ FunctionEnd
<td>Append the username to the per-user radio button.</td> <td>Append the username to the per-user radio button.</td>
</tr> </tr>
</table> </table>
<h3> <h3>Installation Mode Initalization</h3>
Installation Mode Initalization</h3>
<p> <p>
The SetShellVarContext flag (which determines the folders for e.g. shortcuts, like The SetShellVarContext flag (which determines the folders for e.g. shortcuts, like
$DESKTOP) is automatically set depending on the installation mode. In addition, $DESKTOP) is automatically set depending on the installation mode. In addition,
@ -324,18 +315,11 @@ FunctionEnd
mode is initialized:</p> mode is initialized:</p>
<table> <table>
<tr> <tr>
<td> <td><b>Setting</b></td>
<b>Setting</b> <td><b>Description</b></td>
</td>
<td>
<b>Description</b>
</td>
</td>
</tr> </tr>
<tr> <tr>
<td> <td>MULTIUSER_INSTALLMODE_INSTDIR</td>
MULTIUSER_INSTALLMODE_INSTDIR
</td>
<td> <td>
Name of the folder in which to install the application, without a path. This folder Name of the folder in which to install the application, without a path. This folder
will be located in Program Files for a per-machine installation and in the local will be located in Program Files for a per-machine installation and in the local
@ -343,9 +327,7 @@ FunctionEnd
</td> </td>
</tr> </tr>
<tr> <tr>
<td> <td>MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME</td>
MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_KEY MULTIUSER_INSTALLMODE_INSTDIR_REGISTRY_VALUENAME
</td>
<td> <td>
Registry key from which to obtain a previously stored installation folder. It will Registry key from which to obtain a previously stored installation folder. It will
be retrieved from HKCU for per-user and HKLM for per-machine. be retrieved from HKCU for per-user and HKLM for per-machine.
@ -353,7 +335,7 @@ FunctionEnd
</tr> </tr>
<tr> <tr>
<td> <td>
MULTIUSER_INSTALLMODE_FUNCTION<br /> MULTIUSER_INSTALLMODE_FUNCTION<br>
MULTIUSER_INSTALLMODE_UNFUNCTION MULTIUSER_INSTALLMODE_UNFUNCTION
</td> </td>
<td> <td>

View file

@ -7,7 +7,7 @@
<title>System Plug-in (NSIS)</title> <title>System Plug-in (NSIS)</title>
<style type="text/css"> <style type="text/css">
:root { color-scheme: light dark; } :root { color-scheme: light dark; }
html, body { font-family: Verdana, Arial, Helvetica, sans-serif; } html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #050505; background-color: #fefefe; }
html { font-size: 0.84em; } html { font-size: 0.84em; }
body { font-size: 1em; font-size: 1rem; } body { font-size: 1em; font-size: 1rem; }
pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; } pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }
@ -21,6 +21,7 @@ blockquote { margin:0; padding:0; margin-left: 0.5em; }
blockquote pre { background-color: #fefefe; } blockquote pre { background-color: #fefefe; }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
html, body { color: #eeeeee; background-color: #161616; }
blockquote pre { background-color: #202020; } blockquote pre { background-color: #202020; }
} }
</style> </style>

View file

@ -8,7 +8,7 @@
<style type="text/css"> <style type="text/css">
/*<![CDATA[*/ /*<![CDATA[*/
:root { color-scheme: light dark; } :root { color-scheme: light dark; }
html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; background-color: #ffffff; } html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #050505; background-color: #fefefe; }
html { font-size: 0.84em; } html { font-size: 0.84em; }
body { font-size: 1em; font-size: 1rem; } body { font-size: 1em; font-size: 1rem; }
pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; } pre, code { font-family: Courier New, Courier, monospace,serif; font-size: 100%; }
@ -67,7 +67,7 @@ a:hover { color: #182634; text-decoration: underline; }
.T tr, .T td { border: 1px solid #f5f5f5; border-collapse: collapse; padding: 0.2em; } .T tr, .T td { border: 1px solid #f5f5f5; border-collapse: collapse; padding: 0.2em; }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
html, body { color: #eeeeee; background-color:#161616; } html, body { color: #eeeeee; background-color: #161616; }
h1, h2, h3, h4, h5, h5 { color: inherit; } h1, h2, h3, h4, h5, h5 { color: inherit; }
a, a:link, a:visited, a:active { color: #4be; } a:hover { color: #6df; } a, a:link, a:visited, a:active { color: #4be; } a:hover { color: #6df; }
.T tr:nth-child(odd) { background-color: #222222; } .T tr:nth-child(odd) { background-color: #222222; }
@ -78,13 +78,13 @@ a, a:link, a:visited, a:active { color: #4be; } a:hover { color: #6df; }
</style> </style>
</head> </head>
<body> <body>
<h1>VPatch 3.1</h1> <h1>VPatch 3.1</h1>
<div> <div>
<h2>Introduction</h2> <h2>Introduction</h2>
<div> <div>
<p>VPatch allows to create a patch file to update previous versions <p>VPatch allows to create a patch file to update previous versions
of your software. The GenPat utility generates the patch file. The of your software. The GenPat utility generates the patch file.
plug-in can use the patch to update a file. Using a patch, you can The plug-in can use the patch to update a file. Using a patch, you can
reduce the download size of your updates because only the differences reduce the download size of your updates because only the differences
between the files are included in the patch file.</p> between the files are included in the patch file.</p>
</div> </div>
@ -119,8 +119,9 @@ a, a:link, a:visited, a:active { color: #4be; } a:hover { color: #6df; }
<li>Patch data is invalid or corrupt</li> <li>Patch data is invalid or corrupt</li>
<li>No suitable patches were found</li> <li>No suitable patches were found</li>
</ul> </ul>
<p>Check <a href="../../Examples/VPatch/example.nsi">example.nsi</a> for an example. You <p>Check <a href="../../Examples/VPatch/example.nsi">example.nsi</a> for an example.
should check whether the stack string starts with &quot;OK&quot; You
should check whether the stack string starts with &quot;OK&quot;
because then the patch has succeeded and you can rename &quot;temporary_newfile.txt&quot; because then the patch has succeeded and you can rename &quot;temporary_newfile.txt&quot;
to &quot;oldfile.txt&quot; to replace the original, if you want.</p> to &quot;oldfile.txt&quot; to replace the original, if you want.</p>
</div> </div>
@ -128,9 +129,11 @@ a, a:link, a:visited, a:active { color: #4be; } a:hover { color: #6df; }
<div> <div>
<p>GenPat appends a patch to the file you specified. If there is already <p>GenPat appends a patch to the file you specified. If there is already
a patch for the same original file, with the same CRC/MD5, in the patch file, a patch for the same original file, with the same CRC/MD5, in the patch file,
the patch will be replaced. For example, if you want to be able to upgrade the patch will be replaced. For example, if you want to be able to upgrade
version 1 and 2 to version 3, you can put a 1 &gt; 3 and 2 &gt; 3 patch in version 1 and 2 to version 3,
one file.</p> you can put a 1 &gt; 3 and 2 &gt; 3 patch in
one file.</p>
<p>You can also put patches for different files in one patch file, for <p>You can also put patches for different files in one patch file, for
example, a patch from file A version 1 to file A version 2 and a patch example, a patch from file A version 1 to file A version 2 and a patch
from file B version 1 to file B version 2. Just call the plug-in multiple from file B version 1 to file B version 2. Just call the plug-in multiple
@ -175,6 +178,7 @@ a, a:link, a:visited, a:active { color: #4be; } a:hover { color: #6df; }
<h2>Source code</h2> <h2>Source code</h2>
<div> <div>
<p>Source code is available in the original package and in the SVN repository of NSIS.</p> <p>Source code is available in the original package and in the SVN repository of NSIS.</p>
<h3>NSIS plug-in (C++)</h3> <h3>NSIS plug-in (C++)</h3>
<div> <div>
<p>The source of the NSIS plug-in that applies patches can be found <p>The source of the NSIS plug-in that applies patches can be found
@ -183,9 +187,10 @@ a, a:link, a:visited, a:active { color: #4be; } a:hover { color: #6df; }
<h3>Patch Generator (C++)</h3> <h3>Patch Generator (C++)</h3>
<div> <div>
<p>The most interesting part of VPatch, the actual patch generation <p>The most interesting part of VPatch, the actual patch generation
algorithm, can be found in Source\GenPat\PatchGenerator.cpp. The algorithm, can be found in Source\GenPat\PatchGenerator.cpp.
header of that file contains a brief explanation of the algorithm The
as well.</p> header of that file contains a brief explanation of the algorithm as well.
</p>
</div> </div>
<h3>User interface (Delphi)</h3> <h3>User interface (Delphi)</h3>
<div> <div>

View file

@ -7,7 +7,7 @@
<title>nsDialogs</title> <title>nsDialogs</title>
<style type="text/css"> <style type="text/css">
:root { color-scheme: light dark; } :root { color-scheme: light dark; }
html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; background-color: #ffffff; } html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #050505; background-color: #fefefe; }
html { font-size: 0.85em; } html { font-size: 0.85em; }
body { font-size: 1em; font-size: 1rem; } body { font-size: 1em; font-size: 1rem; }
blockquote { margin: 0.75em; } .faq blockquote { margin-left: 0; } blockquote { margin: 0.75em; } .faq blockquote { margin-left: 0; }
@ -19,7 +19,7 @@ blockquote pre > b { color: #bb0000; }
abbr { font-variant: none; cursor: help; } abbr { font-variant: none; cursor: help; }
@media (prefers-color-scheme: dark) { @media (prefers-color-scheme: dark) {
html, body { color: #eeeeee; background-color:#161616; } html, body { color: #eeeeee; background-color: #161616; }
span.inlcod i { color: #bbbbbb; } span.inlcod i { color: #bbbbbb; }
code { background-color: #202020; } code { background-color: #202020; }
blockquote pre { background-color: #222222; } blockquote pre { background-color: #222222; }

View file

@ -86,6 +86,7 @@ typedef struct {
wchar_t *author, *description; wchar_t *author, *description;
wchar_t *html_lang, *meta_charset; wchar_t *html_lang, *meta_charset;
wchar_t *head_start, *head_middle, *head_end, *body, *body_start, *body_end; wchar_t *head_start, *head_middle, *head_end, *body, *body_start, *body_end;
ustr_slist *meta_append;
wchar_t *address_start, *address_end, *nav_attrs; wchar_t *address_start, *address_end, *nav_attrs;
wchar_t *rlink_prefix, *rlink_suffix; wchar_t *rlink_prefix, *rlink_suffix;
wchar_t *chm_toc_file, *chm_ind_file; wchar_t *chm_toc_file, *chm_ind_file;
@ -177,6 +178,7 @@ static xhtmlconfig xhtml_configure(paragraph * source)
ret.body = NULL; ret.body = NULL;
ret.body_start = NULL; ret.body_start = NULL;
ret.body_end = NULL; ret.body_end = NULL;
ret.meta_append = NULL;
ret.address_start = NULL; ret.address_start = NULL;
ret.address_end = NULL; ret.address_end = NULL;
ret.nav_attrs = NULL; ret.nav_attrs = NULL;
@ -268,6 +270,9 @@ static xhtmlconfig xhtml_configure(paragraph * source)
} else if (ishtmlkeyword(source->keyword, L"xhtml-body-end")) } else if (ishtmlkeyword(source->keyword, L"xhtml-body-end"))
{ {
ret.body_end = uadv(source->keyword); ret.body_end = uadv(source->keyword);
} else if (ishtmlkeyword(source->keyword, L"html-append-meta"))
{
ustr_slist_append(&ret.meta_append, uadv(source->keyword));
} else if (ishtmlkeyword(source->keyword, L"xhtml-address-start")) } else if (ishtmlkeyword(source->keyword, L"xhtml-address-start"))
{ {
ret.address_start = uadv(source->keyword); ret.address_start = uadv(source->keyword);
@ -1500,14 +1505,15 @@ static void xhtml_doheader(FILE * fp, word * title)
{ {
const int xhtml = is_xhtml(), html5 = is_html5(); const int xhtml = is_xhtml(), html5 = is_html5();
const char *xhtmldoctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; const char *xhtmldoctype = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
const char *html4doctype = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">"; const char *html4doctype = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n";
const char *xmlns = xhtml ? " xmlns=\"http://www.w3.org/1999/xhtml\"" : 0; const char *xhtmlxmlns = xhtml ? " xmlns=\"http://www.w3.org/1999/xhtml\"" : 0;
const char *voidend = xhtml ? " /" : ""; const char *voidend = xhtml ? " /" : "";
const wchar_t *tmpwstr; const wchar_t *tmpwstr;
const ustr_slist *pussl;
if (xhtml && html5) fatal(err_whatever, "indeterminate format"); if (xhtml && html5) fatal(err_whatever, "indeterminate format");
fprintf(fp, html5 ? "<!DOCTYPE html>\n" : xhtml ? xhtmldoctype : html4doctype); fprintf(fp, html5 ? "<!DOCTYPE html>\n" : xhtml ? xhtmldoctype : html4doctype);
fprintf(fp, "<html%s", xhtml ? xmlns : ""); fprintf(fp, "<html%s", xhtml ? xhtmlxmlns : "");
//www.w3.org/International/questions/qa-html-language-declarations //www.w3.org/International/questions/qa-html-language-declarations
if (*(tmpwstr = ustrdef(conf.html_lang, L""))) if (*(tmpwstr = ustrdef(conf.html_lang, L"")))
fprintf(fp, "%s%ls%s lang=\"%ls\"", xhtml ? " xml:lang=\"" : "", xhtml ? tmpwstr : L"", xhtml ? "\"" : "", tmpwstr); fprintf(fp, "%s%ls%s lang=\"%ls\"", xhtml ? " xml:lang=\"" : "", xhtml ? tmpwstr : L"", xhtml ? "\"" : "", tmpwstr);
@ -1515,12 +1521,14 @@ static void xhtml_doheader(FILE * fp, word * title)
if (ustricmp(L"none", (tmpwstr = ustrdef(conf.meta_charset, L"UTF-8")))) if (ustricmp(L"none", (tmpwstr = ustrdef(conf.meta_charset, L"UTF-8"))))
fprintf(fp, (xhtml || !html5) ? "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%ls\"%s>" : "<meta charset=\"%ls\">\n", tmpwstr, voidend); fprintf(fp, (xhtml || !html5) ? "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=%ls\"%s>" : "<meta charset=\"%ls\">\n", tmpwstr, voidend);
printoptstr(fp, "", conf.head_start, "\n"); printoptstr(fp, "", conf.head_start, "\n");
fprintf(fp, "<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"%s>\n" "<title>", voidend); fprintf(fp, "<title>");
if (title == NULL) if (title == NULL)
fprintf(fp, "Documentation"); fprintf(fp, "Documentation");
else else
xhtml_para(fp, title); xhtml_para(fp, title);
fprintf(fp, "</title>\n"); fprintf(fp, "</title>\n");
for (pussl = conf.meta_append; pussl; pussl = pussl->next)
fprintf(fp, "<meta %ls%s>", pussl->string, voidend);
printoptstr(fp, "", conf.head_middle, "\n"); printoptstr(fp, "", conf.head_middle, "\n");
fprintf(fp, "<meta name=\"generator\" content=\"Halibut %s xhtml-backend\"%s>\n", version, voidend); fprintf(fp, "<meta name=\"generator\" content=\"Halibut %s xhtml-backend\"%s>\n", version, voidend);
if (conf.author) if (conf.author)
@ -1546,7 +1554,11 @@ static void chm_doheader(FILE * fp, word * title)
*/ */
static void xhtml_dofooter(FILE * fp) static void xhtml_dofooter(FILE * fp)
{ {
fprintf(fp, "\n%s\n\n", gettagtxt_hr()); int hr = conf.body_end || !conf.suppress_address;
if (hr)
fprintf(fp, "\n%s\n\n", gettagtxt_hr());
if (conf.body_end) if (conf.body_end)
fprintf(fp, "%ls\n", conf.body_end); fprintf(fp, "%ls\n", conf.body_end);
if (!conf.suppress_address) if (!conf.suppress_address)
@ -1570,7 +1582,7 @@ static void xhtml_dofooter(FILE * fp)
fprintf(fp, "%ls\n", conf.address_end); fprintf(fp, "%ls\n", conf.address_end);
fprintf(fp, "</address>\n"); fprintf(fp, "</address>\n");
} }
fprintf(fp, "</body>\n\n</html>\n"); fprintf(fp, "</body></html>\n");
} }
static void chm_dofooter(FILE * fp) static void chm_dofooter(FILE * fp)
{ {

View file

@ -39,6 +39,11 @@ typedef struct indextag_Tag indextag;
typedef struct indexentry_Tag indexentry; typedef struct indexentry_Tag indexentry;
typedef struct macrostack_Tag macrostack; typedef struct macrostack_Tag macrostack;
typedef struct ustr_slist_Tag {
struct ustr_slist_Tag *next;
wchar_t string[1];
} ustr_slist;
/* /*
* Data structure to hold a file name and index, a line and a * Data structure to hold a file name and index, a line and a
* column number, for reporting errors * column number, for reporting errors
@ -256,6 +261,7 @@ int utob(const wchar_t *);
int uisdigit(wchar_t); int uisdigit(wchar_t);
wchar_t *ustrlow(wchar_t * s); wchar_t *ustrlow(wchar_t * s);
wchar_t *ustrftime(wchar_t * fmt, struct tm *timespec); wchar_t *ustrftime(wchar_t * fmt, struct tm *timespec);
ustr_slist* ustr_slist_append(ustr_slist**headaddr, const wchar_t*str);
/* /*
* help.c * help.c

View file

@ -205,3 +205,21 @@ wchar_t *ustrftime(wchar_t * wfmt, struct tm * timespec)
sfree(text); sfree(text);
return wblk; return wblk;
} }
ustr_slist* ustr_slist_append(ustr_slist**headaddr, const wchar_t*str)
{
size_t cch = ustrlen(str) + 1;
size_t cb = sizeof(ustr_slist) + (cch * sizeof(wchar_t));
ustr_slist *p = (ustr_slist*) mknewa(char, cb), *walk;
if (p)
{
ustrcpy(p->string, str);
p->next = NULL;
for (walk = *headaddr; walk; walk = walk->next)
if (!walk->next)
walk->next = p, walk = p;
if (!*headaddr)
*headaddr = p;
}
return p;
}

View file

@ -6,6 +6,8 @@
\cfg{html-suppress-address}{true} \cfg{html-suppress-address}{true}
\cfg{html-append-meta}{name="viewport" content="width=device-width, initial-scale=1"}
\define{NsisCopyright} Copyright (C) 1999-2021 Contributors \define{NsisCopyright} Copyright (C) 1999-2021 Contributors
\copyright \NsisCopyright \copyright \NsisCopyright

View file

@ -1,4 +1,4 @@
html, body { font-family: Verdana, Arial, Helvetica, sans-serif; } html, body { font-family: Verdana, Arial, Helvetica, sans-serif; color: #000000; background-color: #ffffff; }
html { font-size: 0.8em; } html { font-size: 0.8em; }
body { font-size: 1em; font-size: 1rem; } body { font-size: 1em; font-size: 1rem; }
@ -42,7 +42,6 @@ a {
text-decoration: none; text-decoration: none;
} }
a:hover { a:hover {
background-color: #F4F4F4;
color: #303030; color: #303030;
text-decoration: underline; text-decoration: underline;
} }
@ -51,13 +50,20 @@ a:hover {
text-decoration: none; text-decoration: none;
} }
.btitle:hover { .btitle:hover {
background-color: #F4F4F4;
color: #000000; color: #000000;
text-decoration: underline; text-decoration: underline;
} }
.wb { .wb {
background-color: #FFFFD8; color: #000000; background-color: #FFFFD8;
color: #000000;
border: 1px solid #CECEAA; border: 1px solid #CECEAA;
padding: 0.2em; padding: 0.2em;
}
:root { color-scheme: light dark; }
@media (prefers-color-scheme: dark) {
html, body { color: #eee; background-color:#161616; }
a, a:link, a:visited, a:active { color: #8ce; } a:hover { color: #29c; }
.btitle { color: #ccc !important; } .btitle:hover { color: #aaa !important; }
pre { background-color: #202020; }
.wb { color: #a6a688; background-color: #454535; border-color: #3b3b30; }
} }