Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FR: automate advanced settings doc #2589

Closed
Frenzie opened this issue Feb 26, 2017 · 28 comments
Closed

FR: automate advanced settings doc #2589

Frenzie opened this issue Feb 26, 2017 · 28 comments

Comments

@Frenzie
Copy link
Member

Frenzie commented Feb 26, 2017

Issue

@poire-z made an interesting observation:

We should have a wiki page documenting the available settings that are not manageable thru menus (i added quite a few these last months).

This should print an alphabetic list of all the available options.

grep --include \*.lua -hoPr "(?<=G_reader_settings:readSetting\(\")\w+(?=\"\))" |sort |uniq

Ideally we'd automatically add some explanation as well somehow, but for starters just getting the (slightly further processed) output of that command or something equivalent in auto-generated docs somehow would be nice.

@AlanSP1
Copy link

AlanSP1 commented Feb 26, 2017

Yes, this would be very useful and also necessary. At the moment there's many options, but if we don't know how to use them, or that they even exist, we can't use them. Having them at least listed in wiki (or in some pdf or epub file that comes with koreader) would be great.

@poire-z
Copy link
Contributor

poire-z commented Feb 26, 2017

There's also some with G_reader_settings:nilOrTrue and friends.
But looking at grep outputs, i'm not sure there're really many settings not reachable via menus.
So, I don't know if it would not be better to make menus for them.

These are the ones i added or that have been discussed in topics i followed:

G_reader_settings:nilOrTrue("wikipedia_prettify") (wikipedia headings unicode symbol prefix)
G_reader_settings:nilOrTrue("dict_justify") (dict & wiki text justification)
those were cause i made them the default after i added these features, to give a chance for people who wouldn't like them to disable them (is there really some reason to dislike them ? may be i was just a bit shy :) should they stay ? should there be menus for that ?)

wikipedia_languages : a list of wikipedia languages the user wants, hard to implement as a menu, the available items may change and be huge, and there should be the notion of multiple choice and ordering them... fallback to UI Language + book language (if available) + "EN" if not set
wikipedia_save_dir: directory to save wikipedia epub to (fallback to other download dir if not set) - could be as easy as cut & paste from other similar "select directory" menu

show_file_in_bold (|false|"opened") : conditions for filenames to be displayed in bold (default: new files (files with no sidecar) in bold) in filemanager
autoremove_deleted_items_from_history : self explanatory, filemanager

I haven't really checked each of the other ones, but from their names, there's no surprise and they all look like they are related to some menu entry i've seen :)

@retrue
Copy link
Contributor

retrue commented Feb 26, 2017

There are some options in settings.reader.lua for screensavers: use of book cover, a specific image or directory or even a text message, differently for sleep and power-off. Here: #2349 (comment)
Or even the option to enable debug mode.

@houqp
Copy link
Member

houqp commented Feb 26, 2017

My original plan was introducing setting annotation via comments similar to what we are doing with API docs. So we can write a little snippet comment to document every setting in the code right next to where the setting is used.

Then we just need a custom script to parse out all those annotations and generate a manual with it. It should be very easy to do with LPEG, I just haven't had enough time to work on it. If anyone wants to give it a try, I can help point you to the right direction and clean up blockers for you :)

@Frenzie
Copy link
Member Author

Frenzie commented Feb 27, 2017

@poire-z

may be i was just a bit shy :)

The Wikipedia thing is hard to defend as a setting imo, assuming that without it all you get is some plain text. At worst one might complain that square and diamond are less clear than, say, # and ##. If anything I'd say the default (prettify enabled) is more like the boring ASCII fallback for proper typography. That's not on you of course. :-)

Justification is slightly different because justification is very hard to get right. Frankly anything other than LaTeX is pretty awful at it and even then only if you monitor the results and define custom linebreaks. I missed one in my thesis (the result of some last minute edits) and it still annoys me. Not that I'd care enough to change such a setting, let alone look for it… but I can see why someone would defend its existence.

@houqp

Sounds simple enough (although I don't know if I have the time), but what format would we take for the comments? Would there be conflicts with the *Doc format of

--- Summary ends with a period.
-- Some description, can be over several lines.
-- @param p1 first parameter
-- @param p2 second parameter
-- @return a string value
-- @see second_fun

or is that non-functional unless it's followed by a function definition?

@houqp
Copy link
Member

houqp commented Mar 6, 2017

I am thinking something like the following:

-- === ko-setting ===
-- @name: open_last
-- @value: boolean
-- @default: false
-- @category: filemanager
-- @description:
-- When set to true, filemanager will automatically open last opened file on start
local open_last = G_reader_settings:readSetting("open_last")

Since we get to write our own parser, it doesn't need to be followed by function definition. The parser will just look for any comment block starts with -- === ko-setting ===.

@poire-z
Copy link
Contributor

poire-z commented Aug 22, 2017

I'm so fond of the new checkmarks for togglable menu items, that I wish we had more :)
So, I checked for settings not manageable yet thru menus, and here's the list with links to related PR, as a documentation about them, and a starting point for discussing which deserve to be put in menu.

FILE BROWSER RELATED

home_dir_display_name used by filemanagerutil.abbreviate(path) to shorten directory in title bar
I like it, we could make it a toggle (true => "~", false => nil)
show_file_in_bold filemanager items in bold : true/false/"opened" #2457
autoremove_deleted_items_from_history #2583 (comment)

^ available in menu since 20170825 (#3129)
fm_screen_mode : save of this setting was disabled by #2347
debug : could be added to Developer's options ?

READER RELATED

auto_book_status (nilOrTrue): show book status onEndOfBook (this annoyed me, so it could be nice for others to be able to toggle) #2363
^ available in menu since 20180130 (#3642)
enable_back_history (isFalse): disabled back history (#3862)
page_gap_color , page_gap_height , page_gap_width page separator in scroll mode #2318
copt_overlap_lines crengine in scoll mode with overlap enabled: number of line from bottom of previous page to show on top of next page (#3870)
txt_preformatted crengine plain text read mode #2702
followed_link_marker (false: no marker shown, true: maker shown and not auto removed, <number>: removed after seconds) crengine link markers (#3669)
cre_compress_cached_data (nilOrTrue): set to false to not compress cache file, speeds up loading and usage of big books (#3670) - not really useful anymore
cre_storage_size_factor increase crengine in-memory cache size, default is 20 (#3700, #3732)
cre_disk_cache_max_size crengine max disk space usable for storing book caches and allow fast re-openings, default is 64 MB (#3760)
cre_header_status_font_size font size of the top (full) status bar (#3996)
cre_min_space_condensing_percent how much we can decrease a space width to make text fit on a line, default is 50, increase to 70 or 80 if words looks too stuck together on some lines (#4023) now available thru bottom config (#4026)

DICTIONARY AND WIKIPEDIA RELATED

dict_justify (nilOrTrue) : #2470 to be added to a Dictionary settings submenu, with Disable fuzzy search
wikipedia_languages : #2393 Wikipedia settings / Set Wikipedia languages ~~ now available in menu
wikipedia_save_dir : #2507 Wikipedia settings / Set Wikipedia 'Save as EPUB' directory

^ available in menu since 20170822 (#3121)
wikipedia_prettify (nilOrTrue) : #2507 probably not useful enough to be included as a menu item
(I have work ongoing to add this Wikipedia settings submenu).

SUSPEND, SLEEP, POWER, SCREENSAVER related

poweroff_screensaver , reboot_screensaver , suspend_screensaver : #2349 (comment) a few variations related to screensaver folder/file/path/message, with many alternatives, so probably not easily configurable via menus Obsoleted: replaced with the following ones (#3572):
poweroff_screensaver_type = "random_image" or "message", "cover", "bookstatus", "readingprogress", "disable",
poweroff_screensaver_dir = "path to same as screensaver_dir or alternate dir for poweroff image(s)",
poweroff_screensaver_message = "message to use instead of Powered off",
reboot_screensaver_type = "random_image" or "message", "cover", "bookstatus", "readingprogress", "disable",
reboot_screensaver_dir = "path to same as screensaver_dir or alternate dir for reboot image(s)",
reboot_screensaver_message = "message to use instead of Rebooting...",

The next ones are Kobo only:
auto_suspend_timeout_seconds : autosuspend.koplugin, should be available in menu, with a checkmark if 0 vs > 0 (like Read timer menu item), to be added to Screen submenu ?
ignore_power_sleepcover #1982
frontlight_sync_with_nickel : not yet implemented, #3103

MISCELLANEOUS

plugins_disabled: allow for disabling some plugins (#4054)

OTHERS that can probably be ignored

fontmap (reader.lua) : allow for overriding fonts defined in frontend/ui/font.lua ?
show_advanced : removed in #2610
extra_plugin_paths : platform stuff, probably not for endusers #2693
trans_server : translator_servers (not useful enough)
kobo_touch_switch_xy : tools/kobo_touch_probe.lua ?

ENGINE OPTIONS

copt_embedded_css
copt_font_gamma
copt_font_size
copt_font_weight
copt_line_spacing
copt_page_margins
copt_screen_mode
kopt_contrast
kopt_screen_mode
engine options, either old settings, or available for custom override

There may also be a few other interesting options in https://github.com/koreader/koreader/blob/master/defaults.lua

@KenMaltby
Copy link

The few that I still do, in the scripts :

For me, with my Kobo AuraHD, it is in .adds\koreader\frontend\ui\widget\menu.lua
The "cfont", at line 122 and 325, using Notepad++
I changed mine to 18. It looks fine but The Aura HD, has a higher res than some, which means that the fine print is clear and readable. The text is smaller, so more of the titles are visible.

To adjust number of lines per page, change:
Around Line 374: Screen:scaleBySize(46), -- hardcoded for now. I changed to (28), for my AuraHD)
Would be mostly for the "Classic" view now, I guess.

\koreader\frontend\apps\reader\modules\readerfooter.lua Line 57 return os.date ("%I:%M") To show the footer time as a 12 hour clock.

@mwoz123
Copy link
Contributor

mwoz123 commented Jul 4, 2018

offtopic: @poire-z thanks for your comment #2589 (comment) .
But I think it's better to keep that on wiki pages.

Could you move it e.g. here https://github.com/koreader/koreader/wiki/Change-defaults as "Advanced" section?
It doesn't have to be a table, it look fine at the moment
I could do this by my own but then we'll loose all of your formatting...

@poire-z
Copy link
Contributor

poire-z commented Jul 4, 2018

The wiki seems so outdated, including the page you linked to. And this page doesn't really feel right to host that list of manual settings.
May be just add a link to that PR comment until we find a better structure for such things?
In case you really want to add it, here's the markdown version of my post in case you can't access it (with the Edit button). (Remove the stuff striken that appears in~~ if you do)

Updating the wiki (dictionary, wikipedia, for the features I modified quite a lot) would be a lot of work. It may feel easier to just link to the PRs/Issues where some features are introduced or discussed.

@mwoz123
Copy link
Contributor

mwoz123 commented Jul 5, 2018

offtopic: @poire-z even commercial developments have problems with keeping documentation up-to-date, so if free software also does it's not a surprise for me, and I won't complain.

Keeping it here I see 3 major disadvantages:

  • only you can edit it
  • if you won't edit in some time it will also be out-of-date
  • it's hard to find it here

I've paste it there https://github.com/koreader/koreader/wiki/Change-defaults.
Don't know why it lost new lines sings. Could you re-paste and link in you post?
So maybe there's a chance at least for someone to update it..

@poire-z
Copy link
Contributor

poire-z commented Jul 5, 2018

only you can edit it

Other maintainers can edit it too.
I just updated the wiki to link to the comment. May be I'll have time in the summer to more correctly update the wiki.

@turkeyphant
Copy link

Is it possible to add options for:

  • dictionary order (without rebooting, moving files, etc.)
  • menu text size (and maybe typeface too?) It's currently far to big for my eyes

@Frenzie
Copy link
Member Author

Frenzie commented Dec 7, 2018

Just set the DPI a little lower? :-)

@turkeyphant
Copy link

Higher you mean? I'll try that.

@turkeyphant
Copy link

Seems the DPI settings are Small, Medium and Large which actually correlated to high, medium and low DPI respectively. I have been unable to get the Custom DPI setting to work.

Please could you advise how to access this feature? Thanks :)

@Frenzie
Copy link
Member Author

Frenzie commented Dec 8, 2018

Huh, it seems to be broken. That's weird.

I don't use it on my actual device, just in the emulator with the EMULATE_READER_DPI environment variable. And even that seldom directly, but through the kodev script shortcut settings like -s=kobo-aura-one and -s=hidpi (which I stuck in there to quickly test 600).

Anyway, you should be able to stick that environment variable in the startup script on Kobo too. But at some point you could just set a DPI through the menu. I thought it hadn't even been touched in years. >_>

@Frenzie
Copy link
Member Author

Frenzie commented Dec 8, 2018

Oh! It's not broken. You just have to long-press it.

I'll just quickly add that to the text between parentheses.

@turkeyphant
Copy link

turkeyphant commented Dec 8, 2018

Thanks for the quick response. A way to preview any change would be exceedingly useful but I suspect probably not widely requested.

EDIT: just tested at 600 dpi and everything is massive which goes against my intuition. Some of the screens (like stats, don't seem to scale well at (in this case) low dpi either).

Frenzie added a commit to Frenzie/koreader that referenced this issue Dec 8, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Dec 8, 2018
* It was unclear that you needed to hold to set DPI, see koreader#2589 (comment)

* Up the DPI limit to 900 as several Android devices have already breached 800. This will increase the possibility of crashes due to a higher setting even on relatively high-DPI devices, but that was always already an issue.

* Also brings the custom DPI dialog box in line with the UX guidelines as per <http://koreader.rocks/doc/modules/ui.widget.confirmbox.html>.
@turkeyphant
Copy link

I'm also getting some odd reflow behaviour in PDFs and DJVU at non auto DPI on my device (have tried 90, 100, "small" so far). Typeface resizing doesn't always work and you sometimes get sentences in much bigger typefaces in the middle of a paragraph. Side margins also disappear regardless of settings (still no top/bottom margins).

@Frenzie
Copy link
Member Author

Frenzie commented Dec 8, 2018

Higher DPI means using more pixels to display things, so a lower DPI setting makes things smaller (= fewer pixels are used to draw stuff) and a higher DPI setting makes things bigger.

I'm also getting some odd reflow behaviour in PDFs and DJVU at non auto DPI on my device (have tried 90, 100, "small" so far). Typeface resizing doesn't always work and you sometimes get sentences in much bigger typefaces in the middle of a paragraph. Side margins also disappear regardless of settings (still no top/bottom margins).

Note that you probably have to clear out the cache manually. There's a developer options menu on page 2 of the tools in file browser that enables you to do so. (Yeah, it's hard to find.)

@turkeyphant
Copy link

turkeyphant commented Dec 8, 2018

Thanks for the info about the cache. I think that's fixed it. Another thing that might be helpful is to show the user what small, medium and large correspond to quantitatively in order to aid in picking a good custom DPI without multiple restarts to test.

Higher DPI means using more pixels to display things, so a lower DPI setting makes things smaller (= fewer pixels are used to draw stuff) and a higher DPI setting makes things bigger.

Really? I always understood that items/objects are a set number of pixels and higher DPI means greater pixel density hence the same thing takes up less physical space (appears smaller).

Frenzie added a commit that referenced this issue Dec 8, 2018
* It was unclear that you needed to hold to set DPI, see #2589 (comment)

* Up the DPI limit to 900 as several Android devices have already breached 800. This will increase the possibility of crashes due to a higher setting even on relatively high-DPI devices, but that was always already an issue.

* Also brings the custom DPI dialog box in line with the UX guidelines as per <http://koreader.rocks/doc/modules/ui.widget.confirmbox.html>.
@Frenzie
Copy link
Member Author

Frenzie commented Dec 8, 2018

If you draw things at the same size then a higher DPI screen will display things smaller, yes. The point of the DPI setting is to draw items with more pixels so they're (roughly) the same size but sharper, based on a presumed "correct" size. In our case that's how the program looks on some ancient model Kindle with — you guessed it — a DPI of 160, while for Windows it's probably something like 800 x 600 on an 11 inch display, or 1024 x 768 on 14 inch.

Some desktop environments, including Windows, have switched from calling it DPI to calling it a scaling factor. However, a scaling factor of 2 or 200% means nothing more or less than rendering at 200% of 96 DPI. In other words, the result is as if you're rendering at the "correct" size for a 192 DPI display. But the actual DPI of your display doesn't matter.

I'd simply call it size instead when using an alternative term, because I think scaling implies something like potentially ugly upscaling instead of rendering sharply at a higher or lower resolution.

Frenzie added a commit to Frenzie/koreader that referenced this issue Dec 8, 2018
Frenzie added a commit to Frenzie/koreader that referenced this issue Dec 8, 2018
Follow-up of koreader#4388.

Implements the suggestion by @turkeyphant from <koreader#2589 (comment)>.

Also adds a little explanatory message when holding on the Auto DPI option.
Frenzie added a commit to Frenzie/koreader that referenced this issue Dec 8, 2018
Follow-up of koreader#4388.

Implements the suggestion by @turkeyphant from <koreader#2589 (comment)>.

Also adds a little explanatory message when holding on the Auto DPI option.
Frenzie added a commit that referenced this issue Dec 8, 2018
Follow-up of #4388.

Implements the suggestion by @turkeyphant from <#2589 (comment)>.

Also adds a little explanatory message when holding on the Auto DPI option.
@Bushmills
Copy link

It's nice that some configuration settings can be set permanently in the setting.reader.lua files, as it is useful that some other settings can be set interactively in koreader. What I'm missing is a way to permanently save the interactive settings, ideally for the file type they've been applied for. Take for example pdf files: especially on smaller screens, enabling reflow and turning on page mode is desired. But those settings don't stick - when opering another pdf file, they're back to the less useful defaults. As far I haven't found a way to make my settings permanent.
I'd really like to change those settings, then push a button for saving the current configuration. Ideally with a choice whether settings are meant as global default, or apply for the file type of the currently loaded file only.
Whenever another file of that type is opened, the file type specific configuration is loaded, or, if none exists, the confguration saved as "global"
Apart from this point, I'm very happy with koreader. It runs on a rooted and reflashed ebook reader (A Tolino Vision 4 HD) with koreader installed from f-droid, and everything of relevance (or better, all of those features I currently care about) work nicely. Especially the pdf reflow capability is why I prefer koreader over other readers on this device. Reading and using the device is twice as much fun now as it was before on stock firmware/reader.

@NiLuJe
Copy link
Member

NiLuJe commented Oct 4, 2020

Given that reflowable and fixed-layout documents don't actually share most of their settings, setting a global default in a PDF for most of the bottom-menu should only actually stick to PDFs?

(As in, long-press on a setting to set is as default. Oh, Quickstart Guide, how people pass you by ;p).

@Bushmills
Copy link

Thanks! Will check that at next opportunity. Missing that method is what one gets from consulting the "Configuration" section of https://github.com/koreader/koreader/wiki - thinking that diving into "real" docs may be preferable over a "quick" start - gestures, multi-swipes, dictionary setup, lots more there. Maybe I (or somebody else) should add a pointer to the quick start docs there too :)

@NiLuJe
Copy link
Member

NiLuJe commented Oct 4, 2020

You're quite right that regardless of me whining about it, the Quick Start could use a bit of polishing, and getting it up to date on the recent (and not so recent ^^) features ;).

@poire-z
Copy link
Contributor

poire-z commented Feb 9, 2021

Still valid as documentation, but given we moved a lot to the menu with some help_text, feels uneeded to document them more: just move them to the menu if they are that interesting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants