# Set up (see https://code.visualstudio.com/api/working-with-extensions/publishing-extension)
npm install -g vsce
# Build and package
(cd ./ckeditor5-build-markdown && npm run build)
# Remember to increment the version in package.json
vsce package
code --force --install-extension $(find -name "markdown-wysiwyg*" | tail -1)
# Publish extension
vsce publish
npx ovsx publish -p ${OVSX_TOKEN}
# Run CKEditor5 subproject
(cd ./ckeditor5-build-markdown && npm start)
Implements a CustomTextEditor
for markdown (.md) files.
Our CustomTextEditor
implementation (called MarkdownEditorProvider
) is defined in markdownEditor.js
and registers a webview to show the user when that editor is active
Communication between the webview and VS Code is done using vscode.postMessage
and is described here
The method getHtmlForWebview
defines what this webview looks like, in our case importing and rendering a custom CKEditor5 build for markdown from the folder ckeditor5-build-markdown
. It then runs markdownEditorInitScript
inside the webview to register.
- Add autolink to CKE editor
- Sync scroll position (to plain editor and to markdown preview)
- Do it like this https://stackoverflow.com/questions/54556208/scroll-to-marker-in-ckeditor-5
- And need this for importing that function https://stackoverflow.com/questions/61307979/how-to-import-npm-packages-in-vs-code-webview-extension-development
- Remove breadcrumb
- Add code formatting
- ckeditor/ckeditor5#1354
- ckeditor/ckeditor5#6309
- ckeditor/ckeditor5#436
- ckeditor/ckeditor5#5769
- I couldnt get this working without errors
- Support pasting clipboard images like https://github.com/telesoho/vscode-markdown-paste-image
- Support DocumentSymbolProvider so that the outline and breadcrumb views aren't blank
- https://stackoverflow.com/a/59132169/3620725
- Need this upstream issue completed first: microsoft/vscode#97095
- Support extended HTML features https://ckeditor.com/docs/ckeditor5/latest/features/markdown.html#extending-formatting-support
- Figure out how to toggle between editors without saving and without showing a popup prompt
- Improve support for keyboard shortcuts, eg. the shortcut should automatically appear in brackets when hovering the toolbar button
- Fix the following markdown not being shown as bullets
- one
- two
- three
- Don't clear undo history on save