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

PDF downloads #7

Closed
shawaj opened this issue Jan 18, 2021 · 14 comments
Closed

PDF downloads #7

shawaj opened this issue Jan 18, 2021 · 14 comments

Comments

@shawaj
Copy link
Member

shawaj commented Jan 18, 2021

See plugin here https://github.com/meff34/docsify-to-pdf-converter

Also docsify awesome https://github.com/docsifyjs/awesome-docsify

@ryanteck
Copy link
Contributor

Adding it now

@ryanteck
Copy link
Contributor

@shawaj
Copy link
Member Author

shawaj commented Jan 19, 2021

@ryanteck how do we generate them for other pages? And does this auto-generate somehow or we can build into a GitHub workflow?

@shawaj
Copy link
Member Author

shawaj commented Jan 19, 2021

From here - https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions

And here - https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageemulatemediamediatype

It looks like there is quite a lot of customisation options, including separate print templates etc.

Wonder if we can have pdfs of just certain pages / folders from the repo

@ryanteck
Copy link
Contributor

@ryanteck how do we generate them for other pages? And does this auto-generate somehow or we can build into a GitHub workflow?

Currently for testing I've been running a command locally.

I can likely set it up on github actions or a cron that runs on the Pi that hosts it.

@ryanteck
Copy link
Contributor

PDF generation files because of removing the # from what I can tell.

https://github.com/meff34/docsify-to-pdf-converter/blob/aae1db48cce15ebfae744bb0a046cf5c68f56f1e/src/render.js#L22

@shawaj
Copy link
Member Author

shawaj commented Jan 20, 2021

Nice find @ryanteck

Started an issue meff34/docsify-to-pdf-converter#24

Maybe we can do a pr that checks for the history router and changes the behaviour?

@ryanteck
Copy link
Contributor

It looks like an abandoned project now so don't think it'll get fixed.

I think the easiest thing will be if I just edit the # out and see if that fixes it.

@shawaj
Copy link
Member Author

shawaj commented Jan 20, 2021

Yeah for sure. So just fork it and do our own?

@ryanteck
Copy link
Contributor

I don't think should need to do that.

The plugin is installed locally on the server so I just need to remove the # from that.

I'll then set it up to automate generation of the PDF each git push too

Just doing it now.

@shawaj
Copy link
Member Author

shawaj commented Jan 20, 2021

@ryanteck can we just do one PDF from the whole site or we can do multiple different PDFs?

@ryanteck
Copy link
Contributor

I think with this plug in it is the whole site.

It might be better instead to use a different piece of software to render induvidual PDFs from each markdown.

I'm currently having issues getting the plugin set up on the Pi server because of lack of IPv4 is causing issues with NPM.

@shawaj
Copy link
Member Author

shawaj commented Jan 20, 2021

Yeah, I guess this will do for now and we can improve in the future

@ryanteck
Copy link
Contributor

Was still having issues with this plugin.

For now I've configured the server that it will generate PDFs for files listed in https://github.com/NebraLtd/Helium-Guides/blob/main/pdf-gen/gen-pdfs.sh

Currently I've just got it generating the main ones that need to be provided as PDF which are the overview and quick start guides.

Could possibly in the future move it to be where it generates for every file, however I think for most just the main guides are the ones required to be in PDF form.

These are generated every time the repo's main branch is pushed to, and are uploaded to https://helium.nebra.com/pdfs/

shawaj added a commit that referenced this issue Nov 5, 2021
# This is the 1st commit message:

Update generate-pdfs.yml
# This is the commit message #2:

Update generate-pdfs.yml
# This is the commit message #3:

Update gen-pdfs.sh
# This is the commit message #4:

Update gen-pdfs.sh
# This is the commit message #5:

Update pdf-data.yml
# This is the commit message #6:

Update pdf-data.yml
# This is the commit message #7:

Update pdf-data.yml
# This is the commit message #8:

Update generate-pdfs.yml
# This is the commit message #9:

Update generate-pdfs.yml
# This is the commit message #10:

Update pdf-data.yml
# This is the commit message #11:

Update pdf-data.yml
# This is the commit message #12:

Update generate-pdfs.yml
# This is the commit message #13:

Update generate-pdfs.yml
# This is the commit message #14:

Update generate-pdfs.yml
# This is the commit message #15:

Update PDFs
# This is the commit message #16:

Create generate-pdfs.yml
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

2 participants