Compare commits

...

6 Commits

Author SHA1 Message Date
FineFindus
7b5120d2d3 Merge 5c3adee95b into e4dd739d72 2024-08-29 18:00:38 +02:00
Philipp Oppermann
e4dd739d72 Merge pull request #1340 from Fincap/patch-1
04-testing: Added panic-abort-tests flag note to "duplicate lang item" workaround
2024-08-26 07:59:56 +02:00
Matthew Archer
9a6039237d 04-testing: Added panic-abort-tests flag note to duplicate lang item workaround 2024-08-12 18:08:50 +10:00
FineFindus
5c3adee95b feat(epub): use poper file name 2023-08-05 22:16:13 +02:00
FineFindus
fc8c87bee5 feat(epub): add cover image 2023-08-05 22:05:04 +02:00
FineFindus
e1c58bba97 feat: add script to generate epub 2023-08-05 14:38:08 +02:00
3 changed files with 31 additions and 1 deletions

View File

@@ -91,7 +91,7 @@ When we run `cargo test` now, we see that it now succeeds (if it doesn't, see th
<div class = "warning">
**Note:** There is currently a bug in cargo that leads to "duplicate lang item" errors on `cargo test` in some cases. It occurs when you have set `panic = "abort"` for a profile in your `Cargo.toml`. Try removing it, then `cargo test` should work. See the [cargo issue](https://github.com/rust-lang/cargo/issues/7359) for more information on this.
**Note:** There is currently a bug in cargo that leads to "duplicate lang item" errors on `cargo test` in some cases. It occurs when you have set `panic = "abort"` for a profile in your `Cargo.toml`. Try removing it, then `cargo test` should work. Alternatively, if that doesn't work, then add `panic-abort-tests = true` to the `[unstable]` section of your `.config/cargo.toml` file. See the [cargo issue](https://github.com/rust-lang/cargo/issues/7359) for more information on this.
</div>

BIN
scripts/cover.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

30
scripts/create-book.sh Executable file
View File

@@ -0,0 +1,30 @@
#!/bin/bash
# create working dir
rm -r book/
mkdir book/
# copy data to working dir
cat ../blog/content/edition-2/posts/*/index.md > book/book.md
find ../blog/content/edition-2/posts ! -name "*.md" -exec cp -t book/ {} +
# remove zola metadata
sed -i '/^+++/,/^+++/d' book/book.md
# remove br in table in 06, pandoc handles the layout
sed -i '/<br>/d' book/book.md
# details/summary breaks epub layout
sed -i '/^<details>/d' book/book.md
sed -i '/^<\/details>/d' book/book.md
sed -i '/^<summary>/d' book/book.md
# special fix for linking to different folder
sed -i 's|../paging-introduction/||g' book/book.md
# go to work dir and create epub
cd book/
pandoc book.md -o "Writing an OS in Rust.epub" --metadata cover-image="../cover.png" --metadata title="Writing an OS in Rust" --metadata author="Philipp Oppermann" --metadata description="This blog series creates a small operating system in the Rust programming language. Each post is a small tutorial and includes all needed code, so you can follow along if you like. The source code is also available in the corresponding Github repository."
#clean up
cd ..
mv "book/Writing an OS in Rust.epub" .
rm -rf book/