Skip to content

Commit 5368f89

Browse files
committed
Introduce new syntax highlighting stdlib
Having this as a standard library allows for syntax highlighting to be used in the Markdown and REPL standard libraries. As a bonus, this provides an easy and canonical way of obtaining syntax highlighted code across the ecosystem.
1 parent f71228d commit 5368f89

File tree

8 files changed

+20
-4
lines changed

8 files changed

+20
-4
lines changed

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ Standard library changes
6767
* The new `@styled_str` string macro provides a convenient way of creating a
6868
`AnnotatedString` with various faces or other attributes applied.
6969

70+
#### JuliaSyntaxHighlighting
71+
72+
* A new standard library for applying syntax highlighting to Julia code, this
73+
uses `JuliaSyntax` and `StyledStrings` to implement a `highlight` function
74+
that creates an `AnnotatedString` with syntax highlighting applied.
75+
7076
#### Package Manager
7177

7278
#### LinearAlgebra
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
591172b4514117ce311436d25304944d
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
41a28a8ab4439b3091de6f248d9276bae636f7c695f1a0513d4e0f00eb22623ba970864457e06e12a88edd6443eef2aea2144b626be2e080bc1e5fc7001d891b

pkgimage.mk

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ $(eval $(call stdlib_builder,Printf,Unicode))
9292
$(eval $(call stdlib_builder,Random,SHA))
9393
$(eval $(call stdlib_builder,Tar,ArgTools,SHA))
9494
$(eval $(call stdlib_builder,DelimitedFiles,Mmap))
95+
$(eval $(call stdlib_builder,JuliaSyntaxHighlighting,))
9596

9697
# 2-depth packages
9798
$(eval $(call stdlib_builder,LLD_jll,Zlib_jll libLLVM_jll Artifacts Libdl))

stdlib/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,8 @@
2727
/Distributed
2828
/StyledStrings-*
2929
/StyledStrings
30+
/JuliaSyntaxHighlighting-*
31+
/JuliaSyntaxHighlighting
3032
/*_jll/StdlibArtifacts.toml
3133
/*/Manifest.toml
3234
/*.image
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
JULIASYNTAXHIGHLIGHTING_BRANCH = main
2+
JULIASYNTAXHIGHLIGHTING_SHA1 = d0ea83439db25b837b836822d9cdece6b9cc5fbf
3+
JULIASYNTAXHIGHLIGHTING_GIT_URL := https://github.com/tecosaur/JuliaSyntaxHighlighting.jl.git
4+
JULIASYNTAXHIGHLIGHTING_TAR_URL = https://api.github.com/repos/tecosaur/JuliaSyntaxHighlighting.jl/tarball/$1

stdlib/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ STDLIBS = Artifacts Base64 CRC32c Dates FileWatching \
4747
$(JLL_NAMES)
4848

4949
STDLIBS_EXT = Pkg Statistics LazyArtifacts LibCURL DelimitedFiles Downloads ArgTools \
50-
Tar NetworkOptions SuiteSparse SparseArrays StyledStrings SHA Distributed
50+
Tar NetworkOptions SuiteSparse SparseArrays StyledStrings SHA Distributed \
51+
JuliaSyntaxHighlighting
5152

5253
$(foreach module, $(STDLIBS_EXT), $(eval $(call stdlib-external,$(module),$(shell echo $(module) | tr a-z A-Z))))
5354

stdlib/stdlib.mk

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ STDLIBS_WITHIN_SYSIMG := \
44

55
INDEPENDENT_STDLIBS := \
66
ArgTools Base64 CRC32c Dates DelimitedFiles Distributed Downloads Future \
7-
InteractiveUtils LazyArtifacts LibGit2 LibCURL Logging Markdown Mmap \
8-
NetworkOptions Profile Printf Pkg REPL Serialization SharedArrays SparseArrays \
9-
Statistics StyledStrings Tar Test TOML Unicode UUIDs \
7+
InteractiveUtils JuliaSyntaxHighlighting LazyArtifacts LibGit2 LibCURL Logging \
8+
Markdown Mmap NetworkOptions Profile Printf Pkg REPL Serialization SharedArrays \
9+
SparseArrays Statistics StyledStrings Tar Test TOML Unicode UUIDs \
1010
dSFMT_jll GMP_jll libLLVM_jll LLD_jll LLVMLibUnwind_jll LibUnwind_jll LibUV_jll \
1111
LibCURL_jll LibSSH2_jll LibGit2_jll nghttp2_jll MozillaCACerts_jll MbedTLS_jll \
1212
MPFR_jll OpenLibm_jll PCRE2_jll p7zip_jll Zlib_jll

0 commit comments

Comments
 (0)