Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil > Plugins

Notices

Reply
 
Thread Tools Search this Thread
Old 11-09-2019, 02:12 AM   #1
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
[Plugin] MarkdownImport - Markdown to HMTL converter

Released: August 8, 2023
Current Version: "0.1.5.4"

This plugin allows you to import self-contained UTF-8-encoded Markdown files and plain text files without markup.
For more information on the Markdown syntax, see this website, which also offers an interactive Markdown tutorial for beginners.

Credits

This plugin uses cmark-gfm for the actual conversion. (KevinH and DiapDealer kindly provided the macOS and Windows binaries bundled with this plugin. KevinH also updated the code to support non-standard epubs.)

System requirements

This plugin requires Sigil 0.9.8 or higher. If you uncheck the Use Bundled Python option, you'll also need to install Python 3 and PyQt5. Linux users will also need to install the cmark-gfm package.

Installation

1. Select Manage Plugins from the Plugins menu and enable the Use Bundled Python option, if it isn't already enabled (or greyed out).
2. Click Add Plugin and select MarkdownImport_v0.1.5.4.zip. This will install the plugin, which you can select via Plugins > Edit > MarkdownImport.

If you want to test the plugin, copy test.md and plugin.png from the plugin folder to your Desktop folder, run the plugin and then select test.md as the input file.

Settings

Advanced users can change some conversion settings by editing the following MarkdownImport.json entries:

"extensions": ["footnotes", "table", "strikethrough", "autolink", "tagfilter"],

This entry defines the extensions that'll be used. For more information on these extensions, see the GitHub Flavored Markdown Spec guide.

"strong": true,

By default, the plugin will generate <strong> and <em> tags. If you prefer <b> and <i> tags, change this setting to false.

"sigil_split_marker": false,

If you change this setting to true, the plugin will add sigil_split_marker class attributes to all <hr> tags (defined as --- in Markdown files). This will allow you to split the file using Edit > Split At Markers.

"cmark_exe_path": "C:\\Users\\user\\AppData\\Local\\sigil-ebook\\sigil\\plugins\\MarkdownImport\\cmark-gfm.exe"

This entry defines the cmark-gfm path. You can change this setting to specify a custom cmark-gfm path.

Troubleshooting:

If you're a macOS user you might be getting the following error message:

Code:
Error: [Errno 13] Permission denied
To fix this problem, temporarily rename the Markdown preferences folder and run the plugin once. Afterwards, you should be able to put the renamed Markdown preferences folder back or just set new preferences.
To display the Sigil plugin preferences folder, select Edit > Preferences > Open Preferences location > plugins_prefs > MarkdownImport.

License: GNU General Public License v3 (GPL-3)
Attached Files
File Type: zip MarkdownImport_v0.1.5.4.zip (308.2 KB, 292 views)

Last edited by Doitsu; 08-07-2023 at 02:03 PM. Reason: Updated for Qt 6.5.2 and Python 3.11.3
Doitsu is offline   Reply With Quote
Old 11-09-2019, 03:30 AM   #2
Vroni
Banned
Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'Vroni knows the difference between 'who' and 'whom'
 
Posts: 168
Karma: 10010
Join Date: Oct 2018
Device: Tolino/PRS 650/Tablet
exe file? Windows only?
Vroni is offline   Reply With Quote
Advert
Old 11-09-2019, 03:31 AM   #3
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,583
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Vroni View Post
exe file? Windows only?
No, a macOS binary is bundled with the plugin. Only Linux users will need to install the cmark-gfm package.
Doitsu is offline   Reply With Quote
Old 07-26-2022, 11:11 AM   #4
philm
Member
philm began at the beginning.
 
Posts: 24
Karma: 10
Join Date: Jul 2022
Location: France
Device: Kobo Clara
It works on Linux if, after following all steps described here, you also add a package: `python3-pyqt5.qtsvg`
philm is offline   Reply With Quote
Old 07-26-2022, 01:10 PM   #5
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 27,546
Karma: 193191846
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
It becomes more and more difficult to determine (let alone specify) which pieces of PyQt5 are necessary for a plugin's success. Especially when more and more distros have chosen to break Qt's python bindings down into component pieces much like the Qt modules themselves.

When we bundle python with our Sigil Windows and MacOS packages, the python binding pieces we include for use with plugins are:

Code:
PYQT_MODULES = ['%s.pyd' % x for x in (
    'Qt', 'QtCore', 'QtGui', 'QtNetwork', 'QtPrintSupport', 
    'QtWebEngine', 'QtWebEngineCore', 'QtWebEngineWidgets',
    'QtWebChannel', 'QtSvg', 'QtWidgets'
    )]
So users of Linux should probably make sure the corresponding pyqt packages for their distros are present if they make use of Sigil plugins. I'll try to make sure these are mentioned in Sigil's documentation somewhere. The Qt5Svg module is definitely a runtime dependency of Sigil on Linux, but package maintainers consider Sigil plugins to be optional. So they don't include any of the PyQt bindings that come with Sigil Win/Mac by default as dependencies. It sucks. But it is what it is.

When we release an official Sigil based on Qt6 (users can already build this for themselves), the PySide6 packages needed to be fully ready for all Sigil plugins will be:

Code:
PYSIDE6_MODULES = [
    'QtCore', 'QtGui', 'QtNetwork', 'QtOpenGlWidgets','QtPrintSupport',
    'QtUiTools','QtWebEngine', 'QtWebEngineCore', 'QtWebEngineWidgets',
    'QtWebChannel', 'QtSvg', 'QtWidgets', 'Shiboken'
    ]

Last edited by DiapDealer; 07-26-2022 at 01:12 PM.
DiapDealer is online now   Reply With Quote
Advert
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
k2pdfopt output converter Calibre plugin? amolbk Conversion 0 04-08-2017 08:55 AM
Markdown Metadata Dalcyks Conversion 8 11-16-2016 03:04 AM
Hamster ebook converter - Free converter converts formats. SamuraiXSendai Amazon Kindle 4 07-07-2011 07:22 PM
Converting *.imp to rtf/hmtl/doc dreddengineer Workshop 6 07-06-2006 12:07 PM


All times are GMT -4. The time now is 01:42 PM.


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