Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for VSCode plot pane display. #48

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions src/LaTeXStrings.jl
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,17 @@ function Base.show(io::IO, s::LaTeXString)
end
end

Base.showable(::MIME"juliavscode/html", ::LaTeXString) = true
function Base.repr(::MIME"juliavscode/html", s::LaTeXString)
mathjax_import_str = """
<script> MathJax = { tex: { displayMath: [['\$', '\$']] } }; </script>
<script src="/js/mathjax/tex-chtml.js" id="MathJax-script" async></script>
<script src="https://polyfill.io/v3/polyfill.min.js?features=es6"></script>
<script id="MathJax-script" async src="https://cdn.jsdelivr.net/npm/mathjax@3/es5/tex-mml-chtml.js"></script>
"""
return mathjax_import_str * s.s
end

Base.firstindex(s::LaTeXString) = firstindex(s.s)
Base.lastindex(s::LaTeXString) = lastindex(s.s)
Base.iterate(s::LaTeXString, i::Int) = iterate(s.s, i)
Expand Down