So I want to open a file in markdown preview, so when the certain command is triggered I want to open a file in vscode (but in markdown preview mode)
What have I tried so far:
- This will open the file in raw text mode
const docs = await workspace.openTextDocument("/path/to/file.md");
await window.showTextDocument(docs);
- This will trigger markdown command and the just opened file from above will be rendered in markdown preview
await commands.executeCommand("markdown.showPreview");
Is there a better way to achieve this, since it take fraction of seconds to open the file and then trigger markdown preview