-
Notifications
You must be signed in to change notification settings - Fork 3.4k
feat: add "Edit on GitHub" links to each page #69
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
Conversation
👋 I'm your friendly documentation robot, and I'm going to build your pull request on our staging site so that you can review it. If you push up subsequent commits, I'll rebuild your staging area (and when this pull request is closed, I'll clean that staging area up). I'll let you know when I'm done! 🤖 |
👋 I've finished building this pull request on our staging site. 🤖 To see how it looks, visit: https://docs-staging.npmjs.com/69/ |
I still see |
This is to add "Edit on GitHub" links to all pages, including npm cli command pages. Is that an incorrect link on that page to edit that command? I realize that some of it is generated but I think the comments do a good job of pointing people to the correct page. And I would prefer doc PRs that are for generated content if the alternative is no PRs at all. |
I'm on the fence about that. Yes folks could discover through the documentation repo that the cli is the best place to edit those files, I'd just like to set them up for success. I suppose the real issue is just that: better directing folks who are trying to submit PRs to the documentation repo when the files are sourced from the CLI. |
Is it possible to not have the I have a similar concern for the the CLI docs, where this is pointing folks towards a place to make doc changes where we can't actually land them (although we can transfer to the CLI repo). As it is right now I don't think we can land this, would like to ensure we are pointing people to the right place where we have this component |
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.
I want to see the "edit on github" link only appear on pages that can actually be edited in the repository
This PR should be pointing people to the cli repo. This is the page I end up on from the access command page: afaict, this page does contain some canonical source for documentation. And the rest is contained in other |
@MylesBorins Do you have a list of pages like policies that I should turn this off on? That should be easy to apply to individual pages. |
@lukekarrys we should turn this off for the entirety of the policies section and for all index pages. I was mistaken re: CLI changes, great work there 👍🏼 |
I didn’t realize the index pages were generated. I will turn the edit links off on those too. |
This also does some the following chores: - Updates to node 16 and npm 8 - Fixes relative urls for published site - Simplifies package.json scripts - Turns on and fixes GitHub edit links ref: npm/documentation#69
This also does some the following chores: - Updates to node 16 and npm 8 - Fixes relative urls for published site - Simplifies package.json scripts - Turns on and fixes GitHub edit links - Uses package.json files to reduce package size ref: npm/documentation#69
This also does some the following chores: - Updates to node 16 and npm 8 - Fixes relative urls for published site - Simplifies package.json scripts - Turns on and fixes GitHub edit links - Uses package.json files to reduce package size ref: npm/documentation#69
This also does some the following chores: - Updates to node 16 and npm 8 - Fixes relative urls for published site - Simplifies package.json scripts - Turns on and fixes GitHub edit links - Uses package.json files to reduce package size - Links packages via workspaces - Installs with only root package lock ref: npm/documentation#69
This also does some the following chores: - Updates to node 16 and npm 8 - Fixes relative urls for published site - Simplifies package.json scripts - Turns on and fixes GitHub edit links - Uses package.json files to reduce package size - Links packages via workspaces - Installs with only root package lock ref: npm/documentation#69
This also does some the following chores: - Updates to node 16 and npm 8 - Fixes relative urls for published site - Simplifies package.json scripts - Turns on and fixes GitHub edit links - Uses package.json files to reduce package size - Links packages via workspaces - Installs with only root package lock ref: npm/documentation#69
27ecda5
to
ec64875
Compare
I converted this to a draft PR while waiting on a publish from npm/doctornpm#2 which enables the settings used in this PR. This adds the "edit on GitHub" links to all pages, except policy pages.
|
@MylesBorins The only change from what we discussed previously is that I left in the edit links on the index pages, since some of them are not generated. If there are some that we still want to turn off manually, that can still be done.
|
ec64875
to
dfdc638
Compare
@lukekarrys I'm still seeing the edit link on the policy pages FYI (testing staging and locally) |
Sorry, I should've wrapped this part in 🚨 emojis:
Can you help me get publish access to that? |
This adds the "edit on GitHub" links to all pages, except policy pages. All pages point to their direct counterpart in either this repo or `npm/cli` with the following exceptions: - Generated index pages in the `/cli/` section point to `npm/cli/edit/<BRANCH>/docs/nav.yml` since those contain the section titles. - The root edit link in the sidebar is removed since it doesn't make sense to link directly to the homepage of this repo when content is split across both repos. - `index.mdx` pages in all other sections are linked to directly since many of them contain at least some canonical content. I added a comment to each page in the source indicating that the hierarchical links in those pages are generated based on `src/nav-base.yml`. Closes #48
dfdc638
to
6f57364
Compare
converting back to draft because i broke something |
@MylesBorins this is ready for review again! |
@@ -52,27 +50,6 @@ const cliUrl = '/cli'; | |||
const cliNavFile = path.join('docs', 'nav.yml'); | |||
const cliContentPath = path.join('docs', 'content'); | |||
|
|||
const indexMarkdown = `<Index depth="1" />`; | |||
|
|||
const translations = { |
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.
These titles are now generated directly from the cli nav: https://github.com/npm/cli/blob/latest/docs/nav.yml#L5
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
This setting is part of the theme config. Setting it to
true
workedfor all pages except
cli/**/index.mdx
pages which live in this repoand not
npm/cli
. This updates the import script to not set per pagegithub_*
config values forindex.mdx
pages.Closes #48