Detalhes do pacote

@scalar/code-highlight

scalar294.8kMIT0.2.0

Central methods and themes for code highlighting in Scalar projects

syntax, highlight, lowlight, highlightjs

readme (leia-me)

CI Contributors GitHub License Twitter Discord

Scalar

<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> <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>

Interactive API Reference from OpenAPI/Swagger

└ Renders OpenAPI/Swagger documents
└ Comes with an API testing tool
└ Doesn't look like 2011
└ Generates code examples for many languages & frameworks
└ Integrates with your favorite framework
Try Demo

An offline-first API Client built for OpenAPI

└ Free and open-source
└ First-class OpenAPI/Swagger support
└ Integrates with dozens of API Frameworks (Elysia, Hono, FastAPI, etc)
└ Syncs with your favorite server framework (Watch Mode)
└ Has environment variables, dynamic parameters and everything
Try It in the BrowserDownload (Windows, MacOS, Linux)

### Trusted by:

<picture> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/73dcef95-fc4f-4111-bb09-f3ce37453a81#gh-light-mode-only"> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/c792c977-8551-432c-9417-3ea05e408151#gh-dark-mode-only"> Scalar API client </picture> <picture> <source media="(prefers-color-scheme: light)" srcset="https://github.com/user-attachments/assets/1da6b904-34be-4760-b535-0dd2160e6d12#gh-light-mode-only"> <source media="(prefers-color-scheme: dark)" srcset="https://github.com/user-attachments/assets/54a9ea69-c50a-4f49-8c3e-ddd6f8fbe1f3#gh-dark-mode-only"> Scalar API client </picture>

Quickstart

All you need is a single HTML file to create an amazing 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://registry.scalar.com/@scalar/apis/galaxy?format=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 API references (free)
  • YOUR_NAME_HERE.apidocumentation.com subdomain and SSL (free)
  • GitHub Sync
  • Write free-form documentation
  • Collaborate with your team
  • Use any domain

Ready? Create your Scalar Account


Documentation

Topic Description
Configuration The universal configuration object
Themes Predefined themes, layouts & styling
OpenAPI OpenAPI specification extensions
Markdown Supported Markdown syntax
Plugins Extend the functionality


Projects

Project Description
Scalar API Reference Self-hosted API Reference
Scalar API Client Postman alternative
Scalar Registry Manage OpenAPI documents
Scalar Docs Hosted documentation
Scalar Docs Starter Starter template for Scalar Docs
Scalar SDKs SDK generation
Scalar CLI Command-line interface
Scalar Mock Server Mock APIs from OpenAPI documents
Scalar Galaxy Our OpenAPI Example
Scalar Editor OpenAPI Online Editor
Scalar OpenAPI Parser Parse OpenAPI documents
Scalar OpenAPI Upgrader Upgrade OpenAPI documents
Scalar Void Server HTTP Request Mirror


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
geoffgscott
geoffgscott
DemonHa
DemonHa
tmastrom
tmastrom
marcalexiei
marcalexiei
inyourtime
inyourtime
bgrcs
bgrcs
gevann
gevann
federicobond
federicobond
ahmedrangel
ahmedrangel
matthyk
matthyk
Amorim33
Amorim33
baywet
baywet
liamdscalar
liamdscalar
ivanagas
ivanagas
Mason-Little
Mason-Little
RemcoGoy
RemcoGoy
adjsky
adjsky
mcollina
mcollina
mpminardi
mpminardi
TheVaan
TheVaan
si-net
si-net
nsychev
nsychev
Mohib834
Mohib834
lc-soft
lc-soft
fuma-nama
fuma-nama
Edgaraszs
Edgaraszs
ATREAY
ATREAY
yshrsmz
yshrsmz
hex0id
hex0id
soulchild
soulchild
horpto
horpto
x-delfino
x-delfino
ykdojo
ykdojo
timheuer
timheuer
ledgersteve
ledgersteve
SebastianBienert
SebastianBienert
mouhannad-sh
mouhannad-sh
mason-at-pieces
mason-at-pieces
luc122c
luc122c
handrews
handrews
gsmcdonald
gsmcdonald
WDaan
WDaan
Duncanma
Duncanma
roryschadler
roryschadler
rmp135
rmp135
mirismaili
mirismaili
STP5940
STP5940
captainsafia
captainsafia
realsama
realsama
ventocis
ventocis
dotfortun
dotfortun
smoores-dev
smoores-dev
soGit
soGit
sinh117801
sinh117801
stratosblue
stratosblue
yokeTH
yokeTH
Huliiiiii
Huliiiiii
rpmccarter
rpmccarter
hrynevychroman
hrynevychroman
rbange
rbange
rickihastings
rickihastings
rhuanbarreto
rhuanbarreto
petercinibulk
petercinibulk
Olexandr88
Olexandr88
Lazialize
Lazialize
malinbranduse
malinbranduse
mvt147
mvt147
MaxBreida
MaxBreida
tinchoz49
tinchoz49
not-my-profile
not-my-profile
MarioGK
MarioGK
DmitriiKhudiakov
DmitriiKhudiakov
unnoq
unnoq
tsiwek-piwik
tsiwek-piwik
dunklesToast
dunklesToast
stefanprobst
stefanprobst
omerp-explorium
omerp-explorium
o-az
o-az
milksense
milksense
kwaichanz
kwaichanz
jpjpjp
jpjpjp
g-airey
g-airey
ga1az
ga1az
FotieMConstant
FotieMConstant
danwithabox
danwithabox
WilliamBonvini
WilliamBonvini
bsdayo
bsdayo
Chinlinlee
Chinlinlee
bingbeann
bingbeann
zakaria-shahen
zakaria-shahen
rolldeep-stepmerrily
rolldeep-stepmerrily
Wolf-Syndrome
Wolf-Syndrome
wilcoschoneveld
wilcoschoneveld
rotciw
rotciw
WesleySkeen
WesleySkeen
Ma-ve
Ma-ve
Mai0313
Mai0313
Courtcircuits
Courtcircuits
rektdeckard
rektdeckard
thibaultleouay
thibaultleouay
diegolopes
diegolopes
untiny
untiny
lundibundi
lundibundi
DavidNiessen
DavidNiessen
darekaze
darekaze
danp
danp
danjohnson95
danjohnson95
yungwarlock
yungwarlock
ClanEver
ClanEver
chrislearn
chrislearn
chadwhitacre
chadwhitacre
carstenlebek
carstenlebek
cactysman
cactysman
brunogrcsada
brunogrcsada
brianheineman
brianheineman
Borisich
Borisich
bdpiprava
bdpiprava
BenJeau
BenJeau
saithis
saithis
zsilbi
zsilbi
arthurfiorette
arthurfiorette
arashsheyda
arashsheyda
sigpwned
sigpwned
gizero
gizero
alewin
alewin
slash686
slash686
ahmadi-akbar
ahmadi-akbar
MathurAditya724
MathurAditya724
abdulamite
abdulamite
luke-hagar-sp
luke-hagar-sp
ShadiestGoat
ShadiestGoat
mrlubos
mrlubos
sanscontext
sanscontext
kyllian
kyllian
jlnslv
jlnslv
IHIutch
IHIutch
jonataw
jonataw
Jannchie
Jannchie
jwangnz
jwangnz
Jefwillems
Jefwillems
Tholdrim
Tholdrim
JacobCoffee
JacobCoffee
kevinand11
kevinand11
tltsutltsu
tltsutltsu
eltociear
eltociear
IceyWu
IceyWu
iagobalmeida
iagobalmeida
hpmouton
hpmouton
CJHwong
CJHwong
HelgeSverre
HelgeSverre
Hamidrzash
Hamidrzash
255kb
255kb
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

changelog (log de mudanças)

@scalar/code-highlight

0.2.0

Minor Changes

  • 0aa6d26: feat: add ~45 new highlight.js languages + alias maps and new grouped exports (mediumLanguages, specializedLanguages, allLanguages)

0.1.9

Patch Changes

  • d4cb86b: fix: removes inline block display to keep caret in empty code input usage

0.1.8

Patch Changes

  • 85ee2ce: feat: updates markdown alert component style
  • 85ee2ce: feat: moves markdown style from code-highlight to components package

0.1.7

Patch Changes

  • 6ab3a21: feat: updates markdown details component style

0.1.6

Patch Changes

  • 903f975: feat: increases code line margin to enhance alignment

0.1.5

Patch Changes

  • 2d7f995: refactor: use more common straight apostrophe ' instead of the real apostrophe ’

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