-
Notifications
You must be signed in to change notification settings - Fork 545
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
Enable Export to PDF / EPUB / MOBI #7
Comments
Hi @public-daniel, would you mind sharing the PDF you got? Doesn't work for me even with the fix above. Thanks |
@public-daniel what about sharing the PDF? Thanks! |
Hi, PFA for the pdf version of the book. I hope the authors of the book have no issue with this.😓 Regards, |
Hi @animesh-007, this is amazing. I just sent you an email with a follow-up question about PDF rendering. Thank you so much!
|
Hi @chiphuyen. I tried to answer your follow-up question in the email. Hope the problem is resolved now. 😇 |
Thanks Animesh! Yep we're working on it, just some few formatting problems left!
|
hello all, |
Is the url you posted up-to-date? If not could you post instructions as to how you generated it? I'd really appreciate it |
Here is a ml-interviews-book.pdf I just generated from the most recent commit. The instructions provided by @public-daniel still work perfectly #7 (comment). |
And here is a recent ml-interview-book.epub |
$ npm install
npm warn deprecated [email protected]: this library is no longer supported
npm warn deprecated [email protected]: Use your platform's native atob() and btoa() methods instead
npm warn deprecated [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be p
roblematic. See https://v8.dev/blog/math-random for details.
npm warn deprecated [email protected]: request has been deprecated, see https://github.com/request/request/issues/3142
$ npx honkit pdf ./ ./ml-interviews-book.pdf
Need to install the following packages:
[email protected]
Ok to proceed? (y) y
npm warn deprecated [email protected]: Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.
(node:9508) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
ReferenceError: Failed to load HonKit's plugin module: "mathjax" is not found.
cwd: ...\ml-interviews-book-master
baseDir:
at PluginResolver.resolvePluginPackageName (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\honkit\lib\plugins\PluginResolver.js:78:19)
at %LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\honkit\lib\plugins\loadForBook.js:26:34
at %LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:3016:46
at List.__iterate (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:2206:13)
at mappedSequence.__iterateUncached (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:3015:23)
at seqIterate (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:604:16)
at IndexedSeq.__iterate (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:320:14)
at IndexedIterable.toArray (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:4258:23)
at List [as constructor] (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:2065:62)
at reify (%LOCALAPPDATA%\npm-cache\_npx\8ad405cc3f853826\node_modules\immutable\dist\immutable.js:3570:37)
|
When attempting to export to PDF, I got an error. It looks like MathJAX-Node dependency is using a deprecated API. This will probably get resolved upstream, but just in case anyone else wants to export, there is a workaround:
Modify
node_modules/mathjax-node/lib/mj-single.js
on line 540 fromresult.speakText = speech.processExpression(result.mml);
to
result.speakText = speech.toSpeech(result.mml);
Source for workaround: kgryte/tex-equation-to-svg#2 (comment)
Command for exporting:
npx honkit pdf ./ ./ml-interviews-book.pdf
ornpx honkit epub ./ ./ml-interview-book.epub
The text was updated successfully, but these errors were encountered: