GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — doc: add "Edit on GitHub" link by Trott · Pull Request #21703 · nodejs/node

Conversation

@Trott

@Trott Trott commented Jul 7, 2018

Copy link
Copy Markdown
Member

Proof of concept for an "Edit on GitHub" link, inspired by the
Serverless docs.

One issue is that the link is to the version of the docs on the master
branch even if the person was reading a different version of the doc. I
don't consider that a big problem, although we can always remove the
link if it turns out to be a big problem. I don't think there is a good
solution. PRs need to be opened against the master branch generally.
Having a bunch of PRs against staging branches is probably not what we
want. If there's an update to one version of the doc, there will usually
be an update to other versions.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • commit message follows commit guidelines

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@nodejs-github-bot

nodejs-github-bot commented Jul 7, 2018

Copy link
Copy Markdown
Collaborator

@Trott build started: https://ci.nodejs.org/blue/organizations/jenkins/node-test-pull-request-lite-pipeline/detail/node-test-pull-request-lite-pipeline/224/pipeline

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@nodejs-github-bot nodejs-github-bot added doc Issues and PRs related to Node.js documentation. tools Issues and PRs related to the tools directory. labels Jul 7, 2018
@Trott

Trott commented Jul 7, 2018

Copy link
Copy Markdown
Member Author

@nodejs/website

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jul 7, 2018

Copy link
Copy Markdown
Member Author

SVG should be in its own file.

CSS should be pulled out of the style attribute and into a CSS file.

If someone's motivated to do that, by all means, push right to the branch to update.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jul 7, 2018

Copy link
Copy Markdown
Member Author

@nodejs/documentation

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

apapirovski
apapirovski approved these changes Jul 7, 2018
View reviewed changes
@vsemozhetbyt

vsemozhetbyt commented Jul 7, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

The only issue is the all.html: it refers to the https://github.com/nodejs/node/edit/master/doc/api/_toc.md

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Jul 7, 2018

Copy link
Copy Markdown
Contributor

It seems this part of the newborn allhtml.js needs to be updated:

node/tools/doc/allhtml.js

Lines 50 to 54 in 01eee53

// Replace various mentions of _toc with all.
let all = toc.replace(/_toc\.html/g, 'all.html')
.replace('_toc.json', 'all.json')
.replace('api-section-_toc', 'api-section-all')
.replace('data-id="_toc"', 'data-id="all"');

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jul 7, 2018

Copy link
Copy Markdown
Member Author

Probably the thing to do is not have the link in all.html?

vsemozhetbyt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@vsemozhetbyt

vsemozhetbyt commented Jul 7, 2018

Copy link
Copy Markdown
Contributor

Seems so. We can remove it in the same part. Also, we will need to rebase and update again if https://github.com/nodejs/node/pull/21637/files#diff-faeb3c03dc0d66ce9c5820ab41dc9f58 is landed before this PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@richardlau

richardlau commented Jul 8, 2018

Copy link
Copy Markdown
Member

Is there a danger of encouraging collaborators to commit directly to the master branch instead of raising a PR? I think the edit link also creates branches in the main repo instead of your fork (at least if you have a commit bit)?

TimothyGu, maclover7, and rgbkrk reacted with thumbs up emoji
All reactions
  • 👍 3 reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

silverwind
silverwind reviewed Jul 8, 2018
View reviewed changes
Comment thread tools/doc/html.js Outdated

@silverwind silverwind Jul 8, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Slightly optimized version with xmlns removed because it's inline and .1px viewbox added because of a cropping issue in the original logo:

<svg height="16" width="16" viewBox="0 0 16.1 16.1"><path d="M8 0a8 8 0 0 0-2.5 15.6c.4 0 .5-.2.5-.4v-1.5c-2 .4-2.5-.5-2.7-1 0-.1-.5-.9-.8-1-.3-.2-.7-.6 0-.6.6 0 1 .6 1.2.8.7 1.2 1.9 1 2.4.7 0-.5.2-.9.5-1-1.8-.3-3.7-1-3.7-4 0-.9.3-1.6.8-2.2 0-.2-.3-1 .1-2 0 0 .7-.3 2.2.7a7.4 7.4 0 0 1 4 0c1.5-1 2.2-.8 2.2-.8.5 1.1.2 2 .1 2.1.5.6.8 1.3.8 2.2 0 3-1.9 3.7-3.6 4 .3.2.5.7.5 1.4v2.2c0 .2.1.5.5.4A8 8 0 0 0 16 8a8 8 0 0 0-8-8z"/></svg>

I'm fine with keeping the SVG in here, but the CSS should be in the css file.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
fhinkel
fhinkel approved these changes Jul 8, 2018
View reviewed changes
hiroppy
hiroppy approved these changes Jul 8, 2018
View reviewed changes
JungMinu
JungMinu approved these changes Jul 9, 2018
View reviewed changes
PeterDaveHello
PeterDaveHello approved these changes Jul 9, 2018
View reviewed changes
@Trott
Trott force-pushed the edit-on-github branch from be52412 to 821e484 Compare July 10, 2018 22:47
sagirk
sagirk approved these changes Jul 11, 2018
View reviewed changes

@sagirk sagirk left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 🎉

I wanted to suggest alt="GitHub Icon" for the SVG, but in retrospect I think it will just add more noise. The Edit on GitHub link text is already pretty sufficient.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@silverwind

silverwind commented Jul 11, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Not a fan of loading SVG as <img> as it forbids styling. Can you load the content with a fs.readFile and then paste it inline? In that case, you can omit the xmlns attribute as it is optional for inline SVG.

Also, I suggest applying fill: currentColor to it so it matches the text color like this:

screenshot 2018-07-11 at 10 29 08

screenshot 2018-07-11 at 10 29 24

sagirk reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

silverwind
silverwind suggested changes Jul 11, 2018
View reviewed changes

@silverwind silverwind left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Trott added 4 commits July 12, 2018 19:55
@Trott
doc: add "Edit on GitHub" link
7252864
Proof of concept for an "Edit on GitHub" link, inspired by the
Serverless docs.

One issue is that the link is to the version of the docs on the master
branch even if the person was reading a different version of the doc. I
don't consider that a big problem, although we can always remove the
link if it turns out to be a big problem. I don't think there is a good
solution. PRs need to be opened against the master branch generally.
Having a bunch of PRs against staging branches is probably not what we
want. If there's an update to one version of the doc, there will usually
be an update to other versions.
@Trott
squash! update svg per silverwind
9d6f38d
@Trott
squash! move css and svg to own files
3620da2
@Trott
squash! do not include edit-on-github link in all.html
d0df43f
@Trott
Trott force-pushed the edit-on-github branch from e4c2b1c to d0df43f Compare July 13, 2018 03:13
@Trott

Trott commented Jul 13, 2018 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member Author

The only issue is the all.html

@vsemozhetbyt Fixed. The link is now omitted in all.html.

vsemozhetbyt reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jul 13, 2018

Copy link
Copy Markdown
Member Author

Is there a danger of encouraging collaborators to commit directly to the master branch instead of raising a PR?

@richardlau It's a possibility. I'm inclined to give our Collaborators the benefit of the doubt on this until we have a problem, but that's my opinion only and this is certainly something reasonable people can disagree on. Is this a blocking problem to you (@richardlau) or any of the Collaborators that gave the comment a 👍 (@TimothyGu, @maclover7)?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@richardlau

richardlau commented Jul 13, 2018

Copy link
Copy Markdown
Member

Not blocking for me -- Just wanted to make sure we're aware of potential downsides.

Trott reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott
squash! move svg inline again
c69cae7
@Trott

Trott commented Jul 13, 2018

Copy link
Copy Markdown
Member Author

@silverwind I've moved the SVG inline again. PTAL. Thanks.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott

Trott commented Jul 13, 2018

Copy link
Copy Markdown
Member Author

CI: https://ci.nodejs.org/job/node-test-pull-request/15841/

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

silverwind
silverwind approved these changes Jul 13, 2018
View reviewed changes
ckotzbauer
ckotzbauer approved these changes Jul 13, 2018
View reviewed changes
Trott added a commit to Trott/io.js that referenced this pull request Jul 14, 2018
@Trott
doc: add "Edit on GitHub" link
61cd101
Proof of concept for an "Edit on GitHub" link, inspired by the
Serverless docs.

One issue is that the link is to the version of the docs on the master
branch even if the person was reading a different version of the doc. I
don't consider that a big problem, although we can always remove the
link if it turns out to be a big problem. I don't think there is a good
solution. PRs need to be opened against the master branch generally.
Having a bunch of PRs against staging branches is probably not what we
want. If there's an update to one version of the doc, there will usually
be an update to other versions.

PR-URL: nodejs#21703
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
@Trott

Trott commented Jul 14, 2018

Copy link
Copy Markdown
Member Author

Landed in 61cd101

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Trott Trott closed this Jul 14, 2018
targos pushed a commit that referenced this pull request Jul 14, 2018
@Trott @targos
doc: add "Edit on GitHub" link
0de0f89
Proof of concept for an "Edit on GitHub" link, inspired by the
Serverless docs.

One issue is that the link is to the version of the docs on the master
branch even if the person was reading a different version of the doc. I
don't consider that a big problem, although we can always remove the
link if it turns out to be a big problem. I don't think there is a good
solution. PRs need to be opened against the master branch generally.
Having a bunch of PRs against staging branches is probably not what we
want. If there's an update to one version of the doc, there will usually
be an update to other versions.

PR-URL: #21703
Reviewed-By: Anatoli Papirovski <[email protected]>
Reviewed-By: Franziska Hinkelmann <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Minwoo Jung <[email protected]>
Reviewed-By: Roman Reiss <[email protected]>
@targos targos mentioned this pull request Jul 17, 2018
v10.7.0 proposal #21851
Merged
This was referenced Jul 18, 2018
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#207
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#208
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#209
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#210
Closed
2018-07-18 Version 10.7.0 (Current) @targos beevelop/docker-nodejs#211
Closed
@richardlau richardlau mentioned this pull request Jul 19, 2018
doc - Document MODULE_NOT_FOUND error code #21890
Closed
@refack refack mentioned this pull request Oct 31, 2018
docs: When using the "Edit on GitHub" button references to the guides are not obvious #24003
Closed
@Trott
Trott deleted the edit-on-github branch January 13, 2022 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JungMinu JungMinu JungMinu approved these changes
+7 more reviewers
@apapirovski apapirovski apapirovski approved these changes
@fhinkel fhinkel fhinkel approved these changes
@silverwind silverwind silverwind approved these changes
@sagirk sagirk sagirk approved these changes
@hiroppy hiroppy hiroppy approved these changes
@PeterDaveHello PeterDaveHello PeterDaveHello approved these changes
@ckotzbauer ckotzbauer ckotzbauer approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

doc Issues and PRs related to Node.js documentation. tools Issues and PRs related to the tools directory.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

12 participants

@Trott @nodejs-github-bot @vsemozhetbyt @richardlau @silverwind @apapirovski @fhinkel @sagirk @hiroppy @PeterDaveHello @JungMinu @ckotzbauer
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.