Quote:
Originally Posted by Blood Black
I am struggling to produce clean html and css from Apple Pages.
My documents are (to me) very simple and structured. Essentially novel-like texts, 'correctly' formatted. Nothing fancy. I am trying to end up with ePub files with clean HTML and stylesheets.
|
From what I've gathered over the years, Pages's HTML output is a mess.
Side Note: We recently brought this up on a tangent in this InDesign thread:
https://www.mobileread.com/forums/sh...58#post4119758
Complaining about
atrocious InDesign/GoogleDocs/Pages code.
Quote:
Originally Posted by Blood Black
My only misbehaviour is that I explicitly identify first paragraphs. I want only my named paragraph and character styles in the output.
|
And you're sure you're using Styles properly?
If you export to HTML (or EPUB) from Pages, what does the actual HTML look like?
So let's say you apply your "first" Style. Clean HTML would look like this:
Code:
<h2>Chapter 1</h2>
<p class="first">On a cold and stormy night...</p>
What does your Apple Pages HTML look like?
Quote:
Originally Posted by Blood Black
Exporting directly to ePub (from Pages or LibreOffice) ends up messy. Exporting to Word (docx) and then using Calibre also ends up with very messy files.
|
There was a heck of a lot of great discussion about Styles + DOCX conversion + tools in:
2020: "eBook Formatting in Sigil"
Sounds like you're on a Mac though, so some of the really clean output tools are out of your reach (Windows only).
* * *
I'm not sure what your LibreOffice DOCX problems are... could be when LibreOffice imports your Pages document, it carries over all the Pages cruft, which then makes its way into your Calibre conversion.
Quote:
Originally Posted by Blood Black
And I would prefer the generated stylesheets to not have formatting information—just a list of the named or used paragraph and character/span styles.
It is possible (even likely) I am using the wrong tools for this.
|
Sounds like Mammoth
may work for you, but that's a much more advanced Python commandline tool.
For a little bit more Mammoth ease-of-use, there's
DiapDealer's "DOCXImport" (Sigil plugin)... but again, it's a very advanced method of conversion.
IF you use Styles properly/consistently though, that could be what you need.
But... a lot of this depends on the actual Pages code. (Which I must admit, I haven't personally seen yet, only heard through the grapevine.)