This is getting ridiculous.

I got Pandoc so that I could compile the github files into an ePub. But the source files were in asciidoc format, so I went to install AsciiDoctor. That required Ruby, which I installed.

(I also took a side trail and looked into using the AsciiDoctor extension with Visual Studio. In the desktop version, the extension search wouldn't find AsciiDoctor, so I switched to the browser-based version, then discovered the browser-based version of AsciiDoctor doesn't support exporting files to PDF or HTML. I switched back to desktop, somehow was able to find and install the extension, but then couldn't find the menu options to export any files.)

I finally got Pandoc and AsciiDoctor working in the command line, but when I tried to merge all the asciidoc files together, I got a variety of errors. First I moved some config files around so my command could find them, but the other issues involve hierarchal structure problems in the source files. Wut?

When I was searching for a free version of this book and saw the GitHub repository, I thought "Yes! I should be able to get this into an ePub in a couple of clicks." But no. It's been way more complicated than that, and I still haven't succeeded.

I don't have time to work through this anymore. Why is this so difficult?!?! Should I just bail?

#notaprogrammer

#asknostr nostr:note1x8mwml2v0zgskqpdxunnl4d8plhzug8j3lpzcuer7hlj6xdkcxcq2zn9ad

Reply to this note

Please Login to reply.

Discussion

Try this maybe:

1. Compile AsciiDoc Files into a Single HTML File:

Using AsciiDoctor, you can convert all asciidoc files into a single HTML file. The command is:

asciidoctor -b html5 -o output.html input.adoc

Repeat for all asciidoc files and then concatenate them into a single HTML file.

2. Create a CSS File (Optional):

If styling is necessary, create a CSS file and link it within the HTML file.

3. Convert HTML to ePub using Pandoc:

Once you have an HTML file, you can convert it to ePub using Pandoc. The command is:

pandoc output.html -o final.epub

4. Modify Calibre Settings (If Needed):

If you're still considering using Calibre, ensure that the settings match the specific needs of the file you're converting. Sometimes, altering specific input or output settings can resolve conversion issues.

That is the the command I ran earlier, only I had all the input files listed together. Doing it your way, I successfully converted all of the manually to HTML, although two generated errors:

E[line ###] section out of sequence: expected level 3, got level 4

I don’t understand what the issue was, but the HTML generated anyway, so I moved on.

After successfully merging everything to a single HTML file, I dropped it into Calibre and converted to ePub—it appears to have worked!

If anyone wants the file rather than recreate my path, send me a DM.

Thank you!!!