Skip to content

Commit

Permalink
Introduce new syntax highlighting stdlib
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tecosaur committed Nov 9, 2023
1 parent f99e6bf commit ec9b978
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 4 deletions.
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ Standard library changes
* The new `@styled_str` string macro provides a convenient way of creating a
`AnnotatedString` with various faces or other attributes applied ([#49586]).

#### JuliaSyntaxHighlighting

* A new standard library for applying syntax highlighting to Julia code, this
uses `JuliaSyntax` and `StyledStrings` to implement a `highlight` function
that creates an `AnnotatedString` with syntax highlighting applied.

#### Package Manager

#### LinearAlgebra
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
e82035353b3770b93880326dbc39eaed
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1912792a7576a24bddd965c7ca82d5cb26539486901f238a54611431a5b4218a72c5aa8b50c6adbadbab4bed46e5541ee946d5682a0fc48a96cf9d790f119bea
1 change: 1 addition & 0 deletions pkgimage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ $(eval $(call stdlib_builder,Printf,Unicode))
$(eval $(call stdlib_builder,Random,SHA))
$(eval $(call stdlib_builder,Tar,ArgTools,SHA))
$(eval $(call stdlib_builder,DelimitedFiles,Mmap))
$(eval $(call stdlib_builder,JuliaSyntaxHighlighting,))

# 2-depth packages
$(eval $(call stdlib_builder,LLD_jll,Zlib_jll libLLVM_jll Artifacts Libdl))
Expand Down
2 changes: 2 additions & 0 deletions stdlib/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@
/Distributed
/StyledStrings-*
/StyledStrings
/JuliaSyntaxHighlighting-*
/JuliaSyntaxHighlighting
/*_jll/StdlibArtifacts.toml
/*/Manifest.toml
/*.image
4 changes: 4 additions & 0 deletions stdlib/JuliaSyntaxHighlighting.version
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
JULIASYNTAXHIGHLIGHTING_BRANCH = main
JULIASYNTAXHIGHLIGHTING_SHA1 = 036981df0cce0628515d02d457f16b0b0cec8e1d
JULIASYNTAXHIGHLIGHTING_GIT_URL := https://github.com/julialang/JuliaSyntaxHighlighting.jl.git
JULIASYNTAXHIGHLIGHTING_TAR_URL = https://api.github.com/repos/julialang/JuliaSyntaxHighlighting.jl/tarball/$1
3 changes: 2 additions & 1 deletion stdlib/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ STDLIBS = Artifacts Base64 CRC32c Dates FileWatching \
$(JLL_NAMES)

STDLIBS_EXT = Pkg Statistics LazyArtifacts LibCURL DelimitedFiles Downloads ArgTools \
Tar NetworkOptions SuiteSparse SparseArrays StyledStrings SHA Distributed
Tar NetworkOptions SuiteSparse SparseArrays StyledStrings SHA Distributed \
JuliaSyntaxHighlighting

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

Expand Down
6 changes: 3 additions & 3 deletions stdlib/stdlib.mk
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ STDLIBS_WITHIN_SYSIMG := \

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

0 comments on commit ec9b978

Please sign in to comment.