Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 02-02-2013, 02:51 PM   #1
packer_backer
Junior Member
packer_backer began at the beginning.
 
Posts: 1
Karma: 10
Join Date: Feb 2013
Device: Kindle
Looking for or requesting a Feature: custom "section" code

Hi,

I've been using Sigil for a few months now, restoring public domain books and making them available on Amazon. Its worked out very well for me. Thank you for creating and maintaining it.

I'd like to suggest (or, if it already exists, know how to find) a feature.

There are certain pieces of code that I always add to each "section" file (usually CSS-related). Is there a way that Sigil could utilize a user-defined xhtml file automatically when creating a new "Section"?

For example, right now, any new "section" added to a EPUB book contains this code:
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
</head>

<body>
  <p>&nbsp;</p>
</body>
</html>
I would find it helpful if I could, somehow, tell Sigil to create every new "section" with:
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <p class="ChapterTitle"> Insert Chapter Title</p>

</body>
</html>
Obviously, this is a very minor change to the code, but thee may be people that have significantly greater amounts of changes they like to make to their books.

Is this possible?
packer_backer is offline   Reply With Quote
Old 02-02-2013, 03:36 PM   #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: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Quote:
Originally Posted by packer_backer View Post
Hi,

I've been using Sigil for a few months now, restoring public domain books and making them available on Amazon. Its worked out very well for me. Thank you for creating and maintaining it.

I'd like to suggest (or, if it already exists, know how to find) a feature.

There are certain pieces of code that I always add to each "section" file (usually CSS-related). Is there a way that Sigil could utilize a user-defined xhtml file automatically when creating a new "Section"?

For example, right now, any new "section" added to a EPUB book contains this code:
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
</head>

<body>
  <p>&nbsp;</p>
</body>
</html>
I would find it helpful if I could, somehow, tell Sigil to create every new "section" with:
Code:
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
  "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title></title>
  <link href="../Styles/stylesheet.css" rel="stylesheet" type="text/css" />
</head>

<body>
  <p class="ChapterTitle"> Insert Chapter Title</p>

</body>
</html>
Obviously, this is a very minor change to the code, but thee may be people that have significantly greater amounts of changes they like to make to their books.

Is this possible?
Use the Clipboard tool to save (and later past your custom boilerplate(s))
theducks is offline   Reply With Quote
Advert
Old 02-02-2013, 08:35 PM   #3
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,069
Karma: 18727053
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
What I have done is create a default epub document the way I want it; default cover/title/acknowledgements/css/opf etc and saved that as "default.epub". You could have your code in the chapter page.

When you want to start a new book, simply open the "default.epub" file and "SaveAs" to a different name. Then when you want to start work on a new chapter page, just right click on your preformed page and select "Add Copy".

Hope that helps!

Cheers,
Turtle91 is offline   Reply With Quote
Old 02-03-2013, 04:01 AM   #4
meme
Sigil developer
meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.meme ought to be getting tired of karma fortunes by now.
 
Posts: 1,275
Karma: 1101600
Join Date: Jan 2011
Location: UK
Device: Kindle PW, K4 NT, K3, Kobo Touch
Quote:
Originally Posted by theducks View Post
Use the Clipboard tool to save (and later past your custom boilerplate(s))
Since the names are similar its actually Clips that you want to use (under Tools->Clip Editor). The Clipboard History under Edit->Paste From Clipboard History is only meant for temporary saves and pastes.

Either of the ways mentioned by theducks or turtle91 work fine. Create a clip with all the text, so when you add a blank page just select it all and paste the clip. Or create your template file, and right click on it and select Add Copy.
meme is offline   Reply With Quote
Old 02-03-2013, 09:51 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: 29,689
Karma: 54369090
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, K4NT(Fixed: New Bat.), Galaxy Tab A
Another way:


Split

Yes, Split the page(near the bottom.even if no words are past the split point). All the boilerplate code is copied
theducks is offline   Reply With Quote
Advert
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Try to remove : This item was downloaded by caliber from .... and "Section Menu", "Ma poulardalber Recipes 4 08-21-2012 05:23 AM
Custom TextToSpeech "engine" as a way to create custom real audiobooks with texts noisy Kindle Developer's Corner 2 03-31-2012 08:42 AM
Custom column: "Updated date", when adding new "versions" of the same file? enriquep Library Management 16 11-03-2011 10:46 AM
Feature Request: configurable space setting for "Insert blank line" in "Look & Feel" therealjoeblow Calibre 15 07-25-2011 03:14 PM
Synchronising "Book" and "Code" views HarryT Sigil 2 08-11-2009 07:07 AM


All times are GMT -4. The time now is 06:51 PM.


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