athens icon indicating copy to clipboard operation
athens copied to clipboard

Integrate with CodeMirror for code blocks

Open neotyk opened this issue 3 years ago • 5 comments

Start of implementation is already done within md-parser.

neotyk avatar Apr 19 '21 22:04 neotyk

AFAIK Codemirror is meant to create an editable space for writing code. Can we be sure that all the cursor behavior, transactions, and keyboard shortcuts will be the same for codemirror as for other blocks?

shanberg avatar Apr 19 '21 22:04 shanberg

@shanberg I think we can just ignore basically most keybindings when inside CodeMirror.

tangjeff0 avatar Apr 19 '21 22:04 tangjeff0

There are libraries which only perform the syntax highlighting like prism or highlight.js if the overhead of CodeMirror's whole stack isn't desirable.

zolrath avatar May 20 '21 22:05 zolrath

I would already be happy to have at least a code block, something like this, but with working intents:

Screen Shot 2022-09-10 at 5 06 41 PM

The way I had to get to this is shameful and it's not even good looking nor can it be copied:

Screen Shot 2022-09-10 at 5 07 49 PM

I have no remorse whatsoever. 😂

Please tell me if there is a better way.

martin-braun avatar Sep 10 '22 15:09 martin-braun

We have some degree of code block I thought.

text
text
text

No indent though. @martin-braun

tangjeff0 avatar Sep 15 '22 11:09 tangjeff0