Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question/Feature: Merge multiple markdown files #93

Open
marwie opened this issue Jun 26, 2020 · 4 comments
Open

Question/Feature: Merge multiple markdown files #93

marwie opened this issue Jun 26, 2020 · 4 comments

Comments

@marwie
Copy link

marwie commented Jun 26, 2020

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
Copy link
Owner

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
Copy link

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:

  • all GitHub Wiki repos
  • all GitLab Wiki repos
  • all GitBook repos

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
Copy link
Owner

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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants