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 10-12-2013, 12:22 PM   #1
Tattvadarzin
Member
Tattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplane
 
Posts: 19
Karma: 55146
Join Date: Oct 2013
Location: UK
Device: Kobo Clara HD, Android Tablet
Losing paragraph format in txt to epub with block and markdown - REASON FOUND

I am using paragraph style block and formatting style markdown.

The markdown appears to work but the text paragraphs are being combined even though I am separating them with a blank line.

What am I missing here? It seems calibre is ignoring the block paragraph style once the markdown preprocessing has been done.

Thanks.

Input:
Quote:
# THE TITLE OF THE BOOK

# An Author

with acknowledgement to:

The first person,
and the second person, whom I'd like on a line (but not a paragraph) of their own.

Here is a special mention, in its own paragraph, of the third person.

This is the end paragraph of the acknowledgement section.

---

### Version History
It would be nice to have some sort of table facility without using tabs or spaces or dots.

Version.....Date...............Editor

1.0.........October 2013.......Me

---

### Another Heading

I wanted to convert a text base file into epub format. I wanted to use markdown too so that I could have nicer formatting in e-readers that could use it in text format

I wanted to use calibre as the conversion engine.

What would be nice would be to allow hard end of lines.
A bit like this.
And this
so I could have lines of things without making them lists but keeping single line spacing.
Output:
Quote:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Unknown</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<h1>THE TITLE OF THE BOOK</h1>
<h1>An Author</h1>
<p>with acknowledgement to:
The first person, and the second person, whom I'd like on a line (but not a paragraph) of their own.
Here is a special mention, in its own paragraph, of the third person.
This is the end paragraph of the acknowledgement section.</p>
<hr/>
<h3>Version History It would be nice to have some sort of table facility without using tabs or spaces or dots.</h3>
<p>Version.....Date...............Editor
1.0.........October 2013.......Me</p>
<hr/>
<h3>Another Heading</h3>
<p>I wanted to convert a text base file into epub format. I wanted to use markdown too so that I could have nicer formatting in e-readers that could use it in text format
I wanted to use calibre as the conversion engine.
What would be nice would be to allow hard end of lines. A bit like this. And this so I could have lines of things without making them lists but keeping single line spacing.</p>
</body></html>
Having discovered how to do markdown hard breaks with 2 spaces at the end of a line I put my source through Dingus and here is the result. Perhaps calibre's Python markdown processing is the difference?
Quote:
<h1>THE TITLE OF THE BOOK</h1>

<h1>An Author</h1>

<p>with acknowledgement to:</p>

<p>The first person, <br />
and the second person, whom I'd like on a line (but not a paragraph) of their own.</p>

<p>Here is a special mention, in its own paragraph, of the third person.</p>

<p>This is the end paragraph of the acknowledgement section.</p>

<hr />

<h3>Version History</h3>

<p>It would be nice to have some sort of table facility without using tabs or spaces or dots.</p>

<p>Version.....Date...............Editor</p>

<p>1.0.........October 2013.......Me</p>

<hr />

<h3>Another Heading</h3>

<p>I wanted to convert a text base file into epub format. I wanted to use markdown too so that I could have nicer formatting in e-readers that could use it in text format</p>

<p>I wanted to use calibre as the conversion engine.</p>

<p>What would be nice would be to allow hard end of lines. <br />
A bit like this. <br />
And this <br />
so I could have lines of things without making them lists but keeping single line spacing.</p>

Last edited by Tattvadarzin; 10-17-2013 at 08:22 AM. Reason: New information
Tattvadarzin is offline   Reply With Quote
Old 10-12-2013, 03:33 PM   #2
Tattvadarzin
Member
Tattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplane
 
Posts: 19
Karma: 55146
Join Date: Oct 2013
Location: UK
Device: Kobo Clara HD, Android Tablet
I changed this to paragraph style off and added in the markdown hard breaks. It looks to me as though the Python markdown processor is not doing the paragraphs properly. It is ignoring the markdown rule that a new paragraph is indicated after a blank line.

Quote:
<?xml version='1.0' encoding='utf-8'?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Unknown</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
</head>
<body>
<h1>THE TITLE OF THE BOOK</h1>
<h1>An Author</h1>
<p>with acknowledgement to:
The first person,<br/>
and the second person, whom I'd like on a line (but not a paragraph) of their own.
Here is a special mention, in its own paragraph, of the third person.
This is the end paragraph of the acknowledgement section.</p>
<hr/>
<h3>Version History</h3>
<p>It would be nice to have some sort of table facility without using tabs or spaces or dots.
Version.....Date...............Editor
1.0.........October 2013.......Me</p>
<hr/>
<h3>Another Heading</h3>
<p>I wanted to convert a text base file into epub format. I wanted to use markdown too so that I could have nicer formatting in e-readers that could use it in text format
I wanted to use calibre as the conversion engine.
What would be nice would be to allow hard end of lines.<br/>
A bit like this.<br/>
And this<br/>
so I could have lines of things without making them lists but keeping single line spacing.</p>
</body></html>
Tattvadarzin is offline   Reply With Quote
Advert
Old 10-17-2013, 08:21 AM   #3
Tattvadarzin
Member
Tattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplane
 
Posts: 19
Karma: 55146
Join Date: Oct 2013
Location: UK
Device: Kobo Clara HD, Android Tablet
I think I've found the problem.

I had "Remove indents at the beginning of lines" ticked. Unticking it gave me what I want. Now I don't understand why because I had no indents. It looks as though it affects the processing though.

So the TXT settings that are working are:
Paragraph Style: off
Formatting Style: markdown
Preserve spaces: unticked
Remove indents at the beginning of lines: unticked
Tattvadarzin is offline   Reply With Quote
Old 10-18-2013, 08:59 AM   #4
Sabardeyn
Guru
Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.Sabardeyn ought to be getting tired of karma fortunes by now.
 
Sabardeyn's Avatar
 
Posts: 644
Karma: 1242364
Join Date: May 2009
Location: The Right Coast
Device: PC (Calibre), Nexus 7 2013 (Moon+ Pro), HTC HD2/Leo (Freda)
My guess would be the original text file had either a tab or series of spaces at the beginning of a line of text. However, with the Remove Indents option set (ticked) the text did not show them. Effectively, they were invisible.

As with many other kinds of media related text display, it is a good idea to have a capable editor which can display control characters and other inline markup for situations like you just encountered. This is especially true if any kind of Search & Replace (normal or regex) is done on the text -- which can accidentally break hidden commands/characters -- whether done by yourself or anyone previously.

Lots of editors include this function although it's not always prominently shown -- you might have to hunt for it. I know MS Word has such an option as does Notepad++ (free) for Windows.
Sabardeyn is offline   Reply With Quote
Old 10-25-2013, 02:49 AM   #5
Tattvadarzin
Member
Tattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplaneTattvadarzin makes transoceanic flights without the assistance of an airplane
 
Posts: 19
Karma: 55146
Join Date: Oct 2013
Location: UK
Device: Kobo Clara HD, Android Tablet
Indeed - I use Notepad++ extensively (at home and work) and I had the option to display all control characters. It is good for showing whether you have \r, \r\n, or \n line endings.

However the test file above failed so any inherent problem in my book text must also be in that. So if you copy and paste that into Notepad++ you'll see that there are no hidden nasties :-)

I'm afraid that I still suspect the code.

However thanks for the reply - I felt I was talking to the breeze.

Last edited by Tattvadarzin; 10-25-2013 at 03:03 AM. Reason: typo
Tattvadarzin is offline   Reply With Quote
Advert
Reply

Tags
block, epub, markdown, txt


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert from epub/mobi back to TXT or any format? KDA1 Calibre 1 01-26-2012 04:19 PM
Losing Indents and Paragraph spacing videopope ePub 11 06-03-2011 07:47 PM
Having trouble converting html to markdown txt bfollowell Conversion 7 03-30-2011 11:17 AM
->Txt+Markdown Perkin Calibre 2 12-11-2010 04:04 AM
TXT conversion to ePub or LRF - paragraph formatting Zapped Calibre 6 10-23-2009 05:06 PM


All times are GMT -4. The time now is 05:30 PM.


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