#Codemirror
1 messages ยท Page 1 of 1 (latest)
i agree tbh
(plus codemirror made me angy lmao)
also
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
Yeah
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
i disagree tbh
i think andre summed it up best here: https://github.com/modrinth/knossos/pull/624#issuecomment-1250317493
I'd say it's a welcome change imo
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
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
is there shortcuts support so you can quickly make your text bold/italic/whatever ๐
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 :')
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
|
time to write our own library
that would absolutely justify the change ;)
i really would like that but i think what we can do with this is still limited
honestly,,,,, worth it
most of this comes from my growing hatred of codemirror lmao
I understand that point, but the main thing I want to get at is if something is being changed to knososs, the change should be done right. Codemirror kinda seems like a bandaid and is honestly not the best tool for solving this problem
i agree but i do think something similar is needed
would you be open to different tools like monaco and stuff like that?
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
i agree i just haven't found one yet lmao
But for making it more accessible, I would say just increasing the line height so the text is spaced out more would probably work
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
i agree that's definitely better i just don't think it's enough for an editor
this looks somewhat promising?
it's not bloated like codemirror ๐
it's not super actively maintained though but i don't think that's really a problem with something this small lmao
I think it's just a vue wrapper
wait, does it not use hljs?
can you use highlightjs?
ngl no clue what that is lmao
wait i just realized
oh, nevermind
highlight js is what the frontend uses for syntax highlighting in markdown code blocks
oh!! i always wondered what that was just not enough to actually check or ask lmao
it works with highlight js, just take a look at the highlighter plugin
that library looks good
can you link it pls im very confused lmao
import hljs from 'highlight.js/lib/core'
import markdown from 'highlight.js/lib/languages/markdown
hljs.highlightBlock(targetHTML)
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:
that's really good for this use case then lol
also i was gonna try to implement an example of it using your rewrite parity branch but i found a bug while doing so and don't really know where to post it since it's not even in test subjects yet
comment on pr
okiee
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
tryin to make things work:
I fixed the box shadow looking like that if you update your branch
i haven't committed anything yet so i can't rn unfortunately :')
i can't figure out why it's not working like it does in their CodeSandbox https://codesandbox.io/s/nuxt-vue-prism-editor-62e06?file=/components/CodeEditor.vue
i assume it's some global styles affecting it but i can't find it lmao
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
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
babe wake up new 999-based indexing just dropped ๐
it's only happening on nuxt?????
what
the vue-prism-editor plugin seems to be abandoned
last update was almost two years ago
it is but i don't think there's another good one i could find lmao
just write a new one :5Head: || /j ||
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
this bug still makes my brain hurt so if anyone else wants to take a stab at it, feel free pls lmao
just hide the first child of the line numbers w css?
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
yeahh :(
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
i tried to implement this and it hurt my brain im bad at things lmao