05-18-2023, 07:30 AM | #1 |
Enthusiast
Posts: 46
Karma: 10
Join Date: May 2021
Device: PW 2 3gb
|
Add blank HTML file
Hello -
Is there a way to create a blank HTML file and the default extension be .html instead of .xhtml? Just curious. Also, should I be using the .xhtml instead of .html? What would the difference or benefit be? Thanks, Andy |
05-18-2023, 09:30 AM | #2 |
Sigil Developer
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
|
all epubs require xhtml files not html files. Xhtml files are true xml with case sensitivity and proper closing tag for every opening tag, etc. html code has much fewer restrictions and can omit closing tags such as a closing p tag in many circumstances leaving the code a bit of a spaghetti hash.
Early versions of epub3 required the .xhtml extension, now it is just recommended. Using .html is allowed but not encouraged. No matter what the extension, the contents are xhtml not html so matching the extension to the contents just makes the most sense. Last edited by KevinH; 05-18-2023 at 10:05 AM. |
05-18-2023, 10:18 AM | #3 |
Sigil Developer
Posts: 8,158
Karma: 5450818
Join Date: Nov 2009
Device: many
|
FYI, you can also mass change the file extension used for text files in Sigil at any point to be all .xhtml (or any other extension) using Sigil's BookBrowser
|
05-18-2023, 11:18 AM | #4 |
A Hairy Wizard
Posts: 3,222
Karma: 19000635
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
|
Not sure you were asking this as well, but you can add a blank page by right-clicking on the "Text" folder (or any current page IN the folder) and selecting "Add Blank HTML File" from the contextual pop-up. (see attachment)
As KevinH mentioned, the extension isn't as crucial as the content (xml syntax), don't be thrown off that the pop-up says HTML instead of XHTML. |
05-18-2023, 07:11 PM | #5 | |
Wizard
Posts: 2,304
Karma: 12126963
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Quote:
Like KevinH said, EPUBs require XHTML. What's the difference? Well, HTML is very loose with their rules + XHTML is a little more strict. So HTML would allow code like: Code:
<p>This is a paragraph. <p>This is another paragraph. Code:
<p>This is a paragraph.</p> <p>This is another paragraph.</p> Code:
<P>This is a paragraph.</p> <BLOCKQUOTE><p>This is a blockquote with <SpAn>a span</span>.</p></BLOCKQUOTE> Code:
<p>This is a paragraph.</p> <blockquote><p>This is a blockquote with <span>a span</span>.</p></blockquote> All you need to know is that Sigil's Mend and Prettify will clean up a lot of that junk if you accidentally put it in your documents. :P Last edited by Tex2002ans; 05-18-2023 at 07:26 PM. |
|
05-18-2023, 08:45 PM | #6 |
Enthusiast
Posts: 46
Karma: 10
Join Date: May 2021
Device: PW 2 3gb
|
Appreciate the help! Esp @Tex2002ans
|
Tags |
add blank, blank, html, xhtml |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
JPG image lost when add HTML file to Calibre | mshane | Conversion | 8 | 01-03-2013 07:08 PM |
HTML input plugin stripping text within toc tags in child html file | nimblebooks | Conversion | 3 | 02-21-2012 04:24 PM |
Convert HTML to MOBI (HTML recognized as ZIP file) | pdubois | Conversion | 1 | 01-25-2011 01:55 PM |
Add book as HTML file | Mister_R | Calibre | 5 | 10-19-2010 11:43 AM |
Add a blank page | rodrigo2008 | iRex | 1 | 04-22-2008 02:46 AM |