04-11-2022, 07:18 PM | #1 |
EBook-obsessive gal
Posts: 39
Karma: 10
Join Date: Mar 2011
Location: La ciudad de la eterna primavera
Device: Kobo Clara HD
|
Toggle comments on HTML or CSS files
Hi, everyone!
I have looked up with no success. Does anyone know if there is a plugin to toggle comments on HTML or CSS files? Or maybe just a regex function is needed? Since I'm no programmer, I cannot do it myself. I'm sorry for that. |
04-11-2022, 07:33 PM | #2 |
Bibliophagist
Posts: 39,995
Karma: 154914010
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
What do you mean by toggle comments? in the CSS files, you would use /* comment text */ and in a HTML file, you would use <! -- comment text --> to add a comment. Are you looking for a plugin to allow you to highlight text and then mark it as a comment?
I.e. Code:
<!-- Write your comments here for a HTML file --> /* This is a single-line comment in a CSS file */ p { text-align:center; /* center the text */ } |
Advert | |
|
04-11-2022, 07:50 PM | #3 |
A Hairy Wizard
Posts: 3,215
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
|
I would just set that as a clip.
- type your comment - highlight your commented text - click the appropriate clip button Probably alot shorter/faster/easier than making a whole plugin for it. |
04-11-2022, 08:07 PM | #4 | |
EBook-obsessive gal
Posts: 39
Karma: 10
Join Date: Mar 2011
Location: La ciudad de la eterna primavera
Device: Kobo Clara HD
|
Quote:
What I mean is when I'm experimenting with the code, I want to highlihgt some text block and comment it. Or if it is already commented, I want to uncomment it. Exactly as you said Last edited by celiapgt; 04-11-2022 at 08:16 PM. |
|
04-11-2022, 08:13 PM | #5 |
EBook-obsessive gal
Posts: 39
Karma: 10
Join Date: Mar 2011
Location: La ciudad de la eterna primavera
Device: Kobo Clara HD
|
Yes, I was thinking of using clips, but I do not know how to use it. For example,
Code:
<p>A paragraph</p> <hr /> <p>Another paragraph</p> Code:
blockquote.modern { text-align:justify; margin: 0 1em 1em; } Code:
<!-- <p>A paragraph</p> <hr /> <p>Another paragraph</p> --> Code:
/* blockquote.modern { text-align:justify; margin: 0 1em 1em; } */ How can I achieve it? Is it possible using clips/regex or plugins? |
Advert | |
|
04-11-2022, 08:50 PM | #6 |
A Hairy Wizard
Posts: 3,215
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
|
That could be done with a saved search.
Find: [\<\!\-\-|\/\*]\s*(.*?)\s*[\-\-\>|\*\/] Replace: \1 - highlight commented section, including tags - hit saved search button I’m pretty sure you can assign a shortcut key for the clip(s), maybe you can do the same for a saved search?? Also, I’m not sure you need to escape every character in the find - I’m writing this on my phone without testing - but you get the idea. If I’m wrong I guarantee someone will correct it! Edit: added \s* to not capture any spaces to prevent adding space every time this method is used. </CDO> Last edited by Turtle91; 04-11-2022 at 09:00 PM. |
04-12-2022, 01:15 PM | #7 |
EBook-obsessive gal
Posts: 39
Karma: 10
Join Date: Mar 2011
Location: La ciudad de la eterna primavera
Device: Kobo Clara HD
|
Hey, Turtle91!
Thank you for your response. I'm trying and coping with your idea. Yes, I get it ;D Clever one! Regex are not my strong but now I can develop the rest of them. I cannot assign a keyboard shortcut to a saved search :-S It is something worthwhile to have keyboard shortcuts for Saved Searches, and I hope the developers consider it. Would save a lot of time and clicking (I'm more a keyboard gal). Thanks again! Live long and prosper! |
04-12-2022, 03:48 PM | #8 | |
Grand Sorcerer
Posts: 5,637
Karma: 23191067
Join Date: Dec 2010
Device: Kindle PW2
|
Quote:
Just assign the following two clips to one of the first 20 clips: Code:
CSS comment /* \1 */ HTML comment <!-- \1 --> |
|
04-16-2022, 08:26 PM | #9 |
EBook-obsessive gal
Posts: 39
Karma: 10
Join Date: Mar 2011
Location: La ciudad de la eterna primavera
Device: Kobo Clara HD
|
Thank you, Doitsu!
I'm saving them as clips. |
Tags |
comments, css, html, regex function, toggle |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Convert Several Html and Css files into one Epub File? | MarjaE | Editor | 3 | 04-04-2017 03:20 PM |
How to change CSS to comments but retain original numeric values | crankypants | Sigil | 3 | 11-03-2015 10:49 AM |
Importing css in html files | shotsky | Conversion | 6 | 07-14-2012 05:34 PM |
Fixed Layout Sample ".mobi" file with package(html, css, opf, ncx files). | Sushil | Kindle Fire | 1 | 01-13-2012 07:16 AM |
Help! Newbie having problems converting HTML/CSS files | jackie_w | Calibre | 6 | 09-14-2009 04:53 PM |