-
-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Only getting first page #47
Comments
Okay, thanks for letting me know the actual book behind the whole story! Now I understand why you said that the method I mentioned is not working #46 (comment) They have customized commands for those preprocessors, which actually compile the dependencies checked out as submodules (they are not depending on the binaries you mentioned directly). The mdbook-pdf Docker image doesn't have the rust toolchain to compile those submodules. The book also depends on Python, which the Docker image doesn't have as well (All of these are to reduce the image size, and these compiling environments are not typically needed for books). Hence, I don't believe those commands really work #46 (comment) To make life easier, let's not use Docker for this case. You need to have Rust toolchain https://rustup.rs/ and Python3 installed on your machine (enough for all mdbook-pdf related stuff, and also suggested here https://github.com/gbadev-org/tonc?tab=readme-ov-file#setup). Execute the following commands: # Install everything locally
cargo install --git https://github.com/HollowMan6/mdbook-pdf.git
cargo install --git https://github.com/HollowMan6/mdBook mdbook
python3 -m venv venv
source venv/bin/activate
pip3 install mdbook-pdf-outline
git clone https://github.com/gbadev-org/tonc
cd tonc
git submodule init
git submodule update --recursive Then, run I'll close this issue now since I don't find anything abnormal in the generated book above. Let me know if you have any other questions. |
Related to #47 Signed-off-by: Hollow Man <hollowman@opensuse.org>
I added the book you mentioned to the CI 63bd360 Now you can get the book from GitHub Actions Artifacts as well: https://github.com/HollowMan6/mdbook-pdf/actions/runs/8861938688 as well |
Thank you so much, that is of such a huge help. The pdf you uploaded looks good, except some cropping issues, especially when it comes to the tables. On page 16 a lot of the text in the table is cropped out, while this is not the case when doing a normal print to pdf when viewing it in Chrome. And thanks for adding it as an artifact :D |
Theoretically, it should look the same, I guess you inherited some settings from your previous print when you printed that manually. You can always do so as well in mdbook-pdf. If text in the table is cropped out, I would suggest you fine-tune those margin settings https://github.com/HollowMan6/mdbook-pdf/blob/main/test_doc/book.toml#L31-L34, as well as the scale https://github.com/HollowMan6/mdbook-pdf/blob/main/test_doc/book.toml#L28 PS: Actually I found that the table on page 16 of the PDF generated from the CI looks good, so you might want to apply the same settings when you build your book locally https://github.com/HollowMan6/mdbook-pdf/blob/main/.github/workflows/test.yml#L228-L241 The PDF I generated out myself just use the default settings. |
I see the issue was only in the first one you linked to above, the issue went away in the build from artifacts and the one in the last comment, so all is good, thank you! Regarding compiling, I might want to have to try on another machine, as I'm getting |
It should be fine with builds on MacOS as the build CI passed. Anyway you can always get the binary from the CI or release: mdbook-pdf-v0.1.8-aarch64-apple-darwin |
Thanks, the binary did the trick! |
Me again! Trying to make a pdf of a mdbook source, and everything compiles fine, but I only get the first page and no table of contents. This is the repo: https://github.com/gbadev-org/tonc
It depends on mdbook-pandoc, mdbook-toc and mdbook-external-links.
A live server with the compiled book is up here for reference: https://gbadev.net/tonc/
Is it something wrong with my setup, or is the source perhaps not compatible with mdbook-pdf?
The text was updated successfully, but these errors were encountered: