svelte-highlight 6.1.1 → 6.2.1
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.
- package/CHANGELOG.md +28 -1
- package/Highlight.svelte.d.ts +21 -12
- package/HighlightAuto.svelte.d.ts +9 -16
- package/HighlightSvelte.svelte.d.ts +9 -11
- package/README.md +89 -24
- package/languages/1c.d.ts +2 -0
- package/languages/abnf.d.ts +2 -0
- package/languages/accesslog.d.ts +2 -0
- package/languages/actionscript.d.ts +2 -0
- package/languages/ada.d.ts +2 -0
- package/languages/angelscript.d.ts +2 -0
- package/languages/apache.d.ts +2 -0
- package/languages/applescript.d.ts +2 -0
- package/languages/arcade.d.ts +2 -0
- package/languages/arduino.d.ts +2 -0
- package/languages/armasm.d.ts +2 -0
- package/languages/asciidoc.d.ts +2 -0
- package/languages/aspectj.d.ts +2 -0
- package/languages/autohotkey.d.ts +2 -0
- package/languages/autoit.d.ts +2 -0
- package/languages/avrasm.d.ts +2 -0
- package/languages/awk.d.ts +2 -0
- package/languages/axapta.d.ts +2 -0
- package/languages/bash.d.ts +2 -0
- package/languages/basic.d.ts +2 -0
- package/languages/bnf.d.ts +2 -0
- package/languages/brainfuck.d.ts +2 -0
- package/languages/c.d.ts +2 -0
- package/languages/cal.d.ts +2 -0
- package/languages/capnproto.d.ts +2 -0
- package/languages/ceylon.d.ts +2 -0
- package/languages/clean.d.ts +2 -0
- package/languages/clojure-repl.d.ts +2 -0
- package/languages/clojure.d.ts +2 -0
- package/languages/cmake.d.ts +2 -0
- package/languages/coffeescript.d.ts +2 -0
- package/languages/coq.d.ts +2 -0
- package/languages/cos.d.ts +2 -0
- package/languages/cpp.d.ts +2 -0
- package/languages/crmsh.d.ts +2 -0
- package/languages/crystal.d.ts +2 -0
- package/languages/csharp.d.ts +2 -0
- package/languages/csp.d.ts +2 -0
- package/languages/css.d.ts +2 -0
- package/languages/d.d.ts +2 -0
- package/languages/dart.d.ts +2 -0
- package/languages/delphi.d.ts +2 -0
- package/languages/diff.d.ts +2 -0
- package/languages/django.d.ts +2 -0
- package/languages/dns.d.ts +2 -0
- package/languages/dockerfile.d.ts +2 -0
- package/languages/dos.d.ts +2 -0
- package/languages/dsconfig.d.ts +2 -0
- package/languages/dts.d.ts +2 -0
- package/languages/dust.d.ts +2 -0
- package/languages/ebnf.d.ts +2 -0
- package/languages/elixir.d.ts +2 -0
- package/languages/elm.d.ts +2 -0
- package/languages/erb.d.ts +2 -0
- package/languages/erlang-repl.d.ts +2 -0
- package/languages/erlang.d.ts +2 -0
- package/languages/excel.d.ts +2 -0
- package/languages/fix.d.ts +2 -0
- package/languages/flix.d.ts +2 -0
- package/languages/fortran.d.ts +2 -0
- package/languages/fsharp.d.ts +2 -0
- package/languages/gams.d.ts +2 -0
- package/languages/gauss.d.ts +2 -0
- package/languages/gcode.d.ts +2 -0
- package/languages/gherkin.d.ts +2 -0
- package/languages/glsl.d.ts +2 -0
- package/languages/gml.d.ts +2 -0
- package/languages/go.d.ts +2 -0
- package/languages/golo.d.ts +2 -0
- package/languages/gradle.d.ts +2 -0
- package/languages/graphql.d.ts +2 -0
- package/languages/groovy.d.ts +2 -0
- package/languages/haml.d.ts +2 -0
- package/languages/handlebars.d.ts +2 -0
- package/languages/haskell.d.ts +2 -0
- package/languages/haxe.d.ts +2 -0
- package/languages/hsp.d.ts +2 -0
- package/languages/http.d.ts +2 -0
- package/languages/hy.d.ts +2 -0
- package/languages/index.d.ts +199 -0
- package/languages/inform7.d.ts +2 -0
- package/languages/ini.d.ts +2 -0
- package/languages/irpf90.d.ts +2 -0
- package/languages/isbl.d.ts +2 -0
- package/languages/java.d.ts +2 -0
- package/languages/javascript.d.ts +2 -0
- package/languages/jboss-cli.d.ts +2 -0
- package/languages/json.d.ts +2 -0
- package/languages/julia-repl.d.ts +2 -0
- package/languages/julia.d.ts +2 -0
- package/languages/kotlin.d.ts +2 -0
- package/languages/lasso.d.ts +2 -0
- package/languages/latex.d.ts +2 -0
- package/languages/ldif.d.ts +2 -0
- package/languages/leaf.d.ts +2 -0
- package/languages/less.d.ts +2 -0
- package/languages/lisp.d.ts +2 -0
- package/languages/livecodeserver.d.ts +2 -0
- package/languages/livescript.d.ts +2 -0
- package/languages/llvm.d.ts +2 -0
- package/languages/lsl.d.ts +2 -0
- package/languages/lua.d.ts +2 -0
- package/languages/makefile.d.ts +2 -0
- package/languages/markdown.d.ts +2 -0
- package/languages/mathematica.d.ts +2 -0
- package/languages/matlab.d.ts +2 -0
- package/languages/maxima.d.ts +2 -0
- package/languages/mel.d.ts +2 -0
- package/languages/mercury.d.ts +2 -0
- package/languages/mipsasm.d.ts +2 -0
- package/languages/mizar.d.ts +2 -0
- package/languages/mojolicious.d.ts +2 -0
- package/languages/monkey.d.ts +2 -0
- package/languages/moonscript.d.ts +2 -0
- package/languages/n1ql.d.ts +2 -0
- package/languages/nestedtext.d.ts +2 -0
- package/languages/nginx.d.ts +2 -0
- package/languages/nim.d.ts +2 -0
- package/languages/nix.d.ts +2 -0
- package/languages/node-repl.d.ts +2 -0
- package/languages/nsis.d.ts +2 -0
- package/languages/objectivec.d.ts +2 -0
- package/languages/ocaml.d.ts +2 -0
- package/languages/openscad.d.ts +2 -0
- package/languages/oxygene.d.ts +2 -0
- package/languages/parser3.d.ts +2 -0
- package/languages/perl.d.ts +2 -0
- package/languages/pf.d.ts +2 -0
- package/languages/pgsql.d.ts +2 -0
- package/languages/php-template.d.ts +2 -0
- package/languages/php.d.ts +2 -0
- package/languages/plaintext.d.ts +2 -0
- package/languages/pony.d.ts +2 -0
- package/languages/powershell.d.ts +2 -0
- package/languages/processing.d.ts +2 -0
- package/languages/profile.d.ts +2 -0
- package/languages/prolog.d.ts +2 -0
- package/languages/properties.d.ts +2 -0
- package/languages/protobuf.d.ts +2 -0
- package/languages/puppet.d.ts +2 -0
- package/languages/purebasic.d.ts +2 -0
- package/languages/python-repl.d.ts +2 -0
- package/languages/python.d.ts +2 -0
- package/languages/q.d.ts +2 -0
- package/languages/qml.d.ts +2 -0
- package/languages/r.d.ts +2 -0
- package/languages/reasonml.d.ts +2 -0
- package/languages/rib.d.ts +2 -0
- package/languages/roboconf.d.ts +2 -0
- package/languages/routeros.d.ts +2 -0
- package/languages/rsl.d.ts +2 -0
- package/languages/ruby.d.ts +2 -0
- package/languages/ruleslanguage.d.ts +2 -0
- package/languages/rust.d.ts +2 -0
- package/languages/sas.d.ts +2 -0
- package/languages/scala.d.ts +2 -0
- package/languages/scheme.d.ts +2 -0
- package/languages/scilab.d.ts +2 -0
- package/languages/scss.d.ts +2 -0
- package/languages/shell.d.ts +2 -0
- package/languages/smali.d.ts +2 -0
- package/languages/smalltalk.d.ts +2 -0
- package/languages/sml.d.ts +2 -0
- package/languages/sqf.d.ts +2 -0
- package/languages/sql.d.ts +2 -0
- package/languages/stan.d.ts +2 -0
- package/languages/stata.d.ts +2 -0
- package/languages/step21.d.ts +2 -0
- package/languages/stylus.d.ts +2 -0
- package/languages/subunit.d.ts +2 -0
- package/languages/swift.d.ts +2 -0
- package/languages/taggerscript.d.ts +2 -0
- package/languages/tap.d.ts +2 -0
- package/languages/tcl.d.ts +2 -0
- package/languages/thrift.d.ts +2 -0
- package/languages/tp.d.ts +2 -0
- package/languages/twig.d.ts +2 -0
- package/languages/typescript.d.ts +2 -0
- package/languages/vala.d.ts +2 -0
- package/languages/vbnet.d.ts +2 -0
- package/languages/vbscript-html.d.ts +2 -0
- package/languages/vbscript.d.ts +2 -0
- package/languages/verilog.d.ts +2 -0
- package/languages/vhdl.d.ts +2 -0
- package/languages/vim.d.ts +2 -0
- package/languages/wasm.d.ts +2 -0
- package/languages/wren.d.ts +2 -0
- package/languages/x86asm.d.ts +2 -0
- package/languages/xl.d.ts +2 -0
- package/languages/xml.d.ts +2 -0
- package/languages/xquery.d.ts +2 -0
- package/languages/yaml.d.ts +2 -0
- package/languages/zephir.d.ts +2 -0
- package/package.json +16 -11
- package/styles/3024.d.ts +1 -0
- package/styles/a11y-dark.d.ts +1 -0
- package/styles/a11y-light.d.ts +1 -0
- package/styles/agate.d.ts +1 -0
- package/styles/an-old-hope.d.ts +1 -0
- package/styles/androidstudio.d.ts +1 -0
- package/styles/apathy.d.ts +1 -0
- package/styles/apprentice.d.ts +1 -0
- package/styles/arduino-light.d.ts +1 -0
- package/styles/arta.d.ts +1 -0
- package/styles/ascetic.d.ts +1 -0
- package/styles/ashes.d.ts +1 -0
- package/styles/atelier-cave-light.d.ts +1 -0
- package/styles/atelier-cave.d.ts +1 -0
- package/styles/atelier-dune-light.d.ts +1 -0
- package/styles/atelier-dune.d.ts +1 -0
- package/styles/atelier-estuary-light.d.ts +1 -0
- package/styles/atelier-estuary.d.ts +1 -0
- package/styles/atelier-forest-light.d.ts +1 -0
- package/styles/atelier-forest.d.ts +1 -0
- package/styles/atelier-heath-light.d.ts +1 -0
- package/styles/atelier-heath.d.ts +1 -0
- package/styles/atelier-lakeside-light.d.ts +1 -0
- package/styles/atelier-lakeside.d.ts +1 -0
- package/styles/atelier-plateau-light.d.ts +1 -0
- package/styles/atelier-plateau.d.ts +1 -0
- package/styles/atelier-savanna-light.d.ts +1 -0
- package/styles/atelier-savanna.d.ts +1 -0
- package/styles/atelier-seaside-light.d.ts +1 -0
- package/styles/atelier-seaside.d.ts +1 -0
- package/styles/atelier-sulphurpool-light.d.ts +1 -0
- package/styles/atelier-sulphurpool.d.ts +1 -0
- package/styles/atlas.d.ts +1 -0
- package/styles/atom-one-dark-reasonable.d.ts +1 -0
- package/styles/atom-one-dark.d.ts +1 -0
- package/styles/atom-one-light.d.ts +1 -0
- package/styles/base16-github.d.ts +1 -0
- package/styles/base16-ir-black.d.ts +1 -0
- package/styles/base16-monokai.d.ts +1 -0
- package/styles/base16-nord.d.ts +1 -0
- package/styles/bespin.d.ts +1 -0
- package/styles/black-metal-bathory.d.ts +1 -0
- package/styles/black-metal-burzum.d.ts +1 -0
- package/styles/black-metal-dark-funeral.d.ts +1 -0
- package/styles/black-metal-gorgoroth.d.ts +1 -0
- package/styles/black-metal-immortal.d.ts +1 -0
- package/styles/black-metal-khold.d.ts +1 -0
- package/styles/black-metal-marduk.d.ts +1 -0
- package/styles/black-metal-mayhem.d.ts +1 -0
- package/styles/black-metal-nile.d.ts +1 -0
- package/styles/black-metal-venom.d.ts +1 -0
- package/styles/black-metal.d.ts +1 -0
- package/styles/brewer.d.ts +1 -0
- package/styles/bright.d.ts +1 -0
- package/styles/brogrammer.d.ts +1 -0
- package/styles/brown-paper.d.ts +1 -0
- package/styles/brush-trees-dark.d.ts +1 -0
- package/styles/brush-trees.d.ts +1 -0
- package/styles/chalk.d.ts +1 -0
- package/styles/circus.d.ts +1 -0
- package/styles/classic-dark.d.ts +1 -0
- package/styles/classic-light.d.ts +1 -0
- package/styles/codepen-embed.d.ts +1 -0
- package/styles/codeschool.d.ts +1 -0
- package/styles/color-brewer.d.ts +1 -0
- package/styles/colors.d.ts +1 -0
- package/styles/cupcake.d.ts +1 -0
- package/styles/cupertino.d.ts +1 -0
- package/styles/danqing.d.ts +1 -0
- package/styles/darcula.d.ts +1 -0
- package/styles/dark-violet.d.ts +1 -0
- package/styles/dark.d.ts +1 -0
- package/styles/darkmoss.d.ts +1 -0
- package/styles/darktooth.d.ts +1 -0
- package/styles/decaf.d.ts +1 -0
- package/styles/default-dark.d.ts +1 -0
- package/styles/default-light.d.ts +1 -0
- package/styles/default.d.ts +1 -0
- package/styles/devibeans.d.ts +1 -0
- package/styles/dirtysea.d.ts +1 -0
- package/styles/docco.d.ts +1 -0
- package/styles/dracula.d.ts +1 -0
- package/styles/edge-dark.d.ts +1 -0
- package/styles/edge-light.d.ts +1 -0
- package/styles/eighties.d.ts +1 -0
- package/styles/embers.d.ts +1 -0
- package/styles/equilibrium-dark.d.ts +1 -0
- package/styles/equilibrium-gray-dark.d.ts +1 -0
- package/styles/equilibrium-gray-light.d.ts +1 -0
- package/styles/equilibrium-light.d.ts +1 -0
- package/styles/espresso.d.ts +1 -0
- package/styles/eva-dim.d.ts +1 -0
- package/styles/eva.d.ts +1 -0
- package/styles/far.d.ts +1 -0
- package/styles/felipec.d.ts +1 -0
- package/styles/flat.d.ts +1 -0
- package/styles/foundation.d.ts +1 -0
- package/styles/framer.d.ts +1 -0
- package/styles/fruit-soda.d.ts +1 -0
- package/styles/gigavolt.d.ts +1 -0
- package/styles/github-dark-dimmed.d.ts +1 -0
- package/styles/github-dark.d.ts +1 -0
- package/styles/github.d.ts +1 -0
- package/styles/gml.d.ts +1 -0
- package/styles/google-dark.d.ts +1 -0
- package/styles/google-light.d.ts +1 -0
- package/styles/googlecode.d.ts +1 -0
- package/styles/gradient-dark.d.ts +1 -0
- package/styles/gradient-light.d.ts +1 -0
- package/styles/grayscale-dark.d.ts +1 -0
- package/styles/grayscale-light.d.ts +1 -0
- package/styles/grayscale.d.ts +1 -0
- package/styles/green-screen.d.ts +1 -0
- package/styles/gruvbox-dark-hard.d.ts +1 -0
- package/styles/gruvbox-dark-medium.d.ts +1 -0
- package/styles/gruvbox-dark-pale.d.ts +1 -0
- package/styles/gruvbox-dark-soft.d.ts +1 -0
- package/styles/gruvbox-light-hard.d.ts +1 -0
- package/styles/gruvbox-light-medium.d.ts +1 -0
- package/styles/gruvbox-light-soft.d.ts +1 -0
- package/styles/hardcore.d.ts +1 -0
- package/styles/harmonic16-dark.d.ts +1 -0
- package/styles/harmonic16-light.d.ts +1 -0
- package/styles/heetch-dark.d.ts +1 -0
- package/styles/heetch-light.d.ts +1 -0
- package/styles/helios.d.ts +1 -0
- package/styles/hopscotch.d.ts +1 -0
- package/styles/horizon-dark.d.ts +1 -0
- package/styles/horizon-light.d.ts +1 -0
- package/styles/humanoid-dark.d.ts +1 -0
- package/styles/humanoid-light.d.ts +1 -0
- package/styles/hybrid.d.ts +1 -0
- package/styles/ia-dark.d.ts +1 -0
- package/styles/ia-light.d.ts +1 -0
- package/styles/icy-dark.d.ts +1 -0
- package/styles/idea.d.ts +1 -0
- package/styles/index.d.ts +248 -0
- package/styles/index.js +2 -0
- package/styles/intellij-light.d.ts +1 -0
- package/styles/ir-black.d.ts +1 -0
- package/styles/isbl-editor-dark.d.ts +1 -0
- package/styles/isbl-editor-light.d.ts +1 -0
- package/styles/isotope.d.ts +1 -0
- package/styles/kimber.d.ts +1 -0
- package/styles/kimbie-dark.d.ts +1 -0
- package/styles/kimbie-light.d.ts +1 -0
- package/styles/lightfair.d.ts +1 -0
- package/styles/lioshi.d.ts +1 -0
- package/styles/london-tube.d.ts +1 -0
- package/styles/macintosh.d.ts +1 -0
- package/styles/magula.d.ts +1 -0
- package/styles/marrakesh.d.ts +1 -0
- package/styles/materia.d.ts +1 -0
- package/styles/material-darker.d.ts +1 -0
- package/styles/material-lighter.d.ts +1 -0
- package/styles/material-palenight.d.ts +1 -0
- package/styles/material-vivid.d.ts +1 -0
- package/styles/material.d.ts +1 -0
- package/styles/mellow-purple.d.ts +1 -0
- package/styles/mexico-light.d.ts +1 -0
- package/styles/mocha.d.ts +1 -0
- package/styles/mono-blue.d.ts +1 -0
- package/styles/monokai-sublime.d.ts +1 -0
- package/styles/monokai.d.ts +1 -0
- package/styles/nebula.d.ts +1 -0
- package/styles/night-owl.d.ts +1 -0
- package/styles/nnfx-dark.d.ts +1 -0
- package/styles/nnfx-light.d.ts +1 -0
- package/styles/nord.d.ts +1 -0
- package/styles/nova.d.ts +1 -0
- package/styles/obsidian.d.ts +1 -0
- package/styles/ocean.d.ts +1 -0
- package/styles/oceanicnext.d.ts +1 -0
- package/styles/one-light.d.ts +1 -0
- package/styles/onedark.d.ts +1 -0
- package/styles/outrun-dark.d.ts +1 -0
- package/styles/panda-syntax-dark.css +87 -0
- package/styles/panda-syntax-dark.d.ts +1 -0
- package/styles/panda-syntax-dark.js +3 -0
- package/styles/panda-syntax-light.css +84 -0
- package/styles/panda-syntax-light.d.ts +1 -0
- package/styles/panda-syntax-light.js +3 -0
- package/styles/papercolor-dark.d.ts +1 -0
- package/styles/papercolor-light.d.ts +1 -0
- package/styles/paraiso-dark.d.ts +1 -0
- package/styles/paraiso-light.d.ts +1 -0
- package/styles/paraiso.d.ts +1 -0
- package/styles/pasque.d.ts +1 -0
- package/styles/phd.d.ts +1 -0
- package/styles/pico.d.ts +1 -0
- package/styles/pojoaque.d.ts +1 -0
- package/styles/pop.d.ts +1 -0
- package/styles/porple.d.ts +1 -0
- package/styles/purebasic.d.ts +1 -0
- package/styles/qtcreator-dark.d.ts +1 -0
- package/styles/qtcreator-light.d.ts +1 -0
- package/styles/qualia.d.ts +1 -0
- package/styles/railscasts.d.ts +1 -0
- package/styles/rainbow.d.ts +1 -0
- package/styles/rebecca.d.ts +1 -0
- package/styles/ros-pine-dawn.d.ts +1 -0
- package/styles/ros-pine-moon.d.ts +1 -0
- package/styles/ros-pine.d.ts +1 -0
- package/styles/routeros.d.ts +1 -0
- package/styles/sagelight.d.ts +1 -0
- package/styles/sandcastle.d.ts +1 -0
- package/styles/school-book.d.ts +1 -0
- package/styles/seti-ui.d.ts +1 -0
- package/styles/shades-of-purple.d.ts +1 -0
- package/styles/shapeshifter.d.ts +1 -0
- package/styles/silk-dark.d.ts +1 -0
- package/styles/silk-light.d.ts +1 -0
- package/styles/snazzy.d.ts +1 -0
- package/styles/solar-flare-light.d.ts +1 -0
- package/styles/solar-flare.d.ts +1 -0
- package/styles/solarized-dark.d.ts +1 -0
- package/styles/solarized-light.d.ts +1 -0
- package/styles/spacemacs.d.ts +1 -0
- package/styles/srcery.d.ts +1 -0
- package/styles/stackoverflow-dark.d.ts +1 -0
- package/styles/stackoverflow-light.d.ts +1 -0
- package/styles/summercamp.d.ts +1 -0
- package/styles/summerfruit-dark.d.ts +1 -0
- package/styles/summerfruit-light.d.ts +1 -0
- package/styles/sunburst.d.ts +1 -0
- package/styles/synth-midnight-terminal-dark.d.ts +1 -0
- package/styles/synth-midnight-terminal-light.d.ts +1 -0
- package/styles/tango.d.ts +1 -0
- package/styles/tender.d.ts +1 -0
- package/styles/tokyo-night-dark.d.ts +1 -0
- package/styles/tokyo-night-light.d.ts +1 -0
- package/styles/tomorrow-night-blue.d.ts +1 -0
- package/styles/tomorrow-night-bright.d.ts +1 -0
- package/styles/tomorrow-night.d.ts +1 -0
- package/styles/tomorrow.d.ts +1 -0
- package/styles/twilight.d.ts +1 -0
- package/styles/unikitty-dark.d.ts +1 -0
- package/styles/unikitty-light.d.ts +1 -0
- package/styles/vs.d.ts +1 -0
- package/styles/vs2015.d.ts +1 -0
- package/styles/vulcan.d.ts +1 -0
- package/styles/windows-10-light.d.ts +1 -0
- package/styles/windows-10.d.ts +1 -0
- package/styles/windows-95-light.d.ts +1 -0
- package/styles/windows-95.d.ts +1 -0
- package/styles/windows-high-contrast-light.d.ts +1 -0
- package/styles/windows-high-contrast.d.ts +1 -0
- package/styles/windows-nt-light.d.ts +1 -0
- package/styles/windows-nt.d.ts +1 -0
- package/styles/woodland.d.ts +1 -0
- package/styles/xcode-dusk.d.ts +1 -0
- package/styles/xcode.d.ts +1 -0
- package/styles/xt256.d.ts +1 -0
- package/styles/zenburn.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,33 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [6.2.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.2.1) - 2022-08-07
|
|
9
|
+
|
|
10
|
+
**Fixes**
|
|
11
|
+
|
|
12
|
+
- generate types for `svelte-highlight/languages/*`, `svelte-highlight/styles/*`
|
|
13
|
+
|
|
14
|
+
**Documentation**
|
|
15
|
+
|
|
16
|
+
- add dynamic import example
|
|
17
|
+
- document CDN styles usage
|
|
18
|
+
- use TypeScript in all example set-ups
|
|
19
|
+
- remove Sapper example as it is deprecated
|
|
20
|
+
- remove Snowpack example as it is no longer maintained
|
|
21
|
+
- update set-up instructions for SvelteKit/Vite
|
|
22
|
+
|
|
23
|
+
## [6.2.0](https://github.com/metonym/svelte-highlight/releases/tag/v6.2.0) - 2022-07-13
|
|
24
|
+
|
|
25
|
+
**Features**
|
|
26
|
+
|
|
27
|
+
- upgrade `highlight.js` to version [11.6.0](https://github.com/highlightjs/highlight.js/releases/tag/11.6.0) (net +2 styles)
|
|
28
|
+
|
|
29
|
+
## [6.1.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.1.1) - 2022-07-02
|
|
30
|
+
|
|
31
|
+
**Fixes**
|
|
32
|
+
|
|
33
|
+
- remove `language` prop type from `HighlightAuto` TypeScript definitions
|
|
34
|
+
|
|
8
35
|
## [6.1.1](https://github.com/metonym/svelte-highlight/releases/tag/v6.1.1) - 2022-06-27
|
|
9
36
|
|
|
10
37
|
**Refactor**
|
|
@@ -38,7 +65,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
38
65
|
|
|
39
66
|
## [5.3.2](https://github.com/metonym/svelte-highlight/releases/tag/v5.3.2) - 2022-03-16
|
|
40
67
|
|
|
41
|
-
- specify in docs that
|
|
68
|
+
- specify in docs that Vite should optimize both "highlight.js" and "highlight.js/lib/core" if using SvelteKit or Vite
|
|
42
69
|
|
|
43
70
|
## [5.3.1](https://github.com/metonym/svelte-highlight/releases/tag/v5.3.1) - 2022-03-16
|
|
44
71
|
|
package/Highlight.svelte.d.ts
CHANGED
|
@@ -5,10 +5,21 @@ export interface Language {
|
|
|
5
5
|
name?: string;
|
|
6
6
|
register: LanguageFn;
|
|
7
7
|
}
|
|
8
|
+
export interface Slots {
|
|
9
|
+
default: {
|
|
10
|
+
/**
|
|
11
|
+
* The highlighted code.
|
|
12
|
+
*/
|
|
13
|
+
highlighted: HighlightedCode;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
8
16
|
export interface Events {
|
|
9
|
-
highlight: {
|
|
17
|
+
highlight: CustomEvent<{
|
|
18
|
+
/**
|
|
19
|
+
* The highlighted code.
|
|
20
|
+
*/
|
|
10
21
|
highlighted?: HighlightedCode;
|
|
11
|
-
}
|
|
22
|
+
}>;
|
|
12
23
|
}
|
|
13
24
|
declare const __propDef: {
|
|
14
25
|
props: {
|
|
@@ -346,19 +357,17 @@ declare const __propDef: {
|
|
|
346
357
|
/**
|
|
347
358
|
* Set to `true` for the language name to be
|
|
348
359
|
* displayed at the top right of the code block.
|
|
360
|
+
*
|
|
361
|
+
* Use CSS variables to customize styles:
|
|
362
|
+
* - `--hljs-background`
|
|
363
|
+
* - `--hljs-foreground`
|
|
364
|
+
* - `--hljs-radius`
|
|
349
365
|
*/
|
|
350
366
|
langtag?: boolean;
|
|
351
367
|
};
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
[evt: string]: CustomEvent<any>;
|
|
356
|
-
};
|
|
357
|
-
slots: {
|
|
358
|
-
default: {
|
|
359
|
-
highlighted: HighlightedCode;
|
|
360
|
-
};
|
|
361
|
-
};
|
|
368
|
+
slots: Slots;
|
|
369
|
+
getters: {};
|
|
370
|
+
events: Events;
|
|
362
371
|
};
|
|
363
372
|
export declare type HighlightProps = typeof __propDef.props;
|
|
364
373
|
export declare type HighlightEvents = typeof __propDef.events;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Slots, Events } from "./Highlight.svelte";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
width?: number;
|
|
@@ -328,27 +328,20 @@ declare const __propDef: {
|
|
|
328
328
|
* Specify the source code to highlight.
|
|
329
329
|
*/
|
|
330
330
|
code?: any;
|
|
331
|
-
/**
|
|
332
|
-
* Provide the language to highlight the code.
|
|
333
|
-
* Import languages from `svelte-highlight/languages/*`.
|
|
334
|
-
*/
|
|
335
|
-
language?: Language;
|
|
336
331
|
/**
|
|
337
332
|
* Set to `true` for the language name to be
|
|
338
333
|
* displayed at the top right of the code block.
|
|
334
|
+
*
|
|
335
|
+
* Use CSS variables to customize styles:
|
|
336
|
+
* - `--hljs-background`
|
|
337
|
+
* - `--hljs-foreground`
|
|
338
|
+
* - `--hljs-radius`
|
|
339
339
|
*/
|
|
340
340
|
langtag?: boolean;
|
|
341
341
|
};
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
[evt: string]: CustomEvent<any>;
|
|
346
|
-
};
|
|
347
|
-
slots: {
|
|
348
|
-
default: {
|
|
349
|
-
highlighted: HighlightedCode;
|
|
350
|
-
};
|
|
351
|
-
};
|
|
342
|
+
slots: Slots;
|
|
343
|
+
getters: {};
|
|
344
|
+
events: Events;
|
|
352
345
|
};
|
|
353
346
|
export declare type HighlightAutoProps = typeof __propDef.props;
|
|
354
347
|
export declare type HighlightAutoEvents = typeof __propDef.events;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SvelteComponentTyped } from "svelte";
|
|
2
|
-
import type {
|
|
2
|
+
import type { Slots, Events } from "./Highlight.svelte";
|
|
3
3
|
declare const __propDef: {
|
|
4
4
|
props: {
|
|
5
5
|
width?: number;
|
|
@@ -331,19 +331,17 @@ declare const __propDef: {
|
|
|
331
331
|
/**
|
|
332
332
|
* Set to `true` for the language name to be
|
|
333
333
|
* displayed at the top right of the code block.
|
|
334
|
+
*
|
|
335
|
+
* Use CSS variables to customize styles:
|
|
336
|
+
* - `--hljs-background`
|
|
337
|
+
* - `--hljs-foreground`
|
|
338
|
+
* - `--hljs-radius`
|
|
334
339
|
*/
|
|
335
340
|
langtag?: boolean;
|
|
336
341
|
};
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
[evt: string]: CustomEvent<any>;
|
|
341
|
-
};
|
|
342
|
-
slots: {
|
|
343
|
-
default: {
|
|
344
|
-
highlighted: HighlightedCode;
|
|
345
|
-
};
|
|
346
|
-
};
|
|
342
|
+
slots: Slots;
|
|
343
|
+
getters: {};
|
|
344
|
+
events: Events;
|
|
347
345
|
};
|
|
348
346
|
export declare type HighlightSvelteProps = typeof __propDef.props;
|
|
349
347
|
export declare type HighlightSvelteEvents = typeof __propDef.events;
|
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
|
|
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,33 +22,40 @@ 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
|
|
25
|
+
Note that [pnpm](https://github.com/pnpm/pnpm) users must also install `highlight.js`.
|
|
26
26
|
|
|
27
27
|
## SvelteKit Set-up
|
|
28
28
|
|
|
29
|
-
To use this library with [SvelteKit](https://github.com/sveltejs/kit) or [
|
|
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](https://vitejs.dev/config/dep-optimization-options.html#optimizedeps-include) `highlight.js` and `highlight.js/lib/core`:
|
|
30
30
|
|
|
31
31
|
```diff
|
|
32
|
-
|
|
32
|
+
+ optimizeDeps: {
|
|
33
|
+
+ include: ["highlight.js", "highlight.js/lib/core"],
|
|
34
|
+
+ },
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**vite.config.js**
|
|
38
|
+
|
|
39
|
+
```js
|
|
40
|
+
import { sveltekit } from "@sveltejs/kit/vite";
|
|
41
|
+
|
|
42
|
+
/** @type {import('vite').UserConfig} */
|
|
33
43
|
export default {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
+ include: ["highlight.js", "highlight.js/lib/core"],
|
|
38
|
-
+ },
|
|
39
|
-
+ },
|
|
44
|
+
plugins: [sveltekit()],
|
|
45
|
+
optimizeDeps: {
|
|
46
|
+
include: ["highlight.js", "highlight.js/lib/core"],
|
|
40
47
|
},
|
|
41
48
|
};
|
|
42
49
|
```
|
|
43
50
|
|
|
44
|
-
Refer to [examples/sveltekit](examples/sveltekit)
|
|
51
|
+
Refer to [examples/sveltekit](examples/sveltekit) or [examples/vite](examples/vite).
|
|
45
52
|
|
|
46
53
|
## Usage
|
|
47
54
|
|
|
48
|
-
There are two ways to apply `highlight.js` styles
|
|
55
|
+
There are two ways to apply `highlight.js` styles.
|
|
49
56
|
|
|
50
|
-
1.
|
|
51
|
-
2. CSS StyleSheets
|
|
57
|
+
1. Injected styles through [svelte:head](https://svelte.dev/docs#template-syntax-svelte-head)
|
|
58
|
+
2. CSS StyleSheets
|
|
52
59
|
|
|
53
60
|
### Injected Styles
|
|
54
61
|
|
|
@@ -86,6 +93,37 @@ Depending on your set-up, importing a CSS StyleSheet in Svelte may require a CSS
|
|
|
86
93
|
<Highlight language={typescript} {code} />
|
|
87
94
|
```
|
|
88
95
|
|
|
96
|
+
#### Linking from a CDN
|
|
97
|
+
|
|
98
|
+
CSS StyleSheets can also be externally linked from a Content Delivery Network (CDN) like [unpkg.com](https://unpkg.com/).
|
|
99
|
+
|
|
100
|
+
This is best suited for prototyping and not recommended for production use.
|
|
101
|
+
|
|
102
|
+
**HTML**
|
|
103
|
+
|
|
104
|
+
```html
|
|
105
|
+
<!DOCTYPE html>
|
|
106
|
+
<html lang="en">
|
|
107
|
+
<head>
|
|
108
|
+
<link
|
|
109
|
+
rel="stylesheet"
|
|
110
|
+
href="https://unpkg.com/svelte-highlight/styles/github.css"
|
|
111
|
+
/>
|
|
112
|
+
</head>
|
|
113
|
+
</html>
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
**svelte:head**
|
|
117
|
+
|
|
118
|
+
```svelte
|
|
119
|
+
<svelte:head>
|
|
120
|
+
<link
|
|
121
|
+
rel="stylesheet"
|
|
122
|
+
href="https://unpkg.com/svelte-highlight/styles/github.css"
|
|
123
|
+
/>
|
|
124
|
+
</svelte:head>
|
|
125
|
+
```
|
|
126
|
+
|
|
89
127
|
## Svelte Syntax Highlighting
|
|
90
128
|
|
|
91
129
|
Use the `HighlightSvelte` component for Svelte syntax highlighting.
|
|
@@ -107,9 +145,9 @@ Use the `HighlightSvelte` component for Svelte syntax highlighting.
|
|
|
107
145
|
|
|
108
146
|
## Auto-highlighting
|
|
109
147
|
|
|
110
|
-
The `HighlightAuto` component
|
|
148
|
+
The `HighlightAuto` component uses [highlightAuto](https://highlightjs.readthedocs.io/en/latest/api.html#highlightauto) API.
|
|
111
149
|
|
|
112
|
-
Note
|
|
150
|
+
**Note:** auto-highlighting will result in a larger bundle size in order to infer a language.
|
|
113
151
|
|
|
114
152
|
Prefer to specify a language if possible.
|
|
115
153
|
|
|
@@ -132,8 +170,6 @@ Prefer to specify a language if possible.
|
|
|
132
170
|
|
|
133
171
|
All `Highlight` components apply a `data-language` attribute on the codeblock containing the language name.
|
|
134
172
|
|
|
135
|
-
This is also compatible with custom languages.
|
|
136
|
-
|
|
137
173
|
See the [Languages page](SUPPORTED_LANGUAGES.md) for a list of supported languages.
|
|
138
174
|
|
|
139
175
|
```css
|
|
@@ -146,11 +182,9 @@ See the [Languages page](SUPPORTED_LANGUAGES.md) for a list of supported languag
|
|
|
146
182
|
|
|
147
183
|
All `Highlight` components allow for a tag to be added at the top-right of the codeblock displaying the language name.
|
|
148
184
|
|
|
149
|
-
The language tag can be given a custom `background` , `color` , and `border-radius` through
|
|
185
|
+
The language tag can be given a custom `background` , `color` , and `border-radius` through CSS custom properties.
|
|
150
186
|
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
It is recommended that you set values for `--hljs-background` and `--hljs-foreground` to ensure the langtags remain readable on any theme.
|
|
187
|
+
It is recommended that you set values for `--hljs-background` and `--hljs-foreground` to ensure the langtags are readable with your theme.
|
|
154
188
|
|
|
155
189
|
See the [Languages page](SUPPORTED_LANGUAGES.md) for a list of supported languages.
|
|
156
190
|
|
|
@@ -194,6 +228,7 @@ Refer to the highlight.js [language definition guide](https://highlightjs.readth
|
|
|
194
228
|
register: (hljs) => {
|
|
195
229
|
return {
|
|
196
230
|
/** custom language rules */
|
|
231
|
+
contains: [],
|
|
197
232
|
};
|
|
198
233
|
},
|
|
199
234
|
};
|
|
@@ -202,6 +237,38 @@ Refer to the highlight.js [language definition guide](https://highlightjs.readth
|
|
|
202
237
|
<Highlight {language} code="..." />
|
|
203
238
|
```
|
|
204
239
|
|
|
240
|
+
## Code-splitting
|
|
241
|
+
|
|
242
|
+
You can use the `dynamic import` syntax to code-split code.
|
|
243
|
+
|
|
244
|
+
In the example below, the `HighlightAuto` component and injected styles are dynamically loaded.
|
|
245
|
+
|
|
246
|
+
```svelte
|
|
247
|
+
<script>
|
|
248
|
+
import { onMount } from "svelte";
|
|
249
|
+
|
|
250
|
+
let component;
|
|
251
|
+
let styles;
|
|
252
|
+
|
|
253
|
+
onMount(async () => {
|
|
254
|
+
component = (await import("svelte-highlight")).HighlightAuto;
|
|
255
|
+
styles = (await import("svelte-highlight/styles/github")).default;
|
|
256
|
+
});
|
|
257
|
+
</script>
|
|
258
|
+
|
|
259
|
+
<svelte:head>
|
|
260
|
+
{#if styles}
|
|
261
|
+
{@html styles}
|
|
262
|
+
{/if}
|
|
263
|
+
</svelte:head>
|
|
264
|
+
|
|
265
|
+
<svelte:component
|
|
266
|
+
this={component}
|
|
267
|
+
langtag
|
|
268
|
+
code={`body {\n padding: 0;\n color: red;\n}`}
|
|
269
|
+
/>
|
|
270
|
+
```
|
|
271
|
+
|
|
205
272
|
## API
|
|
206
273
|
|
|
207
274
|
### Props
|
|
@@ -241,8 +308,6 @@ TypeScript definitions are auto-generated by SvelteKit.
|
|
|
241
308
|
## Examples
|
|
242
309
|
|
|
243
310
|
- [examples/rollup](examples/rollup)
|
|
244
|
-
- [examples/rollup-typescript](examples/rollup-typescript)
|
|
245
|
-
- [examples/snowpack](examples/snowpack)
|
|
246
311
|
- [examples/sveltekit](examples/sveltekit)
|
|
247
312
|
- [examples/vite](examples/vite)
|
|
248
313
|
- [examples/webpack](examples/webpack)
|
package/languages/c.d.ts
ADDED
package/languages/d.d.ts
ADDED