Closed kohheepeace closed 3 years ago
Implemented and close
@kohheepeace the sections are still not generated in the PDF. Please reopen this issue.
Steps to reproduce:
npx mr-pdf --initialDocsURL="https://zowe-docs.netlify.app/stable/getting-started/overview" --contentSelector="article" --paginationSelector=".pagination-nav__item--next > a" --excludeSelectors=".announcementBar_UUUQ,nav.navbar,.docSidebarContainer_3pwe,.docMainContainer_2pgU .col.col--3,footer.footer,.docItemContainer_2szM > .margin-vert--xl > .row > .col:first-child,.pagination-nav,.docsRating,.navbar__inner,.thin-scrollbar" --coverImage="https://docusaurus.io/img/docusaurus.png" --coverTitle="Zowe Documentation" --outputPDFFilename="zowe-docs.pdf"
This script is suppose to generate complete PDF for https://zowe-docs.netlify.app/ website. But only generates the first section.
@covalentbond Sorry,
Use, --initialDocURLs
with comma separete. Note that initialDocURLs
not initialDocsURL
.
--initialDocURLs="https://zowe-docs.netlify.app/stable/getting-started/overview,https://zowe-docs.netlify.app/stable/user-guide/installandconfig,https://zowe-docs.netlify.app/stable/extend/extend-zowe-overview"
But, in your document, there is a duplicate(two same section) in https://zowe-docs.netlify.app/stable/extend/extend-zowe-overview. Developing for Zowe application framework section.
So, PDF generation will loop and not finish.
@kohheepeace it gives an error: error: unknown option '--initialDocURLs'
I'm running this scrpit for the two sections only:
npx mr-pdf --initialDocURLs="https://zowe-docs.netlify.app/stable/getting-started/overview,https://zowe-docs.netlify.app/stable/user-guide/installandconfig" --contentSelector="article" --paginationSelector=".pagination-nav__item--next > a" --excludeSelectors=".announcementBar_UUUQ,nav.navbar,.docSidebarContainer_3pwe,.docMainContainer_2pgU .col.col--3,footer.footer,.docItemContainer_2szM > .margin-vert--xl > .row > .col:first-child,.pagination-nav,.docsRating,.navbar__inner,.thin-scrollbar" --coverImage="https://zowe-docs.netlify.app/img/zowe-icon.png" --coverTitle="Zowe Documentation" --outputPDFFilename="zowe-docs.pdf"
@covalentbond What is the log of mr-pdf -h
?
It says mr-pdf: command not found
?
Just to tell you, --initialDocsURL= PDF is still being generated this
@covalentbond
npx mr-pdf -h
Options:
--initialDocURLs <urls> set urls to start generating PDF from
--excludeURLs <urls> urls to be excluded in PDF
--contentSelector <selector> used to find the part of main content
--paginationSelector <selector> used to find next url
--excludeSelectors <selectors> exclude selector ex: .nav
--cssStyle <cssString> css style to adjust PDF output ex: body{padding-top: 0;}
--outputPDFFilename <filename> name of output PDF file
--pdfMargin <margin> set margin around PDF file
--pdfFormat <format> pdf format ex: A3, A4...
--coverTitle <title> title for PDF cover
--coverImage <src> image for PDF cover. *.svg file not working!
-h, --help output usage information
@kohheepeace here it is: Have you not updated the NPM package?
$ npx mr-pdf -h
Need to install the following packages:
mr-pdf
Ok to proceed? (y) y
Usage: mr-pdf [options]
Options:
--initialDocsURL <url> set url to start generating PDF from
--contentSelector <selector> used to find the part of main content
--paginationSelector <selector> used to find next url
--excludeSelectors <selectors> exclude selector ex: .nav
--cssStyle <cssString> css style to adjust PDF output ex: body{padding-top: 0;}
--outputPDFFilename <filename> name of output PDF file
--pdfMargin <margin> set margin around PDF file
--pdfFormat <format> pdf format ex: A3, A4...
--coverTitle <title> title for PDF cover
--coverImage <src> image for PDF cover. *.svg file not working!
-h, --help output usage information
@kohheepeace Note: I'm using Docusaurus V2 here.
@covalentbond sorry I'm so stupid. I forget to publish to npm. I updated and publish new version. Could you check it again ?
=> I was not stupid. I published npm correctly. I'm not sure why your npx reffer to old version.
@covalentbond And if you donwload mr-pdf
global, you don't need to donwload puppeteer everytime.
npm i -g mr-pdf
@kohheepeace Thank you!! It worked 🚀
--excludeURLs
was made to require, this option can be set to optional I think.Get Started
, User Guide
, Extend
, Troubleshoot
, Contribute
& Reference
and to print them we provide links of these sections respectively in --initialDocURLs=""
.--sectionHeadings="Get Started, User Guide, Extend....."
which will contain section headings seperated by commas to add section heading in TOC. It will be a great feature.Because in TOC, there is just a text Table of Contents and a very long list of links.. Just before each section starts in TOC, providing sub headings will make it easy for users to read it. Something like this:
@covalentbond glad to hear that.
I found that --excludeURLs was made to require, this option can be set to optional I think.
Okay thanks 👍
I would like to know what is the usecase of PDF in your case. Actually I'm not a fan of PDF, I'm making this PDF tools for future backup when closing document website.
@kohheepeace Yes, I completely agree that 800 pages PDF can be too annoying to read. But some of our users still like to read PDF. For that we need to provide them this.
But some of our users still like to read PDF. For that we need to provide them this.
@covalentbond I understand 👍
And I don't fully understand your feature requests. Do you mean having multiple TOC per section (at the beginning of section)?
Have a look at this PDF: https://docs.zowe.org/stable/Zowe_Documentation.pdf
We were using a diff library to create PDF for our Vuepress website. It is having section heading as well in the TOC. Like "Getting Started", "Extend"...
I'm willing if something this could also happen.
@kohheepeace did you get it?
@covalentbond yes, I understand 👍 But I've lost my motivation now, so don't expect quick fix 😉 👍
Yaa completely understand, it's still somewhat a feature. But can you fix the internal links issue reported at your earliest convenience, because we are planning to deploy the website publically in a few days! 😅
Were you able to figure out the reason why it was happening
https://github.com/kohheepeace/mr-pdf/issues/10#issuecomment-852218292