View Single Post
Old 02-06-2019, 08:30 PM   #8
davidfor
Grand Sorcerer
davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.davidfor ought to be getting tired of karma fortunes by now.
 
Posts: 24,905
Karma: 47303824
Join Date: Jul 2011
Location: Sydney, Australia
Device: Kobo:Touch,Glo, AuraH2O, GloHD,AuraONE, ClaraHD, Libra H2O; tolinoepos
Quote:
Originally Posted by wyoung View Post
I gave you detailed instructions for producing as many Markdown files as you like.

But if you must have one pre-prepared, I've attached the one I've been testing with.

EDIT: ...which this forum appears to have eaten, perhaps because I'm too new to be trusted to create attachments? No matter, I can fake it. Cut and paste the following text into a file called x.md:

Code:
This is a markdown file...

...with multiple paragraphs.
Result:

The issue is that you are seeing a problem and others are not. There are two possibilities, you are using different options that mess things up or something is different about the files being tested. By you posting a sample that doesn't work for you, when others test, we know that we are starting from the same place. Suggesting we take text from the forum page doesn't always work as it might be a code page issue, or line-ends or something else that the browser obscures.

And you should be able to attach a file as a new user. But, the forum doesn't allow .md files, so that might be it. There would have been a message when you tried to attach it, but I know I missed it now. And I usually forget to hit the "Upload" button on the attachments dialog and wonder why the attachment isn't there later.

In any case, I did what you said and put the three lines into a file. Added that to calibre (3.39.1 on a Linux box), hit the conversion without changing any options. Looked at the generated epub and I have two paragraphs. Then I repeated the test using a .txt file as .md cannot be attached here. Same results. I have attached the input .txt file and the generated epub for you to see.

Below is the output log from the conversion. This includes the options used for the conversion. Comparing yours to this might give a hint for what is going on.

Spoiler:

Code:
Convert book 1 of 1 (Markdown)
Conversion options changed from defaults:
  read_metadata_from_opf: u'/tmp/calibre_3.39.1_tmp_B2IXMv/7LBSRa.opf'
  duplicate_links_in_toc: True
  verbose: 2
  output_profile: 'tablet'
  markdown_extensions: u'tables, footnotes, toc'
Resolved conversion options
calibre version: 3.39.1
{'asciiize': False,
 'author_sort': None,
 'authors': None,
 'base_font_size': 0.0,
 'book_producer': None,
 'change_justification': u'original',
 'chapter': u"//*[((name()='h1' or name()='h2') and re:test(., '\\s*((chapter|book|section|part)\\s+)|((prolog|prologue|epilogue)(\\s+|$))', 'i')) or @class = 'chapter']",
 'chapter_mark': u'pagebreak',
 'comments': None,
 'cover': None,
 'debug_pipeline': None,
 'dehyphenate': True,
 'delete_blank_paragraphs': True,
 'disable_font_rescaling': False,
 'dont_split_on_page_breaks': False,
 'duplicate_links_in_toc': True,
 'embed_all_fonts': False,
 'embed_font_family': None,
 'enable_heuristics': False,
 'epub_flatten': False,
 'epub_inline_toc': False,
 'epub_toc_at_end': False,
 'epub_version': u'2',
 'expand_css': False,
 'extra_css': None,
 'extract_to': None,
 'filter_css': u'',
 'fix_indents': True,
 'flow_size': 260,
 'font_size_mapping': None,
 'format_scene_breaks': True,
 'formatting_type': u'auto',
 'html_unwrap_factor': 0.4,
 'input_encoding': None,
 'input_profile': <calibre.customize.profiles.InputProfile object at 0x7ffb6b0119d0>,
 'insert_blank_line': False,
 'insert_blank_line_size': 0.5,
 'insert_metadata': False,
 'isbn': None,
 'italicize_common_cases': True,
 'keep_ligatures': False,
 'language': None,
 'level1_toc': None,
 'level2_toc': None,
 'level3_toc': None,
 'line_height': 0.0,
 'linearize_tables': False,
 'margin_bottom': 5.0,
 'margin_left': 5.0,
 'margin_right': 5.0,
 'margin_top': 5.0,
 'markdown_extensions': u'tables, footnotes, toc',
 'markup_chapter_headings': True,
 'max_toc_links': 50,
 'minimum_line_height': 120.0,
 'no_chapters_in_toc': False,
 'no_default_epub_cover': False,
 'no_inline_navbars': False,
 'no_svg_cover': False,
 'output_profile': <calibre.customize.profiles.TabletOutput object at 0x7ffb6b02c610>,
 'page_breaks_before': u"//*[name()='h1' or name()='h2']",
 'paragraph_type': u'auto',
 'prefer_metadata_cover': False,
 'preserve_cover_aspect_ratio': False,
 'preserve_spaces': False,
 'pretty_print': True,
 'pubdate': None,
 'publisher': None,
 'rating': None,
 'read_metadata_from_opf': u'/tmp/calibre_3.39.1_tmp_B2IXMv/7LBSRa.opf',
 'remove_fake_margins': True,
 'remove_first_image': False,
 'remove_paragraph_spacing': False,
 'remove_paragraph_spacing_indent_size': 1.5,
 'renumber_headings': True,
 'replace_scene_breaks': u'',
 'search_replace': '[]',
 'series': None,
 'series_index': None,
 'smarten_punctuation': False,
 'sr1_replace': None,
 'sr1_search': None,
 'sr2_replace': None,
 'sr2_search': None,
 'sr3_replace': None,
 'sr3_search': None,
 'start_reading_at': None,
 'subset_embedded_fonts': False,
 'tags': None,
 'timestamp': None,
 'title': None,
 'title_sort': None,
 'toc_filter': None,
 'toc_threshold': 6,
 'toc_title': None,
 'transform_css_rules': '[]',
 'txt_in_remove_indents': False,
 'unsmarten_punctuation': False,
 'unwrap_lines': True,
 'use_auto_toc': False,
 'verbose': 2}
InputFormatPlugin: TXT Input running
on /tmp/calibre_3.39.1_tmp_B2IXMv/bhxWev.txt
Reading text from file...
Detected input encoding as ascii with a confidence of 100.0%
Auto detected paragraph type as unformatted
Auto detected formatting as heuristic
Running text through basic conversion...
Language not specified
Creator not specified
Building file list...
	Found files...
		 HTMLFile:0:a:/tmp/calibre_3.39.1_tmp_B2IXMv/index-2.html
Normalizing filename cases
Rewriting HTML links
Parsing index-2.html ...
*********  Heuristic processing HTML  *********
flow is too short, not running heuristics
Forcing index-2.html into XHTML namespace
Merging user specified metadata...
Detecting structure...
Auto generated TOC with 0 entries.
Flattening CSS and remapping font sizes...
Source base font size is 12.00000pt
Removing fake margins...
Found 3 items of level: p_1
Ignoring level p_1
Cleaning up manifest...
Trimming unused files from manifest...
Creating EPUB Output...
Splitting markup on page breaks and flow limits, if any...
	Looking for large trees in index-2.html...
	No large trees found
Generating default cover
This EPUB file has no Table of Contents. Creating a default TOC
EPUB output written to /tmp/calibre_3.39.1_tmp_B2IXMv/YKChvq.epub



For the method that calibre does the conversion, calibre uses internal libraries. For Markdown, it looks to be a Python library from elsewhere, but it is included in the calibre codebase for all platforms.
Attached Files
File Type: epub Markdown - Unknown.epub (134.9 KB, 71 views)
File Type: txt Markdown - Unknown.txt (57 Bytes, 108 views)
davidfor is offline   Reply With Quote