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 08-07-2024, 09:29 AM   #1
thiago.eec
Wizard
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: 1,098
Karma: 1261763
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Indent blocks of code

Hi, everyone.

Is there any way to indent blocks of code? I can use tab to increase the indent of a single element, but that seems to be it.

It would be nice if the Editor could handle multiple elements, like PyCharm and other IDEs. In PyCharm, you can select multiple elements (e.g.: a bunch of <p>s) and hit tab, so they all move forward. You can also use shift+tab to move backwards.

@Kovid, do you think is could be possible? Or maybe there are already shortcuts that I'm not aware of.
thiago.eec is offline   Reply With Quote
Old 08-07-2024, 10:19 AM   #2
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,506
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Beautify? (the flower icon) 1) on the current tab, applies to that Tab. 2) on the main menubar, all Text files
theducks is offline   Reply With Quote
Old 08-07-2024, 10:33 AM   #3
thiago.eec
Wizard
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: 1,098
Karma: 1261763
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by theducks View Post
Beautify? (the flower icon) 1) on the current tab, applies to that Tab. 2) on the main menubar, all Text files
Beautify is an automated process, with good results most of the time, but not always*. Sometimes we need to edit the file manually.

In that case, it would be really useful to be able to speed the process, working with blocks, instead of individual elements.

* Here is an example where beautify doesn't work:
Spoiler:
Code:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" lang="pt-BR" xml:lang="pt-BR">
  <head>
    <title>Teoria da argumentação jurídica</title>
    <link rel="stylesheet" href="../Styles/style0002.css" type="text/css"/>
  </head>
  <body style="font-family:'times new roman',serif;">
    <nav role="doc-toc" epub:type="toc" id="toc">
 <h1 class="sumario">Sumário</h1> 
    <p class="texto-sumario-1"><a href="part0005.xhtml"><strong>Introdução: a crítica de Gulliver</strong></a></p> <p class="texto-sumario-1"><a href="part0006.xhtml">1. Argumentação: noções básicas</a></p>
 <p class="texto-sumario-3"><a href="part0006.xhtml#sigil_toc_id_1">1.1 O que é argumentar?</a></p>
 <p class="texto-sumario-3"><a href="part0006.xhtml#sigil_toc_id_2">1.2 Padronização de argumentos</a></p>
 <p class="texto-sumario-3"><a href="part0006.xhtml#sigil_toc_id_3">1.3 Argumentos complexos</a></p>
 <p class="texto-sumario-3"><a href="part0006.xhtml#sigil_toc_id_4">1.4 Justificação externa e justificação interna</a></p>
 <p class="texto-sumario-3"><a href="part0006.xhtml#sigil_toc_id_5">1.5 Resumo</a></p>
  <p class="texto-sumario-2"><a href="part0007.xhtml"><strong>2. Argumentação prática</strong></a></p>
 <p class="texto-sumario-3"><a href="part0007.xhtml#sigil_toc_id_6">2.1 Argumentação teórica e argumentação prática</a></p>
 <p class="texto-sumario-3"><a href="part0007.xhtml#sigil_toc_id_7">2.2 Argumentação institucional e argumentação substantiva</a></p>
 <p class="texto-sumario-3"><a href="part0007.xhtml#sigil_toc_id_8">2.3 Conclusão</a></p>
 <p class="texto-sumario-3"><a href="part0007.xhtml#sigil_toc_id_9">2.4 Resumo</a></p>
 <p class="texto-sumario-2"><a href="part0008.xhtml">3. Fontes do direito</a></p>
 <p class="texto-sumario-3"><a href="part0008.xhtml#sigil_toc_id_10">3.1 Fontes formais e materiais</a></p>
 <p class="texto-sumario-3"><a href="part0008.xhtml#sigil_toc_id_11">3.2 Fontes obrigatórias e opcionais</a></p>
 <p class="texto-sumario-3"><a href="part0008.xhtml#sigil_toc_id_12">3.3 Acúmulo de fontes</a></p>
 <p class="texto-sumario-3"><a href="part0008.xhtml#sigil_toc_id_13">3.4 Resumo</a></p>
<p class="texto-sumario-2"><a href="part0009.xhtml">4. Métodos de interpretação jurídica</a></p>
 <p class="texto-sumario-3"><a href="part0009.xhtml#sigil_toc_id_14">4.1 O que é interpretação</a></p>
 <p class="texto-sumario-3"><a href="part0009.xhtml#sigil_toc_id_15">4.2 Formalismo e não formalismo</a></p>
<p class="texto-sumario-3"><a href="part0009.xhtml#sigil_toc_id_16">4.3 Interação entre os métodos de interpretação</a></p>
<p class="texto-sumario-3"><a href="part0009.xhtml#sigil_toc_id_17">4.4 Interpretação constitucional</a></p>
 <p class="texto-sumario-3"><a href="part0009.xhtml#sigil_toc_id_18">4.5 Resumo</a></p>
 <p class="texto-sumario-2"><a href="part0010.xhtml">5. Integração de lacunas</a></p>
 <p class="texto-sumario-3"><a href="part0010.xhtml#sigil_toc_id_19">5.1 O que são lacunas na lei</a></p>
 <p class="texto-sumario-3"><a href="part0010.xhtml#sigil_toc_id_20">5.2 Princípios</a></p>
 <p class="texto-sumario-3"><a href="part0010.xhtml#sigil_toc_id_21">5.3 Analogias</a></p>
 <p class="texto-sumario-3"><a href="part0010.xhtml#sigil_toc_id_22">5.4 Jurisprudência</a></p>
 <p class="texto-sumario-3"><a href="part0010.xhtml#sigil_toc_id_23">5.5 Costumes</a></p>
 <p class="texto-sumario-3"><a href="part0010.xhtml#sigil_toc_id_24">5.6 Doutrina</a></p>
 <p class="texto-sumario-3"><a href="part0010.xhtml#sigil_toc_id_25">5.7 Resumo</a></p>
 <p class="texto-sumario-2"><a href="part0011.xhtml">6. Argumentação teórica no direito</a></p>
 <p class="texto-sumario-3"><a href="part0011.xhtml#sigil_toc_id_26">6.1 Argumentação institucional e argumentação substantiva</a></p>
 <p class="texto-sumario-3"><a href="part0011.xhtml#sigil_toc_id_27">6.2 Resumo</a></p>
 <p class="texto-sumario-2"><a href="part0012.xhtml">7. Descoberta e justificação</a></p>
 <p class="texto-sumario-3"><a href="part0012.xhtml#sigil_toc_id_28">7.1 Processo de descoberta e processo de justificação</a></p>
 <p class="texto-sumario-3"><a href="part0012.xhtml#sigil_toc_id_29">7.2 Atalhos e vieses</a></p>
 <p class="texto-sumario-3"><a href="part0012.xhtml#sigil_toc_id_30">7.3 Resumo</a></p>
 <p class="texto-sumario-2"><a href="part0013.xhtml">Conclusão: o que dizer a Gulliver?</a></p> 
<p class="texto-sumario-4"><a href="part0014.xhtml">Referências bibliográficas</a></p>
  </nav>
  </body>
</html>
thiago.eec is offline   Reply With Quote
Old 08-07-2024, 10:44 AM   #4
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,653
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
What exactly are you looking for? A shortcut to add one level of indent to all selected lines? Something dependent on tags?
kovidgoyal is offline   Reply With Quote
Old 08-07-2024, 10:45 AM   #5
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 30,506
Karma: 58055868
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Yep! Which is why I use Both Calibre and Sigil editors. IMHO Sigil does the code Pretty better. Calibre Fixes code better.

Each has their strong points. (and, No! I don't want either to be made the same, you might fix what I already like)
theducks is offline   Reply With Quote
Old 08-07-2024, 10:58 AM   #6
thiago.eec
Wizard
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: 1,098
Karma: 1261763
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
What exactly are you looking for? A shortcut to add one level of indent to all selected lines?
Yes! To add/remove one level of indent to all the selected lines. I suggest tab to add and shift+tab to remove.
thiago.eec is offline   Reply With Quote
Old 08-07-2024, 11:10 AM   #7
jjk
Enthusiast
jjk began at the beginning.
 
Posts: 46
Karma: 10
Join Date: Aug 2018
Location: Paris (France)
Device: Kobo Kindle Vivlio-Inkpad3
Quote:
Originally Posted by thiago.eec View Post
Yes! To add/remove one level of indent to all the selected lines. I suggest tab to add and shift+tab to remove.
That would be all good for me too.
And possibly with some width found in Calibre editor options.
jjk is offline   Reply With Quote
Old 08-07-2024, 11:43 AM   #8
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,653
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
OK should be doable, opena bug report so I dont forget.
kovidgoyal is offline   Reply With Quote
Old 08-07-2024, 11:59 AM   #9
thiago.eec
Wizard
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: 1,098
Karma: 1261763
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by kovidgoyal View Post
OK should be doable, opena bug report so I dont forget.
Thanks

https://bugs.launchpad.net/calibre/+bug/2076251
thiago.eec is offline   Reply With Quote
Old 08-07-2024, 12:07 PM   #10
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: 76,956
Karma: 138256890
Join Date: Nov 2006
Location: Roslindale, Massachusetts
Device: Kobo Libra 2, Kobo Aura H2O, PRS-650, PRS-T1, nook STR, PW3
Please make the keystroke for code indent be control-F5-Shift Z. Something we'd never use or hit by accident.
JSWolf is offline   Reply With Quote
Old 08-07-2024, 12:15 PM   #11
thiago.eec
Wizard
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: 1,098
Karma: 1261763
Join Date: Dec 2016
Location: Goiânia - Brazil
Device: iPad, Kindle Paperwhite
Quote:
Originally Posted by JSWolf View Post
Please make the keystroke for code indent be control-F5-Shift Z. Something we'd never use or hit by accident.
Tab is already used to indent. Also, shift+tab does the same. So, there is no conflict with existing shortcuts.

Assigning an overcomplicated shortcut accomplishes nothing.
thiago.eec is offline   Reply With Quote
Old 08-07-2024, 07:06 PM   #12
BetterRed
null operator (he/him)
BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.BetterRed ought to be getting tired of karma fortunes by now.
 
Posts: 21,114
Karma: 27620706
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Why would insert/remove indent not have a user configurable shortcut?

Unless it can be guaranteed they will not clash with any existing shortcuts (within the application in question, the OS, or a WitW program) new features should not have any default shortcuts… IMO.

BR

Last edited by BetterRed; 08-07-2024 at 07:15 PM.
BetterRed is offline   Reply With Quote
Old 08-09-2024, 11:36 AM   #13
mikapanja
Perfectionist
mikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentametermikapanja can solve quadratic equations while standing on his or her head reciting poetry in iambic pentameter
 
Posts: 72
Karma: 12802
Join Date: Apr 2014
Device: none
Quote:
Originally Posted by kovidgoyal View Post
What exactly are you looking for? A shortcut to add one level of indent to all selected lines? Something dependent on tags?
It would be nice to have the second option as well. IMO a much better solution for long files, if there's a need to indent dozens or hundreds of not necessarily adjacent lines.

For instance, "Indent all <p> tags" or even more granular "Indent all <p class="INSERTCLASS"> tags".
mikapanja is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Alignement of blocks Ghitulescu Workshop 18 09-04-2019 01:49 PM
Css code to indent first paragraph? shootist Editor 14 12-30-2015 07:17 AM
conversion blocks the program volopazzo Conversion 6 01-11-2015 09:54 AM
Immutable code blocks crutledge Sigil 1 05-10-2010 08:54 PM
fonts as blocks in calibre waxly Calibre 1 03-24-2010 11:42 PM


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


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