Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Library Management

Notices

Reply
 
Thread Tools Search this Thread
Old 03-08-2023, 12:17 PM   #1
petzi
Connoisseur
petzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavens
 
petzi's Avatar
 
Posts: 93
Karma: 13884
Join Date: Dec 2009
Location: Austria
Device: Kindle Oasis, Amazon Fire 7 Tablet, iPad mini 4, iPhone XS
Interpreting column as HTML AND Markdown

I have two questions:

1.)
There is the possibility to create columns as "plain text formatting using markdown". But – in contrast to columns interpreted as HTML – you can't see the formatted markdown version when you open the field.

I know that you can see the markdown version in the book details panel. But why not also when you open the field from the database library view?

2.)
I have book annotations (highlights and notes) from different book formats (EPUB, Kindle, PDF) using different tools for exporting my notes. Some of these tools export highlights/notes as text, some as HTML and some as Markdown.

I would need a field where my annotations could be interpreted in all three different formats. I envisage a field with three tabs. It would be similar to the field for HTML but not with two tabs "Normal view", "HTML source", but with three tabs "Source view", "HTML" and "Markdown".

Would this be feasible?

Cheers,
Peter
petzi is offline   Reply With Quote
Old 03-08-2023, 02:14 PM   #2
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,335
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by petzi View Post
I have two questions:

1.)
There is the possibility to create columns as "plain text formatting using markdown". But – in contrast to columns interpreted as HTML – you can't see the formatted markdown version when you open the field.

I know that you can see the markdown version in the book details panel. But why not also when you open the field from the database library view?
Doing so requires work. An enhancement request to do this would come to me. This isn't something I am interested in doing. Others: have at it.
Quote:
2.)
I have book annotations (highlights and notes) from different book formats (EPUB, Kindle, PDF) using different tools for exporting my notes. Some of these tools export highlights/notes as text, some as HTML and some as Markdown.

I would need a field where my annotations could be interpreted in all three different formats. I envisage a field with three tabs. It would be similar to the field for HTML but not with two tabs "Normal view", "HTML source", but with three tabs "Source view", "HTML" and "Markdown".

Would this be feasible?

Cheers,
Peter
No, not with a reasonable amount of effort. Parsing "random" text to extract the various formats is hard.
chaley is offline   Reply With Quote
Advert
Old 03-08-2023, 05:32 PM   #3
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Quote:
Originally Posted by petzi View Post
I have book annotations (highlights and notes) from different book formats (EPUB, Kindle, PDF) using different tools for exporting my notes. Some of these tools export highlights/notes as text, some as HTML and some as Markdown.

I would need a field where my annotations could be interpreted in all three different formats. I envisage a field with three tabs. It would be similar to the field for HTML but not with two tabs "Normal view", "HTML source", but with three tabs "Source view", "HTML" and "Markdown".
Peter, it's been some years since we communicated about your needs for the Zotero Metadata Importer (ZMI) plugin when I was first developing it in 2016.

I imagine what you describe correlates with the new 'Highlights to Obsidian' plugin.

I have been working on all things bibliographical so far this year in my Job Spy and Extract RIS Citations plugins.

What you describe overlaps sufficiently with what I have been doing that I could take a stab at creating a small (in visible size) new Job Spy tool that floats over the Library View and intelligently shows the contents of whatever custom columns is under the cursor at the moment. Perhaps with a manual override radio-button-group 'type of text' control in case the tool guesses wrong about needing to show plain text or markdown or html. Not multiple tabs, but a single tab with a group of 3 radio-buttons, one for each type, plus a 'guesser' that is as good as I can make it. Guessing wrong would have the trivial cost of a single mouse-click on a radio-button.

I assume that the tool would show a cell's text as WYSIWYG, without any editor, and that any editing would be done using F2 directly in the Library View cell. A refresh button in the tool would update what it shows from the Library View cell.

Thoughts?


DaltonST
DaltonST is offline   Reply With Quote
Old 03-09-2023, 01:11 PM   #4
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
New GUI Tool: Early Development Test

Quote:
Originally Posted by DaltonST View Post
Peter, it's been some years since we communicated about your needs for the Zotero Metadata Importer (ZMI) plugin when I was first developing it in 2016.

I imagine what you describe correlates with the new 'Highlights to Obsidian' plugin.

I have been working on all things bibliographical so far this year in my Job Spy and Extract RIS Citations plugins.

What you describe overlaps sufficiently with what I have been doing that I could take a stab at creating a small (in visible size) new Job Spy tool that floats over the Library View and intelligently shows the contents of whatever custom columns is under the cursor at the moment. Perhaps with a manual override radio-button-group 'type of text' control in case the tool guesses wrong about needing to show plain text or markdown or html. Not multiple tabs, but a single tab with a group of 3 radio-buttons, one for each type, plus a 'guesser' that is as good as I can make it. Guessing wrong would have the trivial cost of a single mouse-click on a radio-button.

I assume that the tool would show a cell's text as WYSIWYG, without any editor, and that any editing would be done using F2 directly in the Library View cell. A refresh button in the tool would update what it shows from the Library View cell.

Thoughts?


DaltonST

See for new JS Release:

https://www.mobileread.com/forums/sh...postcount=25ed.




The new Tool is under "Look and Feel> Comments MLTFViewer". The ugly tool name is temporary until I dream up a better one. 'MLTFViewer' means "Multiple Long Text Format Viewer" .

Also, an explanatory image is attached.

I only spent a few hours on this, copying and pasting from my many plugins and other JS Tools, so obviously it is still in alpha testing. However, as the image demonstrates, it worked perfectly on snippets of markdown, plain and html text that I randomly copied from Wikipedia.

If this tool is worth keeping, I will move it all over to the Job Spy thread and continue development.


DaltonST
Attached Thumbnails
Click image for larger version

Name:	js_mltfviewer.jpg
Views:	109
Size:	988.5 KB
ID:	200221  

Last edited by DaltonST; 03-11-2023 at 02:30 PM. Reason: New JS Release
DaltonST is offline   Reply With Quote
Old 03-09-2023, 03:53 PM   #5
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,616
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Why not plain-jane Comments Viewer

Or Comments Peeker

BR
BetterRed is offline   Reply With Quote
Advert
Old 03-10-2023, 01:29 PM   #6
petzi
Connoisseur
petzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavens
 
petzi's Avatar
 
Posts: 93
Karma: 13884
Join Date: Dec 2009
Location: Austria
Device: Kindle Oasis, Amazon Fire 7 Tablet, iPad mini 4, iPhone XS
Quote:
Peter, it's been some years since we communicated about your needs for the Zotero Metadata Importer (ZMI) plugin when I was first developing it in 2016.
Oh, nice to hear from you again!

Quote:
I imagine what you describe correlates with the new 'Highlights to Obsidian' plugin.
Not really in this case. I am preparing a book about new methods of scientific research where an essential part are different workflows for note-taking. I am using Obsidian to import my annotations (highlights & notes) as "Fleeting Notes". These Fleeting Notes are later elaborated to "Literature Notes" (LNs) and still later to "Summary Notes". I thought to get an overview of the different phases of my different book annotations, I could use three fields of Calibre side by side.

I am pleased that you are interested in my use case about different formats of fields! Especially as I have planned to get in contact with you anyway with some questions about the ZMI plugin. But let's stick for the moment with MLTFViewer:

After installation and restart, I selected a book where I have some notes stored. Then I chose "GUI Tool that are Look & Feel Related" -> "Comments MLTFViewer". I got the following error message:

Code:
calibre, version 6.14.0
ERROR: Unhandled exception: <b>NameError</b>:name 'tip' is not defined

calibre 6.14  embedded-python: True
macOS-13.2.1-x86_64-i386-64bit Darwin ('64bit', '')
('Darwin', '22.3.0', 'Darwin Kernel Version 22.3.0: Mon Jan 30 20:42:11 PST 2023; root:xnu-8792.81.3~2/RELEASE_X86_64')
Python 3.10.1
OSX: ('13.2.1', ('', '', ''), 'x86_64')
Interface language: None
Successfully initialized third party plugins: Gather KFX-ZIP (from KFX Input) (1, 51, 0) && DeDRM (7, 2, 1) && Package KFX (from KFX Input) (1, 51, 0) && APNX Generator (1, 1, 0) && Amazon.com secondary source (1, 0, 0) && Amazon.com terciary source (1, 0, 0) && Annotations (1, 17, 13) && BOL_DE (0, 9, 2) && Clipboard Search (1, 4, 0) && Consolidate All Library Metadata (2, 0, 46) && Count Pages (1, 12, 1) && EpubMerge (2, 15, 0) && Extract ISBN (1, 6, 0) && Extract RIS Citations (1, 0, 14) && Favourites Menu (1, 3, 0) && Find Duplicates (1, 10, 7) && Goodreads (1, 7, 3) && Goodreads Sync (1, 16, 2) && Highlights to Obsidian (1, 3, 1) && Import List (1, 9, 0) && Job Spy (1, 0, 211) && KFX metadata reader (from KFX Input) (1, 51, 0) && KFX Input (1, 51, 0) && Set KFX metadata (from KFX Output) (1, 66, 0) && KFX Output (1, 66, 0) && Kindle Collections (1, 7, 29) && KindleUnpack - The Plugin (0, 83, 1) && Library Codes (1, 0, 54) && Markdown Output (1, 0, 3) && Obok DeDRM (6, 7, 0) && Quality Check (1, 13, 3) && Quick Preferences (1, 7, 0) && Reading List (1, 15, 1) && Resize Cover (1, 2, 0) && Search The Internet (1, 10, 0) && View Manager (1, 10, 2) && Zotero Metadata Importer (1, 0, 78)
Traceback (most recent call last):
  File "calibre_plugins.job_spy.ui", line 3876, in show_mltfviewer_dialog
    self.mltfviewer_dialog = MLTFViewerDialog(self.maingui,self.maingui)
  File "calibre_plugins.job_spy.mltf_viewer_dialog", line 68, in __init__
    self.setToolTip(tip)
NameError: name 'tip' is not defined
I do not know what this means. Maybe I should disable all other plugins? Or I need to change some configurations?

At first, I thought I would need a column "Tip" but this didn't help either. Do you know what could be wrong?
petzi is offline   Reply With Quote
Old 03-10-2023, 01:32 PM   #7
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Trivial bug. I caused that just before I uploaded the .zip. Tip is "ToolTip".

Be back shortly with a fixed .zip.

DaltonST
DaltonST is offline   Reply With Quote
Old 03-10-2023, 01:36 PM   #8
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
New JS Release

See for new JS Release:

https://www.mobileread.com/forums/sh...postcount=25ed.

Last edited by DaltonST; 03-11-2023 at 02:29 PM. Reason: New JS Release
DaltonST is offline   Reply With Quote
Old 03-11-2023, 05:31 PM   #9
petzi
Connoisseur
petzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavens
 
petzi's Avatar
 
Posts: 93
Karma: 13884
Join Date: Dec 2009
Location: Austria
Device: Kindle Oasis, Amazon Fire 7 Tablet, iPad mini 4, iPhone XS
Oh yes, it worked fine!

it did recognize the correct format, except for one case, where I started an HTML file with <p>. (Calibre always wraps the HTML code with a <div> tag). Adding a <h1> tag at the beginning, your program recognized the file format correctly as HTML.

How about the UI? I think it would be ideal if your special field it is just another type of database column, so that people could create this multi-format field similar to any other column and use it as they are accustomed: Hovering with the mouse over the field will show (parts of) the content and a double click will it open for editing.

Would that be feasible?
petzi is offline   Reply With Quote
Old 03-11-2023, 05:47 PM   #10
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Chaley totally owns custom column development, and he nixed the idea in a previous post.

I will add more HTML tags to the 'guesser'.

I have moved it to the Job Spy thread where it will live going forward.

DaltonST
DaltonST is offline   Reply With Quote
Old 03-12-2023, 10:04 AM   #11
petzi
Connoisseur
petzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavenspetzi is a rising star in the heavens
 
petzi's Avatar
 
Posts: 93
Karma: 13884
Join Date: Dec 2009
Location: Austria
Device: Kindle Oasis, Amazon Fire 7 Tablet, iPad mini 4, iPhone XS
Quote:
Chaley totally owns custom column development, and he nixed the idea in a previous post.
What a pity!

Quote:
I have moved it to the Job Spy thread where it will live going forward.
Fine.

Whenever I want to use your enhancement, I will generate a column of the type "Long text, like comments, not shown in the browser". But what type of "Interpret this column as:" is preferable? "HTML", "Plain text" or "Plain text formatted using markdown"? Or doesn't it matter?
petzi is offline   Reply With Quote
Old 03-12-2023, 10:22 AM   #12
chaley
Grand Sorcerer
chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.chaley ought to be getting tired of karma fortunes by now.
 
Posts: 12,335
Karma: 8012652
Join Date: Jan 2010
Location: Notts, England
Device: Kobo Libra 2
Quote:
Originally Posted by DaltonST View Post
Chaley totally owns custom column development, and he nixed the idea in a previous post.
I said I wouldn't do it. You are welcome to make (and them maintain) the changes in base calibre. I certainly won't get in the way.

I would guess that you would:
  • Add 'Mixed' or some such to the choices in "Interpret as" in calibre/gui2/preferences/create_custom_column.py
  • Add your code to calibre/ebooks/metadata/book/render.py somewhere around line 134
  • Add your code to the content server: calibre/srv/metadata.py around line 59.
chaley is offline   Reply With Quote
Old 03-12-2023, 12:05 PM   #13
DaltonST
Deviser
DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.DaltonST ought to be getting tired of karma fortunes by now.
 
DaltonST's Avatar
 
Posts: 2,265
Karma: 2090983
Join Date: Aug 2013
Location: Texas
Device: none
Depends on what you plan to put in it. If mixed formats, choose plain text so Calibre won't stomp on your raw data. Let the Notes Viewer do the interpretation, since standard Calibre cannot.


New Release in Job Spy: https://www.mobileread.com/forums/sh...4&postcount=25


Please shift to the Job Spy Thread for future posts about Notes Viewer. Thanks.




DaltonST

Last edited by DaltonST; 03-12-2023 at 01:02 PM. Reason: New Release in Job Spy
DaltonST is offline   Reply With Quote
Old 03-20-2023, 04:19 PM   #14
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,616
Karma: 29710338
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Moderator Notice

@petzi - as per DaltonST's request in post #13, I've moved your recent post to the JS thread ==>> https://www.mobileread.com/forums/sh...269911&page=61

BR
BetterRed is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to convert html and pdf to json or markdown with Calibre? bounce Conversion 3 09-19-2020 01:43 AM
Single-column HTML to 2-column PDF? martz PDF 4 01-05-2013 09:39 AM
Having trouble converting html to markdown txt bfollowell Conversion 7 03-30-2011 11:17 AM
Markdown HTML problem nhopton Conversion 10 02-10-2011 05:43 PM
Capture intermediate html from markdown Agama Calibre 3 07-30-2010 11:33 AM


All times are GMT -4. The time now is 03:56 AM.


MobileRead.com is a privately owned, operated and funded community.