Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 01-26-2021, 02:16 PM   #1
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 953
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
[Feature request] - Ctrl+Click on classes

Hi, Kovid.

Is it possible to add the following feature?

- Ctrl+Click on a CSS class name on Code window leading to the corresponding CSS seletor on the Stylesheet file

Right now, I have to use the Live CSS panel.
thiago.eec is online now   Reply With Quote
Old 01-26-2021, 09:52 PM   #2
retiredbiker
Evangelist
retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.retiredbiker ought to be getting tired of karma fortunes by now.
 
retiredbiker's Avatar
 
Posts: 410
Karma: 2289864
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Jutoh, Kobo Forma
This might sound like a short-cut, but what if the code you ctrl-click on is part of a complex cascade of styling? In a complex book, I have enough trouble figuring some of it out WITH live css! Sometimes when looking at code view, what you think is a controlling class isn't really doing what you think it is. Not against the idea, just pointing this out...
retiredbiker is offline   Reply With Quote
Advert
Old 01-26-2021, 10:14 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,153
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The problem with this, as retiredbiker points out is that it is misleading. There is no single place to jump to. Any class could be used as part of the selector for many different rules.
kovidgoyal is offline   Reply With Quote
Old 01-27-2021, 07:12 AM   #4
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 953
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Sorry, maybe I wasn't specific enough. The Ctrl+Click would be on the actual class name, not in any part of the element.

This is what I had in mind (just like Sigil):

1) Code example:
Spoiler:

Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" lang="pt-BR" xml:lang="pt-BR">

<head>
  <title>part0002</title>
  <link href="../stylesheet.css" rel="stylesheet" type="text/css"/>
  <link href="../page_styles.css" rel="stylesheet" type="text/css"/>
</head>

<body class="calibre">

  <div id="Table_of_Content" class="class2">

    <div class="class3 class8">Sumário</div>

    <div class="class4"><a href="part0003.xhtml" class="class5">1. O caminho amplo e o caminho profundo</a></div>

    <div class="class4"><a href="part0004.xhtml" class="class5">2. Pistas antigas</a></div>

    <div class="class4"><a href="part0005.xhtml" class="class5">3. O depois é o antes do durante seguinte</a></div>

    <div class="class4"><a href="part0006.xhtml" class="class5">4. O melhor que tínhamos</a></div>

    <div class="class4"><a href="part0007.xhtml" class="class5">5. Uma mente imperturbável</a></div>

    <div class="class4"><a href="part0008.xhtml" class="class5">6. Preparado para amar</a></div>

    <div class="class4"><a href="part0009.xhtml" class="class5">7. Atenção!</a></div>

    <div class="class4"><a href="part0010.xhtml" class="class5">8. Leveza de ser</a></div>

    <div class="class4"><a href="part0011.xhtml" class="class5">9. Mente, corpo e genoma</a></div>

    <div class="class4"><a href="part0012.xhtml" class="class5">10. A meditação como psicoterapia</a></div>

    <div class="class4"><a href="part0013.xhtml" class="class5">11. O cérebro de um iogue</a></div>

    <div class="class4"><a href="part0014.xhtml" class="class5">12. Tesouro escondido</a></div>

    <div class="class4"><a href="part0015.xhtml" class="class5">13. Alterando traços</a></div>

    <div class="class4"><a href="part0016.xhtml" class="class5">14. Uma mente saudável</a></div>

    <div class="class6"><a href="part0017.xhtml" class="class7">Agradecimentos</a></div>

    <div class="class4"><a href="part0018.xhtml" class="class7">Notas</a></div>

    <div class="class4"><a href="part0019.xhtml" class="class7">Outras fontes</a></div>

  </div>

</body>

</html>


2) CSS stylesheet:
Spoiler:

.calibre {
display: block;
font-size: 1em;
line-height: 1.2;
padding-left: 0;
padding-right: 0;
margin: 0 5pt
}
.calibre1 {
display: block
}
.calibre2 {
display: block;
line-height: 1.2
}
.class {
display: block;
text-align: center
}
.class1 {
font-size: 1em;
height: 100%;
line-height: 1.2;
width: auto
}
.class2 {
display: block;
font-size: 1em;
line-height: 1.2;
padding: 1.07083em 5%
}
.class3 {
display: block;
font-family: "02-Ines Book";
font-size: 1.5em;
line-height: 1.2;
margin-bottom: 3.9047em;
text-align: center
}
.class4 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2
}
.class5 {
text-decoration-color: rgba(255, 255, 255, 0)
}
.class6 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2;
margin-top: 0.743737em
}
.class7 {
font-style: italic;
font-weight: normal;
text-decoration-color: rgba(255, 255, 255, 0)
}
.class8 {
display: block;
font-family: "02-Ines Book";
font-size: 1.5em;
line-height: 1.2;
margin-bottom: 3.32004em;
text-align: center
}
.class9 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2;
text-align: justify
}
.class10 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2;
text-align: justify;
text-indent: 1.823%
}
.class11 {
font-size: 0.75em;
line-height: 1.2
}
.class12 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-style: italic;
line-height: 1.2;
text-align: justify;
text-indent: 1.823%
}
.class13 {
font-style: italic;
font-weight: normal
}
.class14 {
display: block;
font-family: "Ines Light";
font-size: 0.875em;
font-weight: 200;
line-height: 1.2;
margin-bottom: 0.589085em;
margin-top: 1.17817em
}
.class15 {
font-size: 0.75em;
line-height: 1.2;
text-decoration-color: rgba(255, 255, 255, 0);
vertical-align: text-top
}
.class16 {
display: block;
line-height: 1.2;
margin-left: 7.5%;
margin-right: 7.5%;
margin-top: 1.542em;
width: 85%
}
.class17 {
display: block;
line-height: 1.2;
text-align: center
}
.class18 {
height: auto;
line-height: 1.2;
width: 100%
}
.class19 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2;
margin-top: 0.743737em;
text-align: justify;
text-indent: 1.823%
}
.class20 {
font-size: 0.75em;
line-height: 1.2;
text-decoration: underline;
vertical-align: text-top
}
.class21 {
display: block;
font-family: "Ines Light";
font-size: 0.875em;
font-weight: 200;
line-height: 1.2;
margin-bottom: 0.574458em;
margin-left: 1.823%;
margin-top: 0.574458em
}
.class22 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2;
margin-left: 3.646%;
margin-top: 0.39144em;
text-align: justify;
text-indent: -1.301%
}
.class23 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2;
margin-left: 3.646%;
text-align: justify;
text-indent: -1.301%
}
.class24 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2;
margin-bottom: 0.39144em;
margin-left: 3.646%;
margin-right: 1.302%;
text-align: justify;
text-indent: -1.301%
}
.class25 {
display: block;
font-family: "Ines Light";
font-size: 1em;
font-weight: 200;
line-height: 1.2;
margin-left: 3.646%;
margin-right: 1.302%;
text-align: justify;
text-indent: -1.301%
}
.class26 {
font-size: 0.75em;
line-height: 1.2;
vertical-align: text-top
}
.class27 {
font-size: 0.85714em;
line-height: 1.2;
text-decoration-color: rgba(255, 255, 255, 0);
vertical-align: text-top
}
.class28 {
color: gray;
display: block;
height: 2px;
line-height: 1.2;
border: currentColor inset 1px;
margin: 1.60625em auto 0.200782em
}
.class29 {
display: block;
font-family: "Ines Light";
font-size: 0.875em;
font-weight: 200;
line-height: 1.2;
text-align: justify
}
.class30 {
display: block;
font-family: "02-Ines Book";
font-size: 1.5em;
line-height: 1.2;
text-align: center
}
.class31 {
display: block;
font-family: "Ines Light";
font-size: 0.75em;
font-weight: 200;
line-height: 1.2;
margin-bottom: 0.685021em;
margin-top: 9.14993em
}
.class32 {
display: oeb-page-foot;
font-family: "Ines Light";
font-size: 0.875em;
font-weight: 200;
line-height: 1.2;
text-align: justify;
text-indent: 1.823%
}
.class33 {
font-size: 0.85714em;
line-height: 1.2
}
.class34 {
display: block;
font-family: "Ines Light";
font-size: 0.75em;
font-weight: 200;
line-height: 1.2;
margin-bottom: 0.685021em;
margin-top: 0.978601em
}
.class35 {
display: block;
font-family: "Ines Light";
font-size: 0.875em;
font-weight: 200;
line-height: 1.2;
text-align: justify;
text-indent: 1.823%
}
.class36 {
display: block;
font-family: "Ines Light";
font-size: 0.75em;
line-height: 1.2
}
.class37 {
display: block;
font-size: 1.16667em;
font-weight: 200;
line-height: 1.2;
text-align: justify;
text-indent: 1.823%
}
.class38 {
display: block;
font-weight: 200;
margin-bottom: 0.685021em;
margin-top: 0.978601em
}
.class39 {
display: block;
font-family: "Ines Light";
font-size: 0.875em;
line-height: 1.2
}
.class40 {
display: block;
font-weight: 200;
text-align: justify;
text-indent: 1.823%
}
.class41 {
display: block;
font-size: 0.85714em;
font-weight: 200;
line-height: 1.2;
margin-bottom: 0.685021em;
margin-top: 0.978601em
}
.class42 {
font-family: "02-symbol";
font-weight: normal
}
.class43 {
font-size: 0.85714em;
line-height: 1.2;
text-decoration: underline;
vertical-align: text-top
}
.class44 {
display: block;
font-family: "Ines Light";
font-size: 0.875em;
font-weight: 200;
line-height: 1.2;
margin-left: 1.823%;
text-align: justify;
text-indent: -1.823%
}
.class45 {
text-decoration: underline
}
.class46 {
display: block;
font-size: 1em;
line-height: 1.2;
padding-left: 5%;
padding-right: 5%;
padding-top: 1.07083em
}
.class47 {
display: block;
line-height: 1.2;
margin-left: 25%;
margin-right: 25%;
width: 50%
}
.class48 {
display: block;
line-height: 1.2;
margin-left: 15%;
margin-right: 15%;
margin-top: 1.36531em;
width: 70%
}
.class49 {
display: block;
font-size: 1em;
line-height: 1.2;
padding-bottom: 1.07083em;
padding-left: 5%;
padding-right: 5%
}
.class50 {
display: block;
font-family: "Ines Light";
font-size: 0.75em;
font-weight: 200;
line-height: 1.2;
text-align: right;
text-indent: 3.647%
}
.class51 {
display: block;
font-family: "Ines Light";
font-size: 0.75em;
font-weight: 200;
line-height: 1.2;
margin-bottom: 0.495502em
}
.class52 {
display: block;
font-family: "Ines Light";
font-size: 0.75em;
font-style: italic;
line-height: 1.2;
margin-bottom: 0.495502em
}
.class53 {
font-style: italic;
font-weight: normal;
line-height: 1.2
}
.class54 {
font-size: 1em;
line-height: 1.2
}
.class55 {
display: block;
font-family: "Ines Light";
font-size: 0.75em;
font-weight: 200;
line-height: 1.2;
margin-bottom: 0.495502em;
margin-top: 5.06513em
}
.class56 {
display: block;
margin-top: 1.028em
}
.class57 {
font-size: 1em;
height: auto;
line-height: 1.2;
width: 58.594%
}
.class58 {
display: block;
font-size: 1.5em;
line-height: 1.2;
margin-top: 1.028em
}
.class59 {
display: block;
font-family: sans-serif;
font-size: 0.875em;
line-height: 1.2;
margin-left: 3.656%;
margin-top: 0.506304em;
text-indent: -3.656%
}
.class60 {
display: block;
font-family: sans-serif;
font-size: 0.875em;
line-height: 1.2;
margin-left: 3.656%;
margin-top: 0.182269em;
text-indent: -3.656%
}
.class61 {
display: block;
font-family: sans-serif;
font-size: 1em;
line-height: 1.2;
margin-top: 1.77241em
}
.class62 {
color: #008383;
text-decoration: underline
}
.class63 {
display: block;
font-family: sans-serif;
font-size: 1em;
line-height: 1.2;
margin-top: 1.32931em
}
.class64 {
display: block;
font-family: sans-serif;
font-size: 1em;
line-height: 1.2;
margin-bottom: 0.850759em;
margin-top: 1.77241em
}
.class65 {
display: block;
font-size: 1em;
height: 100%;
line-height: 1.2;
padding-left: 0;
padding-right: 0;
text-align: center;
margin: 0 5pt
}
.class66 {
font-size: 1em;
height: 100%;
line-height: 1.2;
max-width: 100%;
width: auto
}


3) Now, if I Ctrl+Click on any of the class names, it would take me to the corresponding rule on the CSS Stylesheet.

4) If there are more than one rule applied, like the second example on the code (class="class3 class8"), this wouldn't be a problem, since I have to click on one or the other. If I click on on 'class3', it would take me to '.class3 {...}' on the CSS stylesheet. If I click on 'class8', then it would take me to '.class8 {...}'.

Like I said, this is how it works on Sigil. it's very useful and time saving.
On calibre Editor, this already work opening files through their links on the code.

Last edited by thiago.eec; 01-27-2021 at 07:15 AM.
thiago.eec is online now   Reply With Quote
Old 01-27-2021, 07:16 AM   #5
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,153
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
There is no corresponding selector. There can be multiple selectors that have a given class name.
kovidgoyal is offline   Reply With Quote
Advert
Old 01-27-2021, 07:23 AM   #6
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 953
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
There is no corresponding selector. There can be multiple selectors that have a given class name.
How could the parser then know which one to use? This sounds like invalid code.

I mean, maybe you can have the same class name on multiple CSS Stylesheet files, but not on the same, right? And the CSS file is referenced using the <link> element on each HTML file.
thiago.eec is online now   Reply With Quote
Old 01-27-2021, 07:29 AM   #7
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,153
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Code:
p span.moo { color: red }
li span.moo { color: green }
in one stylesheet, now which rule should clicking on moo take you to?

You can even have multiple rules with the exact same selectors

Code:
.moo { font-size: 11pt }
.moo { color: purple }
kovidgoyal is offline   Reply With Quote
Old 01-27-2021, 07:51 AM   #8
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 953
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
Code:
p span.moo { color: red }
li span.moo { color: green }
in one stylesheet, now which rule should clicking on moo take you to?

You can even have multiple rules with the exact same selectors

Code:
.moo { font-size: 11pt }
.moo { color: purple }
I see. Ok, then. I rest my case.
Thanks for explanation.

P.S.: Sigil does recognize the diference between 'p.moo' vs 'li.moo', but choked on 'p span.moo' vs 'li span.moo'
thiago.eec is online now   Reply With Quote
Old 01-27-2021, 12:48 PM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 7,878
Karma: 5449552
Join Date: Nov 2009
Device: many
FWIW, Yes that feature in Sigil was designed to just handle element.class and .class selectors and not combinators and to take you to the first definition of the class if found in a linked stylesheet. The user would have to search the stylesheet for other places that class is defined or used. But that is typically easy to do once the Stylesheet tab is opened especially when only a single stylesheet is linked.

It is not a full query done by selector. It was designed to help in the majority of user cases that involve simple selectors and not meant for use with more advanced combinator or pseudoclass selectors.

The Preview Inspector can be used to determine the exact selectors used.

IMHO, the designers of CSS have completely forgotten the KISS engineering principle (and I could say the same for the epub3 spec, the html5 spec, etc!).

Simple combinations of elements and classees can handle almost all cases especially when class attributes can be easily added to the epub xhtml source by the epub developer unlike when iframes and injected ad blocks are used where classes can not be easily added and therefore combinators must be used to handle things.

FWIW, Sigil has just added its own version of gumbo query and fixed a number of bugs to help it determine if even complex css selectors apply to a specific node. So improvements for this feature in Sigil are coming but as Kovid said, there is no way to handle all cases.
KevinH is offline   Reply With Quote
Old 01-27-2021, 01:03 PM   #10
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 953
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Thanks for the input, Kevin.

I think that handling most of the cases is a great goal. It helps a lot when editing the book.
thiago.eec is online now   Reply With Quote
Old 01-29-2021, 07:36 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,297
Karma: 12126329
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by kovidgoyal View Post
Code:
p span.moo { color: red }
li span.moo { color: green }
in one stylesheet, now which rule should clicking on moo take you to?

You can even have multiple rules with the exact same selectors

Code:
.moo { font-size: 11pt }
.moo { color: purple }
Doesn't Tools > Reports > Style Classes already do something similar?

You're able to double-click and jump to the class's location in the CSS.

(Plus jumping to the very first instance would work for the vast majority of cases, like KevinH said.)

I find the Right-Click > "Go to Link or Style" in Sigil to be absolutely fantastic, and it's one of my most-used features to easily hop around/parse books on opening. (Especially when dealing with calibre### classes.)

Quote:
Originally Posted by KevinH View Post
FWIW, Sigil has just added its own version of gumbo query and fixed a number of bugs to help it determine if even complex css selectors apply to a specific node. So improvements for this feature in Sigil are coming but as Kovid said, there is no way to handle all cases.
Absolutely fantastic work, Kevin!

Last edited by Tex2002ans; 01-29-2021 at 07:41 PM.
Tex2002ans is offline   Reply With Quote
Old 01-29-2021, 08:41 PM   #12
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 75,114
Karma: 131686272
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by thiago.eec View Post
Hi, Kovid.

Is it possible to add the following feature?

- Ctrl+Click on a CSS class name on Code window leading to the corresponding CSS seletor on the Stylesheet file

Right now, I have to use the Live CSS panel.
I find live CSS works really well. I can see the CSS class and see if I want to edit it. I know there is the preview, but it doesn't always show if the class needs editing.
JSWolf is offline   Reply With Quote
Old 01-29-2021, 08:42 PM   #13
JSWolf
Resident Curmudgeon
JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.JSWolf ought to be getting tired of karma fortunes by now.
 
JSWolf's Avatar
 
Posts: 75,114
Karma: 131686272
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Quote:
Originally Posted by thiago.eec View Post
Hi, Kovid.

Is it possible to add the following feature?

- Ctrl+Click on a CSS class name on Code window leading to the corresponding CSS seletor on the Stylesheet file

Right now, I have to use the Live CSS panel.
If this is added, can it be made as a right click menu item instead? I would find that much easier as I already have my hand on the mouse.
JSWolf is offline   Reply With Quote
Old 01-29-2021, 09:30 PM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,153
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
@Tex2002 The calibre editor has live css which is a much more comprehensive solution to this problem. And no the reports allows you to see how many places a class is used not just jump to one, which may be quite misleading.
kovidgoyal is offline   Reply With Quote
Old 01-30-2021, 12:37 PM   #15
thiago.eec
Guru
thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.thiago.eec ought to be getting tired of karma fortunes by now.
 
Posts: 953
Karma: 1183425
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by JSWolf View Post
I find live CSS works really well. I can see the CSS class and see if I want to edit it. I know there is the preview, but it doesn't always show if the class needs editing.
Live CSS works perfectly, but it is a panel, and takes space. So, in my case, I use it as a tab on the right painel. Most of the time, the selected tab is the Preview.

Quote:
Originally Posted by JSWolf View Post
If this is added, can it be made as a right click menu item instead? I would find that much easier as I already have my hand on the mouse.
That would make it a lot less useful. You would have to click and then navigate to the menu item. That's a two step process. Ctrl+Click is a single step, and a lot faster.
thiago.eec is online now   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Feature Request... Syllius Calibre 2 08-26-2019 08:48 PM
Pseudo classes to be deleted as unused classes Leonatus Sigil 2 09-23-2018 09:12 AM
feature request: ctrl+A in in the "file preview" valida Editor 5 09-13-2017 07:18 AM
[Android App] Calibre Companion - long-click request Perkin Devices 3 09-06-2012 01:18 PM
Feature Request Beak Devices 2 02-20-2011 10:18 AM


All times are GMT -4. The time now is 08:32 AM.


MobileRead.com is a privately owned, operated and funded community.