Alpha: Ships on npm at 7.0.0-alpha.07.0.0-alpha.0

Highlight languages

Every language and alias a code window highlights, each with a sample line colored by the renderer's own highlighter.

A terminal section's lang, and every code window a Section type draws, names one of these. The highlighter is small and fixed: keywords, strings, comments and the added and removed lines of a diff. A name it does not know is refused at its path, as Closed sets lists.

44 names in HIGHLIGHT_LANGUAGES of @mdxui/site@7.0.0-alpha.0, each sample colored by highlight() itself, on a plate as the terminal Section type draws it.

Name and aliasesSample, as highlight() returns it
text
Tide tables for every berth, never colored.
bash sh shell zsh
export HARBOR_KEY=hb_live_42 && harbor tides --berth 7 # today
console
$ npx harbor-tides --berth 7
curl
curl -s "https://api.harbor.example/v1/tides?berth=7" -H "Authorization: Bearer $HARBOR_KEY"
http
GET /v1/tides?berth=7 HTTP/1.1
json jsonc
{ "berth": 7, "high": "04:12", "safe": true }
js javascript jsx
const tides = await fetch(url).then((r) => r.json()); // berth 7
ts typescript tsx
export const berth: number = 7; // the outer harbor
py python
def high(berth: int) -> str: return "04:12"  # berth 7
go golang
func High(berth int) string { return "04:12" } // berth 7
rb ruby
def high(berth) = "04:12" # berth 7
php
function high(int $berth): string { return "04:12"; } // berth 7
java
public String high(int berth) { return "04:12"; } // berth 7
kt kotlin
fun high(berth: Int): String = "04:12" // berth 7
cs csharp
public string High(int berth) => "04:12"; // berth 7
rs rust
fn high(berth: u32) -> String { String::from("04:12") } // berth 7
swift
func high(berth: Int) -> String { return "04:12" } // berth 7
sql
SELECT high FROM tides WHERE berth = 7; -- today
graphql gql
query { tide(berth: 7) { high low } }
yaml yml
berth: 7 # the outer harbor
toml
berth = 7 # the outer harbor
ini
berth = 7 ; the outer harbor
env dotenv
HARBOR_KEY=hb_live_42 # never commit it
html
<a href="/tides" class="tide">Tides</a>
xml
<tide berth="7">04:12</tide>
diff patch
- "berth": 6
+ "berth": 7