MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   Programming for automatic bolding? (https://www.mobileread.com/forums/showthread.php?t=342240)

2scre 10-10-2021 04:13 PM

Programming for automatic bolding?
 
1. once you highlight (select) a text, bold the highlighted text without having to press CMD B (if you can't do this within Sigil, can you do it with your computer system? For example run program: automatically applies bolding to everything that you highlight.)

2. once you highlight (select) a text, highlight the text with a certain background color

I'm using 0.9.14

DNSB 10-10-2021 05:12 PM

1. AFAIK, you can't do that. Not to mention what if I want to convert case or italicize or etc.?

And you might want to update to a current version of Sigil. 0.9.1.4 is an old version and includes the glitchy Book View that could rather often generate incorrect or downright illegal code.

DiapDealer 10-10-2021 05:19 PM

2) Text background color is always set using the epub's css/xhtml. And is never a good idea since that text could be rendered unreadable by user preferences.

Also, Sigil 0.9.14 is fairly old. We can't fix any bugs you may find in it.

Binchen 10-11-2021 01:13 PM

Quote:

Originally Posted by 2scre (Post 4161510)
1. once you highlight (select) a text, bold the highlighted text without having to press CMD B

This is a good idea, but I don't want the text to be bold, but in flashing purple.

Tex2002ans 10-12-2021 12:30 AM

Quote:

Originally Posted by Binchen (Post 4161741)
This is a good idea, but I don't want the text to be bold, but in flashing purple.

You should learn about Clips then.

1. Press Tools > Clip Editor (Ctrl+Alt+C).

2. Create a new Clip by pressing the "Add Entry" button:

Name: Highlight
Text: <span class="highlight">\1</span>

then press the "Save" button.

3. In Sigil's main window, View > Clips lets you see a list of all your clips.

4. Now, when you highlight text like the word "example" in this sentence:

Code:

<p>This is an example sentence.</p>
then press your "Highlight" Clip, this will happen:

Code:

<p>This is an <span class="highlight">example</span> sentence.</p>
5. Clips can also be controlled by shortcuts.

If you go into Edit > Preferences > Keyboard Shortcuts, you can assign shortcut keys for Clip 1 -> Clip 20.

By default, Clip 1 = Ctrl+Alt+1

This would allow you to highlight your text, then instead of pressing Ctrl+B (to bold), you instead press Ctrl+Alt+1 (to highlight).

(You can now change each clip's shortcut to whatever you want.)

Binchen 10-12-2021 02:51 AM

But the text is still not displayed in flashing purple.

Turtle91 10-12-2021 10:57 AM

Tex - I’m pretty sure Binchen was being sarcastic - he knows you would have to attach the appropriate CSS file :)

In any case, the OP wanted it automatically - pushing CTRL-B was too much work. I would have recommended setting the keyboard shortcut to CTRL-SPC… that way it’s easier to find the space bar and you don’t need to lift your finger as high on the keyboard:rofl:

hobnail 10-12-2021 01:44 PM

Can you make text flash without javascript? If so, dern, and all this time I've been mooning about the removed blink tag.

Tex2002ans 10-12-2021 03:14 PM

Quote:

Originally Posted by Turtle91 (Post 4161967)
Tex - I’m pretty sure Binchen was being sarcastic - he knows you would have to attach the appropriate CSS file :)

Quoted the wrong person. Meant to do original poster, but the mini Clips tutorial still applies. :)

Quote:

Originally Posted by hobnail (Post 4161996)
Can you make text flash without javascript? If so, dern, and all this time I've been mooning about the removed blink tag.

Yes. You could use CSS3 Animations.

See:

You'd be able to animate visibility or opacity.

Is blinking text a good idea in ebooks though? Definitely not.

Binchen 10-12-2021 03:23 PM

Quote:

Originally Posted by Turtle91 (Post 4161967)
Tex - I’m pretty sure Binchen was being sarcastic - he knows you would have to attach the appropriate CSS file :)

s/ he / she /

Quote:

Originally Posted by Tex2002ans (Post 4162011)

Is blinking text a good idea in ebooks though? Definitely not.

Which reader supports CSS3? :chinscratch:

DiapDealer 10-12-2021 03:26 PM

Quite a few epub3 readers support the CSS3 required by epub spec.

Binchen 10-12-2021 03:31 PM

"Quite a few" is not a valid answer to "which".

Turtle91 10-12-2021 04:10 PM

Quote:

Originally Posted by Binchen (Post 4162013)
s/ he / she /

Are you identifying your preferred pronouns?!?! In that case I’m still confused…lol

Should I have said “she”… if so, I humbly apologize!

Tex2002ans 10-12-2021 04:14 PM

Quote:

Originally Posted by Binchen (Post 4162013)
Which reader supports CSS3? :chinscratch:

Pretty much any one that follows the EPUB3 standards quite well:
  • Kobo (mobile/device)
  • PocketBook (mobile/device)
  • Gitden Reader (Android)
  • Thorium Reader (PC)
  • [...]

No idea if they'd support blinking animations though, never tested it.

DiapDealer 10-12-2021 05:31 PM

Quote:

Originally Posted by Binchen (Post 4162016)
"Quite a few" is not a valid answer to "which".

I'm tired of whatever this weird game is. Feel free to declare yourself the winner.


All times are GMT -4. The time now is 08:07 PM.

Powered by: vBulletin
Copyright ©2000 - 3.8.5, Jelsoft Enterprises Ltd.
MobileRead.com is a privately owned, operated and funded community.