Open fleshel opened 1 year ago
I had a similar idea :smile:
The main question would be what format the export could take, since there isn't really a standard for this. The most used option I could find was CriticMarkup. It introduces syntax for comments and highlights:
Some text. {>>A comment for that text<<}
Some text with a {==highlighted section==}.
Some text with a {==highlighted section==}{>>with a comment for that section<<} followed by not-highlighted text.
Briefly looked at how it works and the book webpage uses web-highlighter for its highlights with a custom HighlightExtra
for the text notes. In the end the data stored in the cookies is:
[
{
"startMeta":{
"parentTagName":"P",
"parentIndex":0,
"textOffset":20
},
"endMeta":{
"parentTagName":"P",
"parentIndex":0,
"textOffset":25
},
"text":"clear",
"id":"a29c9903-dac2-451f-9c12-fdcdee276de5",
"__isHighlightSource":{
},
"extra":"{\"text\":\"note text\",\"page\":\"/foreword.html\",\"domHash\":\"01bc6f8efa4202821e95f4fdf6298b30\"}"
}
]
Where:
start
/endMeta
define the range of highlighted text text
contains the actual snippet of text that was highlightedextra.text
contains the comment/note attached to the highlightGiven what's there, adding some functionality to export this to some plain text file (either by hackily reading the cookie data, or by a contribution to the book which adds the relevant JS functionality and a button somewhere) doesn't look too difficult, but the question would be what format(s) to pick for export.
Formats I can think of:
page
, all the data in start and end meta, text
, and extra.text
? Maybe with, where appropriate, some options for exporting highlights from a single page or the whole book, and only highlighted text or all text.
My JS skills are wonky at best and I'm not sure when or if I'd have time to work on this (wanted to go through the book for years and got nowhere so far lol), so if you or somebody else is interested I'd be super happy with a single page or whole book all text export with CriticMarkup syntax :pray:
I won't have the time to implement this feature, but I would be to accept a PR if someone has the time.
Hello all!
I have been reading through the book and greatly enjoying it.
One idea I had was a way to export the highlighted portions as well as the notes, whether to a
.txt
or.csv
file. I think that this would be incredibly helpful, especially due to the ephemeral nature of the highlights/notes (deleted when cookies are cleared).Please let me know if this is a worthwhile idea -- I would be happy to assist in implementing it if so.
Thanks!