02-15-2018, 05:04 PM | #1 |
Junior Member
Posts: 3
Karma: 10
Join Date: Feb 2018
Device: Nook Simple Touch; Kindle Fire
|
Prettify HTML questions
Hi all.
After updating my Sigil from 0.7.? to 0.9.8, I noticed that my HTML wasn't being standardized any more. I finally did see that I could manually do it via: TOOLS ==> Reformat HTML ==> Mend and Prettify all HTML files. I searched the forum and found a post where the author said that he understood why it's no longer automatically done, but didn't elaborate the reason. So, 2 questions: 1) What was the reason for making it not automatic? 2) Could there be added, or is there already, a preference setting to make it automatic? I didn't see one. Thanks |
02-15-2018, 05:30 PM | #2 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
Not everyone wants to pretify code in the same way and many authors want to make the fewest changes to their xhtml as possible.
You can control mending on open and close but prettifying is something that not everyone wants and is certainly not somethingthat would need to be done repeatedly. So we make a tool to make prettify easier to do when the user wants or needs it. |
Advert | |
|
02-15-2018, 05:41 PM | #3 |
Junior Member
Posts: 3
Karma: 10
Join Date: Feb 2018
Device: Nook Simple Touch; Kindle Fire
|
Thanks for the prompt reply, KevinH.
Your points are noted and I agree. So although I can do the three mouse-clicks when I want to Standardize the HTML, I would like a preference (initially set to off) to prettify HTML automatically on OPEN and/or SAVE. Thanks again. |
02-15-2018, 05:46 PM | #4 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
Sorry, but this is not something we will be changing.
|
02-15-2018, 06:26 PM | #5 |
Grand Sorcerer
Posts: 27,465
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
If it's the three mouse-clicks that are tripping you up, go into your Preferences and assign a keyboard shortcut to Mend and Prettify All HTML Files.
|
Advert | |
|
02-15-2018, 11:55 PM | #6 |
null operator (he/him)
Posts: 20,459
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
Previous post made me think -- be nice to have a plugin that displayed a drop down list list of actions that have a shortcut, and carry out the selected action when it's clicked or enter key is pressed - Quick Actions.
With the passage of time I find it harder to remember shortcuts I've assigned. I'd also spot shortcuts I never use intentionally, but sometimes trip up on; such as Ctrl+Q when I'm after Ctrl+A BR |
02-16-2018, 03:28 PM | #7 |
Connoisseur
Posts: 57
Karma: 600000
Join Date: Jan 2018
Device: Galaxy Tab S2
|
I assume this is not possible. As far as i understood, the plugin system creates files which you can recall from the plugin, and on success are imported in sigil again, but during the runtime of the plugin you do not have "access" to sigil nor you can call any function of sigil.
|
02-16-2018, 04:17 PM | #8 |
Grand Sorcerer
Posts: 27,465
Karma: 192992430
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
Plugins would have no knowledge of Sigil's defined keyboard shortcuts.
|
02-16-2018, 05:01 PM | #9 |
null operator (he/him)
Posts: 20,459
Karma: 26645808
Join Date: Mar 2012
Location: Sydney Australia
Device: none
|
@Maui, DiapDealer: I suspected that might be so. Thanks for considering
BR |
02-17-2018, 11:32 AM | #10 |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
That's what I did -- Alt+P now Prettifies for me. I use it a lot, because I find it so much easier to scan (run my eye across) Code View when it is neatly laid out. It can get quite scattered otherwise.
|
02-17-2018, 11:35 AM | #11 |
Sigil Developer
Posts: 7,506
Karma: 5433350
Join Date: Nov 2009
Device: many
|
I can understand that if you import html that is horribly formatted all the time. But once you run it nothing in Codeview can mess it up unless you type or paste in a bunch of junk.
So why do you need to use prettify more than once or twice. |
02-17-2018, 03:14 PM | #12 |
Connoisseur
Posts: 57
Karma: 600000
Join Date: Jan 2018
Device: Galaxy Tab S2
|
My saved searches aren't really designed to be generic but are working on the outcome of a prettify very well. So i'm doing a prettify often after some of my saved searches to a ground base and get an optical feedback due to a correct/incorrect indentation.
I'm too lazy to modify my saved searches to be more generic. In addition my clips don't know at which level of <p>/<div> they will end up so i'm calling the prettify option very often. |
02-18-2018, 07:39 AM | #13 | |
mostly an observer
Posts: 1,515
Karma: 987654
Join Date: Dec 2012
Device: Kindle
|
Quote:
And sometimes I'll open up WordStar to quick draft a paragraph or two, and paste that in, code-free. (I have clips to add the code.) So it can look pretty ragged on the screen, and I don't like ragged stuff. Prettify does a great job of prettifying, tee hee. By this time I have what amounts to a tic, going Flight Crew / Prettify / Save every ten or fifteen minutes, plus Save a Copy every hour. And all the time, Florencia is chattering in Argie Spanish to her buddies on the phone.... |
|
03-06-2018, 12:47 PM | #14 |
Guru
Posts: 667
Karma: 929286
Join Date: Apr 2014
Device: PW-3, iPad, Android phone
|
Often I do S&R that includes more than one line of code. As the search strings include the whitespace between code, it's simplest to prettify so that the linebreaks and spaces are standard (yeah, I could regex the whitespace, but doing it this way mean I can just copy the lines as-is).
Other edits may un-pretty the code, so I need to redo it before any such search. |
Tags |
prettify html preference |
Thread Tools | Search this Thread |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[GUI Plugin] Prettify Cover | m1d1 | Plugins | 63 | 03-19-2024 08:40 AM |
HTML to MOBI Conversion General Questions | yaelkmiller | Conversion | 2 | 12-24-2012 02:27 PM |
PDF to HTML page break questions | michaelbr | 3 | 01-27-2011 08:49 PM | |
Calibre Recipe HTML content differs from raw html of index.html. | krunk | Calibre | 4 | 09-20-2010 09:48 PM |
Some HTML Mobipocket desktop/Cybook questions | AlexBell | Kindle Formats | 2 | 08-26-2008 11:07 PM |