Commit Graph

36 Commits

Author SHA1 Message Date
un-pogaz 19994000c9 use f-string instead of format call (extra-edit)
ruff 'UP030,UP032' --extend-exclude "src/calibre/*" !partial
2025-01-24 11:14:16 +01:00
un-pogaz 0560b429bf convert some legacy percent format (auto-fix)
ruff 'UP031'
2025-01-24 11:14:16 +01:00
Kovid Goyal 53b74283a4 sort imports in all python files 2024-03-30 13:02:22 +05:30
Kovid Goyal 24c460faec also upgrade code in setup folder 2022-01-08 12:15:18 +05:30
Kovid Goyal edcfcd9792 Bump bundled MathJax version 2021-04-25 13:37:03 +05:30
Kovid Goyal 9ff27782de Remove useless __future__ imports
Not needed on python3
2020-08-22 18:47:55 +05:30
Kovid Goyal 29cd8d64ea Change shebangs to python from python2
Also remove a few other miscellaneous references to python2
2020-08-22 18:47:51 +05:30
Eli Schwartz b48bd4f7c8 build: detect mathjax directory with or without es5/ subdir
The release tarballs contain an es5/ directory with the actual mathjax
code. However, when building against a system mathjax it is likely the
es5/ directory is skipped and the directory name is just
/usr/share/mathjax/

Detect this by moving the es5/ component to the definition of the
mathjax source root, but only appending it if the --path-to-mathjax
actually contains such a directory.
2020-06-25 01:23:08 -04:00
Kovid Goyal e2243bf7a9 Upgrade MathJax to version 3
version 3 is more performant, smaller and simpler to integrate, without
monkeypatching. On the down side, it does not do line breaking, as yet.

Note that only the viewer is currently ported
2020-06-19 18:43:23 +05:30
Eli Schwartz a66e562b08 setup: refactor mathjax class into generic class for vendoring things 2019-12-02 21:05:51 -05:00
Eli Schwartz c161fbe54a resources: bump mathjax version to 2.7.6
There is actually no real consequential change here, because the update
is a trivial bugfix that doesn't affect calibre's use, but let's do it
anyway because it is both simple and harmless.
2019-08-25 00:21:03 -04:00
Eli Schwartz 45ca4c7934 py3: merge multiline __future__ imports to not confuse 2to3 2019-05-27 00:41:14 -04:00
Kovid Goyal e0d5a021dd Fix #1812891 [calibre-3.38.1 tries to download mathjax during build](https://bugs.launchpad.net/calibre/+bug/1812891) again 2019-02-01 13:38:48 +05:30
Kovid Goyal a64579338c Dont download MathJax if it is already present
Fixes #1812891 [calibre-3.38.1 tries to download mathjax  during build](https://bugs.launchpad.net/calibre/+bug/1812891)
2019-01-23 08:03:00 +05:30
Eli Schwartz 82617d3a74 build: add option to symlink to system mathjax installation 2019-01-18 08:40:44 -05:00
Eli Schwartz 6adedd8603 setup/mathjax: fallback to using packed versions of resources
Some mathjax distributions come with the unpacked versions removed as
per the upstream instructions for optimizing an installation. Only use
the unpacked versions if they exist; otherwise fallback on the packed
versions.

Also filter the .woff files to make sure they are actually .woff files,
since they may be files like fonts.dir, fonts.scale, .uuid (created by
xorg-mkfontdir, xorg-mkfontscale, fontconfig).
2019-01-18 08:40:44 -05:00
Kovid Goyal d08e0a33e1 Implement clean for mathjax builder 2019-01-04 22:15:26 +05:30
Kovid Goyal c184fe37c7 Remove unused code 2019-01-04 21:54:57 +05:30
Kovid Goyal f78a7dad58 Do not use a compressed archive for mathjax
Improves performance for local clients such as PDF output and the
viewer. Since we have now removed the old unbundled mathjax, the file
count in the resources directory does not go up too much.
2019-01-04 21:53:06 +05:30
Kovid Goyal bf60631ce0 Avoid the need to use a patched version of MathJax
See https://github.com/mathjax/MathJax/pull/1453
2018-12-17 15:38:14 +05:30
Kovid Goyal f6ef5f3cf7 Fix crash when compressing mathjax on CI servers 2018-12-13 18:48:23 +05:30
Flaviu Tamas 0889ee85ec Fix syntax errors
Command used:

futurize --no-diffs -f libfuturize.fixes.fix_print_with_import -f lib2to3.fixes.fix_throw -f lib2to3.fixes.fix_numliterals -f lib2to3.fixes.fix_except -f lib2to3.fixes.fix_exec -f lib2to3.fixes.fix_raise -f lib2to3.fixes.fix_tuple_params -f lib2to3.fixes.fix_ne -j20 -w -n setup recipes src manual setup.py recipes/*.recipe

And manual adjustments of print((...)) -> print(...)
2018-09-10 12:11:28 +05:30
Kovid Goyal 91d3802377 Use curl to download mathjax as well so that it works in Travis on OS X 2016-12-09 10:41:39 +05:30
Kovid Goyal f0f73830b7 Detect a generic CI server rather than just Travis 2016-07-18 15:59:06 +05:30
Kovid Goyal acd618f404 Speed up compression of MathJax on travis 2016-06-26 13:27:41 +05:30
Kovid Goyal 4d85e84119 Option to control mathjax source URL 2016-05-03 10:58:10 +05:30
Kovid Goyal 3dc7dad1b1 Use the stdlib tempfile module instead of ptempfile 2016-05-03 10:37:06 +05:30
Kovid Goyal cf5755f6a2 Use a forked MathJax, makes it easier to maintain the patch 2016-05-03 10:20:29 +05:30
Kovid Goyal 514a8a2863 Patch MathJax so that correct webfont URLs are generated 2016-05-03 08:30:30 +05:30
Kovid Goyal 00d689e6ac DRYer 2016-05-02 20:23:05 +05:30
Kovid Goyal e2a68b700c typo 2016-05-02 20:18:53 +05:30
Kovid Goyal 663dc80a15 Switch to the modern CommonHTML output for MathJax 2016-05-02 20:11:51 +05:30
Kovid Goyal 6b5ecdc7e1 Add the mathjax version to the compiled js 2016-05-01 20:17:36 +05:30
Kovid Goyal 6531811efa Allow the server to serve up MathJax 2016-05-01 16:50:33 +05:30
Kovid Goyal ef09e886b3 Change all shebangs to use python2 2015-01-23 19:08:21 +05:30
Kovid Goyal 5bd3086aed E-book viewer: SUpport for displaying mathematics in epub files, via mathjax 2012-08-18 15:53:50 +05:30