Skip to content

Commit

Permalink
Add install script
Browse files Browse the repository at this point in the history
  • Loading branch information
lbesnard committed Oct 18, 2024
1 parent 307bd40 commit ea9a39d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,28 @@ Generates [Anki](https://ankiweb.net/) flashcards from highlighted text in [KORe
It utilizes the [BERT](https://huggingface.co/docs/transformers/en/model_doc/bert) model to assess word importance in sentences, allowing for the generation of effective
flashcards for study and revision.

## Installation

```bash
curl -s https://raw.githubusercontent.com/lbesnard/Koreader_Highlights_2_Anki/install.sh | bash
```

## Installation with Poetry
Clone the repo
```bash
pip install poetry
poetry install
```

### Usage
## Usage

1. Mount your Ebook reader
2. Run the script
3. import the APKG into ANKI

```bash
poetry run koreader_highlights_2_anki -h
# If installed from poetry, do `poetry run koreader_highlights_2_anki -h`
koreader_highlights_2_anki -h
usage: koreader_highlights_2_anki [-h] --input-folder INPUT_FOLDER --output-folder OUTPUT_FOLDER [--deck-name DECK_NAME] [--no-ai] [--select-files]

Create Anki flashcards from Koreader highlights.
Expand All @@ -42,4 +49,4 @@ poetry run koreader_highlights_2_anki -i /media/KOBOeReader/Ebooks -o ~/Document
## Example
![cloze1](test_koreader_highlights_2_anki/resources/Screenshot_20241019-093741_AnkiDroid.png)
![cloze1](test_koreader_highlights_2_anki/resources/Screenshot_20241019-093748_AnkiDroid.png)
![cloze1](test_koreader_highlights_2_anki/resources/Screenshot_20241019-093748_AnkiDroid.png)
13 changes: 13 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
latest_release_url=$(curl -s https://api.github.com/repos/lbesnard/Koreader_Highlights_2_Anki/releases/latest | grep -o '"browser_download_url": ".*"' | grep -o 'https://.*.whl"')

# Extract the URL of the wheel file
latest_wheel_url=$(echo "$latest_release_url" | sed 's/"$//')

# Download the wheel file
curl -LO "$latest_wheel_url"

# Extract the filename from the URL
filename=$(basename "$latest_wheel_url")

# Install the package using pip
pip install "$filename"

0 comments on commit ea9a39d

Please sign in to comment.