diff --git a/.github/workflows/tei-editorial-metadata.yml b/.github/workflows/tei-editorial-metadata.yml new file mode 100644 index 0000000..c99741a --- /dev/null +++ b/.github/workflows/tei-editorial-metadata.yml @@ -0,0 +1,151 @@ +name: TEI editorial metadata + +on: + pull_request: + types: [closed] + +jobs: + update-metadata: + if: github.event.pull_request.merged == true + runs-on: ubuntu-latest + + permissions: + pull-requests: read + contents: write + + steps: + - name: Check approval count + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + run: | + approvals=$(gh api \ + repos/$REPO/pulls/$PR_NUMBER/reviews \ + --jq '[.[] | select(.state=="APPROVED") | .user.login] | unique | length') + [ "$approvals" -ge 2 ] || exit 0 + + - name: Check out repository + uses: actions/checkout@v4 + + - name: Get changed XML files + id: changed_xml + env: + BASE_SHA: ${{ github.event.pull_request.base.sha }} + HEAD_SHA: ${{ github.event.pull_request.merge_commit_sha }} + run: | + files=$(git diff --name-only "$BASE_SHA" "$HEAD_SHA" | grep '\.xml$' || true) + echo "xml_files=$(echo "$files" | tr '\n' ' ')" >> "$GITHUB_OUTPUT" + + - name: Install xmlstarlet + run: sudo apt-get update && sudo apt-get install -y xmlstarlet + + - name: Update editorial metadata + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + PR_NUMBER: ${{ github.event.pull_request.number }} + REPO: ${{ github.repository }} + PR_AUTHOR: ${{ github.event.pull_request.user.login }} + PR_BODY: ${{ github.event.pull_request.body }} + MERGE_DATE: ${{ github.event.pull_request.merged_at }} + run: | + set -e + + reviewers=$(gh api \ + repos/$REPO/pulls/$PR_NUMBER/reviews \ + --jq '.[] | select(.state=="APPROVED") | .user.login' | sort -u) + + get_name () { + user=$1 + text=$2 + display=$(gh api users/$user --jq '.name // .login') + echo "$text" | grep -qi anonymous && echo "Anonymous" || echo "$display" + } + + for file in ${{ steps.changed_xml.outputs.xml_files }}; do + + ROOT=$(xmlstarlet sel -t -v "local-name(/*)" "$file") + + if [ "$ROOT" = "TEI" ]; then + HEADER="//teiHeader" + PERSON_EL="name" + elif [ "$ROOT" = "mei" ]; then + HEADER="//meiHead" + PERSON_EL="persName" + else + continue + fi + + if git cat-file -e "${{ github.event.pull_request.base.sha }}:$file" 2>/dev/null; then + MODE="revision" + else + MODE="initial" + fi + + editor_name=$(get_name "$PR_AUTHOR" "$PR_BODY") + + if [ "$MODE" = "initial" ]; then + xmlstarlet ed -L \ + -s "$HEADER/titleStmt" -t elem -n respStmt -v "" \ + -s "$HEADER/titleStmt/respStmt[last()]" -t elem -n resp -v "Edited by" \ + -s "$HEADER/titleStmt/respStmt[last()]" -t elem -n "$PERSON_EL" -v "$editor_name" \ + -i "$HEADER/titleStmt/respStmt[last()]/*[last()]" -t attr -n role -v editor \ + "$file" + + xmlstarlet ed -L \ + -s "$HEADER/titleStmt" -t elem -n respStmt -v "" \ + -s "$HEADER/titleStmt/respStmt[last()]" -t elem -n resp -v "Validated by" \ + "$file" + + for r in $reviewers; do + text=$(gh api repos/$REPO/pulls/$PR_NUMBER/reviews \ + --jq ".[] | select(.user.login==\"$r\") | .body" | tail -n 1) + name=$(get_name "$r" "$text") + + xmlstarlet ed -L \ + -s "$HEADER/titleStmt/respStmt[last()]" -t elem -n "$PERSON_EL" -v "$name" \ + -i "$HEADER/titleStmt/respStmt[last()]/*[last()]" -t attr -n role -v validator \ + "$file" + done + + else + if ! xmlstarlet sel -t -c "$HEADER/revisionDesc" "$file" >/dev/null 2>&1; then + xmlstarlet ed -L \ + -s "$HEADER" -t elem -n revisionDesc -v "" \ + "$file" + fi + + xmlstarlet ed -L \ + -s "$HEADER/revisionDesc" -t elem -n change -v "" \ + -i "$HEADER/revisionDesc/change[last()]" -t attr -n when -v "${MERGE_DATE%%T*}" \ + "$file" + + xmlstarlet ed -L \ + -s "$HEADER/revisionDesc/change[last()]" -t elem -n "$PERSON_EL" -v "$editor_name" \ + -i "$HEADER/revisionDesc/change[last()]/*[last()]" -t attr -n role -v editor \ + "$file" + + for r in $reviewers; do + text=$(gh api repos/$REPO/pulls/$PR_NUMBER/reviews \ + --jq ".[] | select(.user.login==\"$r\") | .body" | tail -n 1) + name=$(get_name "$r" "$text") + + xmlstarlet ed -L \ + -s "$HEADER/revisionDesc/change[last()]" -t elem -n "$PERSON_EL" -v "$name" \ + -i "$HEADER/revisionDesc/change[last()]/*[last()]" -t attr -n role -v validator \ + "$file" + done + + xmlstarlet ed -L \ + -s "$HEADER/revisionDesc/change[last()]" -t elem -n desc -v "Change via PR #$PR_NUMBER" \ + "$file" + fi + done + + - name: Commit changes + run: | + git config user.name "github-actions[bot]" + git config user.email "github-actions@users.noreply.github.com" + git add *.xml + git commit -m "Record editorial metadata for PR #${{ github.event.pull_request.number }}" || exit 0 + git push diff --git a/texts/2004-Irish/Ps148a.xml b/texts/2004-Irish/Ps148a.xml new file mode 100644 index 0000000..e85a53f --- /dev/null +++ b/texts/2004-Irish/Ps148a.xml @@ -0,0 +1,368 @@ + + + + + Psalm 148a + Anonymous + + Encoded by + Timothy Duguid + + + + + The Psalms for Singing + 2004 Irish Psalter + 2004 + + + Nigel Lynn Publishing + + + + + Distributed under a Creative Commons Attribution-NonCommercial 4.0 License + +

Published by Timothy Duguid

+
+ + Suggested tune: + SL262 + + +

Texts come from the 2004 Irish Metrical Psalter

+
+
+ + +

All metre designations are only counts of syllables and do not refer to any type of poetic foot.

+
+
+
+ + +
+ + + 1. HAL- + LE- + LU- + JAH! + Praise + the + LORD + now! + + + From + the + heav- + ens + praise + his + name. + + + Praise + him + in + the + high- + est + pla- + ces. + + + All + his + an- + gels, + praise + pro- + claim. + + + + + 2. All + his + hosts + to- + geth- + er + praise + him, + + + sun + and + moon, + all + stars + of + light. + + + Praise + him, + all + you + high- + est + heav- + ens, + + + wa- + ters, + too, + a- + bove + the + sky. + + + + + 3. Let + them + prais- + es + give + the + LORD's + name; + + + they + were + made + at + his + com- + mand. + + + Them + for- + ev- + er + he + es- + tab- + lished, + + + by + de- + cree + that + firm + will + stand. + + + + + 4. From + the + earth + O + praise + the + LORD's + name, + + + all + you + deeps, + sea + mon- + sters + all, + + + fire + and + hail + with + snow + and + clouds + too, + + + stor- + my + winds + that + heed + his + call. + + + + + 5. Fruit + trees + and + all + ce- + dars + praise + him, + + + all + you + hills + and + moun- + tains + high, + + + creep- + ing + things, + wild + beasts, + all + cat- + tle, + + + and + the + birds + with + wings + to + fly. + + + + + 6. All + earth's + kings + and + peo- + ples + praise + him, + + + prin- + ces + too, + earth's + judg- + es + all. + + + Praise + his + name, + young + men + and + wom- + en, + + + old + men + too, + and + chil- + dren + small. + + + + + 7. Let + them + prais- + es + give + the + LORD's + name, + + + for + his + name + a- + lone + is + high, + + + and + his + glo- + ry + is + ex- + alt- + ed + + + o- + ver + earth + and + heav- + en + high. + + + + + 8. For + his + folk + a + horn + he + raised + up; + + + for + his + saints + there + will + be + praise, + + + Is- + r'el's + chil- + dren + who + are + near + him. + + + Hal- + le- + lu- + jah! + Prais- + es + raise! + + +
+ +
+
\ No newline at end of file diff --git a/tunes/8.6.8.6/Ps23.xml b/tunes/8.6.8.6/Ps23.xml index a01be9b..ff7b09a 100644 --- a/tunes/8.6.8.6/Ps23.xml +++ b/tunes/8.6.8.6/Ps23.xml @@ -52,7 +52,7 @@ - + @@ -88,7 +88,7 @@ - > + @@ -435,4 +435,4 @@ - \ No newline at end of file + diff --git a/tunes/8.6.8.6/crediton.xml b/tunes/8.6.8.6/crediton.xml index 21ba785..d938eda 100644 --- a/tunes/8.6.8.6/crediton.xml +++ b/tunes/8.6.8.6/crediton.xml @@ -154,8 +154,8 @@ - - + + @@ -435,4 +435,4 @@ - \ No newline at end of file + diff --git a/tunes/8.7.8.7/aberdeen.xml b/tunes/8.7.8.7/aberdeen.xml index fcbe0cc..a154738 100644 --- a/tunes/8.7.8.7/aberdeen.xml +++ b/tunes/8.7.8.7/aberdeen.xml @@ -1,5 +1,6 @@ - - + + + Title @@ -19,14 +20,29 @@ SL175 - + + Verovio

Transcoded from MusicXML

-
Howard8.7.8.7.%G-2 $xFC @4/4 4xF/'4xF'A''D'B/'4A'xF'E'A/'4A'A''E''xC/'2B'4A'A/'4A'B'A'D/'4G'G'xF'xF/'4xF'B'A'xF/'2E'4D6 6 9 2 11 9 6 4 9 9 9 4 1 11 9 9 9 11 9 2 7 7 6 6 6 11 9 6 4 20 3 5 3 2 3 2 5 0 0 5 3 2 2 0 0 2 2 5 5 0 1 0 0 5 2 3 2 20 3 5 -3 -2 -3 -2 5 0 0 7 -3 -2 -2 0 0 2 -2 -7 5 0 -1 0 0 5 -2 -3 -2 -2= + + - - - - + = = + - - - = = + - - + = - = = + - - - -
+ + + + Aberdeen + 8.7.8.7. + + %G-2 $xFC @4/4 4F/'4F'A''D'B/'4A'F'E'A/'4A'A''E''C/'2B'4A'A/'4A'B'A'D/'4G'G'F'F/'4F'B'A'F/'2E'4D + 6 6 9 2 11 9 6 4 9 9 9 4 1 11 9 9 9 11 9 2 7 7 6 6 6 11 9 6 4 2 + 0 3 5 -3 -2 -3 -2 5 0 0 7 -3 -2 -2 0 0 2 -2 -7 5 0 -1 0 0 5 -2 -3 -2 -2 + = + + - - - - + = = + - - - = = + - - + = - = = + - - - - + + + + + @@ -36,12 +52,20 @@ - + + + + + - + + + + +
@@ -215,7 +239,11 @@ - + + + + + @@ -405,7 +433,11 @@ - + + + + + @@ -431,4 +463,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/tunes/8.7.8.7/new136.xml b/tunes/8.7.8.7/new136.xml index f399983..f0dffea 100644 --- a/tunes/8.7.8.7/new136.xml +++ b/tunes/8.7.8.7/new136.xml @@ -1,5 +1,6 @@ - - + + + Title @@ -19,14 +20,29 @@ SL241 - + + Verovio

Transcoded from MusicXML

-
New 136th8.7.8.7. D.%G-2 $xFC @4/4 8D'xF/'4A'A'A'8xF'G/'4A'A'A'A/'4B'A'8B''xC''4D/''4D''2xC''4xC/''4D'B'A'G/'4.xF'8G'4A'8B'B/'4G'E'xF'G/'2E'4D2 6 9 9 9 6 7 9 9 9 9 11 9 11 1 2 2 1 1 2 11 9 7 6 7 9 11 11 7 4 6 7 4 24 3 0 0 3 1 2 0 0 0 2 2 2 2 1 0 1 0 1 3 2 2 1 1 2 2 0 4 3 2 1 3 24 3 0 0 -3 1 2 0 0 0 2 -2 2 2 1 0 -1 0 1 -3 -2 -2 -1 1 2 2 0 -4 -3 2 1 -3 -2+ + = = - + + = = = + - + + + = - = + - - - - + + + = - - + + - -
+ + + + New 136th + 8.7.8.7. D. + + %G-2 $xFC @4/4 8D'F/'4A'A'A'8F'G/'4A'A'A'A/'4B'A'8B''C''4D/''4D''2C''4C/''4D'B'A'G/'4.F'8G'4A'8B'B/'4G'E'F'G/'2E'4D + 2 6 9 9 9 6 7 9 9 9 9 11 9 11 1 2 2 1 1 2 11 9 7 6 7 9 11 11 7 4 6 7 4 2 + 4 3 0 0 -3 1 2 0 0 0 2 -2 2 2 1 0 -1 0 1 -3 -2 -2 -1 1 2 2 0 -4 -3 2 1 -3 -2 + + + = = - + + = = = + - + + + = - = + - - - - + + + = - - + + - - + + + + + @@ -36,17 +52,25 @@ - + + + + + - + + + + +
- + @@ -81,7 +105,7 @@ - + @@ -118,26 +142,6 @@ - - - - - - - - - - - - - - - - - - - - @@ -152,8 +156,8 @@ - - + + @@ -162,7 +166,7 @@ - + @@ -184,8 +188,28 @@ + + + + + + + + + + + + + + + + + + + + - + @@ -234,7 +258,7 @@ - + @@ -275,8 +299,7 @@ - - + @@ -322,7 +345,7 @@ - + @@ -386,7 +409,7 @@ - + @@ -432,7 +455,7 @@ - + @@ -472,4 +495,5 @@ - \ No newline at end of file + + \ No newline at end of file diff --git a/tunes/8.7.8.7/sicilianMariners.xml b/tunes/8.7.8.7/sicilianMariners.xml new file mode 100644 index 0000000..493e56c --- /dev/null +++ b/tunes/8.7.8.7/sicilianMariners.xml @@ -0,0 +1,809 @@ + + + + + + Sicilian Mariners + + Composer + Anonymous + + + General editor + Timothy Duguid + + + + + The Psalms for Singing + 2004 Irish Psalter + 2004 + + + + Digital Splitleaf + + Archive Creator + Timothy Duguid + + + Distributed under a Creative Commons Attribution-NonCommercial 4.0 License + + SL262 + + + + + + Verovio +

Transcoded from MusicXML

+
+ + Digital Splitleaf MEI Generator + Luca Guariento +

Post-processing: making the MEI file compatible with the Splitleaf Interface

+
+
+ +

This file is part of the Digital Splitleaf Digital Archive. + Timothy Duguid +

+
+
+ + + Sicilian Mariners + + %G-2 $xFC @4/4 4A'B'8A'G'F'G/'4A'B'8A'G'4F/'4A'A'B''8C''D/''4C'B'2A/'8E'F'E'F'4G'G/'8F'G'F'G'4A'A/''8D''C'B'A''D'B'A'G/'4F'E'2D + 9 11 9 7 6 7 9 11 9 7 6 9 9 11 1 2 1 11 9 4 6 4 6 7 7 6 7 6 7 9 9 2 1 11 9 2 11 9 7 6 4 2 + +2 -2 -2 -1 +1 +2 +2 -2 -2 -1 +3 +0 +2 +2 +1 -1 -2 -2 -5 +2 -2 +2 +1 +0 -1 +1 -1 +1 +2 +0 +5 -1 -2 -2 +5 -3 -2 -2 -1 -2 -2 + + - - - + + + - - - + = + + + - - - - + - + + = - + - + + = + - - - + - - - - - - + + 8.7.8.7. + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ +
+
\ No newline at end of file