diff --git a/.github/workflows/make_test_ebook.yaml b/.github/workflows/make_test_ebook.yaml index 15b4eb5..76d6ac0 100644 --- a/.github/workflows/make_test_ebook.yaml +++ b/.github/workflows/make_test_ebook.yaml @@ -13,6 +13,16 @@ env: BBM_CAIYUN_API_KEY: ${{ secrets.BBM_CAIYUN_API_KEY }} jobs: + typos-check: + name: Spell Check with Typos + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v3 + - name: Check spelling with custom config file + uses: crate-ci/typos@v1.16.6 + with: + config: ./typos.toml testing: runs-on: ubuntu-latest steps: diff --git a/README.md b/README.md index bd21daa..75659fb 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ Find more info here for using liteLLM: https://github.com/BerriAI/litellm/blob/m - Use `--proxy` option to specify proxy server for internet access. Enter a string such as `http://127.0.0.1:7890`. - Use `--resume` option to manually resume the process after an interruption. - epub is made of html files. By default, we only translate contents in `
`.
- Use `--translate-tags` to specify tags need for translation. Use comma to seperate multiple tags. For example:
+ Use `--translate-tags` to specify tags need for translation. Use comma to separate multiple tags. For example:
`--translate-tags h1,h2,h3,p,div`
- Use `--book_from` option to specify e-reader type (Now only `kobo` is available), and use `--device_path` to specify the mounting point.
- If you want to change api_base like using Cloudflare Workers, use `--api_base `. Use `--translate-tags` to specify tags need for translation. Use comma to seperate multiple tags. For example: `--translate-tags h1,h2,h3,p,div`
+epub is made of html files. By default, we only translate contents in ` `. Use `--translate-tags` to specify tags need for translation. Use comma to separate multiple tags. For example: `--translate-tags h1,h2,h3,p,div`
bbook_maker --book_name test_books/animal_farm.epub --openai_key ${openai_key} --translate-tags div,p
@@ -17,4 +17,4 @@ If you want to translate strings in an e-book that aren't labeled with any tags,
Use `--book_from` option to specify e-reader type (Now only `kobo` is available), and use `--device_path` to specify the mounting point.
# Translate books download from Rakuten Kobo on kobo e-reader
- bbook_maker --book_from kobo --device_path /tmp/kobo
\ No newline at end of file
+ bbook_maker --book_from kobo --device_path /tmp/kobo
diff --git a/docs/prompt.md b/docs/prompt.md
index b616601..1b2b37c 100644
--- a/docs/prompt.md
+++ b/docs/prompt.md
@@ -1,4 +1,5 @@
-# Tweek the prompt
+# Tweak the prompt
+
To tweak the prompt, use the `--prompt` parameter. Valid placeholders for the `user` role template include `{text}` and `{language}`. It supports a few ways to configure the prompt:
- If you don't need to set the `system` role content, you can simply set it up like this: `--prompt "Translate {text} to {language}."` or `--prompt prompt_template_sample.txt`
@@ -25,4 +26,4 @@ python3 make_book.py --book_name test_books/animal_farm.epub --prompt prompt_tem
python3 make_book.py --book_name test_books/animal_farm.epub --prompt prompt_template_sample.json
# or
python3 make_book.py --book_name test_books/animal_farm.epub --prompt "Please translate \`{text}\` to {language}"
-```
\ No newline at end of file
+```
diff --git a/mkdocs.yml b/mkdocs.yml
index b379f04..2cfd92d 100644
--- a/mkdocs.yml
+++ b/mkdocs.yml
@@ -16,6 +16,6 @@ nav:
- Command line options: cmd.md
- Translate from different source: book_source.md
- Environment setting: env_settings.md
- - Tweek the prompt: prompt.md
+ - Tweak the prompt: prompt.md
- Disclaimer: disclaimer.md
\ No newline at end of file
diff --git a/tests/test_integration.py b/tests/test_integration.py
index ff3a064..03664b5 100644
--- a/tests/test_integration.py
+++ b/tests/test_integration.py
@@ -128,7 +128,7 @@ def test_google_translate_txt_batch_size(test_book_dir, tmpdir):
reason="No BBM_CAIYUN_API_KEY in environment variable.",
)
def test_caiyun_translate_txt(test_book_dir, tmpdir):
- """Test caiyun tranlate txt"""
+ """Test caiyun translate txt"""
shutil.copyfile(
os.path.join(test_book_dir, "the_little_prince.txt"),
os.path.join(tmpdir, "the_little_prince.txt"),
diff --git a/typos.toml b/typos.toml
new file mode 100644
index 0000000..c506f57
--- /dev/null
+++ b/typos.toml
@@ -0,0 +1,8 @@
+# See https://github.com/crate-ci/typos/blob/master/docs/reference.md to configure typos
+[default.extend-words]
+sur = "sur"
+banch = "banch" # TODO: not sure if this is a typo or not
+fo = "fo"
+ba = "ba"
+[files]
+extend-exclude = ["LICENSE"]