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

[RFC]: add support for exporting API docs to a PDF #30

Open
3 tasks done
kgryte opened this issue Sep 10, 2021 · 8 comments
Open
3 tasks done

[RFC]: add support for exporting API docs to a PDF #30

kgryte opened this issue Sep 10, 2021 · 8 comments

Comments

@kgryte
Copy link
Member

kgryte commented Sep 10, 2021

Description

This RFC proposes adding support for exporting API docs to a PDF.

PDF documentation could be useful outside of the website and in the context of offline usage. PDF docs are common in, e.g., R and TeX documentation.

Generation of the PDF could be done either on-demand (client side; see htm2pdf.js) or pre-compiled on the server and simply sent on request.

HTML to PDF can be problematic, as a common technique is to capture HTML as an image, which prevents the generated PDF text from being searchable or selectable.

This RFC would benefit from gh-27, where JSON could be used to automatically generate TeX which could then be compiled to a PDF.

Related Issues

Related issues #27.

Questions

No.

Other

No.

Checklist

  • I have read and understood the Code of Conduct.
  • Searched for existing issues and pull requests.
  • The issue name begins with RFC:.
@Planeshifter
Copy link
Member

Planeshifter commented Sep 10, 2021

Alternatively, could use pdfmake in combination with html-to-pdfmake, which I have been using with some success.

@kgryte
Copy link
Member Author

kgryte commented Sep 10, 2021

Yeah, my sense is that anything HTML-to-PDF will be tricky/imperfect given our heavy reliance on CSS, and that a more robust conversion pipeline over the long term would be JSON-to-TeX.

@Planeshifter
Copy link
Member

Planeshifter commented Sep 30, 2021

While not getting us near the ability to export the entire docs as a PDF document, I tweaked our CSS a bit per 8eec861 to allow one to nicely print the current README.md from the docs website without any interface elements.

@Planeshifter
Copy link
Member

Here is an example:

array_shape_readme.pdf

We could consider having additional elements that are only visible when printing, e.g. some attribution / date of export. What do you think?

@Planeshifter
Copy link
Member

Also a added a button to print the currently selected README.md per a9495a1.

Dark theme:

image

Light theme:

image

@kgryte
Copy link
Member Author

kgryte commented Sep 30, 2021

Yeah, adding a copyright notice might be one thing to add, along with the date of export.

@Planeshifter
Copy link
Member

And maybe the version of the docs for which the README.md was exported...

@kgryte
Copy link
Member Author

kgryte commented Sep 30, 2021

Yeah, that makes sense, as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants