# Run markdown code blocks in Atom?

**URL:** https://discourse.julialang.org/t/run-markdown-code-blocks-in-atom/20120
**Category:** General Usage
**Tags:** juno
**Created:** [January 26, 2019, 8:02am UTC](https://discourse.julialang.org/t/run-markdown-code-blocks-in-atom/20120 "2019-01-26T08:02:44Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [January 26, 2019, 8:02am UTC](https://discourse.julialang.org/t/run-markdown-code-blocks-in-atom/20120/1 "2019-01-26T08:02:44Z")

</div>

I quite enjoy the ability to run code blocks in a `.jmd` file directly inside atom. Would it somehow be possible to configure atom to run a

```julia
´´´julia
´´´

```

block in a regular markdown file (like `README.md`) in the same way?

Thanks!

---

<div class="post-metadata">

### Author: ![pfitzseb](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pfitzseb/32/45566_2.png) [@pfitzseb](https://discourse.julialang.org/u/pfitzseb)
#### Post date: [January 26, 2019, 9:48am UTC](https://discourse.julialang.org/t/run-markdown-code-blocks-in-atom/20120/2 "2019-01-26T09:48:44Z")

</div>

Yes. 🙂

So by default you can use `Julia: Run Block`, `Julia: Run Cell`, and `Julia: Run File` in any file, but the keybindings are only set in Julia files (or Weave files if you have `language-weave` installed).  
With [this commit](https://github.com/JunoLab/atom-julia-client/commit/5af0ea4d1a04446cb6de40e744d486080d154795) the `Run Cell` command will behave the same in all non-Julia files.

If you want keybindings for e.g. markdown files then you’ll need to copy the following code block into your keymap (open with `Application: Open your Keymap`):

```julia
'.platform-win32 .item-views > atom-text-editor[data-grammar="text md"],
 .platform-linux .item-views > atom-text-editor[data-grammar="text md"]':
  'ctrl-enter': 'julia-client:run-block'
  'shift-enter': 'julia-client:run-and-move'
  'ctrl-shift-enter': 'julia-client:run-file'
  'alt-enter': 'julia-client:run-cell'
  'alt-shift-enter': 'julia-client:run-cell-and-move'
  'alt-down': 'julia-client:next-cell'
  'alt-up': 'julia-client:prev-cell'
  'ctrl-j ctrl-m': 'julia-client:set-working-module'
  'ctrl-shift-c': 'julia-client:interrupt-julia'
  'ctrl-j ctrl-d': 'julia-client:show-documentation'
  'ctrl-j ctrl-g': 'julia-client:goto-symbol'

```

or

```julia
'.platform-darwin .item-views > atom-text-editor[data-grammar="text md"]':
  'cmd-enter': 'julia-client:run-block'
  'shift-enter': 'julia-client:run-and-move'
  'cmd-shift-enter': 'julia-client:run-file'
  'alt-enter': 'julia-client:run-cell'
  'alt-shift-enter': 'julia-client:run-cell-and-move'
  'alt-down': 'julia-client:next-cell'
  'alt-up': 'julia-client:prev-cell'
  'cmd-j cmd-d': 'julia-client:show-documentation'
  'cmd-shift-a': 'julia:select-block'
  'cmd-j cmd-g': 'julia-client:goto-symbol'

```

For others you’ll need to adapt the `[data-grammar="text md"]` part to whatever language you’re using at the time.

---

<div class="post-metadata">

### Author: ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)
#### Post date: [January 26, 2019, 9:57am UTC](https://discourse.julialang.org/t/run-markdown-code-blocks-in-atom/20120/3 "2019-01-26T09:57:17Z")

</div>

Wonderful! Thanks 😃

---

<div class="post-metadata">

### Author: ![kevbonham](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kevbonham/32/216165_2.png) [@kevbonham](https://discourse.julialang.org/u/kevbonham)
#### Post date: [January 26, 2019, 3:13pm UTC](https://discourse.julialang.org/t/run-markdown-code-blocks-in-atom/20120/4 "2019-01-26T15:13:33Z")

</div>

You can also just change the language on a file-by-file basis to be weave markdown. But this solution is probably better 😀
