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 Oct 22, 2023
1 parent f71228d commit 5a46a57
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 @@ -67,6 +67,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.

#### 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 @@
591172b4514117ce311436d25304944d
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
41a28a8ab4439b3091de6f248d9276bae636f7c695f1a0513d4e0f00eb22623ba970864457e06e12a88edd6443eef2aea2144b626be2e080bc1e5fc7001d891b
1 change: 1 addition & 0 deletions pkgimage.mk
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,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 = d0ea83439db25b837b836822d9cdece6b9cc5fbf
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 5a46a57

Please sign in to comment.