03-15-2024, 12:16 AM | #1 |
Enthusiast
Posts: 31
Karma: 10
Join Date: Jun 2011
Location: Lima, Peru
Device: Kindle 10Gen / Kobo Aura HD / Nook STR
|
Some ideas
Hello, Sigil developers!
As a new version is coming, I would like to share some humble ideas, in case it is possible to consider/add them. 1. When using RegEx Rename…, could the Rename Table show only the files that will change? (in this example, don't show the last two in the second column). 2. When using Reformat CSS, Multiple Lines Per Style, could the tags/classes be separated? (i.e. add a space after each comma: this makes it visually clearer). For example: Code:
h1+p, h2 + p, .classA>p, .classB > p { text-indent:0; } .classA, .classB { text-align:right; text-indent:0; } Code:
h1+p,h2 + p,.classA>p,.classB > p { text-indent: 0; } .classA,.classB { text-align: right; text-indent: 0; } 3. In Find/Replace, Options, Regex Options, there are now three possibilities. Could a new one be added to recognize Unicode characters? i.e. the equivalent to (*UPC) Because, in languages with diacritics/"special" characters, word boundaries (\b) don't do what you expect. For example: Code:
\bmonta\b 4. Could phrases (groups of words) be added to the personal dictionary? For example: alter ego, ipso facto, sui generis, etc., are very common in Spanish texts (they are usually italicized) and it would be good to be able to except them only when they appear together in that order, because there are Latin phrases like curriculum vitae, whose first word, alone, in Spanish has an accent ("currículum"). Now they can be added manually (in the "default" file) but they are not recognized at Spellcheck. 5. More a question than a suggestion: Is it possible to configure it to use the "Sigil Norm" by default? (avoiding the use of Restructure... for new epubs). Thank you very much for your attention! |
03-15-2024, 12:27 AM | #2 |
Bibliophagist
Posts: 40,363
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
For new ePubs, I thought the default was using the 'Sigil Norm' layout when they were created? As for using that to restructure ePubs that are being edited, at one time restructuring the ePub was the default behaviour but enough people preferred not to have their ePubs restructured by default that the operation was made an optional to use tool.
|
Advert | |
|
03-15-2024, 06:47 AM | #3 |
Grand Sorcerer
Posts: 28,033
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
As DNSB has noted: new epubs already DO use the Sigil Norm structure as the default (unless you change it with your own default structure). Sigil just no longer automatically restructures ALL epubs upon opening.
As for the rest of your requests: we'll look into them, but it's probably too late for any of them to make it into the upcoming release. We need time for testing changes thoroughly before releasing. RE the Regex Rename: I actually prefer seeing the filenames that aren't going to be affected. It helps to confirm that I've not made a boneheaded mistake before committing. |
03-15-2024, 11:26 AM | #4 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
As for your #1,
- no I want to see the full results before and after when renaming. As for your no 2, - I will look into that although, unnecessary whitespace is typically remove by all css linters for compactness. As for 3, - That is how regex has always worked with unicode. And there are already recognized regex mode flags that can be set for that. Let's hear what others think about that. As for 4, - Have you tried the new updated Spanish dictionary? As for #5, - Sigil no longer restructures and your default starting structure can be controlled by you. There is no one correct structure for epub2 or epub3. Sigil norm is just our old norm, not THE norm. Last edited by KevinH; 03-15-2024 at 12:22 PM. |
03-15-2024, 12:08 PM | #5 |
Guru
Posts: 781
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
Ad 1.
a) The number of items displayed in the table corresponds to the number of files selected before Rename RegEx was selected. Personally, I only select the files whose names I want to change.... b) I think it is possible to reconcile both sides. Changed elements can be highlighted in the table with a background colour, for example. (Below is an example, but you have to take light/dark mode into account). Spoiler:
Ad 2. This line (add space after comma). Although I have checked this, it is worth investigating further. |
Advert | |
|
03-15-2024, 12:20 PM | #6 |
Bibliophagist
Posts: 40,363
Karma: 156982136
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Looking at the items in the request:
|
03-15-2024, 12:29 PM | #7 | |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Thanks. The space after the comma needs to be controlled by the formatting settings to be fully correct. Typically it is not added for single line formats.
Add adding highlighting for changed or unchanged is doable but since this is Regex Rename dialog, it should probably only highlight unchanged. Or as you said, if you do not want to rename a file do not include it when selecting the set of files for Regex rename. Quote:
|
|
03-15-2024, 01:04 PM | #8 |
Grand Sorcerer
Posts: 28,033
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Saving regexps with (*UCP) prepended doesn't really seem any more onerous to me than saving them with a checkbox checked. But I'm not opposed to a checkbox that does the same thing if it can be easily accomplished. Space in the F&R widget has always come at a premium, though. So there's that to consider, too.
Last edited by DiapDealer; 03-15-2024 at 01:11 PM. |
03-16-2024, 11:47 AM | #9 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
If anyone wants to experiment with the changes needed to add a space after a comma when reformatting the css in multi-line format (and not single-line "compact" format), this is the change we are considering for a future release:
Code:
diff --git a/src/Parsers/qCSSParser.cpp b/src/Parsers/qCSSParser.cpp index af04b1e56..e54c1b1e2 100644 --- a/src/Parsers/qCSSParser.cpp +++ b/src/Parsers/qCSSParser.cpp @@ -1,6 +1,6 @@ /************************************************************************ ** - ** Copyright (C) 2021-2023 Kevin B. Hendricks, Stratford, Ontario, Canada + ** Copyright (C) 2021-2024 Kevin B. Hendricks, Stratford, Ontario, Canada ** ** This file is part of Sigil. ** @@ -60,7 +60,7 @@ CSSParser::CSSParser() // Used for serializing parsed css (multiline format) csstemplateM.push_back(" "); // 0 - standard indentation csstemplateM.push_back(" {\n"); // 1 - bracket after @-rule - csstemplateM.push_back(""); // 2 - unused + csstemplateM.push_back(" "); // 2 - space after "," in selector csstemplateM.push_back(" {\n"); // 3 - bracket after selector was "\n{\n" csstemplateM.push_back(""); // 4 - unused csstemplateM.push_back(" "); // 5 - string after property before value @@ -76,7 +76,7 @@ CSSParser::CSSParser() // Used for serializing parsed css (single line format) csstemplate1.push_back(""); // 0 - standard indentation csstemplate1.push_back("{"); // 1 - bracket after @-rule - csstemplate1.push_back(""); // 2 - unused + csstemplate1.push_back(""); // 2 - space after "," in selector csstemplate1.push_back("{"); // 3 - bracket after selector was "\n{\n" csstemplate1.push_back(""); // 4 - unused csstemplate1.push_back(""); // 5 - string after property before value @@ -342,7 +342,9 @@ QString CSSParser::serialize_css(bool tostdout, bool multiline) case SEL_START: indent = CSSUtils::indent(lvl, csstemplate[0]); - output << indent << csstokens[i].data << csstemplate[3]; + output << indent + << CSSUtils::implode("," + csstemplate[2], CSSUtils::explode(",", csstokens[i].data, false)) + << csstemplate[3]; lvl++; break; |
03-16-2024, 11:59 AM | #10 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
Looking at your point 4 more closely, unfortunately hunspell (the spellchecker used by Sigil) is a word based spell checker not a phrase based grammar checker.
So there is no easy way to make it check spelling variations for specific word phrase combinations. So you have a few options: A. Use search and replace to properly mark these words at belonging to the Latin language by adding a span and a lang attribute, and spell check those with the appropriate Latin dictionary. This is technically the most correct way to handle foreign phrases in any epub. or B. Set up a list of saved searches that can in fact detect commonly broken word phrases and use find and replace on that list to make sure those use the correct the spelling variation. or C. Try to find an existing Spanish grammar checker and interface it via a Sigil plugin to detect and report any phrase spelling inconsistencies. |
03-16-2024, 12:09 PM | #11 | |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
@DiapDealer,
Quote:
Do you want me to take a shot at adding support to use "Use Unicode" to Find and Replace? That would, of course, require wholesale recreation and updates to many images in our Sigil User Guide Just let me know if this is something you want us to add for the release after this forthcoming one. Last edited by KevinH; 03-16-2024 at 12:12 PM. |
|
03-16-2024, 01:53 PM | #12 |
Grand Sorcerer
Posts: 28,033
Karma: 199464182
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
It's not really something I want to add... I'm just not opposed.
I don't think we need to upset the applecart right now. Let's see what others think. |
03-16-2024, 03:58 PM | #13 |
Guru
Posts: 781
Karma: 2298438
Join Date: Jan 2017
Location: Poland
Device: Various
|
Checked. It works OK. I'll leave the fix to myself and test during normal Sigil use.
|
03-16-2024, 04:22 PM | #14 |
Sigil Developer
Posts: 8,156
Karma: 5450818
Join Date: Nov 2009
Device: many
|
|
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[FREE]Innovative Ideas to Ignite Your Mind: Business Ideas to Start Entrepreneurship | amazon author | Self-Promotions by Authors and Publishers | 0 | 04-01-2015 04:09 AM |
Where do Ideas Come From? | kennyc | Writers' Corner | 36 | 12-03-2012 11:45 AM |
PRS-505 Any ideas what this might be? | Neupy | Sony Reader | 4 | 07-03-2012 07:19 AM |
Ideas | Drumm | Calibre | 3 | 08-31-2011 06:37 AM |
Ideas? | mike_bike_kite | Which one should I buy? | 10 | 06-13-2010 03:37 PM |