GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - code-hike/lighter: The syntax highlighter used by Code Hike.

BranchesTags
Open more actions menu

Latest commit

 

History

193 Commits
193 Commits

Folders and files

NameName
Last commit message
Last commit date
.changeset
.changeset
 
 
.github/workflows
.github/workflows
 
 
lib
lib
 
 
test
test
 
 
web
web
 
 
.gitignore
.gitignore
 
 
known-issues.md
known-issues.md
 
 
package.json
package.json
 
 
readme.md
readme.md
 
 
yarn.lock
yarn.lock
 
 

Repository files navigation

The syntax highlighter used by Code Hike.

Usage

import { highlight } from "@code-hike/lighter";

const { lines, style } = await highlight(
  /* code  */ "print('hello')",
  /* lang  */ "py",
  /* theme */ "github-dark"
);

// base foreground and background
const { color, background } = style;

console.log(lines);

Output:

[
  [
    { "style": { "color": "#79C0FF" }, "content": "print" },
    { "style": { "color": "#C9D1D9" }, "content": "(" },
    { "style": { "color": "#A5D6FF" }, "content": "'hello'" },
    { "style": { "color": "#C9D1D9" }, "content": ")" }
  ]
]

For dark/light theme support with CSS see #25

For more theme colors (like line number foreground, selection background, etc.):

import { getThemeColors } from "@code-hike/lighter";

const themeColors = await getThemeColors("material-darker");

Credits

  • Using vscode-oniguruma for highlighting
  • Heavily inspired by Shiki and adapted to Code Hike needs.
  • Some more inspiration from starry-night
  • Grammars and some themes come from Shiki, which pulls them from different sources.

About

The syntax highlighter used by Code Hike.

lighter-codehike.vercel.app

Topics

syntax-highlighting

Resources

Readme
Activity
Custom properties

Stars

101 stars

Watchers

2 watching

Forks

13 forks
Report repository

Releases

Sponsor this project

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.