Editing and formatting
This guide provides an overview of the basic formatting features built into the Moment desktop app rich text editor: bold, italic, strikethrough, links, headers, block quotes, and so on.
Because all Moment docs are stored on your local device storage as plain-old Markdown files, you can also edit them with any text editor—Sublime, vscode, vim, emacs, ed, acme, etc. This guide will focus on editing via the rich text editor, but we will also show the underlying Markdown that’s written to disk, so it may still be of use if you plan to edit in another editor.
Paragraphs
Type text into the Moment rich text editor and press Enter
.
This creates a new paragraph.
Each paragraph in the underlying Markdown file will be separated by a blank line.
⚠️ Adjacent whitespace characters are collapsed
HTML and Markdown collapse adjacent whitespace characters. For example, this Markdown will be rendered as follows.
I have too many spaces.
⚠️ Adjacent line breaks are not collapsed
If you press Enter
multiple times, you will notice that Moment will faithfully create successive blank lines. Because HTML and Markdown collapse adjacent whitespace characters, adjacent line breaks would normally be collapsed into a single line break. But Moment represents successive line breaks with the HTML <br />
tag.
For
example.
Soft line breaks
Pressing Shift+Enter
in the editor will produce a soft line break.
In the underlying Markdown, Moment accomplishes this by escaping the newline.
Headings
Typing #
(the pound sign followed by a space) creates an H1 heading. Similarly, two pound signs produces an H2, three produces an H3, and so on.
Here is an H1
Here is an H2
Here is an H3
You can also convert a paragraph into a heading by highlighting it and using the rich text toolbar to select the level of heading you want.
Note that if you are editing the underlying Markdown files, you can also use the “alternative” syntaxes for headers:
Bold, italic, strikethrough
Inline text marks (e.g., bold, italic, strikethrough) can be applied with hotkey shortcuts (e.g., ⌘+b
), or by typing the Markdown syntax directly into the editor (e.g., typing **bold**
will produce bold text).
The full list of inline marks is here
As usual, you can also apply formatting by selecting some text and clicking the desired style in the rich text toolbar.
Inline code
Inline code marks can be added by wrapping text in `backtick`
characters.
⚠️ You cannot yet add this mark through the rich text toolbar or with hotkeys.
Links to other pages
The easiest way add a link to another page in a Moment doc is to use the rich text toolbar in the Moment rich text editor, although you can add them manually by typing Markdown syntax into the editor.
To add via the rich text toolbar, highlight some text and click the “link” button:
This will bring up the link editor. It provides a list of pages you can select from.
Inspecting the underlying Markdown file, you will see the link looks something like the following
Manually adding a page link
You can also this link manually by typing [link](/d/local/<doc ID>/<page ID>)
directly into the Moment rich text editor. To do this you’ll need to obtain the page Moment doc ID and the page ID.
Obtain the Moment copy the path to the page:
This will give you a path of the form ~/.moment/documents/<doc ID>/pages/<page ID>
. You can use the <doc ID>
and <page ID>
values when you manually type out the link: [link](/d/local/<doc ID>/<page ID>)
.
External links
Links can be added by typing the Markdown syntax directly into the Moment rich text editor, or by highlighting the desired text and adding the link with the rich text toolbar.
The easiest way is to use the Moment rich text editor toolbar. First, highlight some text and click the “link” button:
This will bring up the link editor. Instead of selecting a page, type the URL you’d like to link to:
Once done, the underlying Markdown file will appear like this:
Manually adding a link
Links can be added manually by typing the Markdown link syntax directly into the Moment rich text editor. For example, typing [Google](https://www.google.com)
directly into the Moment rich text editor will produce a link like this: Google. In the underlying Markdown file, it will appear as it does in the example above.
Images
⚠️ Image drag-and-drop does not work yet.
⚠️ Typing Markdown image syntax directly into the editor is a work in progress.
Currently, the only way to add images to a Moment doc is to copy and paste them from another source. For example, you can use ⌘+c
to copy an image in the macOS Finder, and then ⌘+v
to paste it into the Moment desktop app.
ℹ️ Images are stored in the Moment doc repository. They are not uploaded to the Moment cloud unless you sync your document to the Moment cloud repository.
Block quotes
Block quotes can be added by typing at the beginning of a line the characters >
(greater than symbold followed by a space). This produces a block quote like so:
Only someone who is well prepared has the opportunity to improvise.
—Ingmar Bergman
Ordered and Unordered Lists
Lists of various types can be added by typing at the begining of the line <integer>
(any integer followed by a space), -
(en dash followed by a space), *
(asterisk followed by a space), or +
(plus sign followed by a space). Respectively, they look like the following:
Numbered list item
Second numbered list item
En dash list item
Asterisk list item
Plus sign list item
This gets written to disk as follows:
It is also possible to create a list item using the rich text toolbar. Highlight some text, click the list submenu, and choose your list type:
Nesting, indenting, mixing list styles
In Moment, any list item can be indented freely, regardless of the indentation level of its peers. List items of different type can be mixed freely. For example:
I am a numbered list item
I am a bullet list item.
I am another list item
ℹ️ This behavior is different from the HTML and Markdown standards, which disallows both of these behaviors.
Task lists
In addition to normal list styles, Moment supports GitHub-flavored Markdown-style task lists. To create a task list type [ ]
(open square bracket, space, closed square bracket, space) or - [ ]
(en dash, space, open square bracket, space, closed square bracket space). It will look liek the following:
I am a task item!
Similarly, to manually create a list type [x]
or - [x]
(same as above, with an x
character):
I am a completed task item!
As with other list items, you convert existing text to a task list item by highlighting it, clicking the list submenu in the rich text toolbar, and choosing Task list
:
Like other list item types, task list items can be freely mixed with other list item types:
Bullet list item
Task list item
Bullet list item 2
Code blocks
Code blocks can be created by typing ```
(three backtick characters in a row.
Click the button in the upper right corner of the code block to choose which language syntax highlighter to use.
When you choose a language from the selector, this will be serialized to the underlying Markdown file with a language hint. For example, the last code block would look like this:
Horizontal rules
This is a horizontal rule:
Typing any of the following will produce a horizontal rule:
Next steps
Now that you know the basics of formatting a doc, you might like to try the following: