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 01-01-2019, 03:47 PM   #1
Banjo
Enthusiast
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 42
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Can I create a template for the xhtml files?

When writing my book, I create one xhtml file for each chapter. Each chapter has some boilerplate in it such as a formatted date, link to a css stylesheet, a link back to the TOC etc.

I currently have to create all of that stuff in each file after I create the new file. Is there some way I can create a new xhtml file from a template file of my design so that I am not starting from scratch each time?

Thanks,
Banjo
(_)=='=~
Banjo is offline   Reply With Quote
Old 01-01-2019, 04:09 PM   #2
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 674
Karma: 150000
Join Date: Feb 2010
Device: none
I guess if it were me, I'd start with a new epub in sigil, and modify the Section0001.xhtml file to suit, with all the boilerplate you want. Then right click on it in the book browser and chose "save as" and save the file with some generic name like "template.xhtml" in your working directory.

Each time I needed a new file, I would right-click on "Text" in the book browser and choose "add existing files" and pick the "template.xhtml" from wherever I'd saved it. Then rename it something appropriate, like "Chapter002.xhtml, and go from there.

HTH
Albert
st_albert is offline   Reply With Quote
Advert
Old 01-01-2019, 06:59 PM   #3
BetterRed
null operator
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: 13,075
Karma: 10793334
Join Date: Mar 2012
Location: Sydney Australia
Device: none
See also ==>> Sigil default templates

BR
BetterRed is offline   Reply With Quote
Old 01-01-2019, 07:52 PM   #4
Banjo
Enthusiast
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 42
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Thank you for the suggestion. My concern with it is that after I import a template file and rename it, the actual template file will be renamed. Is that the way it works? If it leaves the original file unchanged then that could work.

WRT the book templates, I can do that with a template eBook that I open and then SaveAs under a different file name. I need a SaveAs for the chapter files instead of a Rename.

I suppose I could keep a template file in the directory and make a copy of it outside of Sigil, then import the copy into Sigil. That could work.

Thanks for the ideas.
Banjo
(_)=='=~
Banjo is offline   Reply With Quote
Old 01-02-2019, 10:54 AM   #5
st_albert
Guru
st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'st_albert gives new meaning to the word 'superlative.'
 
Posts: 674
Karma: 150000
Join Date: Feb 2010
Device: none
Quote:
Originally Posted by Banjo View Post
Thank you for the suggestion. My concern with it is that after I import a template file and rename it, the actual template file will be renamed. Is that the way it works? If it leaves the original file unchanged then that could work.
Yes, it basically copies the file into the ebook. If you rename it in sigil, you are renaming that copy. Every time you need a new chapter, just re-insert the template.
st_albert is offline   Reply With Quote
Advert
Old 01-02-2019, 11:18 AM   #6
Banjo
Enthusiast
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 42
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Thanks. That works fine for me.
Banjo is offline   Reply With Quote
Old 01-02-2019, 01:14 PM   #7
Doitsu
Wizard
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 4,522
Karma: 14554225
Join Date: Dec 2010
Device: Kindle PW2
Quote:
Originally Posted by Banjo View Post
When writing my book, I create one xhtml file for each chapter. Each chapter has some boilerplate in it such as a formatted date, link to a css stylesheet, a link back to the TOC etc.
I've created a very simple template plugin that you might find helpful.
Doitsu is offline   Reply With Quote
Old 01-02-2019, 03:53 PM   #8
Banjo
Enthusiast
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 42
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
Quote:
Originally Posted by Doitsu View Post
I've created a very simple template plugin that you might find helpful.
Thanks. I will go take a look at it.
Banjo is offline   Reply With Quote
Old 01-02-2019, 04:21 PM   #9
BetterRed
null operator
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: 13,075
Karma: 10793334
Join Date: Mar 2012
Location: Sydney Australia
Device: none
Quote:
Originally Posted by Doitsu View Post
I've created a very simple template plugin that you might find helpful.
That's what I was looking for. I couldn't find it in the Plugins Index, so I assumed I was imagining its existence

BR
BetterRed is offline   Reply With Quote
Old 01-02-2019, 07:37 PM   #10
Banjo
Enthusiast
Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!Banjo , Klaatu Barada Niktu!
 
Banjo's Avatar
 
Posts: 42
Karma: 5276
Join Date: Feb 2013
Device: Asus Zen Pad
I tried it. That's pretty cool. It isn't what I was looking for this time, but it might be useful next time I start a new book.
Banjo is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Some files.html & toc.xhtml (also Cover.xhtml) chaot Workshop 23 02-13-2017 12:20 PM
How to create a send to device template that works Pouget Library Management 6 11-26-2014 11:16 AM
How would one create an identifier template? Sidetrack Library Management 0 06-06-2014 01:38 AM
Create a template to only list one author. PMGeuze Calibre 2 12-04-2013 02:53 PM
mkepub tool to create epub from xhtml sethportman ePub 0 02-03-2012 08:59 AM


All times are GMT -4. The time now is 12:36 AM.


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