| 
			
			 | 
		#1 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#2 | ||
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525 
				Karma: 8065948 
				Join Date: Jan 2010 
				Location: Notts, England 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Quote: 
	
  | 
||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#3 | |
| 
			
			
			
			 Deviser 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265 
				Karma: 2090983 
				Join Date: Aug 2013 
				Location: Texas 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 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  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#4 | |
| 
			
			
			
			 Deviser 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265 
				Karma: 2090983 
				Join Date: Aug 2013 
				Location: Texas 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
			
			 
				
				New GUI Tool: Early Development Test
			 
			Quote: 
	
 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 Last edited by DaltonST; 03-11-2023 at 03:30 PM. Reason: New JS Release  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#5 | 
| 
			
			
			
			 null operator (he/him) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,018 
				Karma: 30277294 
				Join Date: Mar 2012 
				Location: Sydney Australia 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
		
		
		 
			
			Why not plain-jane Comments Viewer 
		
	
		
		
		
		
		
		
		
		
		
		
	
	Or Comments Peeker ![]() BR  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| Advert | |
| 
         | 
    
| 
			
			 | 
		#6 | ||
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 93 
				Karma: 13884 
				Join Date: Dec 2009 
				Location: Austria 
				
				
				Device: Kindle Oasis, Amazon Fire 7 Tablet, iPad mini 4, iPhone XS 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Quote: 
	
 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
At first, I thought I would need a column "Tip" but this didn't help either. Do you know what could be wrong?  | 
||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#7 | 
| 
			
			
			
			 Deviser 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#8 | 
| 
			
			
			
			 Deviser 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,265 
				Karma: 2090983 
				Join Date: Aug 2013 
				Location: Texas 
				
				
				Device: none 
				
				
				 | 
	
	
	
		
		
			
			 
				
				New JS Release
			 
			Last edited by DaltonST; 03-11-2023 at 03:29 PM. Reason: New JS Release  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#9 | 
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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?  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#10 | 
| 
			
			
			
			 Deviser 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#11 | ||
| 
			
			
			
			 Connoisseur 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 93 
				Karma: 13884 
				Join Date: Dec 2009 
				Location: Austria 
				
				
				Device: Kindle Oasis, Amazon Fire 7 Tablet, iPad mini 4, iPhone XS 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 Quote: 
	
 ![]() 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?  | 
||
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#12 | |
| 
			
			
			
			 Grand Sorcerer 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 12,525 
				Karma: 8065948 
				Join Date: Jan 2010 
				Location: Notts, England 
				
				
				Device: Kobo Libra 2 
				
				
				 | 
	
	
	
		
		
		
		
		 Quote: 
	
 I would guess that you would: 
  | 
|
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#13 | 
| 
			
			
			
			 Deviser 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 02:02 PM. Reason: New Release in Job Spy  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
| 
			
			 | 
		#14 | 
| 
			
			
			
			 null operator (he/him) 
			
			![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 22,018 
				Karma: 30277294 
				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  | 
| 
		 | 
	
	
	
		
		
		
		
			 
		
		
		
		
		
		
		
			
		
		
		
	 | 
![]()  | 
            
        
    
            
  | 
    
			 
			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 02:43 AM | 
| Single-column HTML to 2-column PDF? | martz | 4 | 01-05-2013 10:39 AM | |
| Having trouble converting html to markdown txt | bfollowell | Conversion | 7 | 03-30-2011 12:17 PM | 
| Markdown HTML problem | nhopton | Conversion | 10 | 02-10-2011 06:43 PM | 
| Capture intermediate html from markdown | Agama | Calibre | 3 | 07-30-2010 12:33 PM |