qt5base-lts/doc/global/qt-html-templates-offline-simple.qdocconf
Topi Reinio 0b5a1100ff Doc: Adjust offline style for the litehtml rendering engine
Qt Creator now has the option to use the litehtml backend as a
replacement for the QTextBrowser-based help viewer.

Fix a few issues that the offline style has with the litehtml renderer:

- Fall back to using an unordered list for the navigation bar.
- Remove the background image for #buildversion and adjust font size.
- Adjust the generated padding around code snippets.

Keep the script that switches the offline-simple.css style to the
full offline style (offline.css) for JavaScript-enabled browsers.
The litehtml backend in Qt Creator will handle this switch internally.

With these changes, the generated offline documentation looks
acceptable when rendered with QTextBrowser, litehtml, or desktop
web browsers.

Fixes: QTBUG-82567
Change-Id: I86b179b1985b7ef54feddab30cb227b28021efe5
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2020-03-26 15:28:31 +01:00

30 lines
1.2 KiB
Plaintext

# Specify a custom CSS file used by this template
HTML.stylesheets += template/style/offline-simple.css
qhp.extraFiles += style/offline-simple.css
# Override the header styles
HTML.headerstyles = \
" <link rel=\"stylesheet\" type=\"text/css\" href=\"style/offline-simple.css\" />\n" \
" <script type=\"text/javascript\">\n" \
" document.getElementsByTagName(\"link\").item(0).setAttribute(\"href\", \"style/offline.css\");\n" \
" // loading style sheet breaks anchors that were jumped to before\n" \
" // so force jumping to anchor again\n" \
" setTimeout(function() {\n" \
" var anchor = location.hash;\n" \
" // need to jump to different anchor first (e.g. none)\n" \
" location.hash = \"#\";\n" \
" setTimeout(function() {\n" \
" location.hash = anchor;\n" \
" }, 0);\n" \
" }, 0);\n" \
" </script>\n"
HTML.navigationseparator = \
"<span class=\"naviSeparator\"> &#9702; </span>\n"
# Add some padding around code snippets, as we cannot
# currectly style them for QTextBrowser using only CSS.
codeindent = 1
codeprefix = "\n"
codesuffix = "\n"