mirror of
https://github.com/koreader/koreader.git
synced 2025-12-24 12:14:05 +01:00
Quick start guide: revamp text and look (#7985)
By @offset-torque, extracts from his upcoming user manual. See https://github.com/koreader/koreader/discussions/7898
This commit is contained in:
@@ -38,11 +38,12 @@ local FileConverter = {
|
||||
---- @string markdown the markdown fragment
|
||||
---- @string title an optional title for the HTML document
|
||||
---- @treturn string an HTML document
|
||||
function FileConverter:mdToHtml(markdown, title)
|
||||
function FileConverter:mdToHtml(markdown, title, stylesheet)
|
||||
local MD = require("apps/filemanager/lib/md")
|
||||
stylesheet = stylesheet and string.format("<style>\n%s\n</style>\n", stylesheet) or ""
|
||||
local md_options = {
|
||||
prependHead = "<!DOCTYPE html>\n<html>\n<head>\n",
|
||||
insertHead = string.format("<title>%s</title>\n</head>\n<body>\n", title),
|
||||
insertHead = string.format("<title>%s</title>\n%s</head>\n<body>\n", title, stylesheet),
|
||||
appendTail = "\n</body>\n</html>",
|
||||
}
|
||||
local html, err = MD(markdown, md_options)
|
||||
|
||||
@@ -10,61 +10,184 @@ local lfs = require("libs/libkoreader-lfs")
|
||||
local _ = require("gettext")
|
||||
|
||||
local QuickStart = {
|
||||
quickstart_force_show_version = 201511982,
|
||||
quickstart_force_show_version = 2021070000,
|
||||
}
|
||||
|
||||
local language = G_reader_settings:readSetting("language") or "en"
|
||||
local version = Version:getNormalizedCurrentVersion()
|
||||
local rev = Version:getCurrentRevision()
|
||||
|
||||
local stylesheet = [[
|
||||
div.logo { float: right; }
|
||||
div.logo > img { height: 4em; }
|
||||
h1 { page-break-before: avoid; margin-bottom: 1em; text-transform: uppercase; }
|
||||
h2 { background-color: black; color: white; text-align: center; page-break-after: avoid; text-transform: uppercase; }
|
||||
|
||||
hr { margin: 1em 20%; }
|
||||
div.generated { font-size: x-small; }
|
||||
|
||||
li { margin: 0.5em 0; page-break-inside: avoid; }
|
||||
blockquote { text-align: center; page-break-before: avoid; page-break-inside: avoid; } /* Markdown lines starting with '>' */
|
||||
|
||||
/* Inline image (icons) */
|
||||
p img, blockquote img { height: 1.5em; vertical-align: bottom; }
|
||||
|
||||
/* Standalone image (UI screenshots) */
|
||||
div.img-block { text-align: center; margin: 0.5em; }
|
||||
div.img-block > img { max-height: 60vh; max-width: 80vw; }
|
||||
div.break-before-avoid { page-break-before: avoid; }
|
||||
div.break-after-avoid { page-break-after: avoid; }
|
||||
|
||||
div.table { display: table; page-break-inside: avoid; width: 100%; }
|
||||
div.table > div { display: table-row; }
|
||||
div.table > div > * { display: table-cell; text-indent: 0; padding: 0.3em; }
|
||||
div.table > div > *:nth-child(2) { text-align: left; hyphens: none; background-color: #eeeeee; }
|
||||
div.table > div > *:nth-child(3) { white-space: nowrap; }
|
||||
]]
|
||||
|
||||
local quickstart_guide = T(_([[
|
||||
# KOReader Quickstart Guide
|
||||
<div class="logo"></div>
|
||||
|
||||
Welcome to KOReader.
|
||||
# Quickstart guide
|
||||
|
||||
You can activate the menu by swiping down from the top of the screen. Clicking outside the menu or swiping up on the menu will discard it.
|
||||
* [User interface](#ui)
|
||||
* [User interface tips](#uitips)
|
||||
* [Accessing files](#afiles)
|
||||
* [Transferring files](#tfiles)
|
||||
* [Frontlight/backlight](#flight)
|
||||
* [While reading](#reading)
|
||||
* [Installing dictionaries](#dicts)
|
||||
* [More info](#more)
|
||||
|
||||
Turning pages can be done either by swiping left and right or by single taps on the left or right side of the screen.
|
||||
---
|
||||
You can access the complete user manual from [our GitHub page](https://github.com/koreader/koreader).
|
||||
]])
|
||||
..
|
||||
_([[## User interface <a id="ui"></a>
|
||||
|
||||
### Contents
|
||||
<div class="img-block"></div>
|
||||
|
||||
* [Menu](#menu)
|
||||
* [Main menu](#main-menu)
|
||||
* [Settings](#settings)
|
||||
* [File browser](#file-browser)
|
||||
- To show the **TOP MENU** or **BOTTOM MENU** you can click the indicated zones. You can click or swipe down the upper zone to show the **TOP MENU**.
|
||||
- The **STATUS BAR** zone can be used to cycle between STATUS BAR items if one item is visible. This will also hide and show the STATUS BAR if you tap enough times.
|
||||
]])
|
||||
..
|
||||
_([[## User interface tips <a id="uitips"></a>
|
||||
|
||||
- You can change the interface language using:
|
||||
|
||||
## Menu <a id="menu"></a>
|
||||
> **TOP MENU ➔  ➔ Language**
|
||||
|
||||
Most menu items will show more information about what they do by long pressing on the item.
|
||||
- If you tap and hold on an option or menu item (font weight, line spacing etc.), you can set its value as **DEFAULT**. The new value will only be applied to documents opened from now on. Previously opened documents will keep their settings. You can identify default values as a STAR in menu or as a black border around indicators as seen below:
|
||||
|
||||
### Main <a id="main-menu"></a>
|
||||
<div class="img-block break-before-avoid"></div>
|
||||
<div class="img-block break-before-avoid"></div>
|
||||
|
||||
 You can always view this quickstart guide again through *Help* → *Quickstart guide* in the top right menu.
|
||||
- You can see explanations for all items on the **BOTTOM MENU** by tapping and holding the name of the option. This is also available for most of the **TOP MENU** menu items.
|
||||
- You can **CLOSE** full screen dialogs (History, Table of Contents, Bookmarks, Reading Statistics etc.) by swiping down
|
||||
- **SCREENSHOTS** can be taken by touching opposing corners of the screen diagonally at the same time or by making a long diagonal swipe
|
||||
|
||||
### Settings <a id="settings"></a>
|
||||
<div class="img-block break-after-avoid"></div>
|
||||
|
||||
 You can change the language and other settings through the gear icon.
|
||||
- In dialogs containing adjustment arrow buttons like the one above, you can tap and hold on arrow buttons to increase / decrease the value in bigger increments
|
||||
- You can **CLOSE** this type of dialog (non-full screen) by tapping outside of the window. You can **MOVE** this type of dialog by holding the window title and dragging
|
||||
- You can make this type of dialog **SEMI-TRANSPARENT** (to see the text under it while adjusting a value) by tapping and holding the window title
|
||||
- Tapping and holding a word brings up a dialog which allows you to search for the selection to find more occurrences in the document or to look it up on Wikipedia
|
||||
- You can highlight sections by tapping and holding a word and dragging your finger
|
||||
- You can move through your document via the **SKIM DOCUMENT** dialog:
|
||||
|
||||
> **TOP MENU ➔  ➔ Skim document**
|
||||
]])
|
||||
..
|
||||
_([[## Accessing files <a id="afiles"></a>
|
||||
|
||||
## File browser <a id="file-browser"></a>
|
||||
The following methods are available for accessing your books and articles:
|
||||
|
||||
The file browser will only show document or ebook files that KOReader can read.
|
||||
* File Browser
|
||||
* Favorites
|
||||
* History
|
||||
|
||||
In the file browser, you can tap on any file to open it. Long press on any file to bring up a menu with more options. The location path display above the list of files and folders shows you which folder you're viewing. The `../` entry, at the top of the listed folders, lets you go *up* one level. For instance, if you are at `/mnt/onboard` now, tapping the `../` will bring you to `/mnt/`.
|
||||
You can assign gestures for quick access to each of these dialogs.
|
||||
|
||||
Once you have found the folder you have your books listed in, you can long press the selection that opens that folder and you should see a message box popup with the option to **Set as HOME folder**.
|
||||
You can also set KOReader to open with any of these dialogs on startup via:
|
||||
|
||||
## Defaults <a id="defaults"></a>
|
||||
> **TOP MENU (in File Browser) ➔  ➔ Start with**
|
||||
]])
|
||||
..
|
||||
_([[## Transferring files <a id="tfiles"></a>
|
||||
|
||||
If you long press an option KOReader will prompt you to set it as the global default.
|
||||
In addition to transferring files the same way you would with the built-in reader application, other options are available depending on your device:
|
||||
|
||||
## Wiki <a id="wiki"></a>
|
||||
1. USB Mass Storage mode within KOReader
|
||||
2. Cloud storage (Dropbox/FTP/Webdav)
|
||||
3. SSH/SFTP access
|
||||
4. Calibre transfer
|
||||
5. News downloader
|
||||
6. Wallabag
|
||||
]])
|
||||
..
|
||||
_([[## Frontlight/backlight <a id="flight"></a>
|
||||
|
||||
Please refer to the wiki at <a href="https://github.com/koreader/koreader/wiki">https://github.com/koreader/koreader/wiki</a> for more documentation.
|
||||
You can control your screen light via this menu. If you have warm lighting (normal white LEDs+orange ones) you can control them separately from this dialog:
|
||||
|
||||
-------------
|
||||
Generated by KOReader %1.
|
||||
> **TOP MENU ➔  ➔ Frontlight**
|
||||
]])
|
||||
..
|
||||
_([[## While reading <a id="reading"></a>
|
||||
|
||||
<div class="table"><div>
|
||||
|
||||
You can change the font
|
||||
|
||||
**TOP MENU ➔  ➔ Font**
|
||||
|
||||
</div><div>
|
||||
|
||||
Make font bigger
|
||||
|
||||
**BOTTOM MENU ➔ **
|
||||
|
||||
</div><div>
|
||||
|
||||
Make font bolder
|
||||
|
||||
**BOTTOM MENU ➔ **
|
||||
|
||||
</div><div>
|
||||
|
||||
Invert the colors (white text on black)
|
||||
|
||||
**TOP MENU ➔  ➔ Night mode**
|
||||
|
||||
</div><div>
|
||||
|
||||
Change many formatting options
|
||||
|
||||
**TOP MENU ➔  ➔ Style tweaks**
|
||||
|
||||
</div></div>
|
||||
]])
|
||||
..
|
||||
_([[## Installing dictionaries <a id="dicts"></a>
|
||||
|
||||
KOReader supports dictionary lookup in EPUB and even in scanned PDF/DJVU documents. To see the dictionary definition or translation, tap and hold a word.
|
||||
|
||||
To use the dictionary lookup function, first you need to install one or more dictionaries in the StarDict format. KOReader has an inbuilt dictionary installation system:
|
||||
|
||||
**TOP MENU ➔  ➔ Dictionary Settings > Download dictionaries**
|
||||
]])
|
||||
..
|
||||
_([[## More info <a id="more"></a>
|
||||
|
||||
You can find more information on our GitHub page
|
||||
|
||||
[https://github.com/koreader/koreader](https://github.com/koreader/koreader)
|
||||
|
||||
You can find other KOReader users on MobileRead forums
|
||||
|
||||
[https://www.mobileread.com/forums/forumdisplay.php?f=276](https://www.mobileread.com/forums/forumdisplay.php?f=276)
|
||||
|
||||
---
|
||||
<div class="generated">Generated by KOReader %1.</div>
|
||||
]]),
|
||||
rev)
|
||||
|
||||
@@ -103,7 +226,7 @@ function QuickStart:getQuickStart()
|
||||
end
|
||||
end
|
||||
|
||||
local quickstart_html = FileConverter:mdToHtml(quickstart_guide, _("KOReader Quickstart Guide"))
|
||||
local quickstart_html = FileConverter:mdToHtml(quickstart_guide, _("KOReader Quickstart Guide"), stylesheet)
|
||||
if quickstart_html then
|
||||
FileConverter:writeStringToFile(quickstart_html, quickstart_filename)
|
||||
end
|
||||
|
||||
BIN
resources/quickstart/defaultsetting1.png
Normal file
BIN
resources/quickstart/defaultsetting1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.9 KiB |
BIN
resources/quickstart/defaultsetting2.png
Normal file
BIN
resources/quickstart/defaultsetting2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.1 KiB |
BIN
resources/quickstart/numberpicker.png
Normal file
BIN
resources/quickstart/numberpicker.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.1 KiB |
BIN
resources/quickstart/touchzones.png
Normal file
BIN
resources/quickstart/touchzones.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 40 KiB |
Reference in New Issue
Block a user