emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* ePub construction
@ 2011-12-13 22:45 Alan L Tyree
  2011-12-14  1:42 ` Nick Dokos
  2011-12-14 23:24 ` suvayu ali
  0 siblings, 2 replies; 7+ messages in thread
From: Alan L Tyree @ 2011-12-13 22:45 UTC (permalink / raw)
  To: emacs-orgmode

G'day,

Here are the modifications that I needed to make to the exported html 
file (using the standard exporter) in order to get a valid ePub 
document. http://threepress.org/document/epub-validate provides an 
on-line validation service.

My document is relatively simple, but does have footnotes, citations 
and formatting commands.

I will be happy to add a fuller description to worg if someone will 
point me to some instructions.


1. Make the html file have utf-8 encoding; there are probably several 
ways to do this, but I used the emacs23 menu MULE options on the org 
document.

2 Change the language statement by removing the "lang=" attribute:

From: <html xmlns="http://www.w3.org/1999/xhtml" lang="en" 
xml:lang="en">

To: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">

3 Change anchor descriptions associated with section headings by
   removing "name=" entries, for example,

From: <a name="sec-1" id="sec-1"></a>

To: <a id="sec-1"></a>

NOTE: this can now be done by customising org-export-html-headline-
anchor-format (Thanks Bastien!!)

4. Change anchor class="footref" by replacing "name=" with "id=". For
   example:

from: <a class="footref" name="fnr.2" href="#fn.2">

to: <a class="footref" id="fnr.2" href="#fn.2">

5. Change anchor class="footnum" by replacing "name=" with "id=". For
   example:

from: <a class="footnum" name="fn.1" href="#fnr.1">1</a>

to: <a class="footnum" id="fn.1" href="#fnr.1">1</a>

Cheers,
Alan


-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206		sip:172385@iptel.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ePub construction
  2011-12-13 22:45 ePub construction Alan L Tyree
@ 2011-12-14  1:42 ` Nick Dokos
  2011-12-14  3:14   ` Alan L Tyree
  2011-12-14 23:24 ` suvayu ali
  1 sibling, 1 reply; 7+ messages in thread
From: Nick Dokos @ 2011-12-14  1:42 UTC (permalink / raw)
  To: Alan L Tyree; +Cc: nicholas.dokos, emacs-orgmode

Alan L Tyree <alantyree@gmail.com> wrote:

> G'day,
> 
> Here are the modifications that I needed to make to the exported html 
> file (using the standard exporter) in order to get a valid ePub 
> document. http://threepress.org/document/epub-validate provides an 
> on-line validation service.
> 
> My document is relatively simple, but does have footnotes, citations 
> and formatting commands.
> 
> I will be happy to add a fuller description to worg if someone will 
> point me to some instructions.
> 
> 
> 1. Make the html file have utf-8 encoding; there are probably several 
> ways to do this, but I used the emacs23 menu MULE options on the org 
> document.
> 
> 2 Change the language statement by removing the "lang=" attribute:
> 
> From: <html xmlns="http://www.w3.org/1999/xhtml" lang="en" 
> xml:lang="en">
> 
> To: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> 
> 3 Change anchor descriptions associated with section headings by
>    removing "name=" entries, for example,
> 
> From: <a name="sec-1" id="sec-1"></a>
> 
> To: <a id="sec-1"></a>
> 
> NOTE: this can now be done by customising org-export-html-headline-
> anchor-format (Thanks Bastien!!)
> 
> 4. Change anchor class="footref" by replacing "name=" with "id=". For
>    example:
> 
> from: <a class="footref" name="fnr.2" href="#fn.2">
> 
> to: <a class="footref" id="fnr.2" href="#fn.2">
> 
> 5. Change anchor class="footnum" by replacing "name=" with "id=". For
>    example:
> 
> from: <a class="footnum" name="fn.1" href="#fnr.1">1</a>
> 
> to: <a class="footnum" id="fn.1" href="#fnr.1">1</a>
> 

Interesting - I downloaded the epub validator, ran Calibre on a silly
little org-produced HTML file and duplicated your "lang" problem.

AFAICT, all of the problems you mention above are legal HTML4, so either
the epub spec (which I have not looked at: do you have a pointer?) is
made to trip people up by enforcing restrictions that they dreamed up,
or the validator is not quite as smart as it should be.

Just for kicks, I ran it against the Calibre Quick Start Guide (the only
"real" ebook I had access to) and it gave me an error :-)

,----
| Epubcheck Version 3.0b3
| 
| ERROR: Calibre Quick Start Guide - John Schember.epub/OEBPS/content.opf(5,57): attribute "file-as" not allowed here; expected attribute "id", "opf:file-as", "opf:role" or "xml:lang"
| 
| Check finished with warnings or errors!
`----

so, presuming that the ebook is "fine", I'm not sure how seriously to
take the validator.

Nick

PS In case it's not obvious, all I know about ebooks is what is
   contained in this email. Caveat emptor.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ePub construction
  2011-12-14  1:42 ` Nick Dokos
@ 2011-12-14  3:14   ` Alan L Tyree
  2011-12-14  8:53     ` Olaf Dietsche
  0 siblings, 1 reply; 7+ messages in thread
From: Alan L Tyree @ 2011-12-14  3:14 UTC (permalink / raw)
  To: nicholas.dokos; +Cc: emacs-orgmode

On 14/12/11 12:42:38, Nick Dokos wrote:
> Alan L Tyree <alantyree@gmail.com> wrote:
> 
> > G'day,
> > 
> > Here are the modifications that I needed to make to the exported
> html 
> > file (using the standard exporter) in order to get a valid ePub 
> > document. http://threepress.org/document/epub-validate provides an 
> > on-line validation service.
> > 
> > My document is relatively simple, but does have footnotes, 
> citations
> 
> > and formatting commands.
> > 
> > I will be happy to add a fuller description to worg if someone will 
> > point me to some instructions.
> > 
> > 
> > 1. Make the html file have utf-8 encoding; there are probably
> several 
> > ways to do this, but I used the emacs23 menu MULE options on the 
> org
> 
> > document.
> > 
> > 2 Change the language statement by removing the "lang=" attribute:
> > 
> > From: <html xmlns="http://www.w3.org/1999/xhtml" lang="en" 
> > xml:lang="en">
> > 
> > To: <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
> > 
> > 3 Change anchor descriptions associated with section headings by
> >    removing "name=" entries, for example,
> > 
> > From: <a name="sec-1" id="sec-1"></a>
> > 
> > To: <a id="sec-1"></a>
> > 
> > NOTE: this can now be done by customising org-export-html-headline-
> > anchor-format (Thanks Bastien!!)
> > 
> > 4. Change anchor class="footref" by replacing "name=" with "id=".
> For
> >    example:
> > 
> > from: <a class="footref" name="fnr.2" href="#fn.2">
> > 
> > to: <a class="footref" id="fnr.2" href="#fn.2">
> > 
> > 5. Change anchor class="footnum" by replacing "name=" with "id=".
> For
> >    example:
> > 
> > from: <a class="footnum" name="fn.1" href="#fnr.1">1</a>
> > 
> > to: <a class="footnum" id="fn.1" href="#fnr.1">1</a>
> > 
> 
> Interesting - I downloaded the epub validator, ran Calibre on a silly
> little org-produced HTML file and duplicated your "lang" problem.
> 
> AFAICT, all of the problems you mention above are legal HTML4, so
> either
> the epub spec (which I have not looked at: do you have a pointer?) is
> made to trip people up by enforcing restrictions that they dreamed 
> up,
> or the validator is not quite as smart as it should be.

Yes, the org export file validates at w3c as a valid XHTML1.0 file. The 
ePub spec is here: http://idpf.org/epub but I admit fatigue in trying 
to wade through it, so I don't know what XHTML1.0 constructions it 
objects to. It seems like the kind of document that nobody has ever 
read: sort of like EULAs and express warranties.

I just made the changes in response to the validation errors.

> 
> Just for kicks, I ran it against the Calibre Quick Start Guide (the
> only
> "real" ebook I had access to) and it gave me an error :-)
> 
> ,----
> | Epubcheck Version 3.0b3
> | 
> | ERROR: Calibre Quick Start Guide - John
> Schember.epub/OEBPS/content.opf(5,57): attribute "file-as" not 
> allowed
> here; expected attribute "id", "opf:file-as", "opf:role" or 
> "xml:lang"
> | 
> | Check finished with warnings or errors!
> `----
> 
> so, presuming that the ebook is "fine", I'm not sure how seriously to
> take the validator.

There is something to that. Calibre explicitly disclaims any intent to 
produce an epub file that validates. In fact, the FAQ seems to suggest 
that a Calibre produced file is *better* than one that validates:

http://manual.calibre-ebook.com/faq.html#the-epub-i-produced-with-app-is-not-valid

The problem is that some marketing sites require validation, although I 
am not sure how much that is enforced.


> 
> Nick
> 
> PS In case it's not obvious, all I know about ebooks is what is
>    contained in this email. Caveat emptor.

Ahhh, what about statutory warranties :-).

Cheers,
Alan

> 



-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ePub construction
  2011-12-14  3:14   ` Alan L Tyree
@ 2011-12-14  8:53     ` Olaf Dietsche
  2011-12-14 13:58       ` Nick Dokos
  0 siblings, 1 reply; 7+ messages in thread
From: Olaf Dietsche @ 2011-12-14  8:53 UTC (permalink / raw)
  To: Alan L Tyree; +Cc: nicholas.dokos, emacs-orgmode

Alan L Tyree <alantyree@gmail.com> writes:

> On 14/12/11 12:42:38, Nick Dokos wrote:
>> 
>> Interesting - I downloaded the epub validator, ran Calibre on a silly
>> little org-produced HTML file and duplicated your "lang" problem.
>> 
>> AFAICT, all of the problems you mention above are legal HTML4, so
>> either
>> the epub spec (which I have not looked at: do you have a pointer?) is
>> made to trip people up by enforcing restrictions that they dreamed 
>> up,
>> or the validator is not quite as smart as it should be.
>
> Yes, the org export file validates at w3c as a valid XHTML1.0 file. The 
> ePub spec is here: http://idpf.org/epub but I admit fatigue in trying 
> to wade through it, so I don't know what XHTML1.0 constructions it 
> objects to. It seems like the kind of document that nobody has ever 
> read: sort of like EULAs and express warranties.

I took a quick look through
<http://idpf.org/epub/20/spec/OPS_2.0.1_draft.htm> and right to the
beginning <http://idpf.org/epub/20/spec/OPS_2.0.1_draft.htm#Section1.3>
"1.3: Relationship to Other Specifications" it says:

"This specification combines subsets and applications of other
specifications."

Next, in <http://idpf.org/epub/20/spec/OPS_2.0.1_draft.htm#Section1.3.4>
"1.3.4: Relationship to XHTML and DTBook" it talks about

"..., the Preferred Vocabularies do not include all XHTML 1.1 elements
and attributes."

So, even if you have a valid XHTML file, only a subset of it might be
valid for an epub book. Same goes for CSS.

Lazy as I am, I haven't looked through the other epub parts, since this
seems not relevant here.

Another interesting epub checker might be
<http://code.google.com/p/epubcheck/>, which uses "... schemas that were
developed by IDPF and DAISY. ..." according to their website.

Regards, Olaf

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ePub construction
  2011-12-14  8:53     ` Olaf Dietsche
@ 2011-12-14 13:58       ` Nick Dokos
  0 siblings, 0 replies; 7+ messages in thread
From: Nick Dokos @ 2011-12-14 13:58 UTC (permalink / raw)
  To: Olaf Dietsche; +Cc: nicholas.dokos, emacs-orgmode, Alan L Tyree

Olaf Dietsche <olaf+list.orgmode@olafdietsche.de> wrote:

> ... 
> Another interesting epub checker might be
> <http://code.google.com/p/epubcheck/>, which uses "... schemas that were
> developed by IDPF and DAISY. ..." according to their website.
> 

I'm pretty sure it's the same checker as the online checker that Alan pointed to.

Nick

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ePub construction
  2011-12-13 22:45 ePub construction Alan L Tyree
  2011-12-14  1:42 ` Nick Dokos
@ 2011-12-14 23:24 ` suvayu ali
  2011-12-14 23:56   ` Alan L Tyree
  1 sibling, 1 reply; 7+ messages in thread
From: suvayu ali @ 2011-12-14 23:24 UTC (permalink / raw)
  To: Alan L Tyree; +Cc: emacs-orgmode

Hi Alan,

On Tue, Dec 13, 2011 at 23:45, Alan L Tyree <alantyree@gmail.com> wrote:
> I will be happy to add a fuller description to worg if someone will
> point me to some instructions.

Here is the latest announcement from Jason:

<http://thread.gmane.org/gmane.emacs.orgmode/49704>

-- 
Suvayu

Open source is the future. It sets us free.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: ePub construction
  2011-12-14 23:24 ` suvayu ali
@ 2011-12-14 23:56   ` Alan L Tyree
  0 siblings, 0 replies; 7+ messages in thread
From: Alan L Tyree @ 2011-12-14 23:56 UTC (permalink / raw)
  To: suvayu ali; +Cc: emacs-orgmode

On 15/12/11 10:24:16, suvayu ali wrote:
> Hi Alan,
> 
> On Tue, Dec 13, 2011 at 23:45, Alan L Tyree <alantyree@gmail.com>
> wrote:
> > I will be happy to add a fuller description to worg if someone will
> > point me to some instructions.
> 
> Here is the latest announcement from Jason:
> 
> <http://thread.gmane.org/gmane.emacs.orgmode/49704>

Thanks for that - I had seen the thread but didn't recognise its 
significance. Duh!

Alan

> 
> -- 
> Suvayu
> 
> Open source is the future. It sets us free.
> 



-- 
Alan L Tyree                    http://www2.austlii.edu.au/~alan
Tel:  04 2748 6206		sip:172385@iptel.org

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-12-14 23:55 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-13 22:45 ePub construction Alan L Tyree
2011-12-14  1:42 ` Nick Dokos
2011-12-14  3:14   ` Alan L Tyree
2011-12-14  8:53     ` Olaf Dietsche
2011-12-14 13:58       ` Nick Dokos
2011-12-14 23:24 ` suvayu ali
2011-12-14 23:56   ` Alan L Tyree

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).