Divyansh Singh
dcb8450f11
fix: typo in missing language check
1 year ago
Divyansh Singh
829977876a
perf: lazy load shiki languages ( #4326 )
1 year ago
Estéban
45968cdc50
fix: cache markdown it instance and properly dispose shiki on config reload ( #4321 )
...
This results in over 5x speedup in build times of certain projects. But this comes at the cost of correctness. `createMarkdownRenderer` now ignores any arguments passed by user. But from our GitHub code search we didn't find any user passing options different than their siteConfig to this function. If you are doing that, please open an issue and we can discuss the best way forward.
---
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
1 year ago
Heptazhou
2ac64b8d41
fix: `vueRE` conflicting with `lineNoRE` ( #4247 )
1 year ago
Chris
256d742b73
chore: replace deprecated code ( #4057 )
1 year ago
Azat S
cb308b9295
fix(a11y): make code blocks accessible with keyboard ( #3902 )
2 years ago
Anthony Fu
1d16a85fdf
chore: upgrade to shiki rc ( #3550 )
2 years ago
Anthony Fu
b8487d3a97
feat: rename shiki packages ( #3506 )
...
BREAKING CHANGE: vitepress now uses shiki instead of shikiji. If you’re on the latest version and using shikiji specific features, you just need to change imports. The shikijiSetup hook is renamed to shikiSetup.
2 years ago
Divyansh Singh
5dab5e3ced
refactor: simplify line filling a bit
2 years ago
Divyansh Singh
176c4008c5
refactor: make conditions more robust
2 years ago
Divyansh Singh
1c9f2aa8e4
refactor: use hast transform instead of regex for filling lines
2 years ago
Divyansh Singh
563020ba61
fix: fill all empty code lines
...
closes #3305
2 years ago
Divyansh Singh
621254300d
chore: bump deps ( #3390 )
2 years ago
Anthony Fu
d12e23ddf6
feat: expose `shikijiSetup` hook ( #3344 )
2 years ago
Anthony Fu
00eec7a4ef
chore: use transformer to clean-up highlight result ( #3343 )
2 years ago
Anthony Fu
8800195457
feat: update shikiji, support twoslash ( #3339 )
2 years ago
Divyansh Singh
33ce7e4478
fix: merge bundledLanguages with user provided languages for less breakage
2 years ago
Anthony Fu
75f18e4733
feat: migrate to shikiji ( #3237 )
2 years ago
Divyansh Singh
6f2a2af1ff
chore: fix types
2 years ago
Divyansh Singh
aa40cecd48
fix(build): don't show missing lang warnings with text specifiers in fences
2 years ago
Divyansh Singh
5bb6bb0a14
fix(build): indentation being lost in code blocks
...
closes #2988
2 years ago
mehm8128
0cd87b1baf
fix: customizing the starting line number even if globally set ( #2941 )
2 years ago
fan1312
c0ce7f723e
feat: support for customizing the starting line number in a code block ( #2917 )
2 years ago
Damien Guard
00dc1e6742
feat: allow customizing markdown renderer used for local search indexing ( #2770 )
...
BREAKING CHANGES: `search.options.exclude` for local search is removed in favor of more flexible `search.options._render`
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
2 years ago
Divyansh Singh
d0f0012aea
feat(theme): support light shiki themes ( #2319 )
...
BREAKING CHANGE: Styling for code blocks might break, especially if you were earlier overriding it for light theme. Those workarounds are no longer required. VitePress will now show code blocks and groups in light mode too if a light shiki theme is specified.
3 years ago
Divyansh Singh
a681fd11e3
fix(build): remove extra line at end of code blocks ( #2191 )
3 years ago
Alois Klink
ac953ce8bd
fix(build): skip warning for `txt` language ( #2109 )
3 years ago
Evan You
3b6a6d1abd
feat(theme): a11y improvements
3 years ago
Evan You
9708510cbd
fix: fix line higlighting for empty lines
3 years ago
Juan Martín Seery
5a6d384952
feat(build): add support for custom languages ( #1837 )
...
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
3 years ago
CHOYSEN
a00bb62143
feat(build): use vite logger ( #1899 )
...
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
3 years ago
Q.Ben Zheng
f9743816a5
feat(shiki): support `ansi` code highlight ( #1878 )
...
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
3 years ago
Divyansh Singh
08e07d643d
chore: bump deps ( #1853 )
3 years ago
Divyansh Singh
99ad162fb7
fix(build): don't warn on blank lang in fences
3 years ago
Clark Cui
1ae0596939
feat(build): don't hard fail on unknown languages in fences ( #1750 )
...
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
3 years ago
Divyansh Singh
3b7ff8d66e
feat(build): support interpolation inside code blocks ( #1759 )
3 years ago
Divyansh Singh
ce9467e389
fix(build): handle `-` in title of code blocks with line highlighting ( #1743 )
3 years ago
Divyansh Singh
c048076370
feat(build): fence-level config for line-numbers ( #1733 )
3 years ago
xinconan
f40df31947
feat(build): allow specifying default language for syntax highlighter ( #1296 )
...
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
3 years ago
Divyansh Singh
a684b67ec0
feat: add code-group feature ( #728 ) ( #1560 )
...
close #728
close #1242
Co-authored-by: "Jinjing.Zhou" <allenzhou@tensorchord.ai>
Co-authored-by: Kia King Ishii <kia.king.08@gmail.com>
3 years ago
Divyansh Singh
4b0b1ef35f
fix(build): use addClass from shiki-processor ( #1557 )
...
reverts #1546 (fixed in upstream)
fixes #1555
3 years ago
Divyansh Singh
178895f067
fix: properly apply dark/light classes in code blocks ( #1546 )
3 years ago
Enzo Innocenzi
04ab0eb6dc
feat: support focus, colored diffs, error highlights in code blocks ( #1534 )
...
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
3 years ago
Jinjiang
e8cb73e065
refactor(build): replace the line highlighting logic with Shiki lineOptions ( #1152 )
3 years ago
xinconan
867f305886
feat(build): support code highlight in uppercase ( #1082 )
...
fixes #772
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
3 years ago
Divyansh Singh
f789932ffc
feat(build): improve code blocks and snippets ( #875 )
...
* refactor: don't hardcode language names
* docs: fix typo
* feat: support specifying language while importing code snippets
* feat: support interpolation inside code blocks
* docs: update v-pre escaping
* fix: ignore starting `>` in case of shell commands
fixes #861 , fixes #471 , fixes #884
3 years ago
Azat S
d5ed66c6d2
feat: allow using custom syntax highlighting themes ( #992 )
...
Co-authored-by: Divyansh Singh <40380293+brc-dd@users.noreply.github.com>
3 years ago
Anthony Fu
41247fcfa0
feat: support dark/light color themes ( #682 )
...
Co-authored-by: Kia Ishii <kia.king.08@gmail.com>
4 years ago
Ryo_gk
1fcf4a4462
feat: use shiki instead of prismjs for syntax highlight ( #627 ) ( #654 )
...
close #627
Co-authored-by: Kia Ishii <kia.king.08@gmail.com>
4 years ago
Evan You
b3a4c52191
refactor: fix bad requires
4 years ago