Using following in vscode with a .ipynb file,
%load_ext abjadext.ipython
import abjad
staff = abjad.Staff("c'4 d'4 e'4 f'4")
abjad.show(staff)
the score looks washed out and hard to see.
So I had to write a stop-gap ipython extension containing following. This simply wraps the svg in a div and displays as html. This way the vscode notebook styling is propagated thru currentColor and it looks fine.
from abjad.io import Illustrator
from abjadext import ipython as ip
def load_ipython_extension(ipython):
# override abjads show()
ip.load_ipython_extension(ipython)
Illustrator.open_output_path = render_svg
def render_svg(self, svgpath):
from IPython.core.display import display_html
with svgpath.open() as f:
svg = f.read()
display_html("<div>"+svg+"</div", raw=True)
I am proposing to incorporate this scheme in your extension directly, Many thanks.
Using following in vscode with a
.ipynbfile,the score looks washed out and hard to see.
So I had to write a stop-gap ipython extension containing following. This simply wraps the
svgin adivand displays as html. This way the vscode notebook styling is propagated thrucurrentColorand it looks fine.I am proposing to incorporate this scheme in your extension directly, Many thanks.