juliadocs / highlights.jl Goto Github PK
View Code? Open in Web Editor NEWA source code highlighter for Julia.
Home Page: https://highlights.juliadocs.org/stable
License: Other
A source code highlighter for Julia.
Home Page: https://highlights.juliadocs.org/stable
License: Other
Hey everyone,
Thank you for developing this package.
I plan to use it in my package Term.jl to show highlighted code in errors tracestack.
I've been able to use the docs to define my Format.render
to produce ANSI codes with Term.jl
and I'm styling a theme as well.
What I would like to know is if there's examples/docs on defining additional tokens. For instance I want to highlight type hints like ::Union{Nothing String}
. I can do that on my own using regexes etc, but it would be great to be able to simply define additional tokens. Also, regarding type hints, the :
in ::Union
gets highlighted as an OPERATOR
, which might not be what one would expect here?
A list of lexers for different languages/filetypes that would be useful to have. For the most part this list should be based on what other source code highlighters (Pygments, Rouge, etc.) have implemented.
jlcon
.It looks as though Format.jl sets the CSS border, margins, and padding of a pre.hljl
selector using hard-coded values. In my testing, a theme cannot override these settings. This complicates downstream usage. Most saliently, the caller cannot set them in the pre
selector for itself and have those values respected across a variety of containers. (See JunoLab/Weave.jl#172 (comment).)
Options would be to remove these values from the pre.hljl
selector in Format.jl, or make the values changeable via the theme.
Currently only the default
Pygments theme has been written. Additional themes would be good to have and aren't particularly challenging to implement based on ones already available elsewhere.
This issue is used to trigger TagBot; feel free to unsubscribe.
If you haven't already, you should update your TagBot.yml
to include issue comment triggers.
Please see this post on Discourse for instructions and more details.
If you'd like for me to do this for you, comment TagBot fix
on this issue.
I'll open a PR within a few hours, please be patient!
Update DocStringExtensions to latest version (currently 0.9)?
Hi, I'm trying to define a Lexer in a local module and during the precompilation I get LoadError
:
ERROR: LoadError: LoadError: Evaluation into the closed module `Lexers` breaks incremental compilation because the side effects will not be permanent. This is likely due to some other module mutating `Lexers` with `eval` during precompilation -
don't do this.
Travis, AppVeyor, and Codecov.
Noticed when using Debugger.jl:
julia> sprint(highlight, MIME("text/ansi-debugger"), "√", Lexers.JuliaLexer, Themes.MonokaiTheme)
ERROR: BoundsError: attempt to access "√"
at index [1:4]
Proper Documenter-style README.md and docs/
describing how to writer a new lexer and theme, how to highlight some source code, and docstrings for all the important internal and public functions and types.
For individual lexers as well as internals such as lexer compiler and formatter.
Would be nice to update to a recent Documenter version so that it looks consistent with the rest of the Julia docs.
The JuliaConsoleLexer adds some extra braces to the output part of the following code.
highlight(stdout,MIME("text/latex"),"""julia> [1,2,3]
3-element Array{Int64,1}:
1
2
3""",Highlights.Lexers.JuliaConsoleLexer)
Which gives this latex code:
\begin{lstlisting}
(*@\HLJLnB{julia> }@*)(*@\HLJLp{[}@*)(*@\HLJLni{1}@*)(*@\HLJLp{,}@*)(*@\HLJLni{2}@*)(*@\HLJLp{,}@*)(*@\HLJLni{3}@*)(*@\HLJLp{]}@*)
3-element Array{\{}Int64,1{\}}:
1
2
3
\end{lstlisting}
Currently highlight
only supports html
& latex
MIME types which are written to a stream. For other julia projects to use Highlights it would be helpful to implement a show(x::Highlights.Compiler.Context)
so it can be used easily by various outputs like Pluto(HTML), Terminal,.etc
Now throws:
ErrorException("type Regex has no field match_data")
Downstream issue: JuliaDebug/Debugger.jl#193.
The package already has several themes based on ones ported from Pygments as well as a default one based on the official Julia colours. This issue is for tracking the addition of other themes (suggestions/PRs welcome) and general improvements to the current collection (which is definitely needed in some of them).
I use this package for syntax highlighting in Weave.jl and it would be nice to get rid off deprecation warnings for 0.6 (and for coming 0.7/1.0). It seems that FemtoCleaner could fix current deprecation warnings. Could you run it on this repo?
I can take a look at the potential errors if something needs to be handled manually.
Leaving issue to track progress.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.