mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
Quick start guide: fix links to images (#8072)
"../resources/..." was not working on some devices like Android. Build the correct relative path on all devices.
This commit is contained in:
@@ -46,7 +46,7 @@ div.table > div > *:nth-child(3) { white-space: nowrap; }
|
||||
]]
|
||||
|
||||
local quickstart_guide = T(_([[
|
||||
<div class="logo"></div>
|
||||
<div class="logo"></div>
|
||||
|
||||
# Quickstart guide
|
||||
|
||||
@@ -65,7 +65,7 @@ You can access the complete user manual from [our GitHub page](https://github.co
|
||||
..
|
||||
_([[## User interface <a id="ui"></a>
|
||||
|
||||
<div class="img-block"></div>
|
||||
<div class="img-block"></div>
|
||||
|
||||
- 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.
|
||||
@@ -75,18 +75,18 @@ _([[## User interface tips <a id="uitips"></a>
|
||||
|
||||
- You can change the interface language using:
|
||||
|
||||
> **TOP MENU ➔  ➔ Language**
|
||||
> **TOP MENU ➔  ➔ Language**
|
||||
|
||||
- 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:
|
||||
|
||||
<div class="img-block break-before-avoid"></div>
|
||||
<div class="img-block break-before-avoid"></div>
|
||||
<div class="img-block break-before-avoid"></div>
|
||||
<div class="img-block break-before-avoid"></div>
|
||||
|
||||
- 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
|
||||
|
||||
<div class="img-block break-after-avoid"></div>
|
||||
<div class="img-block break-after-avoid"></div>
|
||||
|
||||
- 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
|
||||
@@ -95,7 +95,7 @@ _([[## User interface tips <a id="uitips"></a>
|
||||
- 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**
|
||||
> **TOP MENU ➔  ➔ Skim document**
|
||||
]])
|
||||
..
|
||||
_([[## Accessing files <a id="afiles"></a>
|
||||
@@ -110,7 +110,7 @@ You can assign gestures for quick access to each of these dialogs.
|
||||
|
||||
You can also set KOReader to open with any of these dialogs on startup via:
|
||||
|
||||
> **TOP MENU (in File Browser) ➔  ➔ Start with**
|
||||
> **TOP MENU (in File Browser) ➔  ➔ Start with**
|
||||
]])
|
||||
..
|
||||
_([[## Transferring files <a id="tfiles"></a>
|
||||
@@ -129,7 +129,7 @@ _([[## Frontlight/backlight <a id="flight"></a>
|
||||
|
||||
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:
|
||||
|
||||
> **TOP MENU ➔  ➔ Frontlight**
|
||||
> **TOP MENU ➔  ➔ Frontlight**
|
||||
]])
|
||||
..
|
||||
_([[## While reading <a id="reading"></a>
|
||||
@@ -138,31 +138,31 @@ _([[## While reading <a id="reading"></a>
|
||||
|
||||
You can change the font
|
||||
|
||||
**TOP MENU ➔  ➔ Font**
|
||||
**TOP MENU ➔  ➔ Font**
|
||||
|
||||
</div><div>
|
||||
|
||||
Make font bigger
|
||||
|
||||
**BOTTOM MENU ➔ **
|
||||
**BOTTOM MENU ➔ **
|
||||
|
||||
</div><div>
|
||||
|
||||
Make font bolder
|
||||
|
||||
**BOTTOM MENU ➔ **
|
||||
**BOTTOM MENU ➔ **
|
||||
|
||||
</div><div>
|
||||
|
||||
Invert the colors (white text on black)
|
||||
|
||||
**TOP MENU ➔  ➔ Night mode**
|
||||
**TOP MENU ➔  ➔ Night mode**
|
||||
|
||||
</div><div>
|
||||
|
||||
Change many formatting options
|
||||
|
||||
**TOP MENU ➔  ➔ Style tweaks**
|
||||
**TOP MENU ➔  ➔ Style tweaks**
|
||||
|
||||
</div></div>
|
||||
]])
|
||||
@@ -173,7 +173,7 @@ KOReader supports dictionary lookup in EPUB and even in scanned PDF/DJVU documen
|
||||
|
||||
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**
|
||||
**TOP MENU ➔  ➔ Dictionary Settings > Download dictionaries**
|
||||
]])
|
||||
..
|
||||
_([[## More info <a id="more"></a>
|
||||
@@ -228,6 +228,36 @@ function QuickStart:getQuickStart()
|
||||
|
||||
local quickstart_html = FileConverter:mdToHtml(quickstart_guide, _("KOReader Quickstart Guide"), stylesheet)
|
||||
if quickstart_html then
|
||||
-- Fix links to images, which are in KOReader install directory, which may not
|
||||
-- be alongside help/ on some platforms like Android.
|
||||
-- crengine won't accept full paths, so we need to make these relative
|
||||
local src = FFIUtil.realpath(quickstart_dir) .. "/"
|
||||
local dst = lfs.currentdir() .. "/"
|
||||
-- Find the common leading directories
|
||||
local idx = 0
|
||||
while true do
|
||||
local tst = src:find("/", idx + 1, true)
|
||||
if tst and src:sub(1,tst) == dst:sub(1,tst) then
|
||||
idx = tst
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
-- Trim off the common directories from the front
|
||||
src = src:sub(idx + 1)
|
||||
dst = dst:sub(idx + 1)
|
||||
-- Back up from dst to get to this common parent
|
||||
local relpath = ""
|
||||
idx = src:find("/")
|
||||
while idx do
|
||||
relpath = relpath .. "../"
|
||||
idx = src:find("/", idx + 1)
|
||||
end
|
||||
-- Add the path down to dst from here
|
||||
relpath = relpath .. dst
|
||||
relpath = relpath:gsub("//", "/") -- make it prettier
|
||||
quickstart_html = quickstart_html:gsub([[src="resources/]], [[src="]]..relpath..[[resources/]])
|
||||
-- Write the fixed HTML content
|
||||
FileConverter:writeStringToFile(quickstart_html, quickstart_filename)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user