Compare commits
No commits in common. "main" and "v0.1.3" have entirely different histories.
3 changed files with 25 additions and 27 deletions
|
|
@ -1,6 +1,6 @@
|
|||
(package
|
||||
(name (textmate-bjolang))
|
||||
(version "0.2.0")
|
||||
(version "0.1.3")
|
||||
(description "Syntax highlighting for Bjolang: VS Code's TextMate grammars and themes, through TextMateSharp, as (text xml) nodes.")
|
||||
(license "MPL-2.0")
|
||||
|
||||
|
|
|
|||
48
src/core.bjo
48
src/core.bjo
|
|
@ -156,33 +156,31 @@
|
|||
;; ---------------------------------------------------------------------------
|
||||
|
||||
;; VS Code's themes, the ones TextMateSharp carries: #:theme 'dark-plus.
|
||||
(def/grammar TmTheme
|
||||
(:or (: ThemeDarkPlus 'dark-plus)
|
||||
(: ThemeLightPlus 'light-plus)
|
||||
(: ThemeDark 'dark)
|
||||
(: ThemeLight 'light)
|
||||
(: ThemeMonokai 'monokai)
|
||||
(: ThemeDimmedMonokai 'dimmed-monokai)
|
||||
(: ThemeOneDark 'one-dark)
|
||||
(: ThemeAtomOneDark 'atom-one-dark)
|
||||
(: ThemeAtomOneLight 'atom-one-light)
|
||||
(: ThemeDracula 'dracula)
|
||||
(: ThemeSolarizedDark 'solarized-dark)
|
||||
(: ThemeSolarizedLight 'solarized-light)
|
||||
(: ThemeQuietLight 'quiet-light)
|
||||
(: ThemeKimbieDark 'kimbie-dark)
|
||||
(: ThemeTomorrowNightBlue 'tomorrow-night-blue)
|
||||
(: ThemeAbyss 'abyss)
|
||||
(: ThemeRed 'red)
|
||||
(: ThemeHighContrastDark 'high-contrast-dark)
|
||||
(: ThemeHighContrastLight 'high-contrast-light)
|
||||
(: ThemeVisualStudioDark 'visual-studio-dark)
|
||||
(: ThemeVisualStudioLight 'visual-studio-light)))
|
||||
(type (: TmTheme (Union (: ThemeDarkPlus #:tag dark-plus)
|
||||
(: ThemeLightPlus #:tag light-plus)
|
||||
(: ThemeDark #:tag dark)
|
||||
(: ThemeLight #:tag light)
|
||||
(: ThemeMonokai #:tag monokai)
|
||||
(: ThemeDimmedMonokai #:tag dimmed-monokai)
|
||||
(: ThemeOneDark #:tag one-dark)
|
||||
(: ThemeAtomOneDark #:tag atom-one-dark)
|
||||
(: ThemeAtomOneLight #:tag atom-one-light)
|
||||
(: ThemeDracula #:tag dracula)
|
||||
(: ThemeSolarizedDark #:tag solarized-dark)
|
||||
(: ThemeSolarizedLight #:tag solarized-light)
|
||||
(: ThemeQuietLight #:tag quiet-light)
|
||||
(: ThemeKimbieDark #:tag kimbie-dark)
|
||||
(: ThemeTomorrowNightBlue #:tag tomorrow-night-blue)
|
||||
(: ThemeAbyss #:tag abyss)
|
||||
(: ThemeRed #:tag red)
|
||||
(: ThemeHighContrastDark #:tag high-contrast-dark)
|
||||
(: ThemeHighContrastLight #:tag high-contrast-light)
|
||||
(: ThemeVisualStudioDark #:tag visual-studio-dark)
|
||||
(: ThemeVisualStudioLight #:tag visual-studio-light))))
|
||||
|
||||
;; How a node is coloured: #:style 'inline or #:style 'classes.
|
||||
(def/grammar TmStyleMode
|
||||
(:or (: StyleInline 'inline)
|
||||
(: StyleClasses 'classes)))
|
||||
(type (: TmStyleMode (Union (: StyleInline #:tag inline)
|
||||
(: StyleClasses #:tag classes))))
|
||||
|
||||
;; How a piece of text looks. None is the theme's own colour, which the pre
|
||||
;; around the code already has.
|
||||
|
|
|
|||
|
|
@ -149,7 +149,7 @@
|
|||
" (code (@ (class \"language-csharp\")) (span (@ (style \"color:#B5CEA8\")) \"1\")))"))
|
||||
(expect "several lines, a newline between them"
|
||||
(->str (highlight->nodes cs "1\n2" #:style 'classes))
|
||||
(str "((span (@ (class \"tm-constant tm-constant-numeric\")) \"1\") \"\\n\""
|
||||
(str "'((span (@ (class \"tm-constant tm-constant-numeric\")) \"1\") \"\\n\""
|
||||
" (span (@ (class \"tm-constant tm-constant-numeric\")) \"2\"))"))
|
||||
|
||||
;; --- the stylesheet ---------------------------------------------------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue