How can I convert ebooks to asciidoc format properly?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

How can I convert ebooks to asciidoc format properly?

documentationchronicles
This post was updated on .
Hi there. I am trying to convert programming ebooks to asciidoc format for adding this books to my asciidoc notes and making changes(adding extra notes and adding my own codes) on it. My problem is conversion tools cannot convert code blocks properly.I know that a lot of techniques exist pdf, epub to asciidoc so I want to discuss which technique is better for converting cs books to asciidoc format.

EPUB->HTML->ASCIIDOC
My technique is the following:

* I use epub ebooks rather than pdf ebooks. Because epub format has a better structure for HTML, I have a lot of data loss when I tried to convert PDF to HTML because PDF format is a presenttation tool, not a structure tool.
* I use calibre to convert EPUB to HTML because it is awesome for structure detection.
* I use pandoc to convert html to asciidoc.My results are pretty good except for code blocks.Code blocks rendered as HTML paragraphs instead of asciidoc code blocks.
Any advice for converting programming ebooks to asciidoc format appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: How can I convert ebooks to markdown format properly?

mojavelinux
Administrator
If I am reading your message correctly, you're having difficulty when converting HTML to AsciiDoc using pandoc. Since that relates to pandoc and not Asciidoctor, I suggest opening the issue here:


Cheers,

-Dan

On Thu, Nov 1, 2018 at 1:22 PM documentationchronicles [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Hi there. I am trying to convert programming ebooks to asciidoc format for adding this books to my asciidoc notes and making changes(adding extra notes and adding my own codes) on it. My problem is conversion tools cannot convert code blocks properly.I know that a lot of techniques exist pdf, epub to asciidoc so I want to discuss which technique is better for converting cs books to asciidoc format.

EPUB->HTML->ASCIIDOC
My technique is the following:

I use epub ebooks rather than pdf ebooks. Because epub format has a better structure for HTML, I have a lot of data loss when I tried to convert PDF to HTML because PDF format is a presenttation tool, not a structure tool.
I use calibre to convert EPUB to HTML because it is awesome for structure detection.
I use pandoc to convert html to asciidoc.My results are pretty good except for code blocks.Code blocks rendered as HTML paragraphs instead of asciidoc code blocks.
Any advice for converting programming ebooks to asciidoc format appreciated.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-can-I-convert-ebooks-to-markdown-format-properly-tp6577.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux
Reply | Threaded
Open this post in threaded view
|

Re: How can I convert ebooks to markdown format properly?

documentationchronicles
This post was updated on .
Thanks,mojavelinux.My problem is that conversion tools lose code block style on PDF,EPUB to HTML conversion phase. I tried pandoc,calibre but neither of these programs maintain code block style.They  put code blocks inside of  paragraphs tags and it looks like the paragraph content like the following:

Note: I will also create feature requests on calibre bug report page and pandoc github page . I'm open for alternative method suggestion to convert books to asciidoc.
Reply | Threaded
Open this post in threaded view
|

Re: How can I convert ebooks to markdown format properly?

mojavelinux
Administrator
I understand the pain you are having. However, Asciidoctor does not handle conversion from HTML. Therefore, you need to look elsewhere for a solution to this particular issue.

Cheers,

-Dan

On Thu, Nov 1, 2018 at 2:17 PM documentationchronicles [via Asciidoctor :: Discussion] <[hidden email]> wrote:
Thanks,mojavelinux.My problem is that conversion tools lose code block style on PDF,EPUB to HTML conversion phase. I tried pandoc,calibre but neither of these programs maintain code block style.


If you reply to this email, your message will be added to the discussion below:
http://discuss.asciidoctor.org/How-can-I-convert-ebooks-to-markdown-format-properly-tp6577p6579.html
To start a new topic under Asciidoctor :: Discussion, email [hidden email]
To unsubscribe from Asciidoctor :: Discussion, click here.
NAML


--
Dan Allen | @mojavelinux | https://twitter.com/mojavelinux