[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Doc: document grob metadata in SVG output in Notation Reference (issue 3

From: paulwmorris
Subject: Doc: document grob metadata in SVG output in Notation Reference (issue 357720044 by address@hidden)
Date: Thu, 21 Jun 2018 11:39:00 -0700

Reviewers: ,

Please review, thanks, -Paul

Doc: document grob metadata in SVG output in Notation Reference

I.e. using the 'output-attributes' grob property to add id, class,
and other attributes to the SVG output for a given grob.

Please review this at

Affected files (+35, -1 lines):
  M Documentation/notation/input.itely

Index: Documentation/notation/input.itely
diff --git a/Documentation/notation/input.itely b/Documentation/notation/input.itely index f31d23086fda0aa31dbe72b32cbfe88a5f302a63..247cb0dba592228aec0ff5d99e3946cce122a2d8 100644
--- a/Documentation/notation/input.itely
+++ b/Documentation/notation/input.itely
@@ -2774,9 +2774,43 @@ voices and staves, saving even more time.
 The default output formats for the printed score are Portable
 Document Format (PDF) and PostScript (PS).  Portable
 Network Graphics (PNG), Scalable Vector Graphics (SVG) and Encapsulated
-PostScript (EPS) output is available through the command line option,
+PostScript (EPS) output is available through command line options,
 see @rprogram{Basic command line options for LilyPond}.

address@hidden SVG Output
address@hidden SVG Output
+SVG output can optionally contain metadata for graphical objects (grobs) like
+note heads, rests, etc.  This metadata can be standard SVG attributes like
address@hidden and @code{class}, or non-standard custom attributes.  Specify the
+attributes and their values by overriding a grob's @code{output-attributes}
+property with a Scheme association list (alist). The values can be numbers,
+strings, or symbols.  For example:
+  \once \override NoteHead.output-attributes =
+  #'((id . 123)
+     (class . "this that")
+     (data-whatever . something))
+  c
address@hidden example
+The input above will produce the following @code{<g>} (group) tag in the SVG
+<g id="123" class="this that" data-whatever="something">
+  ...NoteHead grob SVG elements...
address@hidden example
+The @code{<g>} tag contains all of the SVG elements for a given grob. (Some +grobs generate multiple SVG elements.) In SVG syntax the @code{data-} prefix
+is used for non-standard custom metadata attributes.

 @node Replacing the notation font
 @subsection Replacing the notation font

reply via email to

[Prev in Thread] Current Thread [Next in Thread]