octokit.net icon indicating copy to clipboard operation
octokit.net copied to clipboard

[DOCS] Update all links to developer.github.com in docs and code comments to the more accurate docs.github.com

Open nickfloyd opened this issue 2 years ago • 2 comments

It's been a while since we've updated the documentation for octokit.net (*.md). The hostname for the docs site on GitHub has since changed from developer.github.com to docs.github.com so all of the references need to change given the redirects might not always be there and might not currently be accurate.

Things to watch out for:

  • This also includes the v3 URI segment - in most cases that can be removed for docs
  • There are close to 4000 lines that have a string segment of developer.github.com/v3 - most of them currently redirect property but we'll need to be more cautious around the more complex URLs
  • Make sure to sanitize out localization - en, https://docs.github.com/en/rest/issues should be https://docs.github.com/rest/issues etc... the docs site should handle all of that

nickfloyd avatar Jul 11 '22 14:07 nickfloyd

Planning this task a little more.

The below powershell script tells me there are 1928 unique URLs containing developer.github.com in the project.

Get-ChildItem -Path *.cs -Recurse | Select-String -Pattern '(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])' | Foreach-Object { $_.matches.Value } | Where-Object { $_ -Match "developer.github.com" } | Get-Unique | Measure-Object

So I exported a text file:

Get-ChildItem -Path *.cs -Recurse | Select-String -Pattern '(?:(?:https?|ftp|file):\/\/|www\.|ftp\.)(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[-A-Z0-9+&@#\/%=~_|$?!:,.])*(?:\([-A-Z0-9+&@#\/%=~_|$?!:,.]*\)|[A-Z0-9+&@#\/%=~_|$])' | Foreach-Object { $_.matches.Value } | Where-Object { $_ -Match "developer.github.com" } | Get-Unique >> links.txt

And I put that into Excel, which I'm linking here: https://1drv.ms/x/s!AuaqsrDoMOUHofFGQlnoE6jKbcuxHg?e=v7JX7a

I'm thinking the next step would be to do some quick analysis to see if there's a systemic way to approach it, or at least use the Excel file to create a checklist to break things down.

SeanKilleen avatar Sep 15 '22 21:09 SeanKilleen

Nice! How about this for a starter

  • Ensure https
  • Replace developer.github.com with docs.github.com
  • Remove v3
  • Change help.github.com (are these still valid)? Perhaps at this point re-assess what we've got and identify all the links in the code-base and test for validity. If we can see which are invalid, which are redirects and which are valid we can come up with the next steps?

JonruAlveus avatar Sep 16 '22 06:09 JonruAlveus