noembryo / KoHighlights

KOHighlights is a utility for viewing KOReader's highlights and/or export them to simple text, html, csv or markdown files.
MIT License
128 stars 5 forks source link

Choose which details (Date, Title..) to export and which not ... possible? #12

Closed benytzlich closed 3 years ago

benytzlich commented 3 years ago

Tried Kohighlight today. Its great!

I just wonder if its possible to select the details one want to export. even possible to export to .md? Otherwise my exports a cluttered and the essential highlights dont get the attention..

cherio

example Kobonotes with less details: grafik

noembryo commented 3 years ago

You can use the "Show in Highlights" drop down menu (bottom right in the "Books" page) to enable /disable the Page number, Date, Highlight text (yes, you can disable that too :wink: ) and Comment... The md export OTOH is a really niche feature that I don't think I will ever include since there is already an html export.. :unamused:

benytzlich commented 3 years ago

I see. On the Books-Pages you are able to manipulate if the Page number, Date, Highlight text and Comments etc are displayed and in which manner. But I am not able to export to a file if I choose just to export Highlights without Date/Page#. Copy-Paste works too, but...

I guess its due to the fact, that some sorting- references like a Date/Page is necessary to build an exportfile?

What about extracting Highlights grouped by chapters? Would that help?

cherio!

noembryo commented 3 years ago

But I am not able to export to a file if I choose just to export Highlights without Date/Page#. Copy-Paste works too, but...

Nope, I just tried it and it works as advertised (export from the "Books" page)...

I did find another bug though! If I export in individual text files, the text files contain html code... :disappointed:

Edit: Yeap! exporting to individual files had the text export html and vice versa :face_with_head_bandage:

benytzlich commented 3 years ago

Ups! :)

exporting to individual files had the text export html and vice versa face_with_head_bandage

1) in version 1.4.00: I tried again to export just Highlights on the Books-Page (choosing "show in Highlights"). After confirming export ,it just shows the idle-symbol right below, no file is created. strange. (1)**

2) couldnt replicate the txt-html swap.

(1)** Log shows for exporting on bookpage to txt

Error in sys.excepthook: Traceback (most recent call last): File "boot_config.py", line 72, in except_hook File "traceback.py", line 124, in print_exception File "traceback.py", line 13, in _print TypeError: write() argument 1 must be unicode, not str

Original exception was: Traceback (most recent call last): File "main.py", line 2059, in on_export File "main.py", line 2094, in export File "main.py", line 2189, in save_merged_file File "main.py", line 1568, in sort_high4write ValueError: invalid literal for int() with base 10: ''

didnt drill down to the code sofar

noembryo commented 3 years ago

I tried again to export just Highlights on the Books-Page (choosing "show in Highlights"). After confirming export ,it just shows the idle-symbol right below, no file is created. strange.

What is the "idle-symbol"?

I just tried the following:

That created a text file with only the highlights and the comments of the selected book. What step of these did not work for you?

couldnt replicate the txt-html swap.

This only happens when exporting highlights from multiple books..

noembryo commented 3 years ago

Original exception was: Traceback (most recent call last): File "main.py", line 2059, in on_export File "main.py", line 2094, in export File "main.py", line 2189, in save_merged_file File "main.py", line 1568, in sort_high4write ValueError: invalid literal for int() with base 10: ''

Does the highlighted text contain any strange character? Can you try it with a different book/highlights, because these to issues don't seem related... Let's first solve the exporting sans date/page and then we can check the problem with the specific book. ... or this is happening with all your books?

noembryo commented 3 years ago

Aaaaa.... OK The problem happens if the Highlights are sorted by page but the Page is not included.. Nice catch... It will be fixed in the next version. For now, just sort them by date... :wink:

benytzlich commented 3 years ago
  1. Just to be precise: The problem happens if the Highlights are sorted by Page OR by Date butt Page/Date is not included in the outputfile.. Including Date or Page works
  2. Another topic: what about sorting Highlights by chapter? It would be necessary to index the chapters and link them with pagenumbers somehow. Is that feasable then?
  3. md export OTOH is a really niche feature that I don't think I will ever include since there is already an html export..

Thanks for your quick response

noembryo commented 3 years ago

Just to be precise: The problem happens if the Highlights are sorted by Page OR by Date butt Page/Date is not included in the outputfile.. Including Date or Page works

Nope.. Just re-checked.. The export as text from the Books page with sorting by Date is working, even if the Date and Page are disabled... If this is not working for you, then, there is something else wrong over there.. Maybe you could provide me with the metadata file of a book known to not work?

Another topic: what about sorting Highlights by chapter? It would be necessary to index the chapters and link them with pagenumbers somehow. Is that feasable then?

There is no chapter information in the metadata file of a book, so, this is not possible..

benytzlich commented 3 years ago

Yes it works. Choosing sort by date to export just Highlghts works.

There is no chapter information in the metadata file of a book, so, this is not possible..

ok. mh just wondering where such information is hidden in a ebook?