Plugin: Markdown

name

Markdown

icon

integration_instructions

description

Allows inserting Markdown into a note as well as editing the whole note as Markdown

instructions

This plugin allows you to insert Markdown content into a note at cursor position by typing {Markdown: Insert}.

Additionally, it allows showing a note's contents as markdown and saving any changes back to the note by selecting "Markdown: Edit note" from the note options. This is mostly useful for development purposes.

Important note about editing a whole note as Markdown: Currently, in the Amplenote plugin system the Markdown passed to plugins isn't 100% compatible with the Markdown passed from plugins. In some cases, content or formatting can get slightly modified when saving it back. It's even possible that data is lost in the process, so always be careful when using the Markdown note editing function and check the result is what you expect! Especially rich footnotes often get messed up in the process!



☕ If you like my work, you can buy me a coffee!

({
noteOption: {
'Edit note': {
async run (app, noteUUID) {
const oldContent = await app.getNoteContent({ uuid: noteUUID })
const newContent = await app.prompt('Edit note as Markdown:', {
inputs: [{
type: 'text',
value: oldContent
}]
})
if (newContent === null) return
 
await app.replaceNoteContent({ uuid: noteUUID }, newContent)
}
}
},
 
insertText: {
'Insert': {
async run (app) {
const newContent = await app.prompt('Enter Markdown content to insert:')
await app.context.replaceSelection(newContent ?? '')
}
}
}
})