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

Create layout for exporting docs to PDF manually #1647

Closed
apaskulin opened this issue Jul 30, 2019 · 5 comments · Fixed by #1779
Closed

Create layout for exporting docs to PDF manually #1647

apaskulin opened this issue Jul 30, 2019 · 5 comments · Fixed by #1779
Assignees
Labels
enhancement New or updated site functionality in progress Currently being worked site development Improves docs.sensu.io functionality

Comments

@apaskulin
Copy link
Contributor

apaskulin commented Jul 30, 2019

User stories

  • As a maintainer, I can archive a past version of the docs by creating a downloadable PDF. This can be a manual process.
  • As a user needing docs for a past version of Sensu, I can download a PDF with copy-and-paste-able code sample, working links, and readable styles.

To do

Create a version of the docs that is suitable for export to PDF using Adobe Acrobat Pro's recursive output-to-PDF feature, including these considerations:

  • Fonts are adjusted to work well within PDF
  • Code samples are forced to wrap within text blocks instead of using a horizontal scrollbar
  • Content within language toggle blocks is accessible.

Resources

@apaskulin apaskulin added this to the Site development milestone Jul 30, 2019
@apaskulin apaskulin added the enhancement New or updated site functionality label Aug 9, 2019
@rnevius rnevius added the in progress Currently being worked label Aug 16, 2019
@rnevius
Copy link
Contributor

rnevius commented Aug 16, 2019

After thoroughly investigating and testing Adobe Acrobat Pro's PDF exporting tool set, I've encountered the following issues which would need to be resolved if we are to go this route:

  1. Standardization of internal links. Linking to headings is consistently broken (likely because multiple elements with the same id attribute exist in the same PDF document. These elements are on completely different pages on the website). Some internal links also try to open in a browser.
  2. Occasional broken images.
  3. Broken third-party assets.
  4. Print-only styles are not rendered. This means that we would have to use something other than @media print to redefine styles (e.g. an environment variable that is injected when the local server runs and which is checked for in partials to determine which CSS files are required).
  5. Broken tables.
  6. Incorrect Table of Contents.
  7. Footer content is printed multiple times.

@rnevius
Copy link
Contributor

rnevius commented Sep 3, 2019

A solution is currently being worked on in the feature/ebook branch.

@cwjohnston
Copy link
Contributor

Thanks @rnevius! One question regarding this point:

  1. Standardization of internal links. Linking to headings is consistently broken (likely because multiple elements with the same id attribute exist in the same PDF document. These elements are on completely different pages on the website). Some internal links also try to open in a browser.

I can see how this would happen if we were generating a PDF containing the content for multiple versions of the same product. Does that explain what you are seeing or is there more to it?

@rnevius
Copy link
Contributor

rnevius commented Sep 6, 2019

@cwjohnston

Linking to headings is consistently broken

This was probably just me getting unlucky with a few actual broken links during my original testing. Here's an example: https://docs.sensu.io/sensu-go/5.12/guides/plan-maintenance/#what-is-sensu-silencing ("event handlers" links to nowhere). This doesn't actually seem to be an issue with PDF export as originally suspected.

Some internal links also try to open in a browser.

This actually seems to be the main issue. I believe switching to relative links wherever possible should fix this.

@cwjohnston
Copy link
Contributor

@rnevius any updates on this?

We've recently discovered that our search functionality is impacted by the increasing number of versions we have documented (see #1761). I'd love for us to resolve this by using export docs to PDF as a way to deprecate and remove old documentation from this project.

@calebhailey calebhailey added the site development Improves docs.sensu.io functionality label Sep 23, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New or updated site functionality in progress Currently being worked site development Improves docs.sensu.io functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants