08-23-2024, 02:17 PM | #1 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Thoughts on Potential New Features for Sigil
Hi All,
I am looking for thoughts on new features for future versions of Sigil: Here is a new feature I have been thinking about ... Since epubcheck now reports on out of date or incorrect media types, I was thinking of: A. adding a tool to BookBrowser to change the Media Type for a resource one at a time. Inside Sigil each resource object keeps its own media type internally, and of course there is the OPF manifest which also provides the media type so both have to be updated. Multiple selection in the BookBrowser would be possible. or B. adding a new Sigil Tool menu to automatically walk all manifest types updating them when older media types need to be updated to new ones. The only issue with both option A or B is that of course you can convert a binary media-type to a text media type without losing anything if really needed but not visa-versa. Also what happens when the new media-type input from the user is actually has a different file format that what was provided in the OPF when first launched. That should not happen often but it could. So I would love to hear from you to understand if either option A or B would be useful enough to add to Sigil itself instead or if you feel these things would be better as a plugin, or not useful at all. Please use this thread to make other feature suggestions that might prove useful to the main body of Sigil users. Please try not to suggest things that have already been ruled out in earlier feature threads or that already exist in the form of a plugin. Be sure to explain why you think your feature would benefit the majority of the users of Sigil. Thanks. Last edited by KevinH; 08-23-2024 at 02:21 PM. |
08-23-2024, 05:09 PM | #2 |
Grand Sorcerer
Posts: 5,640
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
How about a "Fix outdated/wrong media types" right-click Book Browser menu option that is only shown for .opf files?
|
Advert | |
|
08-23-2024, 09:53 PM | #3 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
|
08-24-2024, 10:30 AM | #4 |
Chalut o/
Posts: 421
Karma: 145424
Join Date: Dec 2017
Device: Kobo
|
I would have liked a dedicated tool, which would offer many options, but a such use case would be absolutely rare. Apart from correcting wrong media types, altering the media type by anything other than that on of the file makes almost no sense and is of no use. And if you really wanted to do it, then you knew exactly what you were doing and didn't need such a tool.
So @Doitsu's proposal is really perfect. Simple, small and effective. However, I recommend making this action accessible into the Automation tool. |
08-24-2024, 10:36 AM | #5 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
The only hard case is pure xml files with the generic .xml file extension but no way to easily detect what type of xml is in the file. I could always leave them alone and not update those.
|
Advert | |
|
08-24-2024, 11:01 AM | #6 |
Guru
Posts: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
Or perhaps in the case of questionable .xml files, the choice of whether to treat them as pure xml or as “application/xhtml+xml”.
|
08-24-2024, 11:10 AM | #7 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Detecting html and doctype tags in a generic xml file should be quite easy to do. Those we can handle.
|
08-24-2024, 11:46 AM | #8 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
The other interesting case would be how to deal with media-types where they allow multiple media types for the same resource. Seems like Fonts and Javascripts are big with multiple names
Code:
Images -------- image/gif - GIF Images image/jpeg - JPEG Images image/png - PNG Images image/svg+xml - SVG documents image/webp - WebP Images Audio ------- audio/mpeg - MP3 audio audio/mp4 - AAC LC audio using MP4 container audio/ogg - OPUS audio using OGG container Style ------ text/css - CSS Style Sheets. Fonts ------ font/ttf application/font-sfnt - TrueType fonts font/otf application/font-sfnt application/vnd.ms-opentype - OpenType fonts font/woff application/font-woff - WOFF fonts font/woff2 - WOFF2 fonts Other ------ application/xhtml+xml - XHTML content documents application/javascript application/ecmascript text/javascript - JavaScripts application/x-dtbncx+xml - The legacy NCX. application/smil+xml - EPUB media overlay documents Last edited by KevinH; 08-24-2024 at 01:03 PM. |
08-29-2024, 03:56 PM | #9 |
Evangelist
Posts: 461
Karma: 7897546
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe
|
I'd like the CSS mend/pretty to have an option to convert all measures that are effectively zero to 0;
In other words: Code:
.someclass { margin-left: 0em; margin-right: 0px; margin-top: 0.0em; margin-bottom: 0; } Code:
.someclass { margin-left: 0; margin-right: 0; margin-top: 0; margin-bottom: 0; } |
08-29-2024, 04:16 PM | #10 |
Sigil Developer
Posts: 8,160
Karma: 5450818
Join Date: Nov 2009
Device: many
|
I think a regex could do that quite easily. You do know that regex will allow the equivalent of an "or" right (em|px|…). And using the regex function replacement plugin could easily numerically evaluate any set of digits with decimal points to compare it to 0.
|
08-29-2024, 08:35 PM | #11 |
Guru
Posts: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
In Sigil, something like this works:
Find: Code:
:(\s*)0(?:\.0+)?(?:em|px|rem|%|vh|vw|vmin|vmax|cm|mm|in|pt|pc)?(?=;|\s|$) Code:
: 0 |
08-29-2024, 08:44 PM | #12 | |
A Hairy Wizard
Posts: 3,228
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Quote:
I obviously haven't tested this... (I'm taking a 'coke' break at work ) maybe it already does shorthand??? Last edited by Turtle91; 08-29-2024 at 08:48 PM. |
|
08-29-2024, 09:02 PM | #13 |
Guru
Posts: 783
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
You are right! A quick test worked, but I still need to test it on larger samples.
Removing the colon simplifies things, although I started with it and stayed that way until the end. |
08-30-2024, 06:02 AM | #14 |
Resident Curmudgeon
Posts: 76,495
Karma: 136564766
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
|
With that CSS,
Code:
margin: 0px 0em 0 0%; Code:
margin: 0 0em 0 0%; Last edited by JSWolf; 08-30-2024 at 06:14 AM. |
08-30-2024, 06:50 AM | #15 |
Connoisseur
Posts: 68
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
It would be great if it were possible to select text with the mouse in other places (Wikipedia, newspapers), copy it and paste it into Sigil while retaining italics and bold.
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
ALERT: Potential Issues with Sigil 2.2.X and rtl languages and Normalization Forms | KevinH | Sigil | 41 | 07-01-2024 10:09 AM |
Features that i miss in Sigil | abraum | Sigil | 24 | 07-21-2021 11:52 AM |
What Features or Tools does Sigil Still Need Yet? | KevinH | Sigil | 175 | 03-06-2021 10:11 PM |
New Plugin Features in the upcoming Sigil 0.8.900 | KevinH | Plugins | 6 | 09-14-2015 03:48 PM |
Writer2ePub, Sigil, and mjBookMaker Features | Ransom | Writer2ePub | 1 | 09-21-2011 10:20 AM |