Détail du package

@scalar/code-highlight

scalar173.2kMIT0.1.4

Central methods and themes for code highlighting in Scalar projects

syntax, highlight, lowlight, highlightjs

readme

CI Contributors GitHub License Twitter Discord Scalar App

Scalar

<picture> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/b391b82f-d993-4e97-8a17-1c3c7ccbb19b"> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/579d0853-b2a5-4ea8-b2bd-a98753faeaf3"> Scalar API client </picture> <picture> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/9b639f2d-0204-4b15-b918-158072a9afa5"> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/be723d07-ec9c-4edb-b657-05a8bc05c7d6"> Scalar API Reference </picture>

An offline first API Client built for OpenAPI

└ Minimal, powerful & open-source
└ Integrates with dozens of API Frameworks (Elysia, Hono, FastAPI, etc)
└ Syncs directly with your server frameworks with our Watch Mode
└ First class OpenAPI (formerly Swagger) support
└ Environment variables and dynamic parameters
└ Save and organize requests into collections
Download (Windows, MacOS, Linux)
Try Online Demo

Interactive API Reference from OpenAPI/Swagger

└ Uses OpenAPI/Swagger documents
└ Request examples for many favorite languages and frameworks
└ Comes with an integrated API playground
└ Integrates with your favorite framework
└ Doesn't look like 2011
Try Demo

### Trusted by:

Quickstart

You’re just one HTML file away from having an awesome API reference:

<!doctype html>
<html>
  <head>
    <title>Scalar API Reference</title>
    <meta charset="utf-8" />
    <meta
      name="viewport"
      content="width=device-width, initial-scale=1" />
  </head>

  <body>
    <div id="app"></div>

    <!-- Load the Script -->
    <script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>

    <!-- Initialize the Scalar API Reference -->
    <script>
      Scalar.createApiReference('#app', {
        // The URL of the OpenAPI/Swagger document
        url: 'https://cdn.jsdelivr.net/npm/@scalar/galaxy/dist/latest.json',
        // Avoid CORS issues
        proxyUrl: 'https://proxy.scalar.com',
      })
    </script>
  </body>
</html>

Need a Custom Header? Check out this example: https://codepen.io/scalarorg/pen/VwOXqam

And there’s an ever-growing list of plugins and integrations:

Integrations

Built-in Support

The following frameworks have chosen Scalar API Reference as their default OpenAPI documentation UI, recognizing its developer-friendly features and modern design:


Managed Hosting

We’re offering a free and paid managed hosting on the edge, too:

  • Write your API documentation and publish your API references (free)
  • Get SSL and a super cool *.apidocumentation.com subdomain (free)
  • Write free text documentation (paid)
  • Collaborate with your whole team (paid)
  • Use any domain (paid)

Ready? Create your account on scalar.com.


Projects

Project Description
Scalar API Client API client
Scalar CLI Command-line interface
Scalar Galaxy OpenAPI Example
Scalar Mock Server OpenAPI Mock Server
Scalar Void Server HTTP Request Mirror
Scalar Open API Parser OpenAPI SDK
Scalar Sandbox Online OpenAPI Editor


Documentation

Topic Description
Themes Predefined themes, layouts & styling
Configuration The universal configuration object
Plugins Extend the functionality
OpenAPI OpenAPI and our extensions to it
Markdown The supported Markdown syntax


Community

We are API nerds. You too? Let’s chat on Discord: https://discord.gg/scalar


Contributions

Contributions are welcome! Read the CONTRIBUTING guide.

Top 10 Contributors (April 2025)



Top Contributors (All Time)

hanspagel
hanspagel
amritk
amritk
xC0dex
xC0dex
antlio
antlio
marclave
marclave
hwkr
hwkr
cameronrohani
cameronrohani
tmastrom
tmastrom
geoffgscott
geoffgscott
inyourtime
inyourtime
DemonHa
DemonHa
bgrcs
bgrcs
Amorim33
Amorim33
ivanagas
ivanagas
Mason-Little
Mason-Little
adjsky
adjsky
matthyk
matthyk
RemcoGoy
RemcoGoy
mcollina
mcollina
mpminardi
mpminardi
nsychev
nsychev
Mohib834
Mohib834
lc-soft
lc-soft
fuma-nama
fuma-nama
Edgaraszs
Edgaraszs
ATREAY
ATREAY
ahmedrangel
ahmedrangel
yshrsmz
yshrsmz
hex0id
hex0id
soulchild
soulchild
x-delfino
x-delfino
ykdojo
ykdojo
timheuer
timheuer
SebastianBienert
SebastianBienert
mouhannad-sh
mouhannad-sh
mason-at-pieces
mason-at-pieces
luc122c
luc122c
handrews
handrews
gsmcdonald
gsmcdonald
federicobond
federicobond
WDaan
WDaan
Duncanma
Duncanma
rpmccarter
rpmccarter
rmp135
rmp135
STP5940
STP5940
captainsafia
captainsafia
realsama
realsama
dotfortun
dotfortun
smoores-dev
smoores-dev
soGit
soGit
sinh117801
sinh117801
stratosblue
stratosblue
yokeTH
yokeTH
hrynevychroman
hrynevychroman
rbange
rbange
rickihastings
rickihastings
petercinibulk
petercinibulk
Olexandr88
Olexandr88
malinbranduse
malinbranduse
MaxBreida
MaxBreida
MarioGK
MarioGK
ShadiestGoat
ShadiestGoat
sanscontext
sanscontext
kyllian
kyllian
KiARC
KiARC
Huliiiiii
Huliiiiii
unnoq
unnoq
tsiwek-piwik
tsiwek-piwik
dunklesToast
dunklesToast
o-az
o-az
kwaichanz
kwaichanz
g-airey
g-airey
ga1az
ga1az
FotieMConstant
FotieMConstant
danwithabox
danwithabox
WilliamBonvini
WilliamBonvini
bsdayo
bsdayo
Chinlinlee
Chinlinlee
bingbeann
bingbeann
rolldeep-stepmerrily
rolldeep-stepmerrily
Wolf-Syndrome
Wolf-Syndrome
wilcoschoneveld
wilcoschoneveld
rotciw
rotciw
Ma-ve
Ma-ve
Mai0313
Mai0313
Courtcircuits
Courtcircuits
rektdeckard
rektdeckard
thibaultleouay
thibaultleouay
untiny
untiny
lundibundi
lundibundi
darekaze
darekaze
danp
danp
danjohnson95
danjohnson95
yungwarlock
yungwarlock
ClanEver
ClanEver
chrislearn
chrislearn
chadwhitacre
chadwhitacre
carstenlebek
carstenlebek
cactysman
cactysman
brunogrcsada
brunogrcsada
Borisich
Borisich
bdpiprava
bdpiprava
saithis
saithis
zsilbi
zsilbi
arthurfiorette
arthurfiorette
arashsheyda
arashsheyda
sigpwned
sigpwned
gizero
gizero
alewin
alewin
slash686
slash686
MathurAditya724
MathurAditya724
abdulamite
abdulamite
jlnslv
jlnslv
IHIutch
IHIutch
jonataw
jonataw
Jannchie
Jannchie
jwangnz
jwangnz
Jefwillems
Jefwillems
TheVaan
TheVaan
JacobCoffee
JacobCoffee
kevinand11
kevinand11
IceyWu
IceyWu
iagobalmeida
iagobalmeida
hpmouton
hpmouton
CJHwong
CJHwong
HelgeSverre
HelgeSverre
Hamidrzash
Hamidrzash
GreyXor
GreyXor
Fdawgs
Fdawgs
filiabel
filiabel
facus26
facus26
emmanuel-ferdman
emmanuel-ferdman
elliott-with-the-longest-name-on-github
elliott-with-the-longest-name-on-github
elliotnash
elliotnash
DmitriiKhudiakov
DmitriiKhudiakov
diegolopes
diegolopes

changelog

@scalar/code-highlight

0.1.4

Patch Changes

  • 7913193: feat: updates hljs curl language style

0.1.3

Patch Changes

  • 4156f1d: Expand workspace store integration
  • a37df33: fix: enhances introduction optical alignment

0.1.2

Patch Changes

  • 00fc827: feat: updates markdown overall style
  • 358eb63: fix(api-reference): fix markdown styles pt2

0.1.1

Patch Changes

  • 785939b: feat: adds id to markdown heading
  • cad6277: feat(themes)!: migrate to tailwind v4

0.1.0

Minor Changes

  • 483ca93: chore: require Node 20 (or above)

0.0.29

Patch Changes

  • 8c7bad8: chore: move build tooling to esbuild

0.0.28

Patch Changes

  • e8457cb: Unify themes across scalar. Cleanup interface and remove CJS build.

0.0.27

Patch Changes

  • 799845f: feat(components): allow ScalarCodeblock to support different font sizes

0.0.26

Patch Changes

  • 0e888bc: feat: add dart to standard languages

0.0.25

Patch Changes

  • 632978d: fix(themes): hide summary caret in reset

0.0.24

Patch Changes

  • 9319c0c: fix: allows alert plugin classes in markdown
  • 9319c0c: feat: updates markdown alert style

0.0.23

Patch Changes

  • 3feee27: feat: adds markdown alert support
  • c10bbf5: chore: code style

0.0.22

Patch Changes

  • e350f23: chore: code style

0.0.21

Patch Changes

  • fa6afe8: chore: code formatting
  • 1223c1f: chore: code style

0.0.20

Patch Changes

  • 109e320: fix: removes regex for highlight credentials

0.0.19

Patch Changes

  • 6407b2b: feat(api-reference): extend font weights for links and sidebar items

0.0.18

Patch Changes

  • e199e9b: feat: updates chevron down icon

0.0.17

Patch Changes

  • 9002259: style: font size fixtures

0.0.16

Patch Changes

  • 1b06f64: fix(api-reference): conflicting styles with bulma, galaxy bug on docs

0.0.15

Patch Changes

  • a40999d: chore: added type safety rule noUncheckedIndexedAccess

0.0.14

Patch Changes

  • b4a93ab: fix: tag typography and intro type

0.0.13

Patch Changes

  • 0c34a18: chore: updated vue package to 3.5

0.0.12

Patch Changes

  • e911047: Add default exports

0.0.11

Patch Changes

  • 18744d4: feat(code-highlight): don't force markdown paragraph color

0.0.10

Patch Changes

  • c450bb3: fix: scalar api ref use scalar-border-width

0.0.9

Patch Changes

  • 58e5912: fix: markdown fixes and intro card polish

0.0.8

Patch Changes

  • b910fc1: feat: new Markdown helper methods splitContent and getHeadings

0.0.7

Patch Changes

  • c2362ee: fix: don't constrain markdown image height

0.0.6

Patch Changes

  • 9b035b0: chore: remove stale packages

0.0.5

Patch Changes

  • 94e68ab: chore: upgrade typescript to 5.5

0.0.4

Patch Changes

  • 5e92eab: feat(#doc-1996): themes css exports

0.0.3

Patch Changes

  • e0fc110: chore: patch bump all package

0.0.2

Patch Changes

  • 8494349: Migrate to highlightjs based syntax highlighting
  • 6fbb57e: feat: release all the packages