![]() |
#31 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,776
Karma: 103362673
Join Date: Apr 2011
Device: pb360
|
|
![]() |
![]() |
![]() |
#32 |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7
Karma: 123456
Join Date: Aug 2023
Location: BC, Canada
Device: Kindle Scribe
|
![]()
I have now split the repo into two libraries, one provides the file definitions while the other provides the methods for serializing and deserializing. There is documentation in the file definition repo for the fields that are "known". If I missed anything let me know (either here or make an issue, or even better a PR.)
File definitions: https://github.com/willemml/kindle_formats-rs Serializer and deserializer (read and write to KRDS files): https://github.com/willemml/serde_krds (This is just a small update on what I am doing. There is no functionality added, although now these libraries are published on crates.io (ser/de, definitions) and serde_krds conforms to the Serde data format crate conventions. |
![]() |
![]() |
![]() |
#33 | |
Junior Member
![]() Posts: 3
Karma: 10
Join Date: Dec 2022
Location: Brazil
Device: Kindle PW 2021
|
Quote:
I'm not a Rust developer, I've already tried cargo build but I believe it's not creating an executable that I can run. Could you add some instructions on how to use your code to the REAMED file in the repository? Last edited by paulequilibrio; 11-06-2023 at 03:17 PM. |
|
![]() |
![]() |
![]() |
#34 | |
Junior Member
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7
Karma: 123456
Join Date: Aug 2023
Location: BC, Canada
Device: Kindle Scribe
|
Quote:
|
|
![]() |
![]() |
![]() |
#35 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,776
Karma: 103362673
Join Date: Apr 2011
Device: pb360
|
I would like to convert the line endings for krds.py on github from \r\n to \n
Are there any objections? Rationale is as follows: When I invoke krds.py directly under linux instead of invoking python with krds.py as an argument, it dies with: Code:
krds.py: /usr/bin/python3^M: bad interpreter: No such file or directory I searched around and mostly found blogs automatically generated documentation sites that discussed reading and writing cross platform text files and only mentioned python script line endings in passing. They all agreed that python itself tries to be agnostic about line endings, but that best practice is to use the UNIX style LF for line endings. I don't know what windows does when (trying) to execute a python script directly, but I'm guessing that it ignores the #! line then crashes. I hope that macs work with the \n ending and maybe they treat the \r as white space, but maybe the script crashes for the same reason as linux. In any case, the only use for the shebang (#!) line is to allow direct script execution. So the line as is should either be removed, its ending changed to \n only, or the entire script changed to LF only line endings. For the above reasons I would like to do the last. (Besides, it save 398 bytes.) I am not a python person and don't use microsoft or apple products, so I might be overlooking something. If so, let me know. ETA: I tried limiting my search to python.org and found https://discuss.python.org/t/page-au...g-solved/26644 so I'm also inclined to change the shebang line to Code:
#! /usr/bin/env python3 |
![]() |
![]() |
![]() |
#36 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,927
Karma: 27013865
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
|
I've updated krds.py to handle the new underline (so far Scribe-only) annotation type:
Code:
ANNOT_CLASS_NAMES = { 0: "annotation.personal.bookmark", 1: "annotation.personal.highlight", 2: "annotation.personal.note", 3: "annotation.personal.clip_article", # value not verified 10: "annotation.personal.handwritten_note", 11: "annotation.personal.sticky_note", 13: "annotation.personal.underline", } JSON output example for each: Code:
"annotation.cache.object": { [ ... ] "annotation.personal.underline": [ { "startPosition": "AcsPAAB6AQAA:342909", "endPosition": "AcsPAACaAQAA:342941", "creationTime": "2025-01-20T15:16:39.771000", "lastModificationTime": "2025-01-20T15:16:39.771000", "template": "0\ufffc0" } ], "annotation.personal.handwritten_note": [ { "startPosition": "AcsPAAAAAAAA:342531", "endPosition": "AcsPAAAAAAAA:342531", "creationTime": "2025-01-20T15:20:36.451000", "lastModificationTime": "2025-01-20T15:20:36.451000", "template": "0\ufffc0", "handwritten_note_nbk_ref": "clWfVWeqbQviRtOrSGYnf0A0" } |
![]() |
![]() |
![]() |
#37 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,776
Karma: 103362673
Join Date: Apr 2011
Device: pb360
|
Quote:
https://github.com/K-R-D-S/KRDS It was a bit tedious since for some reason you weren't working from that. So I'm also attaching it here in the hope that you will base any future changes on it. |
|
![]() |
![]() |
![]() |
#38 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,927
Karma: 27013865
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
|
Quote:
Scribe is supposed to get something called 'expandable book margins' in 'early 2025' but I don't think it will add any annotation types. Thanks. |
|
![]() |
![]() |
![]() |
#39 | |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 5,776
Karma: 103362673
Join Date: Apr 2011
Device: pb360
|
Quote:
I've been kind of hoping that jhowell and you join it as contributor or even owner, since I'm not comfortable with being the sole person with write access, especially since I haven't been much of a contributor. |
|
![]() |
![]() |
![]() |
#40 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 6,927
Karma: 27013865
Join Date: Apr 2009
Location: USA
Device: iPhone 15PM, Kindle Scribe, iPad mini 6, PocketBook InkPad Color 3
|
I've Starred and Watched the repo.
|
![]() |
![]() |
![]() |
#41 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 7,062
Karma: 91577715
Join Date: Nov 2011
Location: Charlottesville, VA
Device: Kindles
|
|
![]() |
![]() |
![]() |
#42 |
Junior Member
![]() Posts: 1
Karma: 10
Join Date: Jun 2025
Device: Kindle Paperwhite
|
I've been trying to figure out how to view synced highlights for my personal documents. Especially because I like to use multiple devices to read throughout the day. Thanks to @jhowell for his script and the KFX Input Plugin and some finagling with ChatGPT CodeX, I feel like I've landed on something that works.
This is only valuable for those who are emailing personal documents to their Kindle and highlighting on multiple devices. You can send the HTML file to Readwise, which was my entire reason for doing this. I hadn't found anyone trying to do this, so I can only assume it's a small subset of people. Here's the repo. I'm sure there are a ton of bugs, seeing as how AI helped to write it, but it's worked for me for a few personal documents. |
![]() |
![]() |
![]() |
Tags |
krds |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Where does Reader for PC store files? | redbees | Sony Reader | 13 | 01-22-2021 09:07 AM |
Lost Kindle Data files | Alastair_Lack | Amazon Kindle | 5 | 06-28-2013 03:31 PM |
Where does the Android Kindle app store ebook files? | bfollowell | Amazon Kindle | 3 | 03-12-2013 05:04 PM |
Where does Connect Reader store ebook files | 1490peter | Sony Reader | 1 | 08-12-2009 03:45 AM |
Old RSS data on Sony Store | JeffASonyReader | Sony Reader | 3 | 01-14-2008 06:20 PM |