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

doc: adjusting formatting when printing #24325

Closed
wants to merge 1 commit into from

Conversation

tlhunter
Copy link
Contributor

As a weekend project I built a PDF generator for the Node.js docs. This project required making small changes to the documentation CSS for aesthetics. Take a look at these PDF files to view the CSS changes in action.

Here's an overview of these changes:

  • reduce page margin
  • remove emphasis from links as they're unclickable
    • i.e. color, and underlines when in deprecated block
  • hides expandable > history items since they're collapsed and unreadable
    • alternative: I can make these always expanded instead
  • removes horizontal scrollbar from bottom of print output
  • reduce stability rectangle sizes
    • normally they're full width, now they're as wide as the text
  • shrink all text and headlines slightly
    • they're now closer to what you'd find in a book
  • hide ToC
    • it takes up many many pages and is ultimately unclickable
Checklist

- reduces page margins
- removes emphasis from links
- hides expandable history items
- removes horizontal scrollbar from bottom of print output
- reduce stability rectangle sizes
- shrink headlines slightly
- hide ToC (as it's unclickable when printed)

Ref: https://thomashunter.name/nodejs-documentation-pdf
@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Nov 12, 2018
@tlhunter
Copy link
Contributor Author

/cc @refack

@refack
Copy link
Contributor

refack commented Nov 12, 2018

Hello @tlhunter and thank you for the contribution!

@refack
Copy link
Contributor

refack commented Nov 12, 2018

Lite CI https://ci.nodejs.org/job/node-test-pull-request-lite-pipeline/1586/

I'll setup a demo site so we can compare the generated docs.

@Trott
Copy link
Member

Trott commented Nov 17, 2018

@nodejs/website

@Trott
Copy link
Member

Trott commented Nov 17, 2018

Since these are all under @media print, I think they're all pretty safe. And as you're actually generating PDFs and making them available to the public for offline use, I think you've got a pretty solid stake as a primary use case.

LGTM

Trott pushed a commit to Trott/io.js that referenced this pull request Nov 17, 2018
- reduces page margins
- removes emphasis from links
- hides expandable history items
- removes horizontal scrollbar from bottom of print output
- reduce stability rectangle sizes
- shrink headlines slightly
- hide ToC (as it's unclickable when printed)

Ref: https://thomashunter.name/nodejs-documentation-pdf

PR-URL: nodejs#24325
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Bryan English <[email protected]>
@Trott
Copy link
Member

Trott commented Nov 17, 2018

Landed in 344a46a

@Trott Trott closed this Nov 17, 2018
@refack
Copy link
Contributor

refack commented Nov 17, 2018

@refack
Copy link
Contributor

refack commented Nov 17, 2018

Maybe we can follow up with an improvement to the visual of class="api_stability api_stability_2"

@WaleedAshraf
Copy link
Contributor

I see this in print preview on chrome using @refack links.

Pre:

screenshot 2018-11-17 at 11 09 08 pm

Post:

screenshot 2018-11-17 at 11 09 26 pm

@refack
Copy link
Contributor

refack commented Nov 17, 2018

I see this in print preview on chrome using @refack links.

@WaleedAshraf Do you have "Background Graphics" checked?
image

@WaleedAshraf
Copy link
Contributor

@refack Got it.
Yup, with "Background graphics" it's the same view as you posted above.

targos pushed a commit that referenced this pull request Nov 18, 2018
- reduces page margins
- removes emphasis from links
- hides expandable history items
- removes horizontal scrollbar from bottom of print output
- reduce stability rectangle sizes
- shrink headlines slightly
- hide ToC (as it's unclickable when printed)

Ref: https://thomashunter.name/nodejs-documentation-pdf

PR-URL: #24325
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Bryan English <[email protected]>
@tlhunter tlhunter deleted the print-css branch November 19, 2018 02:25
rvagg pushed a commit that referenced this pull request Nov 28, 2018
- reduces page margins
- removes emphasis from links
- hides expandable history items
- removes horizontal scrollbar from bottom of print output
- reduce stability rectangle sizes
- shrink headlines slightly
- hide ToC (as it's unclickable when printed)

Ref: https://thomashunter.name/nodejs-documentation-pdf

PR-URL: #24325
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Bryan English <[email protected]>
@BridgeAR BridgeAR mentioned this pull request Dec 5, 2018
4 tasks
codebytere pushed a commit that referenced this pull request Jan 12, 2019
- reduces page margins
- removes emphasis from links
- hides expandable history items
- removes horizontal scrollbar from bottom of print output
- reduce stability rectangle sizes
- shrink headlines slightly
- hide ToC (as it's unclickable when printed)

Ref: https://thomashunter.name/nodejs-documentation-pdf

PR-URL: #24325
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Bryan English <[email protected]>
@codebytere codebytere mentioned this pull request Jan 15, 2019
codebytere pushed a commit that referenced this pull request Jan 29, 2019
- reduces page margins
- removes emphasis from links
- hides expandable history items
- removes horizontal scrollbar from bottom of print output
- reduce stability rectangle sizes
- shrink headlines slightly
- hide ToC (as it's unclickable when printed)

Ref: https://thomashunter.name/nodejs-documentation-pdf

PR-URL: #24325
Reviewed-By: Rich Trott <[email protected]>
Reviewed-By: Bryan English <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc Issues and PRs related to the documentations.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants