elliotblackburn / mdpdf

Markdown to PDF command line app with support for stylesheets
https://npmjs.com/package/mdpdf
Apache License 2.0
712 stars 46 forks source link

Question/Feature: Merge multiple markdown files #93

Open marwie opened 4 years ago

marwie commented 4 years ago

Hello,

great tool! Would it be possible to add support for merging multiple files into one pdf? Or is it already possible?

Kind regards, Marcel

elliotblackburn commented 4 years ago

Hi @marwie this isn't something we support at the moment. What sort of use case do you have, and what kind of results do you expect?

cekageka commented 2 years ago

Hi @BlueHatbRit,

agree that using mpdf to convert a folder/subfolder structure to PDF would be a great enhancement. The use case is about all the GitBook / Wiki structures out there:

Some examples: https://github.com/Netflix/Hystrix/wiki https://github.com/d3/d3/wiki https://docs.gitbook.com/

All of these are using a file called _Sidebar.md to structure the documentation and mdpdf could use such a file to generate one PDF from any wiki or gitbook repository.

Thanks, Christian

elliotblackburn commented 2 years ago

Hi @cekageka thanks for the examples there. This certainly is an interesting idea and I'm not against it existing in mdpdf generally speaking. That said I have a couple of concerns which we'd need to think about an address before merging anything in.

  1. The _Sidebar.md is interesting to structure things, although I'd worry that it would be quite brittle to parse as it's just a markdown file. Golum and gitbooks seem to use it but there would be a reasonable amount of work around building something to parse those files and ensure they're valid.
  2. The core mdpdf is quite simple (not the prettiest but hey) and I wouldn't want to make it more complicated to maintain. That's the core piece of functionality and the main use case the software is serving right now.

If we could solve those to a good degree, I think I'd be ok with a new command or sub-command going in to handle this kind of thing.

Right now it's not something I'm keen to work on personally but if someone else wanted to have a crack I'd be happy to give some advice on a potential implementation.

cekageka commented 2 years ago

Hi @BlueHatbRit,

thanks for your very fast reply. I totally agree - after thinking twice I assume it's already perfectly possible to use mdpdf similar to the following pandoc script to do the job:

https://gist.github.com/clemsos/9e480b2b792b57f1b22d

So from my perspective the issue is solved.

Thanks again, Christian