MobileRead Forums

MobileRead Forums (https://www.mobileread.com/forums/index.php)
-   Sigil (https://www.mobileread.com/forums/forumdisplay.php?f=203)
-   -   I need help! (https://www.mobileread.com/forums/showthread.php?t=338167)

ayranism 03-19-2021 09:38 PM

I need help!
 
Hey, newbie here

So I have been trying to edit this epub on sigil but I'm having trouble with one thing...

So basically I have my "style" setteled down but on each paragraph so that's not a problem but i gotta do this "<p> ... </p>" by hand everytime and if you consider that there is over 5000 paragraphs its quite the hussle to do each one of them by hand



Can I automize this whole process?

theducks 03-20-2021 05:57 AM

It is called a (linked) 'stylesheet'

p{ your style stuff here }


What that says is apply that to ALL 'p' tags

Now this is real basic and you will probably want more, but get OUT of the habit of inline style="blahblah' coding.
You will end up with a nightmare if you want to change, whereas there is ONE place to make a change with a stylesheet.
Take a ebook you like and look at the stylesheet
:bulb:click once on the tag for a paragraph, then right click: Go to link or style.
Sigil will normally take you right there

DiapDealer 03-20-2021 07:09 AM

Sigil itself is not really the tool to help you take plain text and turn it into html (though there might be some plugins to help in that regard). Sigil is most commonly used to take html exported from another source and use it to create an epub (though I understand some have some success pasting small amounts of rich text into Sigil's Code View). But if I understand you correctly, Sigil's not really the right tool to help you wrap 5000 paragraphs of plain text with individual p tags.

Doitsu 03-20-2021 09:27 AM

Quote:

Originally Posted by ayranism (Post 4104304)
but i gotta do this "<p> ... </p>" by hand everytime and if you consider that there is over 5000 paragraphs its quite the hussle to do each one of them by hand

You can convert your txt files with Calibre to epub files. You might have to experiment with the conversion settings, though.

BTW, Calibre will automatically convert:

Spoiler:
Code:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula.

Donec tellus augue, tempus sed facilisis sed, fringilla quis leo. Mauris vulputate, leo ac facilisis vulputate, enim orci interdum augue, in blandit quam turpis quis dui. Morbi dictum luctus velit nec faucibus. Cras vitae tortor purus, ut tincidunt mauris. Sed at velit nisl.

Donec eu mauris tortor, interdum condimentum erat. Nam egestas turpis eget nibh laoreet pharetra. Suspendisse a sem eros, ut pulvinar enim. In sed elit eu nulla accumsan tincidunt eget sit amet ipsum. Nullam ut massa rutrum dolor placerat tempor accumsan eget purus.



to:

Spoiler:
Code:

  <p class="calibre1">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla ac tellus nunc. Phasellus imperdiet leo metus, et gravida lacus. Donec metus ligula, elementum at pellentesque pellentesque, suscipit ac nunc. Etiam lobortis, massa ac aliquam auctor, augue nisl sagittis urna, at dapibus tellus erat ullamcorper ligula.</p>

  <p class="softbreak"></p>

  <p class="calibre1">Donec tellus augue, tempus sed facilisis sed, fringilla quis leo. Mauris vulputate, leo ac facilisis vulputate, enim orci interdum augue, in blandit quam turpis quis dui. Morbi dictum luctus velit nec faucibus. Cras vitae tortor purus, ut tincidunt mauris. Sed at velit nisl.</p>

  <p class="softbreak"></p>

  <p class="calibre1">Donec eu mauris tortor, interdum condimentum erat. Nam egestas turpis eget nibh laoreet pharetra. Suspendisse a sem eros, ut pulvinar enim. In sed elit eu nulla accumsan tincidunt eget sit amet ipsum. Nullam ut massa rutrum dolor placerat tempor accumsan eget purus.</p>



(To customize the epub output select, Preferences > Input options > TXT input.)

KevinH 03-20-2021 03:37 PM

On import of text files, Sigil will use double newlines to mark paragraph boundaries and wrap them in p tags when imported.

odamizu 03-21-2021 12:38 AM

I feel like I may be totally misunderstanding things here, but just in case this is useful ...

Quote:

Originally Posted by ayranism (Post 4104304)
... but i gotta do this "<p> ... </p>" by hand everytime and if you consider that there is over 5000 paragraphs its quite the hussle to do each one of them by hand

Doitsu's nifty MarkdownImport plugin will import plain text files with or without markdown and wrap <p> tags around each paragraph.

(Again, I may be misunderstanding the goal here since Doitsu recommended Calibre instead of mentioning his plugin :chinscratch:)

Quote:

Originally Posted by KevinH (Post 4104571)
On import of text files, Sigil will use double newlines to mark paragraph boundaries and wrap them in p tags when imported.

I'm sure I'm doing or thinking something stupid, but when I use Add Existing to import a text file, I don't get any p tags ... :blink:

BeckyEbook 03-21-2021 05:50 AM

Quote:

Originally Posted by odamizu (Post 4104710)
I'm sure I'm doing or thinking something stupid, but when I use Add Existing to import a text file, I don't get any p tags ... :blink:

Use File>Open directly :)
Remember about the spacing between paragraphs in the text file.

odamizu 03-21-2021 01:39 PM

Quote:

Originally Posted by BeckyEbook (Post 4104740)
Use File>Open directly :)

Ha! I knew I was doing something wrong. This is so cool (and very useful)! Thanks!


All times are GMT -4. The time now is 09:25 PM.

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