Hacker Newsnew | past | comments | ask | show | jobs | submit | retpoline's commentslogin

Sorry, I wondered how to express this correctly and I guess I failed

I've been writing from the perspective where you just generate the html/css and e.g put it on your site, so your users don't need to have js enabled


Oh that has on-hover tips, that's really cool


no no, unfortunely demo page still uses a few lines of js just to send request and display it (inserts that html/css into the page)

but the result is just css/html that you can copy/paste anywhere and you'll have the code with syntax colouring without js required

if I didn't have some troubles with newlines then there'd be form for javascript disabled users today too


It uses C# Compiler SDK (Roslyn) that allows to generate "something" even if the input is a mess

and then I use some heuristics to identify for example classes better, e.g by having popular classes names/substrings list and checking whether it is there - like Console, Controller, Service, DTO, Handler etc.

Of course it cannot be perfect because it has no access to the whole code, it uses just some fragment that may not even compile / be completed

but I think that you can achieve something reasonable and at worst you'll be able to tweak it manually.

The goal was bo be able to easily put C# code with VS/VSC colours on a web page and without having to use generic js colouring libs, so we can get something closer to real IDE

You can easily modify generated a few lines of CSS and have your own colours


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: