Guide
Code blocks are useful when you want to insert a code snippet or example into your document.
Add a code block
There are two ways to add a code block:
Type ```
Type / and find Code Block command (or use shortcut Cmd+Option+5)
(ns core.ex
(:refer-clojure :exclude [ex-cause ex-info name try])
(:require [cheshire.core :as cheshire]
[clojure.spec.alpha :as spec]
[clojure.string :as string]))
(def ex-name-default :core.error/internal)
(defn ex? [ex] (instance? Throwable ex))
(defn ex-name [ex] (:error/name (ex-data ex)))
(defn ex-cause [^Throwable ex]
(if-some [^Throwable cause (.getCause ex)]
(recur cause)
ex))
You can also wrap text in code block. Find Wrap code switcher in the top right corner of the code block.
Syntax highlighting
Find language switcher in the right top corner of the code block. Click it and select required language:
FAQ
How to exit a code block?
Code block is not vim, so it is relatively easy to exit it. Push Shift + Enter to exit a code block.