Skip to content

Commit b3bb433

Browse files
committed
Adding template for showing examples rendered with Verovio
1 parent 7325ab7 commit b3bb433

File tree

102 files changed

+10356
-6
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+10356
-6
lines changed

_guidelines-v4/02-shared/02-sharedmusicalelements/05-sharedexpressionmarks/02-sharedtempomarks.md

+4
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,7 @@ version: "v4"
77
Tempo marks are indications through words, abbreviations, or specific metronome settings of the speed at which a piece of music is to be performed. Both instantaneous and continuous tempo markings may be encoded using this element.
88

99
{% include desc elem="tempo" %}
10+
11+
{% include verovio example="tempo-01.mei" %}
12+
13+
{% include verovio example="tempo-01.mei" encoding=false %}

_includes/head.html

+10
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,14 @@
1515
<link rel="stylesheet" href="{{ site.baseurl }}/js/tipuesearch/tipuesearch.css">
1616
<script src="{{ site.baseurl }}/js/tipuesearch/tipuesearch_set.js"></script>
1717
<script src="{{ site.baseurl }}/js/tipuesearch/tipuesearch.min.js"></script>
18+
19+
<!-- verovio -->
20+
<script src="https://www.verovio.org/javascript/latest/verovio-toolkit.js" type="text/javascript" charset="utf-8"></script>
21+
22+
<!-- script for handling verovio examples -->
23+
<script src="{{ site.baseurl }}/js/verovio-examples.js" type="text/javascript" charset="utf-8"></script>
24+
25+
<!-- xml highlighting -->
26+
<link rel="stylesheet" href="{{ site.baseurl }}/js/highlight/styles/default.css">
27+
<script src="{{ site.baseurl }}/js/highlight/highlight.pack.js"></script>
1828
</head>

_includes/verovio

+14-6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
1-
<div class="sampleCode" data-lang="{{include.valid}}">
2-
{% assign file = page.version | append:'/examples/' | append:include.example | downcase %}
3-
{% highlight xml %}
4-
{% include {{ file }} %}
5-
{% endhighlight %}
6-
</div>
1+
{% assign file = 'mei/' | append:page.version | append:'/' | append:include.example | downcase %}
2+
{% assign id = "now" | date: "%N" | prepend:'id_' %}
3+
{% assign vrvId = id | append:'_vrv' %}
4+
<pre><code class="xml" id="{{ id }}"></code></pre>
5+
<div id="{{ vrvId }}"></div>
6+
<script type="text/javascript">
7+
$.get( "{{ site.baseurl }}/{{ file }}" , function( data ) {
8+
{% if include.encoding != false %}
9+
document.getElementById('{{ id }}').innerHTML = escapeXml(prettifyXml(getFilePart(data, 'center')));
10+
hljs.highlightBlock(document.getElementById('{{ id }}'));
11+
{% endif %}
12+
renderVerovio(data, '{{ vrvId }}');
13+
});
14+
</script>

0 commit comments

Comments
 (0)