Deft Docs

Markdown in Deft

Deft reads and writes ordinary Markdown files, with a few additions other note apps share. This page covers where Deft differs from other Markdown apps and the syntax it adds.


Line breaks and blank lines


Deft shows a note’s lines as you typed them. A single line break starts a new line, and every blank line adds a line of space, so three blank lines give three lines of space.


Most Markdown apps follow CommonMark instead: lines with no blank line between them are joined into one paragraph, and any number of blank lines counts as one. A note written in Deft can look different there. To keep a line break everywhere, end the line with a backslash (\), which Deft hides. Many renderers also have an option for line breaks, such as breaks: true in markdown-it and marked.



[[Note name]] links to the note of that name anywhere in the folder, written without its .md. [[Note name|other text]] goes to the same note; the editor shows both parts, and an export or copied HTML shows only the other text. Ordinary Markdown links to a file, like [text](folder/note.md), work too, relative to the note they’re in.


Ctrl+click a link (Cmd+click on a Mac) to follow it, or tap it on a phone or tablet. A plain click puts the cursor in the link, to edit it, except in a read-only note, where it follows the link.


Pictures


A pasted picture is saved in the note’s folder as Pasted_image_ and the date and time, and a link to it goes in the note. A picture dragged in from outside the folder is copied there too, and one already in the folder is linked where it is. Insert › Image… in the right-click menu does the same with a file you choose.


![[name.png]] shows the picture of that name from anywhere in the folder, as Obsidian’s embeds do, so a vault from Obsidian shows its pictures as they are. To set a picture’s size, use HTML: <img src="name.png" width="400">.


Highlights, footnotes and math


  • ==text== highlights text.
  • [^1] marks a footnote, and a line starting [^1]: holds its text.
  • $x^2$ is math in a line of text, and $$ on lines of their own around a formula sets it on its own. Math is written in LaTeX.


Many note apps read these, but they aren’t part of standard Markdown, so another app may show them as plain text.


Tasks and bookmarks


- [ ] starts a task and - [x] a done one.


A bookmark is text between double braces, {{like this}}, which Deft hides. Bookmark in the right-click menu puts the braces around the selection, or around the whole line if nothing is selected, and takes them off a bookmark the cursor is in. In a code block, braces are plain text.


Properties


YAML between two --- lines at the very top of a note is its frontmatter, and Deft shows it as a list of properties. Click the list to edit the YAML as text. YAML that can’t be read stays as text, so nothing is hidden while you’re in the middle of an edit.


---
title: Field notes
tags: [birds, spring]
---


HTML


Deft shows the HTML a Markdown renderer would, short of anything that reaches outside the note: inline tags like <mark>, <sub> and <span style="…">, <br>, blocks of HTML, and pictures from the folder with <img>.


Scripts, <style>, forms, class and id attributes and pictures from the web aren’t shown. HTML with any of them stays as source, grayed out, rather than shown in part. As in any CommonMark renderer, Markdown inside a block of HTML isn’t formatted.