FeaturesTemplatesShowcaseTownie
AI
BlogDocsPricing
Log inSign up
justbe
justbehighlight
Public
Like
highlight
Home
Code
2
README.md
H
main.tsx
Branches
1
Pull requests
Remixes
History
Environment variables
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in miliseconds.
Sign up now
Code
/
Code
/
Search
Open in new tab
README.md

Highlight

This val exposes and endpoint that you can post code to and get back syntax highlighted html via Shiki. Shiki does server side highlighting, so it's perfect for val.town. You can switch themes by providing ?theme=<theme> and specify the language via ?lang=<language>

Example

You can play with a working example here.

Create val
const res = await fetch(`https://just_be-highlight.web.val.run?lang=${lang}&theme=${theme}`, { method: "POST", body: code, }); console.log(await res.text())

Why?

I want to add syntax highlighting to my blog soon and I'm experimenting with what it mean to offload parts of my rendering to val.town (behind a content-addressible cache, of course).

Code
README.md
H
main.tsx
Go to top
X (Twitter)
Discord community
GitHub discussions
YouTube channel
Bluesky
Product
FeaturesPricing
Developers
DocsStatusAPI ExamplesNPM Package Examples
Explore
ShowcaseTemplatesNewest ValsTrending ValsNewsletter
Company
AboutBlogCareersBrandhi@val.town
Terms of usePrivacy policyAbuse contact
© 2025 Val Town, Inc.