File actions
File actions are used to open, create, or preview files in the editor.
Open file
To open a file in the editor, use the open
action. The open
action takes a file path
as an argument.
Create file
To create a new file in the editor, use the create
action. The create
action takes a file path
as an argument and optionally a content
or contentPath
argument.
The content
argument is used to define th content of the file. It is best used when it is a single line of text.
When you want to create a file with a large content, you can use the contentPath
argument. The contentPath
argument is used to define the path to the file in the .demo
folder. The content of the file will be read from the file in the .demo
folder and used as the content of the file to be created.
Preview markdown file
To preview a markdown file in the editor, use the markdownPreview
action. The markdownPreview
action takes a file path
as an argument.
Save current file
To save the current file in the editor, use the save
action.
Rename file
To rename a file in the editor, use the rename
action. The rename
action takes a file path
and a dest
argument.
Delete file
To delete a file in the editor, use the deleteFile
action. The deleteFile
action takes a file path
as an argument.