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

Create a link to open up the pages in vscode #358

Merged
merged 3 commits into from
Dec 29, 2024
Merged

Conversation

jlewi
Copy link
Owner

@jlewi jlewi commented Dec 29, 2024

Create a link in the right hand side bar to open up the current page in VSCode. If Runme is installed this will open it up as a notebook.

Here's how this work

  • VSCode registers to handle URI "vscode://" so you can use a URI like "vscode://file/some/file.md" to open that file in VScode.

So we customize the partial page-meta-links.html. This shows up in the right hand navigation bar and shows links to "edit the page". We add a link to this to open in VSCode using a vscode URI.

A limitation of "vscode://file" URIs is that they only work with absolute paths. So we need to know the BasePath where the repo is cloned in order to have the correct path. This will be different for every user. We can store this in localstorage. So we add some JS to get the value from localstorage and adjust the links.

We also add a settings page to allow users to set BasePath

Copy link

netlify bot commented Dec 29, 2024

Deploy Preview for foyle ready!

Name Link
🔨 Latest commit 1aa1dc4
🔍 Latest deploy log https://app.netlify.com/sites/foyle/deploys/67709eea9a0eb600084a6966
😎 Deploy Preview https://deploy-preview-358--foyle.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@jlewi jlewi merged commit 4c7f07f into main Dec 29, 2024
5 checks passed
@jlewi jlewi deleted the jlewi/editinvscode branch December 29, 2024 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant