-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace custom parser with ChordSheetJS parser
- Loading branch information
1 parent
4303c9b
commit a2857da
Showing
8 changed files
with
220 additions
and
70 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template> | ||
<div class="chordchart-body-paragraph"> | ||
<ChordChartLine | ||
v-for="(line, index) in props.paragraph.lines" | ||
:key="index" | ||
:line="line" | ||
/> | ||
</div> | ||
</template> | ||
|
||
<script setup> | ||
import { Paragraph } from 'chordsheetjs'; | ||
import ChordChartLine from './ChordChartLine.vue'; | ||
const props = defineProps({ | ||
paragraph: { | ||
type: Paragraph, | ||
required: true, | ||
} | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
.chordchart-body-paragraph { | ||
break-inside: avoid; | ||
padding-top: 1em; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<template> | ||
<span class="chordchart-chord-lyrics-pair"> | ||
<code class="chordchart-chords"> | ||
{{ pair.chords }} | ||
</code> | ||
<span class="chordchart-lyrics"> | ||
{{ pair.lyrics }} | ||
</span> | ||
</span> | ||
</template> | ||
|
||
<script setup> | ||
import { ChordLyricsPair } from 'chordsheetjs'; | ||
defineProps({ | ||
pair: { | ||
type: ChordLyricsPair, | ||
required: true, | ||
} | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
.chordchart-chord-lyrics-pair { | ||
align-items: flex-start; | ||
display: inline-flex; | ||
flex-direction: column; | ||
margin-top: .2em; | ||
&:first-of-type { | ||
margin-left: 2em; | ||
} | ||
} | ||
.chordchart-chords { | ||
font-family: inherit; | ||
font-size: 1em; | ||
font-weight: bold; | ||
height: 1.1em; | ||
line-height: 1.1em; | ||
padding-right: .4em; | ||
white-space: pre-wrap; | ||
} | ||
.chordchart-lyrics { | ||
font-size: 1em; | ||
height: 1.1em; | ||
line-height: 1.1em; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<template> | ||
<p class="chordchart-body-paragraph-line"> | ||
<ChordChartLineItem | ||
v-for="(item, index) in line.items" | ||
:key="index" | ||
:item="item" | ||
/> | ||
</p> | ||
</template> | ||
|
||
<script setup> | ||
import { Line } from 'chordsheetjs'; | ||
import ChordChartLineItem from './ChordChartLineItem.vue'; | ||
defineProps({ | ||
line: { | ||
type: Line, | ||
required: true, | ||
} | ||
}); | ||
</script> | ||
|
||
<style scoped> | ||
.chordchart-body-paragraph-line { | ||
display: flex; | ||
flex-wrap: wrap; | ||
gap: .4em; | ||
} | ||
.chordchart-body-paragraph-line-verse { | ||
margin-left: 2em; | ||
} | ||
</style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<ChordChartTag | ||
v-if="isTag" | ||
:tag="item" | ||
/> | ||
<ChordChartChordLyricsPair | ||
v-else | ||
:pair="item" | ||
/> | ||
</template> | ||
|
||
<script setup> | ||
import { ChordLyricsPair, Tag } from 'chordsheetjs'; | ||
import ChordChartChordLyricsPair from './ChordChartChordLyricsPair.vue'; | ||
import ChordChartTag from './ChordChartTag.vue'; | ||
const props = defineProps({ | ||
item: { | ||
type: [ChordLyricsPair, Tag], | ||
required: true, | ||
} | ||
}); | ||
const isTag = props.item instanceof Tag && props.item.hasValue(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<span | ||
v-if="isKeychange" | ||
class="chordchart-tag chordchart-keychange" | ||
> | ||
Key - {{ tag.value }} | ||
</span> | ||
<span | ||
v-else | ||
class="chordchart-tag" | ||
> | ||
{{ tag.value }} | ||
</span> | ||
</template> | ||
|
||
<script setup> | ||
import { Tag } from 'chordsheetjs'; | ||
const props = defineProps({ | ||
tag: { | ||
type: Tag, | ||
required: true, | ||
} | ||
}); | ||
const isKeychange = props.tag.name === 'keychange'; | ||
console.log(isKeychange); | ||
</script> | ||
|
||
<style scoped> | ||
.chordchart-tag { | ||
font-size: 1em; | ||
font-weight: bold; | ||
line-height: 2; | ||
} | ||
.chordchart-keychange { | ||
display: block; | ||
margin-left: auto; | ||
} | ||
</style> |