12-02-2020, 04:07 AM | #1 |
Member
Posts: 11
Karma: 10
Join Date: Jan 2017
Device: Kobo Aura One
|
Markdown?
I was thinking about it while using a Notepad++ plugin which renders a markdown file directly in html: it would be great to have the same in Koreader! I mean a plugin which opens a .md file as a fully rendered .html. This way I could store a lot of small size files but read them in an elegant way... And even edit them!
Would it be possible and of interest? |
12-02-2020, 07:56 AM | #2 | |
cosiñeiro
Posts: 1,316
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
Works fine for little files with local images, etc but cannot fetch remote resources and is a tad slow for huge files. It is also a single file md2html converter. Enhancements welcome |
|
Advert | |
|
12-02-2020, 10:54 AM | #3 |
Wizard
Posts: 1,658
Karma: 730583
Join Date: Oct 2014
Location: Antwerp
Device: Kobo Aura H2O
|
It's a touch proof of concept-ish but it works well enough for my purposes (i.e., mainly the Quickstart Guide).
|
12-04-2020, 04:13 AM | #4 |
Member
Posts: 11
Karma: 10
Join Date: Jan 2017
Device: Kobo Aura One
|
Thanks, I will test it.
But, as far as I understand, it's a true converter. I mean: somewhere I will find a xxx.html file generated from my stored xxx.md file. Correct? I was thinking about something working under the hood and simply rendering the original file without creating a new one (or at least in a temporary way only). |
12-04-2020, 05:15 AM | #5 | ||
cosiñeiro
Posts: 1,316
Karma: 2200073
Join Date: Apr 2014
Device: BQ Cervantes 4
|
Quote:
Quote:
Each type of document can be opened with one or more "viewers". I'm quoting viewers because they can be whatever, from simple things built on top of available widgets (like htmlboxwidget.lua) to wrappers to full engine backends like crengine, mupdf or djvulibre. "Viewers" share in common that they need to be added to a documentRegistry, so the program knows which type of files a given viewer supports. In the case of markdown files, there're currently 2 "viewers": CREngine and the text editor plugin (see attachments). You can wrap you own widget based on htmlboxwidget and handle md documents with it. In that case you can do conversion on the fly, without storing the html in a cache file. That should work for little files, but don't expect to convert the Bible in a Kobo Mini on the fly. My suggestion, if you go that route, is checking the file size of the document you want to render, doing on the fly conversion until a certain size and using a cache file for larger documents. Anyways, you can look at the code in https://github.com/koreader/koreader...ntend/document Have fun |
||
Advert | |
|
12-11-2020, 05:28 AM | #6 |
Member
Posts: 11
Karma: 10
Join Date: Jan 2017
Device: Kobo Aura One
|
Thanks for the explanations!
I will give a look at the code. |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
markdown-calibre | signum | Calibre | 8 | 12-31-2014 07:25 PM |
Multimarkdown instead of markdown | anywho | Calibre | 15 | 08-13-2013 09:20 PM |
markdown-calibre | bobb40 | Conversion | 1 | 07-08-2011 12:02 PM |
->Txt+Markdown | Perkin | Calibre | 2 | 12-11-2010 04:04 AM |
Markdown editor | user_none | Workshop | 0 | 08-30-2009 09:25 PM |