Log In  


I was wondering if anyone knew if there exists CSS code that I could use to post code on a website and have it look like the Pico-8 code editor?


P#65024 2019-06-06 08:08


Well, if there wasn't, there is now:


P#65026 2019-06-06 12:54

Holy heck, this is good! :D
Is this something others can use?

P#65027 2019-06-06 14:23

Sure, it uses prismjs as a code highlighter:

I then started with the font from this thread:

and edited it so that the special symbols were in the right place.

Created a custom syntax definition for prismjs that has all the built-in functions listed and a .css file to define all the colours.

It's part of a stupid website I use to put stuff online for my students, but you're more than welcome to steal what I've done. Props to @RhythmLynx who made the original font.

Website Repo: https://github.com/MalphasWats/computing.codes

Modified font:

Css File:

Prism & syntax definition:

HTML Template:

Example page:

it's all a bit fiddly because it's part of a github pages website. If you get stuck, I could probably separate it out into its own repository to make things a little more obvious.

P#65029 2019-06-06 14:32

Thanks a lot for sharing the info.
I'm sure this will come in handy!

P#65030 2019-06-06 16:09

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-09-22 04:47 | 0.017s | 2097k | Q:18