💾 Archived View for dioskouroi.xyz › thread › 25004215 captured on 2020-11-07 at 00:54:26. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Ibis – A PHP tool that helps you write eBooks in markdown and convert to PDF

Author: simonpure

Score: 149

Comments: 29

Date: 2020-11-06 02:12:40

Web Link

________________________________________________________________________________

zomglings wrote at 2020-11-06 04:12:56:

Looks like a very nice tool.

Question about the GitHub repo, out of curiosity. Did you only start using git in preparation of the open source release?

I don't know PHP. Since your code base looked clean, was hoping to learn some PHP by following along with your git logs, but the beginning of the Ibis universe was only 2 days ago with a very mature code base.

rocketpastsix wrote at 2020-11-06 04:25:26:

Not op but I know him via the PHP community. You can find a lot of his code in the laravel framework. Super smart dude.

themsaid wrote at 2020-11-06 06:15:00:

Thanks! :)

themsaid wrote at 2020-11-06 06:14:41:

Hey. I started with git since the beginning but wiped out the repo history just before making it public. The commits were all "wip" anyway :D I wasn't sure I'll make it public as I was mainly doing this to generate my eBook.

jsshah wrote at 2020-11-06 05:57:30:

Any good example repo where you can learn about the code as well as evolution by following the git log and commit history?

francislavoie wrote at 2020-11-06 06:02:27:

Papyrus?!?!?

https://www.youtube.com/watch?v=jVhlJNJopOQ

themsaid wrote at 2020-11-06 06:17:33:

haha. That's hilarious :D

ta1234567890 wrote at 2020-11-06 03:59:32:

Is there something like this but that does markdown to ePub?

inetsee wrote at 2020-11-06 04:32:19:

Pandoc

https://pandoc.org

is described as a Universal Document Converter. It can convert markdown (and quite a few other formats) into ePubs, PDFs, doc files, etc. If you need to produce eBooks, Pandoc is a more powerful tool. It's been around for quite a while, and it's very well documented.

daitangio wrote at 2020-11-06 12:42:31:

I am using pandoc with amazon kdp and it works nicely.

How this tool is different from pandoc?

asicsp wrote at 2020-11-06 04:34:52:

pandoc supports wide variety of conversions from one format to another, markdown to epub is one of them.

I use pandoc to generate pdf/epub from GitHub style markdown. Here's my custom script for epub:

https://learnbyexample.github.io/customizing-pandoc/#customi...

simion314 wrote at 2020-11-06 08:20:39:

Epubs are zip files, I wrote PHP code that generates the file using the specification. Use the command line apps that already exists if those do the job but if you want to control exactly how the epub content looks don't be afraid dig a bit.

AlphaWeaver wrote at 2020-11-06 04:25:15:

Check out Pandoc!

dgb23 wrote at 2020-11-06 07:13:19:

From glancing over the code it seems you use Primarily html to control the layout. Is this assumption right?

themsaid wrote at 2020-11-06 07:15:52:

Some HTML but mostly CSS.

dgb23 wrote at 2020-11-06 07:39:31:

Yeah that’s what I meant. It seems much more convenient to generate PDF layouts this way than to use standard layout structure like you would with tcpdf or similar.

I know there are a bunch of caveats AKA the browser generally helps renders smarter and some features don’t translate well. But generally I prefer your approach.

notRobot wrote at 2020-11-06 03:19:54:

The sample PDF looks very pretty!

badsectoracula wrote at 2020-11-06 04:27:57:

It looks a bit like a printed webpage though, considering it is supposed to be an A4 paper the font is too large.

themsaid wrote at 2020-11-06 06:16:16:

I went for the large fonts to make it easier for people to read. You can customize everything about fonts and styling while generating your own book.

k_sze wrote at 2020-11-06 07:23:37:

Technically commendable. But please please please stop contributing to PDF, especially in the conversion _to_ PDF. It’s a horrible format.

numlock86 wrote at 2020-11-06 07:33:04:

I am sure you have an alternative suitable and ready for the masses?

k_sze wrote at 2020-11-06 09:37:47:

epub 2 and epub 3 are both much better formats than PDF if you really want to publish ebooks.

PDF is not reflowable and results in a crappy reading experience unless the device screen size is just right.

cicero wrote at 2020-11-06 14:40:17:

PDF is ultimately for paper when you care about how the content fits on each page. A reflowable format will have to at some point be rendered to pages if one is to go to paper, and I can't think of anything better than PDF for storing that rendering.

k_sze wrote at 2020-11-07 02:44:43:

epub is basically many html files packaged together and indexed. So rendering for printing can be taken care of with the right media-querying CSS.

tomcooks wrote at 2020-11-06 08:20:08:

HTML.

Accessible, lighter, works on screen readers, extensible, a standard.

numlock86 wrote at 2020-11-06 12:36:31:

You forgot the horror of printing and rogue JS assisted bitcoin mining.

k_sze wrote at 2020-11-06 13:48:54:

Printing can actually be fixed with the right CSS. The opposite is not true for PDF: you can't fix PDF for responsive rendering.

As for rogue JS, there are good, open-source countermeasures such as dompurify.

zelphirkalt wrote at 2020-11-06 08:45:28:

Unless it is the Pandoc markdown dialect (and perhaps not even then) the fact that it is markdown and not some more powerful language, already tells me, that its use is rather limited. If it was for example rst, it would be actually useful also for technical and scientific documents in general, which have sometimes need of document internal referencing of arbitraty elements, not only headings. Then of course all the other things Pandoc markdown brings, that are more geared towards finding a syntax for citations and footnotes etc. If all of that is not available either, the use is already quite limited.

akie wrote at 2020-11-06 09:12:26:

Glancing at the source code it seems that it's GitHub flavored markdown.