casbin / casbin-website-v2

The new docs website for Casbin based on Docusaurus v2
https://casbin.org
Apache License 2.0
19 stars 68 forks source link

Export the whole docs to PDF #68

Closed hsluoyz closed 2 years ago

hsluoyz commented 2 years ago

We can find a way to export a Docusaurus v2 site into PDF, so it can be used as the manual for the project.

casbin-bot commented 2 years ago

@tangyang9464 @JalinWang @imp2002

hsluoyz commented 2 years ago

@Selflocking

EmperorYP7 commented 2 years ago

Docusaurus doesn't support this out of the box. There are various options to do this:

JalinWang commented 2 years ago

Docusaurus doesn't support this out of the box. There are various options to do this:

They seem to not support Docusaurus v2. How about https://github.com/kohheepeace/mr-pdf/issues/50#issuecomment-1115435683 or https://github.com/kohheepeace/mr-pdf#docusaurus-v2-beta?

updated: It works not well for Docusaurus 2.0.0-rc1 :( https://github.com/casbin/casbin-website-v2/blob/master/package.json#L20 Only part of the documents is captured. image

Test command:

npx mr-pdf --initialDocURLs="https://casbin.io/docs/overview" --contentSelector="article" --paginationSelector=".pagination-nav__item--next > a" --excludeSelectors=".margin-vert--xl a" --coverImage="https://docusaurus.io/img/docusaurus.png" --coverTitle="Docusaurus v2"
Selflocking commented 2 years ago

Docusaurus doesn't support this out of the box. There are various options to do this:

They seem to not support Docusaurus v2. How about kohheepeace/mr-pdf#50 (comment) or https://github.com/kohheepeace/mr-pdf#docusaurus-v2-beta?

updated: It works not well for Docusaurus 2.0.0-rc1 :( https://github.com/casbin/casbin-website-v2/blob/master/package.json#L20 Only part of the documents is captured. image

Test command:

npx mr-pdf --initialDocURLs="https://casbin.io/docs/overview" --contentSelector="article" --paginationSelector=".pagination-nav__item--next > a" --excludeSelectors=".margin-vert--xl a" --coverImage="https://docusaurus.io/img/docusaurus.png" --coverTitle="Docusaurus v2"

I have tried docusaurus-prince-pdf result: https://github.com/Selflocking/casbin-website-v2/releases/tag/pdf It better than mr-pdf. But I'm having trouble with Tabs, image

It seems impossible to switch between tabs in pdf

hsluoyz commented 2 years ago

@Selflocking we can ignore the tabs for now, that's OK. I tried your generated PDF, the zh docs has issues like:

image

Can you fix it?

Selflocking commented 2 years ago

@Selflocking we can ignore the tabs for now, that's OK. I tried your generated PDF, the zh docs has issues like:

image

Can you fix it?

I am trying to fix it