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>
This commit is contained in:
Topi Reinio 2020-03-23 11:08:23 +01:00
parent 07558ae12d
commit 0b5a1100ff
2 changed files with 7 additions and 20 deletions

View File

@ -19,27 +19,11 @@ HTML.headerstyles = \
" }, 0);\n" \
" </script>\n"
HTML.postheader = \
"<body>\n" \
"<div class=\"header\" id=\"qtdocheader\">\n"\
" <div class=\"main\">\n" \
" <div class=\"main-rounded\">\n" \
" <div class=\"navigationbar\">\n" \
" <table><tr>\n"
HTML.postpostheader = \
" </tr></table>\n"\
" </div>\n" \
" </div>\n" \
"<div class=\"content\">\n" \
"<div class=\"line\">\n" \
"<div class=\"content mainContent\">\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 = 2
codeprefix = "\n\n"
codesuffix = "\n\n"
codeindent = 1
codeprefix = "\n"
codesuffix = "\n"

View File

@ -297,11 +297,14 @@ table.buildversion {
#buildversion {
font-style: italic;
font-size: small;
float: right;
margin-right: 5px;
}
#buildversion a {
background: none;
}
/*
/* table of content