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

Go Back   MobileRead Forums > E-Book Formats > ePub

Notices

Reply
 
Thread Tools Search this Thread
Old 02-20-2013, 11:54 PM   #1
carlosbcg
Member
carlosbcg began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Feb 2013
Device: Linux laptop and iPhone
Anybody here know how to use pandoc to output XHTML?

I am creating an EPUB3 which requires "serialized HTML5" (I think that is XHTML5).

Anyway I use a program called pandoc to output the HTML (which I want to have it be XHTML5).

The command line I presently use is:

Code:
pandoc --strict some.md -o some.html
In other words I go from an .md file containing markdown to a file containing...well...what seems like regular HTML.

Now if that all makes sense...therein lies my dilemna.

How do I output XHTML and NOT regular ol HTML using pandoc?

I've Googled and Googled yesterday and today and can't find a thing on this.

I know that the differences between HTML and XHTML5 are pretty minor really (for purposes of P tags and such) but still...I prefer to have a program like pandoc spit out properly formed XHTML instead of going through by hand to convert HTML to XHTML.

If pandoc doesn't cut it as far as outputting XHTML anybody know of any other wonderful program like pandoc that will?

Anybody?

Carlos

PS. Hmm...I wonder what is with the huge space the forum puts between the word "Code" and the code? Oops...the huge space went away after I edited and added this PS. Hmm...

Last edited by carlosbcg; 02-20-2013 at 11:56 PM.
carlosbcg is offline   Reply With Quote
Advert
Old 02-21-2013, 02:08 AM   #2
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
Try running it through a validator. It will probably "just work". Most software that outputs HTML does so using an XML-compatible form, or very nearly so. The likely exceptions can usually be fixed with a simple regular expression or other substitution, e.g.

Code:
cat file.html | sed 's/<hr>/<hr \/>/g'  > newfile.html
or, in English, replace <hr> with <hr />. That's just about the only difference you're likely to run into. That and possibly the need to add </link> closing tags if the files include any CSS or </meta> tags if the files include any meta tags.

Ah. According to Pandoc's documentation, its html output mode is actually xhtml 1.0. Weird. So just add -t html and you should be good.

Last edited by dgatwood; 02-21-2013 at 02:10 AM.
dgatwood is offline   Reply With Quote
Old 02-21-2013, 02:24 AM   #3
carlosbcg
Member
carlosbcg began at the beginning.
 
Posts: 23
Karma: 10
Join Date: Feb 2013
Device: Linux laptop and iPhone
Quote:
Originally Posted by dgatwood View Post
Ah. According to Pandoc's documentation, its html output mode is actually xhtml 1.0. Weird. So just add -t html and you should be good.
I saw that little snippet of conversion goodness a couple of hours after I posted my thread here but thanks for pointing that out.

One can also apparently use an -o html5 flag to output HTML5.

Or is it also an XHTML variety? I'll have to check the output code on that I guess.

That is what can make all this so confusing. Is that all these companies and software will sometimes intermix all these terms as being one thing when they actually mean another. People get sloppy with all these terms and are not precise and one ends up in a mess of confusion.

Oh well.

Carlos
carlosbcg is offline   Reply With Quote
Old 02-21-2013, 08:57 PM   #4
dgatwood
Curmudgeon
dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.dgatwood ought to be getting tired of karma fortunes by now.
 
dgatwood's Avatar
 
Posts: 629
Karma: 1623086
Join Date: Jan 2012
Device: iPad, iPhone, Nook Simple Touch
No idea. HTML5 can be XML or it can be old-style.
dgatwood 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
catalogue builder output columns are not in the same order in the output KWhytte Library Management 5 12-04-2012 02:03 AM
TOC xhtml giosa Sigil 3 01-17-2012 09:12 PM
Converting pandoc generated HTML to ePUB with Calibre Wintermute Conversion 2 04-15-2011 01:25 PM
Comments In XHTML? Fabe Sigil 6 11-30-2010 03:25 AM
Does it have to be XHTML 1.1 Strict? AlexBell ePub 7 07-18-2009 07:51 AM


All times are GMT -4. The time now is 01:31 PM.


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