Open ywjr opened 3 years ago
Probably needs updating for Docusaurus 2.0.0-beta0?
Sorry, I can't link to GitHub now. I can't reply you directly
Sorry, I can't link to GitHub now. I can't answer you directly
I have tested 2.0.0-beta.0 and 2.0.0-alpha.73, and the test results are as follows
2。 However, it failed to run on 2.0.0-beta.0. It can't generate PDF. The failure information is like the above post.
------------------ 原始邮件 ------------------ 发件人: "kohheepeace/docusaurus-pdf" @.>; 发送时间: 2021年5月18日(星期二) 晚上9:58 @.>; @.**@.>; 主题: Re: [kohheepeace/docusaurus-pdf] generate PDF fail (#29)
Probably needs updating for Docusaurus 2.0.0-beta0?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
Sorry, I can only reply by mail now。
I suggest another function:
Multiple MD files are merged and generated into a PDF file
------------------ 原始邮件 ------------------ 发件人: "kohheepeace/docusaurus-pdf" @.>; 发送时间: 2021年5月18日(星期二) 晚上9:58 @.>; @.**@.>; 主题: Re: [kohheepeace/docusaurus-pdf] generate PDF fail (#29)
Probably needs updating for Docusaurus 2.0.0-beta0?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
------------------ 原始邮件 ------------------ 发件人: "kohheepeace/docusaurus-pdf" @.>; 发送时间: 2021年5月18日(星期二) 晚上9:58 @.>; @.**@.>; 主题: Re: [kohheepeace/docusaurus-pdf] generate PDF fail (#29)
Probably needs updating for Docusaurus 2.0.0-beta0?
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I've been facing the same issue - is there any soultion to it?
@covalentbond, @ywjr Are you using docusaurus v1? This npm will create a PDF file for v1.
@antonygibbs Thanks 👍
Thanks @kohheepeace - But I've been using the latest version 2.0.0-beta.0
only.
I've noticed @ywjr have written it already.
@covalentbond I've confirmed that https://github.com/kohheepeace/mr-pdf works correctly for v2 beta. Could you also check if mr-pdf works ? I will merge the code of mr-pdf to docusaurus-pdf.
Just run the below command.
npx mr-pdf --initialDocsURL="https://docusaurus.io/docs" --paginationSelector=".pagination-nav__item--next > a"
📌 [Issue Fix Outlook]
2.0.0-beta.0
.@covalentbond And docusaurus-pdf
cannot generate PDF for homepage. https://zowe-docs.netlify.app/ is homepage not docs page.
the test results are as follows
2。 However, it failed to run on v2.0.0-beta.0. It can't generate PDF.
The failure information is like the above post.
------------------ 原始邮件 ------------------ 发件人: "kohheepeace/docusaurus-pdf" @.>; 发送时间: 2021年5月19日(星期三) 下午5:56 @.>; @.**@.>; 主题: Re: [kohheepeace/docusaurus-pdf] generate PDF fail (#29)
@covalentbond, @ywjr Are you using docusaurus v1? This npm will create a PDF file for v1.
@antonygibbs Thanks 👍
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.
@ywjr Hey, please write the issue properly as possible as you can. It distracts me from reading and dealing with issues. 😠
@covalentbond yes!😀 You can exclude unnecessary HTML elements by using --excludeSelectors
npx mr-pdf ... --excludeSelectors=".docsRating"
Is this working ?
@kohheepeace thanks it worked! 🎉
@kohheepeace Thanks so much for pointing out mr-pdf. I was able to get great PDF documentation from the command line npx mr-pdf --initialDocsURL="http://localhost:3000/docs/{starting-page}" --paginationSelector=".pagination-nav__item--next > a"
, but found that this included the 'Edit this page' icon and link. I was unable to determine how to exclude this in the parameter --excludeSelectors
. Are you able to help on that detail? (I found that all other exclusions I needed happened by default 😃)
@antonygibbs You can use chrome devtools to detect the CSS class for 'Edit this page' icon and link.
But... there is no specific Class for this element...
Is this one working ?
--excludeSelectors=".margin-vert--xl a"
(I found that all other exclusions I needed happened by default 😃)
=> Yes, I've also noticed this. Maybe docusaurus added CSS for print PDF by default. => Or, Maybe Chrome Api has changed.
@kohheepeace That totally worked! Thank you so much for responding to this thread today to offer assistance to us all, and the alternative of mr-pdf is great for some other teams here too, I am spreading the word!
... . I was able to get great PDF documentation from the command line
npx mr-pdf --initialDocsURL="http://localhost:3000/docs/{starting-page}" --paginationSelector=".pagination-nav__item--next > a"
, but ....
@antonygibbs How can this command work? The command you passed above has parameter --initialDocsURL
, but documentation of mr-pdf gives; --initialDocURLs
(note the location of letter s) . I am really confused, help me out here. @kohheepeace @antonygibbs . The command works with parameter described in the documentation; --initialDocURLs
.
I use Docusaurus 2.1.0 (tried with 2.0 beta versions first) and need to generate PDF from the documentation but, below is my adventure with no luck.
npx mr-pdf --initialDocsURL="http://localhost:3000/docs/intro" --paginationSelector=".pagination-nav__item--next > a" --excludeSelectors=".margin-vert--xl a"
error: unknown option '--initialDocsURL'
------------------------------
npx mr-pdf --initialDocURLs="http://localhost:3000/docs/intro" --paginationSelector=".pagination-nav__item--next > a" --excludeSelectors=".margin-vert--xl a"
error: required option '--contentSelector <selector>' not specified
-------------------------------
npx mr-pdf --initialDocURLs="http://localhost:3000/docs/intro" --paginationSelector=".pagination-nav__item--next > a" --excludeSelectors=".margin-vert--xl a" --contentSelector="article"
-- result: PDF generated. Only first page (intro)
The CSS selector for next page link has also changed in 2.0 versions. It was .pagination-nav__item--next
but now it is .pagination-nav__link--next
.
I would appreciate your help to generate PDF with all pages in my Docusaurus documentation project.
@idontknowjs :
Thanks @kohheepeace - But I've been using the latest version
2.0.0-beta.0
only.
I, too get the same error, and also with href
instead of src
sometimes. Did you manage to find a solution for that?
I used Docusaurus versions 2.0.0-beta.14
and 2.1.0
.
Is there any way I can generate pdf of site on button click instead of command line?
npx docusaurus-pdf http://localhost:3000/platformintro/intro intro.pdf
Error: The src attribute of the 'styles*.js' file could not be found! at getScriptPathFromHTML (C:\Users\lenovo\AppData\Roaming\npm-cache_npx\5804\node_modules\docusaurus-pdf\lib\index.js:100:15) at C:\Users\lenovo\AppData\Roaming\npm-cache_npx\5804\node_modules\docusaurus-pdf\lib\index.js:164:42 at processTicksAndRejections (internal/process/task_queues.js:93:5)