-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from iambenzo/ft/gui
- Loading branch information
Showing
10 changed files
with
5,315 additions
and
369 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,5 +21,6 @@ | |
members = [ | ||
"kindle_clippings", | ||
"cli", | ||
"gui", | ||
] | ||
resolver = "2" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,67 @@ | ||
# KTR | ||
|
||
The idea of this utility is to convert the highlights I've made in my Kindle to a format that I can use in my Zettelkasten (Obsidian). | ||
|
||
## Goals | ||
## Installation | ||
|
||
There are no binaries currently provided via a github release, the only way to install is via `cargo`: | ||
|
||
```sh | ||
cargo install --git https://github.com/iambenzo/ktr.git --branch main | ||
``` | ||
|
||
This will install the `ktr` CLI tool and a `ktr_gui` GUI tool. | ||
|
||
> If there's demand, I'll create a release action. | ||
## Usage | ||
|
||
This application doesn't do anything too fancy. It takes a path to your 'My Clippings.txt' file, found on your Kindle under the `documents` directory. | ||
|
||
You can optionally supply your own [Tera](https://github.com/Keats/tera) template if you want to deviate from the [default output](./kindle_clippings/src/templates/default.md)/structure. | ||
|
||
Finally, you need to provide a path to a directory for the output files to land in. | ||
|
||
The output is a set of files, one per book, containing your Kindle highlights ready for augmenting into your Zettelkasten. Any Kindle notes attached to a highlight will also be included by the default template. | ||
|
||
### CLI | ||
|
||
For the CLI, a default `output` directory will be created if one isn't supplied by you, the user. | ||
|
||
The CLI will parse your entire clippings file every time. | ||
|
||
```sh | ||
Usage: ktr [OPTIONS] <CLIPPINGS_FILE> | ||
|
||
Arguments: | ||
<CLIPPINGS_FILE> | ||
|
||
Options: | ||
-t, --template <TEMPLATE_FILE> | ||
-o, --output <OUTPUT_DIR> | ||
-h, --help Print help | ||
-V, --version Print version | ||
``` | ||
|
||
> [!WARNING] | ||
> The error messages aren't pretty. | ||
### GUI | ||
|
||
The GUI is a wizard style application. | ||
|
||
The benefit of the GUI over the CLI is that it will allow you to select which books are processed into output files...though you will have to use your mouse. | ||
|
||
## Templating | ||
|
||
For those of you comfortable reading a little Rust, you can take a look at [this file](./kindle_clippings/src/output.rs) to understand what objects are available to your custom template. | ||
|
||
For those of you who like tables, here you go: | ||
|
||
- [x] Read the "My Clippings.txt" file from file system | ||
- [ ] Output to markdown using a default template | ||
- [ ] Allow the use of a user-defined output template (a la Tera) | ||
- [ ] Have actionable documentation | ||
| Object | Type | Notes | | ||
| ------ | ---- | ----- | | ||
| date | String | Today's date, excluding time | | ||
| highlights | Vec | An iterable list of a book's highlights | | ||
| quotes | Vec | An iterable list of a book's quotes | | ||
|
||
If you take a look at the [model](./kindle_clippings/src/model.rs), you'll see that there's opportunity to make more objects available for templating. If there's demand, then I could look to expand the list of available objects for templating. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[package] | ||
name = "ktr_gui" | ||
description = "Converts Kindle highlights to a reference format for use in a Zettelkasten" | ||
keywords = ["kindle", "highlights", "zettelkasten"] | ||
version = "0.1.0" | ||
edition = "2021" | ||
authors = ["Ben Burbage"] | ||
publish = false | ||
|
||
[dependencies] | ||
iced = {version="0.13.1", features = ["tokio", "advanced"]} | ||
kindle_clippings = { path = "../kindle_clippings"} | ||
rfd = "0.15.0" | ||
# tokio = { version = "1.41.1", features = ["rt"] } |
Oops, something went wrong.