Thread: Two requests
View Single Post
Old 03-19-2014, 05:39 AM   #12
DoctorOhh
US Navy, Retired
DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.DoctorOhh ought to be getting tired of karma fortunes by now.
 
DoctorOhh's Avatar
 
Posts: 9,897
Karma: 13806776
Join Date: Feb 2009
Location: North Carolina
Device: Icarus Illumina XL HD, Kindle PaperWhite SE 11th Gen
Quote:
Originally Posted by Hoods7070 View Post
and centering a line:
Code:
 <p class="calibre1" style="text-align: center;">The cat sat on the fluffy mat.</p>
Either way you select the text then apply the codes. And an alignment style code goes in the same place every time, so you'd (well, I'd) think implementing that with a button would be straightforward at every level. But then again I am probably being completely obtuse here. If it's just a question of coding semantics, I concede.
I don't believe it is a question of "coding semantics." In your example the align should be added to the calibre1 section of the CSS not in-line. What happens if calibre1 says text-align: left and you place a text-align: center attribute in the same paragraph? Which one rules? Calibre1 could cover half the book... If you select four words in the middle of a paragraph you can't just throw any random span with the align attribute and not take into account the rest of the document.

Without question it could be done with enough analysis in the program, but it is definitely far more complicated then the assumptions in your example.

Again, the challenges this creates from a coding point of view I can't even begin to guess, but it is obviously not the same as bold, italic, strike-thru etc...

This editor is most likely never going to be a what you see is what you get editor. So if you want to change calibre1 to text-align: center, for the foreseeable future you'll have to insert the line into the proper class in the CSS.

Quote:
Originally Posted by Hoods7070 View Post
Maybe Kovid can consider it if and when he's ever bored enough ... does that ever happen??
It happens, one example (from 2009) many folks were wanting a lrf to epub conversion capability. It wasn't at the top of his list, but he had a long layover in an airport and was "bored of fixing bugs" ... the next thing you know the lrf to epub conversion feature was added to calibre.

Last edited by DoctorOhh; 03-19-2014 at 05:46 AM.
DoctorOhh is offline   Reply With Quote