Allow using $path and $mcp placeholders in the string-type href option in the Contextual Menu
#1604
novusnota
started this conversation in
Bugs & Feedback
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
The contextual menu can be extended with custom options given in the
"contextual"→"options"field of thedocs.json.Each custom option requires a
hreffield, either as a string or as an object. The problem here is that the special placeholders, such as$path,$page, and$mcp, are only allowed whenhrefis given as an object, but not allowed when it is a string.Please, allow using at least the
$pathplaceholder in the string-typehrefoption, such that resulting URLs can be given as follows:{ // ... "href": "https://example.com/?page=$page" // ... }Here's a real-world example of a
docs.jsonsnippet that could happen if you port such small feature fromhrefs objects tohrefs links:{ // ... "contextual": { "options": [ { "title": "Open in GitHub", "description": "Open this page in the GitHub repository", "href": "https://github.com/ton-org/docs/blob/main/$page", "icon": "github" }, "copy", "chatgpt", "claude", "perplexity", "mcp", "cursor", "vscode" ] }, // ... }Beta Was this translation helpful? Give feedback.
All reactions