#Codemirror

1 messages ยท Page 1 of 1 (latest)

dreamy wing
#

actually in this channel it's probably fine

#

but not in translations

crisp anvil
#

i agree tbh

#

(plus codemirror made me angy lmao)

#

jesus

#

jesus x2

#

i was thinking that tbh i don't think there's much of another option lmao

#

do you want spaghetti code

#

also felt lmao

dreamy wing
#

Yeah

wide peak
#

Ryan, Iโ€™m not sure if the feature is useful or not for the costs

#

Syntax highlighting and line numbers are a really small benefit

crisp anvil
#

i disagree tbh

dreamy wing
#

I'd say it's a welcome change imo

wide peak
#

I mean, the monospaced font change is just a line of css for the textarea.

For syntax highlighting, it's a small benefit. It's easy enough to find typos by looking at the rendered markdown and seeing what it did not render properly.

The issues are that it doesn't integrate well at SSR, increases page load times/bundle size by quite a bit (impacting page load times), and adds a ton of colors which will have to be synced if we ever add new themes

Most of the benefits Andre said can just be fixed in the current textarea. I don't see the need for codemirror/another text editor being packaged into knossos when most annoyances are just a couple lines of CSS to fix

#

Like, enabling resizing on the textarea/making it grow when new text is added, and making it monospaced

crisp anvil
#

I don't think syntax highlighting is really a small benefit. I think it makes it a bit more accessible, especially with people that are dyslexic or people that just have a hard time reading large blocks of text with the same color in general. I'm dyslexic and writing READMEs on github sucks because of it.

i get the SSR concerns but it doesn't really seem to be performing worse (using lighthouse lmao)

#

oops sent early lmao

#

idk it just feels more accessible and i think even with the small performance trade-off, it seems worth it

#

(sorry im bad at articulating my thoughts :'))

#

y e a h

#

wait is there a plugin to make githubs code editor better

#

i just thought of this lmao

merry spear
#

is there shortcuts support so you can quickly make your text bold/italic/whatever ๐Ÿ‘€

crisp anvil
#

if there isn't i don't think it would be hard to write

#

i planned on that with my original proposal but codemirror confuses me lmao

#

oh no :')

merry spear
#

and also things like when you press enter in the list it would make another list item and if you don't type anything and press enter again it'd change to just line break

- hello|
- hello
- |
- hello

|
crisp anvil
#

time to write our own library

merry spear
#

that would absolutely justify the change ;)

crisp anvil
#

honestly,,,,, worth it

#

most of this comes from my growing hatred of codemirror lmao

wide peak
crisp anvil
#

would you be open to different tools like monaco and stuff like that?

wide peak
#

I don't think monaco is the best either

#

I don't think a full-blown code editor is needed, those are meant for sites like repl.it

#

I'm sure someone has made a lean markdown editor

crisp anvil
#

i agree i just haven't found one yet lmao

wide peak
#

But for making it more accessible, I would say just increasing the line height so the text is spaced out more would probably work

crisp anvil
#

it would help a bit but for me i don't think that would fix it

#

i feel like at least light syntax highlighting would be really nice to have

wide peak
#

line heights do a lot, see this vs this

#

(just the bullet points)

crisp anvil
#

i agree that's definitely better i just don't think it's enough for an editor

#

this looks somewhat promising?

wide peak
#

it's not bloated like codemirror ๐Ÿ˜„

crisp anvil
#

it's not super actively maintained though but i don't think that's really a problem with something this small lmao

wide peak
#

I think it's just a vue wrapper

#

wait, does it not use hljs?

#

can you use highlightjs?

crisp anvil
#

ngl no clue what that is lmao

wide peak
#

wait i just realized

#

oh, nevermind

#

highlight js is what the frontend uses for syntax highlighting in markdown code blocks

crisp anvil
#

oh!! i always wondered what that was just not enough to actually check or ask lmao

wide peak
#

that library looks good

crisp anvil
#

can you link it pls im very confused lmao

wide peak
#

import hljs from 'highlight.js/lib/core'
import markdown from 'highlight.js/lib/languages/markdown

hljs.highlightBlock(targetHTML)

crisp anvil
#

so like just ripping prism out of it and replacing it with hljs?

#

wait is it not using prismjs out of the box?

#

the repo acts like it is and then says:

You need to use the editor with a third party library which provides syntax highlighting. For example, it'll look like following with prismjs:

wide peak
#

Yeah you can use any syntax highlighting

#

It just uses prism as an example

crisp anvil
#

that's really good for this use case then lol

crisp anvil
wide peak
#

comment on pr

crisp anvil
#

okiee

crisp anvil
#

this is going,,,, well,,,

#

(normally like this i just disabled textarea stuff in the first one to see if it would render correctly lmao)

#

we have upgraded to this lmao

crisp anvil
#

tryin to make things work:

wide peak
#

I fixed the box shadow looking like that if you update your branch

crisp anvil
#

i haven't committed anything yet so i can't rn unfortunately :')

#

i assume it's some global styles affecting it but i can't find it lmao

crisp anvil
#

oh my fucking god

#

i spent hours yesterday trying to figure out why this didn't work

#

oh my god

#

import "vue-prism-editor/dist/prismeditor.min.css";

#

im gonna do a hate crime

#

the hate is myself rn lmao

crisp anvil
#

it works now but the first line says 999 and i don't know why lmao

#

god im glad this channel exists now so i can spam my pain lmao

merry spear
merry spear
#

the vue-prism-editor plugin seems to be abandoned

#

last update was almost two years ago

crisp anvil
#

it is but i don't think there's another good one i could find lmao

merry spear
#

just write a new one :5Head: || /j ||

crisp anvil
#

tbf,,,, it wouldn't be that hard it'll just be really annoying lmao

#

(since we're using highlightjs)

#

i think im gonna just have to rewrite the line numbers but that is a problem for future me lmao

crisp anvil
#

this bug still makes my brain hurt so if anyone else wants to take a stab at it, feel free pls lmao

wide peak
#

just hide the first child of the line numbers w css?

crisp anvil
#

yeah but it doesn't always happen and i'm not sure why

#

i thought it was line wrapping but it happens with small lines too

wide peak
#

and it only happens on nuxt?

#

that's weird

crisp anvil
#

yeahh :(

crisp anvil
#

holy living fuck it's maintained

#

i haven't done really any webdev in like,,, two weeks i'll probably check it out tomorrow if i can lmaoo

crisp anvil
#

i tried to implement this and it hurt my brain im bad at things lmao