close
The Wayback Machine - https://web.archive.org/web/20201019225806/https://github.com/doocs/advanced-java/pull/185/
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

fix: change urls to make export to pdf works #185

Merged
merged 1 commit into from Aug 30, 2020
Merged

Conversation

@franklingu
Copy link
Contributor

@franklingu franklingu commented Aug 30, 2020

currently, there are a few urls with this pattern /docs/...

when trying to covert to pdf for this docsify project, it fails with such errors:

ERROR:
combineMarkdowns

Error: file /docs/micro-services/huifer-what's-microservice-how-to-communicate.md is not exist, but listed in summary.md

by changing "/docs/..." to "./docs/..." the export will work.

What is more, changing of the URLs make URL patterns in summary.md consistent

currently, there are a few urls with this pattern /docs/...

when trying to covert to pdf for this docsify project, it fails with such errors:
~~~
ERROR:
combineMarkdowns

Error: file /docs/micro-services/huifer-what's-microservice-how-to-communicate.md is not exist, but listed in summary.md
~~~

by changing "/docs/..." to "./docs/..." the export will work.

What is more, changing of the URLs make URL patterns in summary.md consistent
@franklingu
Copy link
Contributor Author

@franklingu franklingu commented Aug 30, 2020

this is the npm module to convert to pdf

https://www.npmjs.com/package/docsify-pdf-converter

and here is what I have as the setting

module.exports = {
  contents: [ "summary.md" ], // array of "table of contents" files path
  pathToPublic: "pdf/readme.pdf", // path where pdf will stored
  pdfOptions: "", // reference: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pagepdfoptions
  removeTemp: true, // remove generated .md and .html or not
  emulateMedia: "screen", // mediaType, emulating by puppeteer for rendering pdf, 'print' by default (reference: https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#pageemulatemediamediatype)
}
@franklingu
Copy link
Contributor Author

@franklingu franklingu commented Aug 30, 2020

我觉得完全可以加上一下export to pdf的相关指导,起码我这种喜欢pdf的会觉得不错

@yanglbme yanglbme merged commit 5f000b4 into doocs:master Aug 30, 2020
5 checks passed
5 checks passed
Header rules - adjava No header rules processed
Details
Pages changed - adjava 1 new file uploaded
Details
Redirect rules - adjava No redirect rules processed
Details
Mixed content - adjava No mixed content detected
Details
netlify/adjava/deploy-preview Deploy preview ready!
Details
yanglbme added a commit that referenced this pull request Aug 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.