1
0
mirror of synced 2025-12-19 09:57:42 -05:00

Move src/bookmarklets to docs-team (#58026)

This commit is contained in:
Kevin Heis
2025-10-16 13:28:23 -07:00
committed by GitHub
parent ae3d51da9a
commit fc1ff198f7
8 changed files with 0 additions and 59 deletions

View File

@@ -1,2 +1 @@
data/release-notes/
src/bookmarklets/

View File

@@ -61,10 +61,6 @@ When you're ready to stop your local server, type <kbd>Ctrl</kbd>+<kbd>C</kbd> i
If you would like to read more about debugging and troubleshooting the {% data variables.product.prodname_docs %} application, see [AUTOTITLE](/contributing/setting-up-your-environment-to-work-on-github-docs/troubleshooting-your-environment) in the github/docs repository.
### Using browser shortcuts
The [`src/bookmarklets`](https://github.com/github/docs/tree/main/src/bookmarklets) directory in the {% data variables.product.prodname_docs %} repository contains browser shortcuts that can help with reviewing {% data variables.product.company_short %} documentation. For more information, see the directory's [`README`](https://github.com/github/docs/tree/main/src/bookmarklets/README.md).
### Enabling different languages
By default, the local server does not run with all supported languages enabled. If you need to run a local server with a particular language, you can temporarily edit the `start` script in `package.json` and update the `ENABLED_LANGUAGES` variable.

View File

@@ -36,9 +36,7 @@ As an alternative, you can simply use [GitHub Codespaces](https://docs.github.co
In a matter of minutes, you will be ready to edit, review and test your changes directly from the comfort of your browser.
### Using browser shortcuts
The [`src/bookmarklets`](../src/bookmarklets) directory contains some browser shortcuts that can help with reviewing GitHub documentation. See [`src/bookmarklets/README.md`](../src/bookmarklets/README.md) for details.
### Enabling different languages

View File

@@ -215,7 +215,6 @@ export default [
ignores: [
'tmp/*',
'.next/',
'src/bookmarklets/*',
'rest-api-description/',
'docs-internal-data/',
'src/code-scanning/scripts/generate-code-scanning-query-list.ts',

View File

@@ -1,41 +0,0 @@
# Bookmarklets
The [bookmarklets](https://en.wikipedia.org/wiki/Bookmarklet) in this directory are browser shortcuts that may help with reviewing GitHub documentation. We may eventually build the functionality they provide into Docs review environments, but these are handy hacks for now.
## Installing bookmarklets
For each bookmarklet described below, create a new bookmark in your browser with a descriptive name, open the JavaScript file and copy its contents, and paste the JavaScript _as the bookmark's URL_.
Clicking the bookmark will then execute the JavaScript.
⚠️ For Safari, you'll need to do the following:
1. Go to **Safari** > **Preferences** > **Advanced** and enable **Show Develop menu in menu bar**.
2. Go to **Develop** and enable **Allow JavaScript from Smart Search field**.
## "View in development" toggle
[`src/bookmarklets/view-in-development.js`](./view-in-development.js)
When you're looking at a page on docs.github.com, clicking this bookmarklet will load the same path you're viewing but on your local server running at localhost:4000.
## "View in production" toggle
[`src/bookmarklets/view-in-production.js`](./view-in-production.js)
When you're looking at a page on your local server running at localhost:4000, clicking this bookmarklet will load the same path you're viewing but on the live documentation site at docs.github.com.
## Open a docs article in VS Code
[`src/bookmarklets/open-in-vscode.js`](./open-in-vscode.js)
When you're looking at a page on either docs.github.com, review, or localhost:4000, clicking this bookmarklet will open the source Markdown file from your local checkout in VS Code.
The installation requires a few steps:
1. Copy the contents of [`src/bookmarklets/open-in-vscode.js`](./open-in-vscode.js).
1. Browse to https://chriszarate.github.io/bookmarkleter/ and paste the code into the box.
1. Find the path of **your local checkout** of the docs repo you want to open files from (for example, `/Users/<USERNAME>/repos/docs`).
1. Paste the path in place of where it says `REPLACE_ME` in line 1 (make sure to leave the single quotes around it).
1. Change the title to something like `Open in VSC`.
1. Drag the generated link onto your bookmarks bar.

View File

@@ -1,8 +0,0 @@
/* The path to your local copy of repo */
const checkoutPath = 'REPLACE_ME'
const filepath = window.location.pathname.replace(/\/en\/([^@]+?@[^@]+?\/)?/, '/content/')
const isIndexFile = filepath.split('/').length < 5
const filename = isIndexFile ? '/index.md' : '.md'
const fullpath = 'vscode://file' + checkoutPath + filepath + filename
window.open(fullpath, '_blank')

View File

@@ -1 +0,0 @@
javascript:(()=>{window.location.href=window.location.href.replace(/https:\/\/docs\.github\.com/,'http://localhost:4000').replace(/https:\/\/.*\..*\.(com|net|dev|io|org|ms)/,'http://localhost:4000')})()

View File

@@ -1 +0,0 @@
javascript:(()=>{window.location.href=window.location.href.replace(/http:\/\/localhost:4000/,'https://docs.github.com').replace(/https:\/\/.*\..*\.(com|net|dev|io|org|ms)/,'https://docs.github.com')})()