Commit Graph

23 Commits (b498d872be328bf14e2ab81b66a6ab708cd3c3d6)

Author SHA1 Message Date
poire-z b498d872be
bump crengine: LI and CITE fixes are now the defaults (#3976)
Books previously opened (that have a metadata.lua, whether with
highlights or not, but because they all have a last_xpointer that
points to the current page, that can be broken too by the changes)
will continue to have the old wrong behaviour, so they won't be
impacted by the breaking changes.
Update cre_dom_version code to use the new functions from cre.cpp.
Remove these Workarounds from Style tweaks.
6 years ago
poire-z 4bb3999cbc RenderImage: factorize all image rendering and scaling code
New module RenderImage (alongside existing RenderText) to provides
image rendering and scaling facilities.
Uses MuPDF, but tries first giflib on GIF.
Allows for getting all the frames from an animated GIF.
6 years ago
poire-z 58f6352d60 Wiki saved as EPUB: stylesheet fix (#3894)
Removed width:80% as it was never supported by crengine (the effect
was achieved thanks to margins and paddings).
Wikipedia saved articles from now on won't be effected by a double
effect if we later add full support for width: into crengine.
6 years ago
poire-z 305e75c5ea Wikipedia Save as EPUB: various encoding fixes (#3851)
* Wiki Save as EPUB: various encoding fixes

Fix display of & in article titles
Fix display of &, <, > in TOC entries and in targeted anchor (the mismatch
with the target id made these TOC entries invalid and simply not displayed).
Remove percent-encoded URLs tweaks for crengine now that crengine
correctly supports them (each percent encode handled as an UTF8 byte).
Bump crengine for that.
Don't include <meta name="cover"> when no cover present.

* bump base/crengine
6 years ago
poire-z 5cfe9992ad Wiki Save as EPUB: better handling of math formulas (#3639)
Also fix some bad filename and extension in epub's OEBPS/content.opf,
Store image files (jpg, png, gif) uncompressed in the .epub as they
don't need compression.
6 years ago
poire-z 1e9457c9b4 Wikipedia full & epub: swap symbols for H3 and H4 (#3627) 6 years ago
poire-z 775b7a364f Wikipedia: show images and allow interrupting queries
Reword some english messages
6 years ago
poire-z 69ec6c07c5 Wikipedia Save as EPUB: fix some wiki links and speedup download (#3551)
- Fix links to wikipedia pages containing '?oldid=123', that
  wouldn't work when used back thru the API.
- Make external links to other wikipedias with a different langage
  work (they didn't work when non-ascii page titles)
- Speedup download of images by using a newly added 'fast_refresh'
  option to Trapper:info() to bypass UIManager.
7 years ago
poire-z 8886e16baa Small fix to wikipedia epub stylesheet (#3534) 7 years ago
poire-z de54ef5ae6 Added Trapper module, for simple interaction with UI
This module provides methods for simple interaction with UI, without
the need for explicit callbacks, for use by linear jobs between
their steps.
Uses coroutines, but their usage is hidden by a simple API.
Factored out of Wikipedia:createEpubWithUI().
7 years ago
poire-z 80d8e44bde Fix Wiki save as epub crash on certain pages (#3231)
* Fix Wiki save as epub crash on certain pages

When first images don't have a height or width attribute
7 years ago
poire-z 79dca8e245 [UX] Wikipedia save as EPUB: allow for aborting download (#3224) 7 years ago
poire-z 0d38547990 Wikipedia save as epub: fix some image download failures 7 years ago
Qingping Hou fc12ee6537 decouple reader footer from dictquicklookup widget & translation fix (#2664)
* chore: fix strings for translations

* dictionary(chore): decouple reader footer from dictquicklookup widget
7 years ago
Frans de Jonge 6257bae77f Language: mostly Wikipedia-related changes 7 years ago
poire-z 2ded2bce5e Wikipedia: save full page as epub (html, with optional images)
Also for the current text-only wikipedia full page: replace
the ==s in section titles with some unicode symbols for a better
visual feeling of hierarchy. These same symbols are also used
in the .epub.
Both can be disabled by adding ["wikipedia_prettify"] = false
to settings.reader.lua

readerhighlight: close ButtonTable (like other buttons do) when looking
up wikipedia, otherwise if we save as epub, and swtich to new document,
this ButtonTable will never be closed and stays in UI.
7 years ago
Qingping Hou f95ad00b9e feat: add logger module & rewrite kobo suspend script in lua 7 years ago
poire-z 1708fd5e1c Dictionary and wikipedia enhancements (#2393)
Stardict:
- remove duplicate results
- better cleaning of selection
- append results from a 2nd query of a 2nd set of dictionaries
  in data/dict_ext/

Wikipedia:
- use the search API for better results
- allow viewing the full page content of a result in a bigger window
- allow queries for multiple languages
- available languages can be set in settings.reader.lua :
    ["wikipedia_languages"] = {"en", "fr", "it"}
- "Wikipedia lookup" added to Tools menu

For both:
- allow selection of multiple words for a new lookup (so one can
  actually browse wikipedia)
- allow continuous reading with Tap
- display "current result / total number of results"

Details in #2393
8 years ago
Qingping Hou 3c647ff244 minor: various luacheck fixes 8 years ago
Frans de Jonge ba994f41ab Fix Wikipedia (HTTP is now HTTPS) and some failsafes
Rudimentary JSON validity check by seeing if the first character is {. The JSON decode function will crash in spite of pcall if it's not.
9 years ago
chrox 82393f0ed3 fix loading frontend/JSON.lua for json.lua on Kindle
The VFAT file system of `/mnt/us` is case insensitive so that
require("json") from Spore which intends to load luajson module in
rock directory actually will load `frontend/JSON.lua`, the two JSON
parser libraries have slightly different APIs.

This patch remove the pure Lua JSON library in favor of `luajson` which
uses LPeg pattern marching backend for better performance.
9 years ago
chrox 7d22318641 don't require ssl.https since it cannot yet be built for win32 10 years ago
chrox 7b10d66e1b enable Wikipedia support
Since wikipedia server is language specific we should first detect
language of the text by querying Google Translate. Make sure you have
access to both Google Translate and Wikipedia service to use this
function.
10 years ago