Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre > Conversion

Notices

Reply
 
Thread Tools Search this Thread
Old 02-10-2011, 01:33 PM   #1
nhopton
Junior Member
nhopton began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Markdown HTML problem

Hi, this is my first post here so it's bound to be silly.

I have Calibre 0.7.44 running under Ubuntu 10.10. What I have been trying to do is to use Markdown to produce HTML for importing into Calibre for onward conversion to MOBI.

The document is an old novel that includes passages of poetry and it is the poetry that is where the problem lies. The HTML from Markdown looks (to me, as a non-expert) reasonable, but when I convert this to MOBI using the default setting I get spurious blank lines inserted in the output. It's as if Calibre is inserting the odd <br /> tag.

Below, a sample of the HTML from Markdown.

Code:
<p>Before the Roman came to Rye or out to Severn strode, <br />
The rolling English drunkard made the rolling English road. <br />
A reeling road, a rolling road, that rambles round the shire, <br />
And after him the parson ran, the sexton and the squire; <br />
A merry road, a mazy road, and such as we did tread <br />
The night we went to Birmingham by way of Beachy Head.</p>

<p>I knew no harm of Bonaparte and plenty of the Squire, <br />
And for to fight the Frenchman I did not much desire; <br />
But I did bash their baggonets because they came arrayed <br />
To straighten out the crooked road an English drunkard made, <br />
Where you and I went down the lane with ale-mugs in our hands, <br />
The night we went to Glastonbury by way of Goodwin Sands.</p>
I'd be grateful for any advice on this problem.

Regards, Nick.

Last edited by nhopton; 02-10-2011 at 01:41 PM.
nhopton is offline   Reply With Quote
Old 02-10-2011, 01:35 PM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,560
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I'm confused are you saying you are getting extra blank lines or missing blank lines?
kovidgoyal is offline   Reply With Quote
Old 02-10-2011, 02:02 PM   #3
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
How are you genrating the markdown html? Also, does it display properly when using calibre's viewer.
user_none is offline   Reply With Quote
Old 02-10-2011, 02:22 PM   #4
nhopton
Junior Member
nhopton began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Sorry, it is inserting extra white lines, one in each verse.

Regards, Nick.
nhopton is offline   Reply With Quote
Old 02-10-2011, 02:25 PM   #5
nhopton
Junior Member
nhopton began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Quote:
Originally Posted by user_none View Post
How are you genrating the markdown html? Also, does it display properly when using calibre's viewer.
I mark the text up in a plain-text editor (Gedit) and then run it through Markdown. The text doesn't display properly in Calibre's MOBI viewer, or on the Kindle.

Regards, Nick.
nhopton is offline   Reply With Quote
Old 02-10-2011, 02:43 PM   #6
ldolse
Wizard
ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.ldolse is an accomplished Snipe hunter.
 
Posts: 1,337
Karma: 123455
Join Date: Apr 2009
Location: Malaysia
Device: PRS-650, iPhone
Try adjusting Calibre's css. Extra CSS box under look and feel:
p {margin-top:.1em; margin-bottom:.1em}
ldolse is offline   Reply With Quote
Old 02-10-2011, 03:04 PM   #7
nhopton
Junior Member
nhopton began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Quote:
Originally Posted by ldolse View Post
Try adjusting Calibre's css. Extra CSS box under look and feel:
p {margin-top:.1em; margin-bottom:.1em}
This still introduces blank lines, in different places from before . But thanks for the suggestion.

Regards, Nick.
nhopton is offline   Reply With Quote
Old 02-10-2011, 03:26 PM   #8
nhopton
Junior Member
nhopton began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Ah, I think we might be getting somewhere. If I load the HTML produced by Markdown into an HTML editor (GWrite) some extra code is inserted automatically, see the codebox. This does import to Calibre and convert to MOBI properly. So at least I have a work-around.

Code:
<!DOCTYPE html> 
<html> 
<head></head><body><p>Before the Roman came to Rye or out to Severn strode, <br> 
The rolling English drunkard made the rolling English road. <br> 
A reeling road, a rolling road, that rambles round the shire, <br> 
And after him the parson ran, the sexton and the squire; <br> 
A merry road, a mazy road, and such as we did tread <br> 
The night we went to Birmingham by way of Beachy Head.  </p> 
 
<p>I knew no harm of Bonaparte and plenty of the Squire, <br> 
And for to fight the Frenchman I did not much desire; <br> 
But I did bash their baggonets because they came arrayed <br> 
To straighten out the crooked road an English drunkard made, <br> 
Where you and I went down the lane with ale-mugs in our hands, <br> 
The night we went to Glastonbury by way of Goodwin Sands.  </p> 

</body> 
</html>
Many thanks, Nick.
nhopton is offline   Reply With Quote
Old 02-10-2011, 03:28 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,560
Karma: 24495948
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
deleted
kovidgoyal is offline   Reply With Quote
Old 02-10-2011, 04:29 PM   #10
user_none
Sigil & calibre developer
user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.user_none ought to be getting tired of karma fortunes by now.
 
user_none's Avatar
 
Posts: 2,487
Karma: 1063785
Join Date: Jan 2009
Location: Florida, USA
Device: Nook STR
I am a bit confused, why are you converting to the Markdown formatted text to HTML and then using calibre to convert the HTML? calibr supports Markdown formatted TXT.
user_none is offline   Reply With Quote
Old 02-10-2011, 06:43 PM   #11
nhopton
Junior Member
nhopton began at the beginning.
 
Posts: 6
Karma: 10
Join Date: Feb 2011
Device: Kindle 3
Quote:
Originally Posted by user_none View Post
I am a bit confused, why are you converting to the Markdown formatted text to HTML and then using calibre to convert the HTML?
Because I'm a fool. I thought I'd read the documentation properly and explored the configuration options, but not well enough it appears.

That's a couple of pints I owe you, should ever you have the melancholy distinction of finding yourself in my home town.

Regards, Nick.
nhopton is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Markdown Syntax in Comments itimpi Calibre 11 01-25-2011 12:28 PM
->Txt+Markdown Perkin Calibre 2 12-11-2010 05:04 AM
Capture intermediate html from markdown Agama Calibre 3 07-30-2010 12:33 PM
Markdown editor user_none Workshop 0 08-30-2009 10:25 PM
html problem Nate the great Workshop 12 03-17-2009 09:38 AM


All times are GMT -4. The time now is 06:59 AM.


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