-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* There’s now `core` (0 languages), `common` (35 languages), and `all` (237 languages) * This switches the default import to use *common*
- Loading branch information
Showing
13 changed files
with
734 additions
and
622 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/** | ||
* @typedef {import('./core.js').RefractorRoot} RefractorRoot | ||
* @typedef {import('./core.js').RefractorElement} RefractorElement | ||
* @typedef {import('./core.js').Text} Text | ||
* @typedef {import('./core.js').Grammar} Grammar | ||
* @typedef {import('./core.js').Syntax} Syntax | ||
*/ | ||
import {refractor} from './core.js' | ||
import clike from '../lang/clike.js' | ||
import c from '../lang/c.js' | ||
import cpp from '../lang/cpp.js' | ||
import arduino from '../lang/arduino.js' | ||
import bash from '../lang/bash.js' | ||
import csharp from '../lang/csharp.js' | ||
import markup from '../lang/markup.js' | ||
import css from '../lang/css.js' | ||
import diff from '../lang/diff.js' | ||
import go from '../lang/go.js' | ||
import ini from '../lang/ini.js' | ||
import java from '../lang/java.js' | ||
import regex from '../lang/regex.js' | ||
import javascript from '../lang/javascript.js' | ||
import json from '../lang/json.js' | ||
import kotlin from '../lang/kotlin.js' | ||
import less from '../lang/less.js' | ||
import lua from '../lang/lua.js' | ||
import makefile from '../lang/makefile.js' | ||
import yaml from '../lang/yaml.js' | ||
import markdown from '../lang/markdown.js' | ||
import objectivec from '../lang/objectivec.js' | ||
import perl from '../lang/perl.js' | ||
import markupTemplating from '../lang/markup-templating.js' | ||
import php from '../lang/php.js' | ||
import python from '../lang/python.js' | ||
import r from '../lang/r.js' | ||
import ruby from '../lang/ruby.js' | ||
import rust from '../lang/rust.js' | ||
import sass from '../lang/sass.js' | ||
import scss from '../lang/scss.js' | ||
import sql from '../lang/sql.js' | ||
import swift from '../lang/swift.js' | ||
import typescript from '../lang/typescript.js' | ||
import basic from '../lang/basic.js' | ||
import vbnet from '../lang/vbnet.js' | ||
|
||
export {refractor} | ||
refractor.register(clike) | ||
refractor.register(c) | ||
refractor.register(cpp) | ||
refractor.register(arduino) | ||
refractor.register(bash) | ||
refractor.register(csharp) | ||
refractor.register(markup) | ||
refractor.register(css) | ||
refractor.register(diff) | ||
refractor.register(go) | ||
refractor.register(ini) | ||
refractor.register(java) | ||
refractor.register(regex) | ||
refractor.register(javascript) | ||
refractor.register(json) | ||
refractor.register(kotlin) | ||
refractor.register(less) | ||
refractor.register(lua) | ||
refractor.register(makefile) | ||
refractor.register(yaml) | ||
refractor.register(markdown) | ||
refractor.register(objectivec) | ||
refractor.register(perl) | ||
refractor.register(markupTemplating) | ||
refractor.register(php) | ||
refractor.register(python) | ||
refractor.register(r) | ||
refractor.register(ruby) | ||
refractor.register(rust) | ||
refractor.register(sass) | ||
refractor.register(scss) | ||
refractor.register(sql) | ||
refractor.register(swift) | ||
refractor.register(typescript) | ||
refractor.register(basic) | ||
refractor.register(vbnet) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import fs from 'fs' | ||
import path from 'path' | ||
import getLoader from 'prismjs/dependencies.js' | ||
|
||
/** @type {{languages: Object.<string, unknown>}} */ | ||
var components = JSON.parse( | ||
String( | ||
fs.readFileSync(path.join('node_modules', 'prismjs', 'components.json')) | ||
) | ||
) | ||
|
||
var allLanguages = Object.keys(components.languages).filter((d) => d !== 'meta') | ||
|
||
/** @type {Array.<string>} */ | ||
export const all = getLoader(components, allLanguages).getIds() | ||
|
||
/** @type {Array.<string>} */ | ||
export const common = getLoader(components, [ | ||
// These are alphabetical, but they are exported in registration order. | ||
// They are based on the languages that lowlight exports as common, | ||
// which is is turn based on what highlight.js treats as common. | ||
// <https://github.com/wooorm/lowlight/blob/bf79fd1/script/build-registry.js#L39> | ||
// <https://github.com/wooorm/lowlight/blob/main/lib/common.js> | ||
'arduino', | ||
'bash', | ||
'clike', | ||
'cpp', | ||
'csharp', | ||
'css', | ||
'diff', | ||
'go', | ||
'ini', | ||
'java', | ||
'javascript', | ||
'json', | ||
'kotlin', | ||
'less', | ||
'lua', | ||
'makefile', | ||
'markdown', | ||
'markup', | ||
'objectivec', | ||
'perl', | ||
'php', | ||
'python', | ||
'r', | ||
'regex', | ||
'ruby', | ||
'rust', | ||
'sass', | ||
'scss', | ||
'sql', | ||
'swift', | ||
'typescript', | ||
'vbnet', | ||
'yaml' | ||
]).getIds() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters