Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use preferred-format in "Code Block" shortcut #11061

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 8 additions & 8 deletions src/main/frontend/commands.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,6 @@
["C" (->priority "C")]]

;; advanced

[["Query" [[:editor/input "{{query }}" {:backward-pos 2}]
[:editor/exit]] query-doc]
["Zotero" (zotero-steps) "Import Zotero journal article"]
Expand All @@ -290,18 +289,19 @@
(println "draw file created, " path))
text)) "Draw a graph with Excalidraw"]
["Embed HTML " (->inline "html")]

["Embed Video URL" [[:editor/input "{{video }}" {:last-pattern command-trigger
:backward-pos 2}]]]

["Embed Youtube timestamp" [[:youtube/insert-timestamp]]]

["Embed Twitter tweet" [[:editor/input "{{tweet }}" {:last-pattern command-trigger
:backward-pos 2}]]]

["Code block" [[:editor/input "```\n```\n" {:type "block"
:backward-pos 5
:only-breakline? true}]
["Code block" [(case (state/get-preferred-format)
:markdown [:editor/input "```\n```\n" {:type "block"
:backward-pos 5
:only-breakline? true}]
:org [:editor/input "#+BEGIN_SRC \n#+END_SRC\n"
{:type "block"
:backward-pos 11
:only-breakline? true}])
[:editor/select-code-block-mode]] "Insert code block"]]

@*extend-slash-commands
Expand Down