svelte-highlight 6.2.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (455) hide show
  1. package/CHANGELOG.md +35 -1
  2. package/Highlight.svelte +9 -11
  3. package/Highlight.svelte.d.ts +228 -332
  4. package/HighlightAuto.svelte +10 -11
  5. package/HighlightAuto.svelte.d.ts +233 -327
  6. package/HighlightSvelte.svelte +7 -6
  7. package/HighlightSvelte.svelte.d.ts +218 -325
  8. package/LineNumbers.svelte +64 -0
  9. package/LineNumbers.svelte.d.ts +260 -0
  10. package/README.md +257 -52
  11. package/index.d.ts +2 -2
  12. package/index.js +2 -2
  13. package/languages/1c.d.ts +2 -0
  14. package/languages/abnf.d.ts +2 -0
  15. package/languages/accesslog.d.ts +2 -0
  16. package/languages/actionscript.d.ts +2 -0
  17. package/languages/ada.d.ts +2 -0
  18. package/languages/angelscript.d.ts +2 -0
  19. package/languages/apache.d.ts +2 -0
  20. package/languages/applescript.d.ts +2 -0
  21. package/languages/arcade.d.ts +2 -0
  22. package/languages/arduino.d.ts +2 -0
  23. package/languages/armasm.d.ts +2 -0
  24. package/languages/asciidoc.d.ts +2 -0
  25. package/languages/aspectj.d.ts +2 -0
  26. package/languages/autohotkey.d.ts +2 -0
  27. package/languages/autoit.d.ts +2 -0
  28. package/languages/avrasm.d.ts +2 -0
  29. package/languages/awk.d.ts +2 -0
  30. package/languages/axapta.d.ts +2 -0
  31. package/languages/bash.d.ts +2 -0
  32. package/languages/basic.d.ts +2 -0
  33. package/languages/bnf.d.ts +2 -0
  34. package/languages/brainfuck.d.ts +2 -0
  35. package/languages/c.d.ts +2 -0
  36. package/languages/cal.d.ts +2 -0
  37. package/languages/capnproto.d.ts +2 -0
  38. package/languages/ceylon.d.ts +2 -0
  39. package/languages/clean.d.ts +2 -0
  40. package/languages/clojure-repl.d.ts +2 -0
  41. package/languages/clojure.d.ts +2 -0
  42. package/languages/cmake.d.ts +2 -0
  43. package/languages/coffeescript.d.ts +2 -0
  44. package/languages/coq.d.ts +2 -0
  45. package/languages/cos.d.ts +2 -0
  46. package/languages/cpp.d.ts +2 -0
  47. package/languages/crmsh.d.ts +2 -0
  48. package/languages/crystal.d.ts +2 -0
  49. package/languages/csharp.d.ts +2 -0
  50. package/languages/csp.d.ts +2 -0
  51. package/languages/css.d.ts +2 -0
  52. package/languages/d.d.ts +2 -0
  53. package/languages/dart.d.ts +2 -0
  54. package/languages/delphi.d.ts +2 -0
  55. package/languages/diff.d.ts +2 -0
  56. package/languages/django.d.ts +2 -0
  57. package/languages/dns.d.ts +2 -0
  58. package/languages/dockerfile.d.ts +2 -0
  59. package/languages/dos.d.ts +2 -0
  60. package/languages/dsconfig.d.ts +2 -0
  61. package/languages/dts.d.ts +2 -0
  62. package/languages/dust.d.ts +2 -0
  63. package/languages/ebnf.d.ts +2 -0
  64. package/languages/elixir.d.ts +2 -0
  65. package/languages/elm.d.ts +2 -0
  66. package/languages/erb.d.ts +2 -0
  67. package/languages/erlang-repl.d.ts +2 -0
  68. package/languages/erlang.d.ts +2 -0
  69. package/languages/excel.d.ts +2 -0
  70. package/languages/fix.d.ts +2 -0
  71. package/languages/flix.d.ts +2 -0
  72. package/languages/fortran.d.ts +2 -0
  73. package/languages/fsharp.d.ts +2 -0
  74. package/languages/gams.d.ts +2 -0
  75. package/languages/gauss.d.ts +2 -0
  76. package/languages/gcode.d.ts +2 -0
  77. package/languages/gherkin.d.ts +2 -0
  78. package/languages/glsl.d.ts +2 -0
  79. package/languages/gml.d.ts +2 -0
  80. package/languages/go.d.ts +2 -0
  81. package/languages/golo.d.ts +2 -0
  82. package/languages/gradle.d.ts +2 -0
  83. package/languages/graphql.d.ts +2 -0
  84. package/languages/groovy.d.ts +2 -0
  85. package/languages/haml.d.ts +2 -0
  86. package/languages/handlebars.d.ts +2 -0
  87. package/languages/haskell.d.ts +2 -0
  88. package/languages/haxe.d.ts +2 -0
  89. package/languages/hsp.d.ts +2 -0
  90. package/languages/http.d.ts +2 -0
  91. package/languages/hy.d.ts +2 -0
  92. package/languages/index.d.ts +199 -0
  93. package/languages/inform7.d.ts +2 -0
  94. package/languages/ini.d.ts +2 -0
  95. package/languages/irpf90.d.ts +2 -0
  96. package/languages/isbl.d.ts +2 -0
  97. package/languages/java.d.ts +2 -0
  98. package/languages/javascript.d.ts +2 -0
  99. package/languages/jboss-cli.d.ts +2 -0
  100. package/languages/json.d.ts +2 -0
  101. package/languages/julia-repl.d.ts +2 -0
  102. package/languages/julia.d.ts +2 -0
  103. package/languages/kotlin.d.ts +2 -0
  104. package/languages/lasso.d.ts +2 -0
  105. package/languages/latex.d.ts +2 -0
  106. package/languages/ldif.d.ts +2 -0
  107. package/languages/leaf.d.ts +2 -0
  108. package/languages/less.d.ts +2 -0
  109. package/languages/lisp.d.ts +2 -0
  110. package/languages/livecodeserver.d.ts +2 -0
  111. package/languages/livescript.d.ts +2 -0
  112. package/languages/llvm.d.ts +2 -0
  113. package/languages/lsl.d.ts +2 -0
  114. package/languages/lua.d.ts +2 -0
  115. package/languages/makefile.d.ts +2 -0
  116. package/languages/markdown.d.ts +2 -0
  117. package/languages/mathematica.d.ts +2 -0
  118. package/languages/matlab.d.ts +2 -0
  119. package/languages/maxima.d.ts +2 -0
  120. package/languages/mel.d.ts +2 -0
  121. package/languages/mercury.d.ts +2 -0
  122. package/languages/mipsasm.d.ts +2 -0
  123. package/languages/mizar.d.ts +2 -0
  124. package/languages/mojolicious.d.ts +2 -0
  125. package/languages/monkey.d.ts +2 -0
  126. package/languages/moonscript.d.ts +2 -0
  127. package/languages/n1ql.d.ts +2 -0
  128. package/languages/nestedtext.d.ts +2 -0
  129. package/languages/nginx.d.ts +2 -0
  130. package/languages/nim.d.ts +2 -0
  131. package/languages/nix.d.ts +2 -0
  132. package/languages/node-repl.d.ts +2 -0
  133. package/languages/nsis.d.ts +2 -0
  134. package/languages/objectivec.d.ts +2 -0
  135. package/languages/ocaml.d.ts +2 -0
  136. package/languages/openscad.d.ts +2 -0
  137. package/languages/oxygene.d.ts +2 -0
  138. package/languages/parser3.d.ts +2 -0
  139. package/languages/perl.d.ts +2 -0
  140. package/languages/pf.d.ts +2 -0
  141. package/languages/pgsql.d.ts +2 -0
  142. package/languages/php-template.d.ts +2 -0
  143. package/languages/php.d.ts +2 -0
  144. package/languages/plaintext.d.ts +2 -0
  145. package/languages/pony.d.ts +2 -0
  146. package/languages/powershell.d.ts +2 -0
  147. package/languages/processing.d.ts +2 -0
  148. package/languages/profile.d.ts +2 -0
  149. package/languages/prolog.d.ts +2 -0
  150. package/languages/properties.d.ts +2 -0
  151. package/languages/protobuf.d.ts +2 -0
  152. package/languages/puppet.d.ts +2 -0
  153. package/languages/purebasic.d.ts +2 -0
  154. package/languages/python-repl.d.ts +2 -0
  155. package/languages/python.d.ts +2 -0
  156. package/languages/q.d.ts +2 -0
  157. package/languages/qml.d.ts +2 -0
  158. package/languages/r.d.ts +2 -0
  159. package/languages/reasonml.d.ts +2 -0
  160. package/languages/rib.d.ts +2 -0
  161. package/languages/roboconf.d.ts +2 -0
  162. package/languages/routeros.d.ts +2 -0
  163. package/languages/rsl.d.ts +2 -0
  164. package/languages/ruby.d.ts +2 -0
  165. package/languages/ruleslanguage.d.ts +2 -0
  166. package/languages/rust.d.ts +2 -0
  167. package/languages/sas.d.ts +2 -0
  168. package/languages/scala.d.ts +2 -0
  169. package/languages/scheme.d.ts +2 -0
  170. package/languages/scilab.d.ts +2 -0
  171. package/languages/scss.d.ts +2 -0
  172. package/languages/shell.d.ts +2 -0
  173. package/languages/smali.d.ts +2 -0
  174. package/languages/smalltalk.d.ts +2 -0
  175. package/languages/sml.d.ts +2 -0
  176. package/languages/sqf.d.ts +2 -0
  177. package/languages/sql.d.ts +2 -0
  178. package/languages/stan.d.ts +2 -0
  179. package/languages/stata.d.ts +2 -0
  180. package/languages/step21.d.ts +2 -0
  181. package/languages/stylus.d.ts +2 -0
  182. package/languages/subunit.d.ts +2 -0
  183. package/languages/swift.d.ts +2 -0
  184. package/languages/taggerscript.d.ts +2 -0
  185. package/languages/tap.d.ts +2 -0
  186. package/languages/tcl.d.ts +2 -0
  187. package/languages/thrift.d.ts +2 -0
  188. package/languages/tp.d.ts +2 -0
  189. package/languages/twig.d.ts +2 -0
  190. package/languages/typescript.d.ts +2 -0
  191. package/languages/vala.d.ts +2 -0
  192. package/languages/vbnet.d.ts +2 -0
  193. package/languages/vbscript-html.d.ts +2 -0
  194. package/languages/vbscript.d.ts +2 -0
  195. package/languages/verilog.d.ts +2 -0
  196. package/languages/vhdl.d.ts +2 -0
  197. package/languages/vim.d.ts +2 -0
  198. package/languages/wasm.d.ts +2 -0
  199. package/languages/wren.d.ts +2 -0
  200. package/languages/x86asm.d.ts +2 -0
  201. package/languages/xl.d.ts +2 -0
  202. package/languages/xml.d.ts +2 -0
  203. package/languages/xquery.d.ts +2 -0
  204. package/languages/yaml.d.ts +2 -0
  205. package/languages/zephir.d.ts +2 -0
  206. package/package.json +21 -18
  207. package/styles/3024.d.ts +1 -0
  208. package/styles/a11y-dark.d.ts +1 -0
  209. package/styles/a11y-light.d.ts +1 -0
  210. package/styles/agate.d.ts +1 -0
  211. package/styles/an-old-hope.d.ts +1 -0
  212. package/styles/androidstudio.d.ts +1 -0
  213. package/styles/apathy.d.ts +1 -0
  214. package/styles/apprentice.d.ts +1 -0
  215. package/styles/arduino-light.d.ts +1 -0
  216. package/styles/arta.d.ts +1 -0
  217. package/styles/ascetic.d.ts +1 -0
  218. package/styles/ashes.d.ts +1 -0
  219. package/styles/atelier-cave-light.d.ts +1 -0
  220. package/styles/atelier-cave.d.ts +1 -0
  221. package/styles/atelier-dune-light.d.ts +1 -0
  222. package/styles/atelier-dune.d.ts +1 -0
  223. package/styles/atelier-estuary-light.d.ts +1 -0
  224. package/styles/atelier-estuary.d.ts +1 -0
  225. package/styles/atelier-forest-light.d.ts +1 -0
  226. package/styles/atelier-forest.d.ts +1 -0
  227. package/styles/atelier-heath-light.d.ts +1 -0
  228. package/styles/atelier-heath.d.ts +1 -0
  229. package/styles/atelier-lakeside-light.d.ts +1 -0
  230. package/styles/atelier-lakeside.d.ts +1 -0
  231. package/styles/atelier-plateau-light.d.ts +1 -0
  232. package/styles/atelier-plateau.d.ts +1 -0
  233. package/styles/atelier-savanna-light.d.ts +1 -0
  234. package/styles/atelier-savanna.d.ts +1 -0
  235. package/styles/atelier-seaside-light.d.ts +1 -0
  236. package/styles/atelier-seaside.d.ts +1 -0
  237. package/styles/atelier-sulphurpool-light.d.ts +1 -0
  238. package/styles/atelier-sulphurpool.d.ts +1 -0
  239. package/styles/atlas.d.ts +1 -0
  240. package/styles/atom-one-dark-reasonable.d.ts +1 -0
  241. package/styles/atom-one-dark.d.ts +1 -0
  242. package/styles/atom-one-light.d.ts +1 -0
  243. package/styles/base16-github.d.ts +1 -0
  244. package/styles/base16-ir-black.d.ts +1 -0
  245. package/styles/base16-monokai.d.ts +1 -0
  246. package/styles/base16-nord.d.ts +1 -0
  247. package/styles/bespin.d.ts +1 -0
  248. package/styles/black-metal-bathory.d.ts +1 -0
  249. package/styles/black-metal-burzum.d.ts +1 -0
  250. package/styles/black-metal-dark-funeral.d.ts +1 -0
  251. package/styles/black-metal-gorgoroth.d.ts +1 -0
  252. package/styles/black-metal-immortal.d.ts +1 -0
  253. package/styles/black-metal-khold.d.ts +1 -0
  254. package/styles/black-metal-marduk.d.ts +1 -0
  255. package/styles/black-metal-mayhem.d.ts +1 -0
  256. package/styles/black-metal-nile.d.ts +1 -0
  257. package/styles/black-metal-venom.d.ts +1 -0
  258. package/styles/black-metal.d.ts +1 -0
  259. package/styles/brewer.d.ts +1 -0
  260. package/styles/bright.d.ts +1 -0
  261. package/styles/brogrammer.d.ts +1 -0
  262. package/styles/brown-paper.d.ts +1 -0
  263. package/styles/brush-trees-dark.d.ts +1 -0
  264. package/styles/brush-trees.d.ts +1 -0
  265. package/styles/chalk.d.ts +1 -0
  266. package/styles/circus.d.ts +1 -0
  267. package/styles/classic-dark.d.ts +1 -0
  268. package/styles/classic-light.d.ts +1 -0
  269. package/styles/codepen-embed.d.ts +1 -0
  270. package/styles/codeschool.d.ts +1 -0
  271. package/styles/color-brewer.d.ts +1 -0
  272. package/styles/colors.d.ts +1 -0
  273. package/styles/cupcake.d.ts +1 -0
  274. package/styles/cupertino.d.ts +1 -0
  275. package/styles/danqing.d.ts +1 -0
  276. package/styles/darcula.d.ts +1 -0
  277. package/styles/dark-violet.d.ts +1 -0
  278. package/styles/dark.d.ts +1 -0
  279. package/styles/darkmoss.d.ts +1 -0
  280. package/styles/darktooth.d.ts +1 -0
  281. package/styles/decaf.d.ts +1 -0
  282. package/styles/default-dark.d.ts +1 -0
  283. package/styles/default-light.d.ts +1 -0
  284. package/styles/default.d.ts +1 -0
  285. package/styles/devibeans.d.ts +1 -0
  286. package/styles/dirtysea.d.ts +1 -0
  287. package/styles/docco.d.ts +1 -0
  288. package/styles/dracula.d.ts +1 -0
  289. package/styles/edge-dark.d.ts +1 -0
  290. package/styles/edge-light.d.ts +1 -0
  291. package/styles/eighties.d.ts +1 -0
  292. package/styles/embers.d.ts +1 -0
  293. package/styles/equilibrium-dark.d.ts +1 -0
  294. package/styles/equilibrium-gray-dark.d.ts +1 -0
  295. package/styles/equilibrium-gray-light.d.ts +1 -0
  296. package/styles/equilibrium-light.d.ts +1 -0
  297. package/styles/espresso.d.ts +1 -0
  298. package/styles/eva-dim.d.ts +1 -0
  299. package/styles/eva.d.ts +1 -0
  300. package/styles/far.d.ts +1 -0
  301. package/styles/felipec.d.ts +1 -0
  302. package/styles/flat.d.ts +1 -0
  303. package/styles/foundation.d.ts +1 -0
  304. package/styles/framer.d.ts +1 -0
  305. package/styles/fruit-soda.d.ts +1 -0
  306. package/styles/gigavolt.d.ts +1 -0
  307. package/styles/github-dark-dimmed.d.ts +1 -0
  308. package/styles/github-dark.d.ts +1 -0
  309. package/styles/github.d.ts +1 -0
  310. package/styles/gml.d.ts +1 -0
  311. package/styles/google-dark.d.ts +1 -0
  312. package/styles/google-light.d.ts +1 -0
  313. package/styles/googlecode.d.ts +1 -0
  314. package/styles/gradient-dark.d.ts +1 -0
  315. package/styles/gradient-light.d.ts +1 -0
  316. package/styles/grayscale-dark.d.ts +1 -0
  317. package/styles/grayscale-light.d.ts +1 -0
  318. package/styles/grayscale.d.ts +1 -0
  319. package/styles/green-screen.d.ts +1 -0
  320. package/styles/gruvbox-dark-hard.d.ts +1 -0
  321. package/styles/gruvbox-dark-medium.d.ts +1 -0
  322. package/styles/gruvbox-dark-pale.d.ts +1 -0
  323. package/styles/gruvbox-dark-soft.d.ts +1 -0
  324. package/styles/gruvbox-light-hard.d.ts +1 -0
  325. package/styles/gruvbox-light-medium.d.ts +1 -0
  326. package/styles/gruvbox-light-soft.d.ts +1 -0
  327. package/styles/hardcore.d.ts +1 -0
  328. package/styles/harmonic16-dark.d.ts +1 -0
  329. package/styles/harmonic16-light.d.ts +1 -0
  330. package/styles/heetch-dark.d.ts +1 -0
  331. package/styles/heetch-light.d.ts +1 -0
  332. package/styles/helios.d.ts +1 -0
  333. package/styles/hopscotch.d.ts +1 -0
  334. package/styles/horizon-dark.d.ts +1 -0
  335. package/styles/horizon-light.d.ts +1 -0
  336. package/styles/humanoid-dark.d.ts +1 -0
  337. package/styles/humanoid-light.d.ts +1 -0
  338. package/styles/hybrid.d.ts +1 -0
  339. package/styles/ia-dark.d.ts +1 -0
  340. package/styles/ia-light.d.ts +1 -0
  341. package/styles/icy-dark.d.ts +1 -0
  342. package/styles/idea.d.ts +1 -0
  343. package/styles/index.d.ts +248 -0
  344. package/styles/intellij-light.d.ts +1 -0
  345. package/styles/ir-black.d.ts +1 -0
  346. package/styles/isbl-editor-dark.d.ts +1 -0
  347. package/styles/isbl-editor-light.d.ts +1 -0
  348. package/styles/isotope.d.ts +1 -0
  349. package/styles/kimber.d.ts +1 -0
  350. package/styles/kimbie-dark.d.ts +1 -0
  351. package/styles/kimbie-light.d.ts +1 -0
  352. package/styles/lightfair.d.ts +1 -0
  353. package/styles/lioshi.d.ts +1 -0
  354. package/styles/london-tube.d.ts +1 -0
  355. package/styles/macintosh.d.ts +1 -0
  356. package/styles/magula.d.ts +1 -0
  357. package/styles/marrakesh.d.ts +1 -0
  358. package/styles/materia.d.ts +1 -0
  359. package/styles/material-darker.d.ts +1 -0
  360. package/styles/material-lighter.d.ts +1 -0
  361. package/styles/material-palenight.d.ts +1 -0
  362. package/styles/material-vivid.d.ts +1 -0
  363. package/styles/material.d.ts +1 -0
  364. package/styles/mellow-purple.d.ts +1 -0
  365. package/styles/mexico-light.d.ts +1 -0
  366. package/styles/mocha.d.ts +1 -0
  367. package/styles/mono-blue.d.ts +1 -0
  368. package/styles/monokai-sublime.d.ts +1 -0
  369. package/styles/monokai.d.ts +1 -0
  370. package/styles/nebula.d.ts +1 -0
  371. package/styles/night-owl.d.ts +1 -0
  372. package/styles/nnfx-dark.d.ts +1 -0
  373. package/styles/nnfx-light.d.ts +1 -0
  374. package/styles/nord.d.ts +1 -0
  375. package/styles/nova.d.ts +1 -0
  376. package/styles/obsidian.d.ts +1 -0
  377. package/styles/ocean.d.ts +1 -0
  378. package/styles/oceanicnext.d.ts +1 -0
  379. package/styles/one-light.d.ts +1 -0
  380. package/styles/onedark.d.ts +1 -0
  381. package/styles/outrun-dark.d.ts +1 -0
  382. package/styles/panda-syntax-dark.d.ts +1 -0
  383. package/styles/panda-syntax-light.d.ts +1 -0
  384. package/styles/papercolor-dark.d.ts +1 -0
  385. package/styles/papercolor-light.d.ts +1 -0
  386. package/styles/paraiso-dark.d.ts +1 -0
  387. package/styles/paraiso-light.d.ts +1 -0
  388. package/styles/paraiso.d.ts +1 -0
  389. package/styles/pasque.d.ts +1 -0
  390. package/styles/phd.d.ts +1 -0
  391. package/styles/pico.d.ts +1 -0
  392. package/styles/pojoaque.d.ts +1 -0
  393. package/styles/pop.d.ts +1 -0
  394. package/styles/porple.d.ts +1 -0
  395. package/styles/purebasic.d.ts +1 -0
  396. package/styles/qtcreator-dark.d.ts +1 -0
  397. package/styles/qtcreator-light.d.ts +1 -0
  398. package/styles/qualia.d.ts +1 -0
  399. package/styles/railscasts.d.ts +1 -0
  400. package/styles/rainbow.d.ts +1 -0
  401. package/styles/rebecca.d.ts +1 -0
  402. package/styles/ros-pine-dawn.d.ts +1 -0
  403. package/styles/ros-pine-moon.d.ts +1 -0
  404. package/styles/ros-pine.d.ts +1 -0
  405. package/styles/routeros.d.ts +1 -0
  406. package/styles/sagelight.d.ts +1 -0
  407. package/styles/sandcastle.d.ts +1 -0
  408. package/styles/school-book.d.ts +1 -0
  409. package/styles/seti-ui.d.ts +1 -0
  410. package/styles/shades-of-purple.d.ts +1 -0
  411. package/styles/shapeshifter.d.ts +1 -0
  412. package/styles/silk-dark.d.ts +1 -0
  413. package/styles/silk-light.d.ts +1 -0
  414. package/styles/snazzy.d.ts +1 -0
  415. package/styles/solar-flare-light.d.ts +1 -0
  416. package/styles/solar-flare.d.ts +1 -0
  417. package/styles/solarized-dark.d.ts +1 -0
  418. package/styles/solarized-light.d.ts +1 -0
  419. package/styles/spacemacs.d.ts +1 -0
  420. package/styles/srcery.d.ts +1 -0
  421. package/styles/stackoverflow-dark.d.ts +1 -0
  422. package/styles/stackoverflow-light.d.ts +1 -0
  423. package/styles/summercamp.d.ts +1 -0
  424. package/styles/summerfruit-dark.d.ts +1 -0
  425. package/styles/summerfruit-light.d.ts +1 -0
  426. package/styles/sunburst.d.ts +1 -0
  427. package/styles/synth-midnight-terminal-dark.d.ts +1 -0
  428. package/styles/synth-midnight-terminal-light.d.ts +1 -0
  429. package/styles/tango.d.ts +1 -0
  430. package/styles/tender.d.ts +1 -0
  431. package/styles/tokyo-night-dark.d.ts +1 -0
  432. package/styles/tokyo-night-light.d.ts +1 -0
  433. package/styles/tomorrow-night-blue.d.ts +1 -0
  434. package/styles/tomorrow-night-bright.d.ts +1 -0
  435. package/styles/tomorrow-night.d.ts +1 -0
  436. package/styles/tomorrow.d.ts +1 -0
  437. package/styles/twilight.d.ts +1 -0
  438. package/styles/unikitty-dark.d.ts +1 -0
  439. package/styles/unikitty-light.d.ts +1 -0
  440. package/styles/vs.d.ts +1 -0
  441. package/styles/vs2015.d.ts +1 -0
  442. package/styles/vulcan.d.ts +1 -0
  443. package/styles/windows-10-light.d.ts +1 -0
  444. package/styles/windows-10.d.ts +1 -0
  445. package/styles/windows-95-light.d.ts +1 -0
  446. package/styles/windows-95.d.ts +1 -0
  447. package/styles/windows-high-contrast-light.d.ts +1 -0
  448. package/styles/windows-high-contrast.d.ts +1 -0
  449. package/styles/windows-nt-light.d.ts +1 -0
  450. package/styles/windows-nt.d.ts +1 -0
  451. package/styles/woodland.d.ts +1 -0
  452. package/styles/xcode-dusk.d.ts +1 -0
  453. package/styles/xcode.d.ts +1 -0
  454. package/styles/xt256.d.ts +1 -0
  455. package/styles/zenburn.d.ts +1 -0
package/README.md CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  > Syntax highlighting for Svelte using [highlight.js](https://github.com/highlightjs/highlight.js).
7
7
 
8
- Try it in the [StackBlitz](https://stackblitz.com/edit/svelte-highlight?file=src%2Froutes%2Findex.svelte).
8
+ Try it in [StackBlitz](https://stackblitz.com/edit/svelte-highlight?file=src%2Froutes%2Findex.svelte).
9
9
 
10
10
  ## [Documentation](https://svhe.onrender.com)
11
11
 
@@ -22,28 +22,33 @@ npm i -D svelte-highlight
22
22
  pnpm i -D svelte-highlight highlight.js
23
23
  ```
24
24
 
25
- Note that [pnpm](https://github.com/pnpm/pnpm) users must also install `highlight.js` as a development dependency.
25
+ Note that [pnpm](https://github.com/pnpm/pnpm) users must also install `highlight.js`.
26
26
 
27
- ## SvelteKit Set-up
27
+ ## Basic Usage
28
28
 
29
- To use this library with [SvelteKit](https://github.com/sveltejs/kit) or [vite](https://github.com/sveltejs/vite-plugin-svelte), instruct vite to optimize `highlight.js` and `highlight.js/lib/core`:
29
+ The `Highlight` component requires two props:
30
30
 
31
- ```diff
32
- # svelte.config.js
33
- export default {
34
- kit: {
35
- + vite: {
36
- + optimizeDeps: {
37
- + include: ["highlight.js", "highlight.js/lib/core"],
38
- + },
39
- + },
40
- },
41
- };
31
+ - `code`: text to highlight
32
+ - `language`: language grammar used to highlight the text
33
+
34
+ Import languages from `svelte-highlight/languages`.
35
+
36
+ See [SUPPORTED_LANGUAGES.md](SUPPORTED_LANGUAGES.md) for a list of supported languages.
37
+
38
+ ```svelte
39
+ <script>
40
+ import Highlight from "svelte-highlight";
41
+ import typescript from "svelte-highlight/languages/typescript";
42
+
43
+ const code = "const add = (a: number, b: number) => a + b;";
44
+ </script>
45
+
46
+ <Highlight language={typescript} {code} />
42
47
  ```
43
48
 
44
- Refer to [examples/sveltekit](examples/sveltekit) or [examples/vite](examples/vite).
49
+ ## Styling
45
50
 
46
- ## Usage
51
+ Import styles from `svelte-highlight/styles`. See [SUPPORTED_STYLES.md](SUPPORTED_STYLES.md) for a list of supported styles.
47
52
 
48
53
  There are two ways to apply `highlight.js` styles.
49
54
 
@@ -72,7 +77,7 @@ This component exports `highlight.js` themes in JavaScript. Import the theme fro
72
77
 
73
78
  ### CSS StyleSheet
74
79
 
75
- Depending on your set-up, importing a CSS StyleSheet in Svelte may require a CSS file loader. Refer to [examples/webpack](examples/webpack) for a sample set-up.
80
+ Depending on your set-up, importing a CSS StyleSheet in Svelte may require a CSS file loader. SvelteKit/Vite automatically supports this. For Webpack, refer to [examples/webpack](examples/webpack).
76
81
 
77
82
  ```svelte
78
83
  <script>
@@ -86,6 +91,38 @@ Depending on your set-up, importing a CSS StyleSheet in Svelte may require a CSS
86
91
  <Highlight language={typescript} {code} />
87
92
  ```
88
93
 
94
+ #### Linking from a CDN
95
+
96
+ CSS StyleSheets can also be externally linked from a Content Delivery Network (CDN) like [unpkg.com](https://unpkg.com/).
97
+
98
+ > **Warning**
99
+ > Using a CDN is best suited for prototyping and not recommended for production use.
100
+
101
+ **HTML**
102
+
103
+ ```html
104
+ <!DOCTYPE html>
105
+ <html lang="en">
106
+ <head>
107
+ <link
108
+ rel="stylesheet"
109
+ href="https://unpkg.com/svelte-highlight/styles/github.css"
110
+ />
111
+ </head>
112
+ </html>
113
+ ```
114
+
115
+ **svelte:head**
116
+
117
+ ```svelte
118
+ <svelte:head>
119
+ <link
120
+ rel="stylesheet"
121
+ href="https://unpkg.com/svelte-highlight/styles/github.css"
122
+ />
123
+ </svelte:head>
124
+ ```
125
+
89
126
  ## Svelte Syntax Highlighting
90
127
 
91
128
  Use the `HighlightSvelte` component for Svelte syntax highlighting.
@@ -95,7 +132,7 @@ Use the `HighlightSvelte` component for Svelte syntax highlighting.
95
132
  import { HighlightSvelte } from "svelte-highlight";
96
133
  import github from "svelte-highlight/styles/github";
97
134
 
98
- $: code = `<button on:click={() => { console.log(0); }}>Increment {count}</button>`;
135
+ const code = `<button on:click={() => { console.log(0); }}>Increment {count}</button>`;
99
136
  </script>
100
137
 
101
138
  <svelte:head>
@@ -109,16 +146,15 @@ Use the `HighlightSvelte` component for Svelte syntax highlighting.
109
146
 
110
147
  The `HighlightAuto` component uses [highlightAuto](https://highlightjs.readthedocs.io/en/latest/api.html#highlightauto) API.
111
148
 
112
- **Note:** auto-highlighting will result in a larger bundle size in order to infer a language.
113
-
114
- Prefer to specify a language if possible.
149
+ > **Warning**
150
+ > Auto-highlighting will result in a larger bundle size. Specify a language if possible.
115
151
 
116
152
  ```svelte
117
153
  <script>
118
154
  import { HighlightAuto } from "svelte-highlight";
119
155
  import github from "svelte-highlight/styles/github";
120
156
 
121
- $: code = `body {\n padding: 0;\n color: red;\n}`;
157
+ const code = `body {\n padding: 0;\n color: red;\n}`;
122
158
  </script>
123
159
 
124
160
  <svelte:head>
@@ -128,11 +164,78 @@ Prefer to specify a language if possible.
128
164
  <HighlightAuto {code} />
129
165
  ```
130
166
 
167
+ ## Line Numbers
168
+
169
+ Use the `LineNumbers` component to render the highlighted code with line numbers.
170
+
171
+ ```svelte
172
+ <script>
173
+ import Hightlight, { LineNumbers } from "svelte-highlight";
174
+ import typescript from "svelte-highlight/languages/typescript";
175
+ import atomOneDark from "svelte-highlight/styles/atom-one-dark";
176
+
177
+ const code = "const add = (a: number, b: number) => a + b";
178
+ </script>
179
+
180
+ <svelte:head>
181
+ {@html atomOneDark}
182
+ </svelte:head>
183
+
184
+ <Highlight language={typescript} {code} let:highlighted>
185
+ <LineNumbers {highlighted} />
186
+ </Highlight>
187
+ ```
188
+
189
+ ### Hidden Border
190
+
191
+ Set `hideBorder` to `true` to hide the border of the line numbers column.
192
+
193
+ ```svelte
194
+ <Highlight language={typescript} {code} let:highlighted>
195
+ <LineNumbers {highlighted} hideBorder />
196
+ </Highlight>
197
+ ```
198
+
199
+ ### Wrapped Lines
200
+
201
+ By default, overflowing horizontal content is contained by a scrollbar.
202
+
203
+ Set `wrapLines` to `true` to hide the border of the line numbers column.
204
+
205
+ ```svelte
206
+ <Highlight language={typescript} {code} let:highlighted>
207
+ <LineNumbers {highlighted} wrapLines />
208
+ </Highlight>
209
+ ```
210
+
211
+ ### Custom Styles
212
+
213
+ Use `--style-props` to customize styles.
214
+
215
+ | Style prop | Description | Default value |
216
+ | :------------------ | :----------------------------------------- | :------------- |
217
+ | --line-number-color | Text color of the line numbers | `currentColor` |
218
+ | --border-color | Border color of the column of line numbers | `currentColor` |
219
+ | --padding-left | Left padding for `td` elements | `1em` |
220
+ | --padding-right | Rightt padding for `td` elements | `1em` |
221
+
222
+ ```svelte
223
+ <Highlight language={typescript} {code} let:highlighted>
224
+ <LineNumbers
225
+ {highlighted}
226
+ --line-number-color="pink"
227
+ --border-color="rgba(255, 255, 255, 0.2)"
228
+ --padding-left="0"
229
+ --padding-right="3em"
230
+ />
231
+ </Highlight>
232
+ ```
233
+
131
234
  ## Language Targeting
132
235
 
133
236
  All `Highlight` components apply a `data-language` attribute on the codeblock containing the language name.
134
237
 
135
- See the [Languages page](SUPPORTED_LANGUAGES.md) for a list of supported languages.
238
+ See [SUPPORTED_LANGUAGES.md](SUPPORTED_LANGUAGES.md) for a list of supported languages.
136
239
 
137
240
  ```css
138
241
  [data-language="css"] {
@@ -142,19 +245,17 @@ See the [Languages page](SUPPORTED_LANGUAGES.md) for a list of supported languag
142
245
 
143
246
  ## Language Tags
144
247
 
145
- All `Highlight` components allow for a tag to be added at the top-right of the codeblock displaying the language name.
146
-
147
- The language tag can be given a custom `background` , `color` , and `border-radius` through CSS custom properties.
248
+ Set `langtag` to `true` to display the language name in the top right corner of the code block.
148
249
 
149
- It is recommended that you set values for `--hljs-background` and `--hljs-foreground` to ensure the langtags are readable with your theme.
250
+ Customize the language tag `background`, `color`, and `border-radius` using style props.
150
251
 
151
252
  See the [Languages page](SUPPORTED_LANGUAGES.md) for a list of supported languages.
152
253
 
153
- Defaults:
154
-
155
- - `--hljs-background: inherit`
156
- - `--hljs-foreground: inherit`
157
- - `--hljs-border-radius: 0`
254
+ | Style prop | Description | Default value |
255
+ | :---------------------- | :------------------------------ | :------------ |
256
+ | --langtag-background | Background color of the langtag | `inherit` |
257
+ | --langtag-color | Text color of the langtag | `inherit` |
258
+ | --langtag-border-radius | Border radius of the langtag | `0` |
158
259
 
159
260
  ```svelte
160
261
  <script>
@@ -168,9 +269,9 @@ Defaults:
168
269
 
169
270
  ```css
170
271
  [data-language="css"] {
171
- --hljs-background: linear-gradient(135deg, #2996cf, 80%, white);
172
- --hljs-foreground: #fff;
173
- --hljs-radius: 8px;
272
+ --langtag-background: linear-gradient(135deg, #2996cf, 80%, white);
273
+ --langtag-color: #fff;
274
+ --langtag-border-radius: 8px;
174
275
  }
175
276
  ```
176
277
 
@@ -199,37 +300,143 @@ Refer to the highlight.js [language definition guide](https://highlightjs.readth
199
300
  <Highlight {language} code="..." />
200
301
  ```
201
302
 
202
- ## API
303
+ ## Code-splitting
203
304
 
204
- ### Props
305
+ You can use the `await import` syntax for code-splitting.
205
306
 
206
- | Name | Type | Default value |
207
- | :---------------------------------------------- | :--------------------------------------------- | :--------------------------------------- |
208
- | code | `any` | `undefined` |
209
- | language (only required for `Highlight.svelte`) | { name: `string`; register: hljs => `object` } | { name: undefined, register: undefined } |
210
- | langtag | `boolean` | `false` |
307
+ In the example below, the `HighlightAuto` component and injected styles are dynamically loaded.
211
308
 
212
- - `$$restProps` are forwarded to the `pre` element
309
+ ```svelte
310
+ <script>
311
+ import { onMount } from "svelte";
312
+
313
+ let component;
314
+ let styles;
213
315
 
214
- ### Dispatched Events
316
+ onMount(async () => {
317
+ component = (await import("svelte-highlight")).HighlightAuto;
318
+ styles = (await import("svelte-highlight/styles/github")).default;
319
+ });
320
+ </script>
215
321
 
216
- - **on:highlight**: fired after code syntax is highlighted
322
+ <svelte:head>
323
+ {#if styles}
324
+ {@html styles}
325
+ {/if}
326
+ </svelte:head>
327
+
328
+ <svelte:component
329
+ this={component}
330
+ langtag
331
+ code={`body {\n padding: 0;\n color: red;\n}`}
332
+ />
333
+ ```
334
+
335
+ ## Component API
336
+
337
+ ### `Highlight`
338
+
339
+ #### Props
340
+
341
+ | Name | Type | Default value |
342
+ | :------- | :--------------------------------------------- | :------------- |
343
+ | code | `any` | N/A (required) |
344
+ | language | { name: `string`; register: hljs => `object` } | N/A (required) |
345
+ | langtag | `boolean` | `false` |
346
+
347
+ `$$restProps` are forwarded to the top-level `pre` element.
348
+
349
+ #### Dispatched Events
350
+
351
+ - **on:highlight**: fired after `code` is highlighted
217
352
 
218
353
  ```svelte
219
354
  <Highlight
220
355
  language={typescript}
221
356
  {code}
222
357
  on:highlight={(e) => {
223
- console.log(e.detail.highlighted); // "<span>...</span>"
358
+ /**
359
+ * The highlighted HTML as a string.
360
+ * @example "<span>...</span>"
361
+ */
362
+ console.log(e.detail.highlighted);
363
+ }}
364
+ />
365
+ ```
366
+
367
+ ### `LineNumbers`
368
+
369
+ #### Props
370
+
371
+ | Name | Type | Default value |
372
+ | :---------- | :-------- | :------------- |
373
+ | highlighted | `string` | N/A (required) |
374
+ | hideBorder | `boolean` | `false` |
375
+ | wrapLines | `boolean` | `false` |
376
+
377
+ `$$restProps` are forwarded to the top-level `div` element.
378
+
379
+ ### `HighlightSvelte`
380
+
381
+ #### Props
382
+
383
+ | Name | Type | Default value |
384
+ | :------ | :-------- | :------------- |
385
+ | code | `any` | N/A (required) |
386
+ | langtag | `boolean` | `false` |
387
+
388
+ `$$restProps` are forwarded to the top-level `pre` element.
389
+
390
+ #### Dispatched Events
391
+
392
+ - **on:highlight**: fired after `code` is highlighted
393
+
394
+ ```svelte
395
+ <HighlightSvelte
396
+ {code}
397
+ on:highlight={(e) => {
398
+ /**
399
+ * The highlighted HTML as a string.
400
+ * @example "<span>...</span>"
401
+ */
402
+ console.log(e.detail.highlighted);
224
403
  }}
225
404
  />
226
405
  ```
227
406
 
228
- ## TypeScript
407
+ ### `HighlightAuto`
408
+
409
+ #### Props
410
+
411
+ | Name | Type | Default value |
412
+ | :------ | :-------- | :------------- |
413
+ | code | `any` | N/A (required) |
414
+ | langtag | `boolean` | `false` |
415
+
416
+ `$$restProps` are forwarded to the top-level `pre` element.
417
+
418
+ #### Dispatched Events
229
419
 
230
- Svelte version 3.31 or greater is required to use this component with TypeScript.
420
+ - **on:highlight**: fired after `code` is highlighted
231
421
 
232
- TypeScript definitions are auto-generated by SvelteKit.
422
+ ```svelte
423
+ <HighlightAuto
424
+ {code}
425
+ on:highlight={(e) => {
426
+ /**
427
+ * The highlighted HTML as a string.
428
+ * @example "<span>...</span>"
429
+ */
430
+ console.log(e.detail.highlighted);
431
+
432
+ /**
433
+ * The inferred language name
434
+ * @example "css"
435
+ */
436
+ console.log(e.detail.language);
437
+ }}
438
+ />
439
+ ```
233
440
 
234
441
  ## [Supported Languages](SUPPORTED_LANGUAGES.md)
235
442
 
@@ -238,8 +445,6 @@ TypeScript definitions are auto-generated by SvelteKit.
238
445
  ## Examples
239
446
 
240
447
  - [examples/rollup](examples/rollup)
241
- - [examples/rollup-typescript](examples/rollup-typescript)
242
- - [examples/snowpack](examples/snowpack)
243
448
  - [examples/sveltekit](examples/sveltekit)
244
449
  - [examples/vite](examples/vite)
245
450
  - [examples/webpack](examples/webpack)
package/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export { default as default } from "./Highlight.svelte";
2
- export { default as Highlight } from "./Highlight.svelte";
1
+ export { default as default, default as Highlight } from "./Highlight.svelte";
3
2
  export { default as HighlightAuto } from "./HighlightAuto.svelte";
4
3
  export { default as HighlightSvelte } from "./HighlightSvelte.svelte";
4
+ export { default as LineNumbers } from "./LineNumbers.svelte";
package/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { default as default } from "./Highlight.svelte";
2
- export { default as Highlight } from "./Highlight.svelte";
1
+ export { default as default, default as Highlight } from "./Highlight.svelte";
3
2
  export { default as HighlightAuto } from "./HighlightAuto.svelte";
4
3
  export { default as HighlightSvelte } from "./HighlightSvelte.svelte";
4
+ export { default as LineNumbers } from "./LineNumbers.svelte";
@@ -0,0 +1,2 @@
1
+ export { _1c } from "./";
2
+ export { _1c as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { abnf } from "./";
2
+ export { abnf as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { accesslog } from "./";
2
+ export { accesslog as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { actionscript } from "./";
2
+ export { actionscript as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { ada } from "./";
2
+ export { ada as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { angelscript } from "./";
2
+ export { angelscript as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { apache } from "./";
2
+ export { apache as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { applescript } from "./";
2
+ export { applescript as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { arcade } from "./";
2
+ export { arcade as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { arduino } from "./";
2
+ export { arduino as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { armasm } from "./";
2
+ export { armasm as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { asciidoc } from "./";
2
+ export { asciidoc as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { aspectj } from "./";
2
+ export { aspectj as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { autohotkey } from "./";
2
+ export { autohotkey as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { autoit } from "./";
2
+ export { autoit as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { avrasm } from "./";
2
+ export { avrasm as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { awk } from "./";
2
+ export { awk as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { axapta } from "./";
2
+ export { axapta as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { bash } from "./";
2
+ export { bash as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { basic } from "./";
2
+ export { basic as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { bnf } from "./";
2
+ export { bnf as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { brainfuck } from "./";
2
+ export { brainfuck as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { c } from "./";
2
+ export { c as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { cal } from "./";
2
+ export { cal as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { capnproto } from "./";
2
+ export { capnproto as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { ceylon } from "./";
2
+ export { ceylon as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { clean } from "./";
2
+ export { clean as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { clojureRepl } from "./";
2
+ export { clojureRepl as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { clojure } from "./";
2
+ export { clojure as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { cmake } from "./";
2
+ export { cmake as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { coffeescript } from "./";
2
+ export { coffeescript as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { coq } from "./";
2
+ export { coq as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { cos } from "./";
2
+ export { cos as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { cpp } from "./";
2
+ export { cpp as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { crmsh } from "./";
2
+ export { crmsh as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { crystal } from "./";
2
+ export { crystal as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { csharp } from "./";
2
+ export { csharp as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { csp } from "./";
2
+ export { csp as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { css } from "./";
2
+ export { css as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { d } from "./";
2
+ export { d as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { dart } from "./";
2
+ export { dart as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { delphi } from "./";
2
+ export { delphi as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { diff } from "./";
2
+ export { diff as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { django } from "./";
2
+ export { django as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { dns } from "./";
2
+ export { dns as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { dockerfile } from "./";
2
+ export { dockerfile as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { dos } from "./";
2
+ export { dos as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { dsconfig } from "./";
2
+ export { dsconfig as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { dts } from "./";
2
+ export { dts as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { dust } from "./";
2
+ export { dust as default } from "./";
@@ -0,0 +1,2 @@
1
+ export { ebnf } from "./";
2
+ export { ebnf as default } from "./";