|
|
#121 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 974
Karma: 3600000
Join Date: Jan 2017
Location: Poland
Device: Various
|
I’ve noticed some other interesting features:
- Options to control indentation and line breaks for code in a new section of the preferences. It works surprisingly well! And users feel like they have control over "Prettify." - Improved code for refreshing plugin icons after changing their assignment in the toolbars (I’ll find that code, test it, and prepare a PR) - Ctrl-8 to wrap with div tags (seems like a small thing, but it might come in handy) |
|
|
|
|
|
#122 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
I do not think that his/her Ctrl-8 code is needed. We can already assign clips to wrap a div (or any other tag) around any selected text right now. You can assign it its own shortcut code too.
I do not think that dev was familiar with clips and their versatilty. And please be careful to not hard code shortcuts as they did in many places. |
|
|
|
| Advert | |
|
|
|
|
#123 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 974
Karma: 3600000
Join Date: Jan 2017
Location: Poland
Device: Various
|
Sure.
I've already found the code that updates the toolbar with the plugin icons, and I'm about to start testing it. |
|
|
|
|
|
#124 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
Okay, I have modded the code from that gitee site that speeds up bulk AddExisting (the BulkRemove, BulkMove, BulkRename etc already existing in Sigil). I had to remove double negative variable naming (which drives me batty!) and removed code existing duplication and pushed it to master.
I tested it loading 268 images (all from our Sigil User guide) via drag and drop and the speedup was noticeable. Not sure how many times I will be adding hundreds or thousands of files to an existing epub, but it can not hurt, and parallels the code already existing in Sigil to do other things in Bulk. It will need some testing as it delays updating the OPF (which is the slow operation as it requires validating the xml of the opf first, then fully parsing it before adding anything and then rebuilding the opf). The old method did this 268 times (once for each file). |
|
|
|
|
|
#125 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 51,318
Karma: 179232794
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
If you are using Windows and you are interesting in testing the latest code, the link to my compile of the latest code can be obtained from: Link removed.
Last edited by DNSB; 04-02-2026 at 02:56 PM. Reason: Removed link for older compile |
|
|
|
| Advert | |
|
|
|
|
#126 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
As BeckyEbook said, there is a whole autocomplete tool, there is an strange auto format html syntax (see her new Preferences image) used by their own Prettify routine, and the possibility to use Emmet (which is a shorthand notation to enter code blocks) that is big for web devs but not really for epub dev since we are typically not starting from absolute 0 (no html and no book text) and instead are cleaning up html generated by a real word processor and need to wrap things around existing text.
There is also a FindReplaceSpecial that adds a pre-find field (so both conditions must be met) but it seems to not work consistently and even crashed twice in testing with broken signals. I guess they did not know you can handle early patterns (and post patterns) in normal regular expressions. All might prove useful to at least keep around to have a deeper look at. Especially since I have never seen a C++ implementation for Emmet (the original is javascript only). Last edited by KevinH; 03-31-2026 at 09:13 AM. |
|
|
|
|
|
#127 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
Here is my evaluation of other "features" from that gitee code:
New CV Insert items ----------------------- SplitTagOrAddBreak - just like using a clip that inserts "</p><p>" or "<p><br/></p>" Paste Rich Text - it just pastes blobs of poor html copied from the clipboard (ie from say a Brower copy action) with horrible inline styles, forced font sizes, forced margins, etc . It would take much longer to clean it up than it would to just manually add a class MergeNextElement - you place you cursor after the closing tag of any element then it will remove the starting next element, keeping just the text, and then makes the closing tag of the next element consistent. Again not very interesting. HeadingDivision - will wrap (not replace) each line in a div. Not sure why it is line baed and not element based but ... again not useful when we can do the same with a simple clip. (this is the Ctrl-8 option BeckyEbook mentions) Unfortunately it is just line based and so not that useful as paragraphs often add newlines in them to make them fit into available screen width when editing. So one p tag content will get multiple div tags (one each for each line). In BookBrowser ----------------- - a new pop-up menu to let you right click on an image and select "Insert Into HTML/CSS" and it will do the equivalent of our Insert Image tool with the highlighted image file BookBrowser. Its chief weakness is that it shows no thumbnails so you pretty much have to guess which image is being inserted from the file name. Far from ideal. My guess is this might be useful when you have literally thousands of images which take time to thumbnail. ImportingTxt is used to insert a Text file into an existing xhtml file at the current cursor which can easily be done now by copy and paste. I think all of these "extras" might be useful if you have tons of text files and tons of images but no html and want to just add markup around them. Of all of the above, the only thing that might be of interest to me is the BookBrowser right click menu to insert that image into current CodeView at the cursor. Useful if you are sure you have selected the correct image file in BookBrowser (since no thumbnails). Last edited by KevinH; 03-31-2026 at 10:34 AM. |
|
|
|
|
|
#128 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
I have been testing the xhtml tag autocompletion in sigil-modified. Unfortunately it is next to worthless mainly because tag names are very short.
So if I type: <d The code completer shows me every tag name that starts with a d and what I wanted "div" was 5 arrow keys down in the list (and trying to use a mouse to select it fails on macOS). So I end up using more key presses than if I simply typed it myself. If instead I type: <di then it still gives me a list of 2 items dialog and div and so I still have to use too many keystrokes. Simply using clips for commonly inserted tags is much better in my opinion. Furthermore the completer code is broken in that it highjacks the Tab key but only sometimes (at least on macOS) so that it is hit or miss if I use the autocomplete if I get the right tag name or I get a tab inserted in the code. Their completer is not smart so if you are in an open tag and try to use the completer to create the matching close tag, it does not immediately suggest the right close. Our Insert closing Tag tool is much smarter. So autocomplete of tag names in xhtml is in general pretty worthless. Not something we will add to Sigil's CodeView. Last edited by KevinH; 03-31-2026 at 04:26 PM. |
|
|
|
|
|
#129 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
And finally, I tested the Emmet code but it has no license banner on the top (so assumed to be gpl'd like the licence on its repo) but it had broken $ numbering in any more complex case.
From eye balling the Emmet code, it appears to me to be an AI code translation from javascript but I can't tell. It is incomplete or buggy when it comes to numbering. Another big issue with sigil-modified is that it is pretty much at the Qt5 code level and it still uses things like QRegExp and QTextCodec that have been relegated to the Qt5Compatibility module (which we no longer use) as these features are going away completely in the next major release of Qt. So from all of the above, I think the only idea from sigil-modified I really like is for the user to have some way of telling Prettify how to handle things, such as indent levels, single or double spaced, and maybe a way to specify which tags to treat as structural and which not to, Its version uses a pseudo css syntax that is not obvious or easy to use. If others play around with sigil-modified, please add your thoughts and observations. Last edited by KevinH; 04-01-2026 at 10:33 AM. |
|
|
|
|
|
#130 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
Is anyone here interested in using Emmet (an abbreviation system - quite old now) that uses a css-like syntax so you can write html and css abbreviations that get expanded?
There is a py-emmet (pure python) module that is fully working (unlike the broken or bad AI translation they used in their Emmet.cpp code) that could very very easily be integrated into CodeView. It would be painless to add a new shortcut, grab text on current cursor line, then pass it to a python routine and get back the expanded version. So few if any changes are needed. But before I add this feature, I wanted to see if anyone here is interested or even uses or has used Emmet to use abbreviations to write html code for you. It seems more like something a webdeveloper might use who has to create lots of custom code, but it could speed up adding css properties using abbreviations and speed up html tag generation once you learn their syntax. Any interest? |
|
|
|
|
|
#131 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
Also, I would love your thoughts on what general parameters you would want control of for pretty printing. Here is what I am thinking about:
- single spaced or double-spaced - indent width: 2 vs 4 vs ? - a way for the user to control the list of structural tags used (ie. change tr, td, to be non-structural) - maybe a way to control the list of inline tags - maybe a way to control the list of tags where spaces are not condensed (i.e like pre) - maybe whether to put structural close tags on their own line or not. Are there any other parameters you would consider important? |
|
|
|
|
|
#132 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 974
Karma: 3600000
Join Date: Jan 2017
Location: Poland
Device: Various
|
Ad Emmet – I’d be happy to test it myself. Users can just take a look at the https://emmet.io/ and https://docs.emmet.io/cheat-sheet/ pages and see if something like this would be useful to them in their daily work with Sigil.
As for prettify, I think those are probably the most important elements, but we’ll definitely need to test it with less common markup, such as MathML. |
|
|
|
|
|
#133 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
Okay, I will code up a way to use py-emmet into CodeView for people to play around with.
The py-emmet code and javascript emmet code are both MIT licensed so we can include it into our python3lib code directly. When I have something working, I will post to this thread to let people know. |
|
|
|
|
|
#134 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,565
Karma: 6774048
Join Date: Nov 2009
Device: many
|
I have added emmet and an interface to from CodeView. I have pushed this only to my personal repo https://github.com/kevinhendricks/Sigil to its master.
If anyone wants to explore if Emmet would help, please give that build a try. If it looks interesting enough, I will push this to normal Sigil master and start trying to test and refine it. In CodeView when editing CSS or XHTML, you can insert a new line with your EmmetAbbreviation in it leaving your cursor at the end of what you just types. Then right click to get the pop-up menu and select Emmet Expand Note, this will only work when editing in CSS and XHTML files in CodeView. I should probably add it to svg editing, and disable it for miscellaneous text and javascript editing but that can come later. Please do let me know if this is something to keep. |
|
|
|
|
|
#135 |
|
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 51,318
Karma: 179232794
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
If you are using Windows and you are interesting in testing the Emmet code, the link to my compile can be obtained from: Sigil-2.7.6-Windows-x64-Setup_Emmet.exe.
Last edited by DNSB; 04-02-2026 at 02:56 PM. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Suggestions for Sigil Improvements or New Features | KevinH | Sigil | 241 | 03-02-2026 01:09 PM |
| Suggestions for Sigil Improvements or New Features | KevinH | Sigil | 168 | 11-18-2025 12:23 PM |
| Ideas for New Improvements or Features | KevinH | Sigil | 97 | 04-09-2025 09:45 AM |
| What Features or Tools does Sigil Still Need Yet? | KevinH | Sigil | 175 | 03-06-2021 09:11 PM |
| Improvements/bugs/features | dontcrash | KOReader | 10 | 10-23-2019 10:05 AM |