#libraries for displaying code

24 messages ยท Page 1 of 1 (latest)

wanton kite
#

Is there a library that can display jsx/html code, can't find a normal one

rotund oceanBOT
#

๐Ÿ”Ž This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

๐Ÿ•ต๏ธ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

โœ… You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

wanton kite
#

libraries for displaying code

verbal crystal
#

I recommend the first one as its very easy to use and supports RSC

solar sapphire
#

But do you know any way to use Shiki to make an editable highlighter? Like codemirror but autocomplete isn't necessary

#

Just the highlight of code in a textarea for eg

tropic idol
solar sapphire
tropic idol
#

yes exactly

solar sapphire
#

Thanks for the help ๐Ÿ™‚

tropic idol
#

keep in mind though that it does add a lot to the bundle size

solar sapphire
#

Well that is totally expected and I guess it's ok because it will be heavy

tropic idol
#

yeah indeed, shiki is designed to be beautiful, not lightweight

solar sapphire
#

Also I don't think if it will impact performance much ๐Ÿค”

#

I mean not in a way that the user has to wait for like 10-20 seconds for the editor

tropic idol
#

yeah, it's not disastrously bad. for most users nowadays the perf hit won't even be noticeable

solar sapphire
#

yup

tropic idol
#

but you wont get the little green numbers in the build log lol

#

it will likely be red but it's ok