You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a link to open up the pages in vscode (#358)
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](https://github.com/google/docsy/blob/main/layouts/partials/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
{{ warnf "Warning: use of `github_url` is deprecated. For details, see https://www.docsy.dev/docs/adding-content/repository-links/#github_url-optional" -}}
14
+
<ahref="{{ $gh_url }}" target="_blank"><iclass="fa-solid fa-pen-to-square fa-fw"></i> {{ T "post_edit_this" }}</a>
15
+
{{ else if $gh_repo -}}
16
+
17
+
{{/* Adjust $path based on path_base_for_github_subdir */ -}}
0 commit comments