02-20-2013, 11:54 PM | #1 |
Member
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 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. |
02-21-2013, 02:08 AM | #2 |
Curmudgeon
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 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. |
Advert | |
|
02-21-2013, 02:24 AM | #3 | |
Member
Posts: 23
Karma: 10
Join Date: Feb 2013
Device: Linux laptop and iPhone
|
Quote:
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 |
|
02-21-2013, 08:57 PM | #4 |
Curmudgeon
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.
|
|
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 |