Add ability to set custom stylesheets for SVG renderer (#105)

* Add ability to set custom stylesheets for SVG renderer

This allow to set custom inline CSS and a optional CSP nonce. This
solves the problem mentioned in #103 and is best used with it, as seen
in the added examples. Without this one would have to write a custom
renderer.

* Add note with link to the custom_stylesheets example
This commit is contained in:
Justin Kromlinger 2018-10-12 18:43:30 +02:00 committed by Will Charczuk
parent 96acfc6a9f
commit 3cb33d48d3
5 changed files with 168 additions and 0 deletions

View file

@ -7,6 +7,8 @@ import (
"net/http"
)
// Note: Additional examples on how to add Stylesheets are in the custom_stylesheets example
func inlineSVGWithClasses(res http.ResponseWriter, req *http.Request) {
res.Write([]byte(
"<!DOCTYPE html><html><head>" +