Compare commits

...

7 Commits

Author SHA1 Message Date
FineFindus
54dfd832e5 Merge 5c3adee95b into 4de9527ef8 2024-12-01 15:59:02 +01:00
Philipp Oppermann
4de9527ef8 Merge pull request #1356 from GNITOAHC/GNITOAHC-patch-1
[translation]: Fix typo in index.zh-TW.md
2024-11-28 20:10:42 +01:00
Philipp Oppermann
c46922678e Use tracnslation_contributors section 2024-11-28 20:10:04 +01:00
Chao-Ting, Chen
146e694d08 docs: Update index.zh-TW.md 2024-11-12 02:53:44 +08: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 33 additions and 1 deletions

View File

@@ -9,6 +9,8 @@ date = 2018-02-10
translation_based_on_commit = "24d04e0e39a3395ecdce795bab0963cb6afe1bfd"
# GitHub usernames of the people that translated this post
translators = ["wusyong"]
# GitHub usernames of the people that contributed to this translation
translation_contributors = ["gnitoahc"]
+++
建立我們自己的作業系統核心的第一步是建立一個不連結標準函式庫的 Rust 執行檔,這使得無需基礎作業系統即可在[裸機][bare metal]上執行 Rust 程式碼。
@@ -367,7 +369,7 @@ cargo rustc -- -C link-args="/ENTRY:_start /SUBSYSTEM:console"
#### macOS
以下是 Linux 上會出現的(簡化過)連結器錯誤:
以下是 macOS 上會出現的(簡化過)連結器錯誤:
```
error: linking with `cc` failed: exit code: 1

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/