Code / Markdown

The Code/Markdown application in CryptPad is an integration of CodeMirror.

../../_images/app-code-preview.png

Toolbar

Tools: Show/hide the text editor toolbar.

Insert: Add an image to the document. The image can be chosen in the CrpytDrive or uploaded. Logged in users

Theme: Set colors for the editor, detailed below.

Preview: Show/hide the Markdown preview pane.

Theme

Color by author: Highlight the text written by each user with their cursor color (picked in user settings). When active:

  • Hide author colors to turn off the display of colors in this window, the colors can be turned back on and remain active for other users.

  • Color by author > Clear and disable to turn off the colors for all users and delete the data.

Theme: Color scheme used in the code editor pane.

Language: Used for syntax highlighting.

Import/Export

File > Import.
Supported formats: Any plain text file, the file extension is used to determine the language.
File > Export.
Supported formats: .md, any other extension can be typed for the name of the exported file.

Markdown

The Code application is particularly suited for writing documents in Markdown: a lightweight syntax that offers basic formatting while remaining readable. Markdown is readily converted to other formats such as HTML.

Markdown syntax guide.

Additionally to basic Markdown syntax, the following features are also available:

  • [TOC] Inserts a table of contents.

  • Todo list

    • - [ ] task for a task to do: task.

    • - [x] task for a completed task: task.

  • Diagrams with Mermaid.

  • Mindmaps with Markmap.

  • Mathematical equations with Mathjax.

Images

It is strongly advised not to insert external images in documents. The Markdown syntax ![description](https://site.com/image.jpg) is supported but presents security risks. Malicious code can be hidden in images and result in data leakage.

For this reason, CryptPad makes use of media-tag to insert images from the CryptDrive. This syntax is more complex but it is managed automatically by the Insert menu.