Skip to content

Commit

Permalink
code: Add icon to toolbar for markdown files that opens the preview
Browse files Browse the repository at this point in the history
Whereas the reStructuredText part of the extension could copy the
patterns for previews established by VSCode's markdown support, doing
so for markdown files would (surprise, surprise!) create conflicts.

So, the toolbar button and command names have been "re-branded" to
make them distinct from the built-in markdown ones. The
reStructuredText part of the extension keeps its existing
keybindings (for now?) and no keybindings have been set for the
markdown side.

Open for suggestions as to what a good default keybinding could be :)

Ref: #780
  • Loading branch information
alcarney committed Apr 28, 2024
1 parent 0473558 commit 76f8316
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions code/changes/780.breaking.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The `Open Preview to the Side` and `Open Preview` commands have been renamed to `Preview Documentation in Split Window` and `Preview Documentation` respectively.
1 change: 1 addition & 0 deletions code/changes/780.enhancement.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Esbonio now adds an icon to the editor toolbar that opens the preview in markdown files.
10 changes: 5 additions & 5 deletions code/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@
"commands": [
{
"command": "esbonio.preview.open",
"title": "Open Preview",
"icon": "$(preview)",
"title": "Preview Documentation",
"icon": "$(open-preview)",
"category": "Esbonio"
},
{
"command": "esbonio.preview.openSide",
"title": "Open Preview to the Side",
"icon": "$(open-preview)",
"title": "Preview Documentation in Split Window",
"icon": "$(book)",
"category": "Esbonio"
},
{
Expand Down Expand Up @@ -418,7 +418,7 @@
"command": "esbonio.preview.openSide",
"alt": "esbonio.preview.open",
"group": "navigation",
"when": "resourceLangId == restructuredtext"
"when": "resourceLangId == restructuredtext || resourceLangId == markdown"
}
]
},
Expand Down

0 comments on commit 76f8316

Please sign in to comment.