1.0.5 • Published 7 years ago

prismsvg v1.0.5

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

prismsvg

Prismjs tweaked to output SVGs.

This is a somewhat dirty adaptation of Prism.js to be able to output SVGs. So you have some code, this produces a syntax highlighted SVG as a result.

    <svg height="3em" width="400" >
        <text y="20" class="language-jsx"
          Your source code here
        >
        </text>
    </svg>

And this will output a bunch of tspan nodes with the right classes for syntax highlighting.

This package includes also a css file with the light solarized theme adapted to work with SVGs.

I have copy&pasted the languages that I needed from Prism.js. It should be easy to use your own languages as long as you keep calling prismsvg.js and prism-cr.js.

I don't know if this is useful for somebody else, so I have just done what I needed. If you want to use this and your use case is not supported, feel free to open an issue. Thanks.

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago