Skip to content

Commit

Permalink
Add ChordOverLyricTransformer to web
Browse files Browse the repository at this point in the history
  • Loading branch information
menees committed Oct 18, 2023
1 parent 51af2fd commit 7e13632
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<IsPublishable>false</IsPublishable>

<!-- Make the assembly, file, and NuGet package versions the same. -->
<Version>0.8.4-beta</Version>
<Version>0.8.5-beta</Version>
<UseLocaMeneesLibraries>false</UseLocaMeneesLibraries>
<LocaMeneesLibrariesSrc/>
<BuildingInsideVisualStudio Condition="'$(BuildingInsideVisualStudio)' == ''">false</BuildingInsideVisualStudio>
Expand Down
1 change: 1 addition & 0 deletions src/Menees.Chords.Web/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
<select id="to" @bind="@ToType" @bind:event="onchange" class="form-select my-2">
<option value="ChordPro">ChordPro</option>
<option value="MobileSheets">MobileSheets</option>
<option value="ChordOverLyric">Chords Over Text</option>
</select>
<button class="btn @copyState.ButtonClass text-nowrap" @onclick="CopyToClipboardAsync" disabled=@copyState.IsDisabled>
<i class="@copyState.ImageClass"></i> @copyState.Text
Expand Down
9 changes: 6 additions & 3 deletions src/Menees.Chords.Web/Index.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,12 @@ private void ConvertInput()
? DocumentParser.ChordProLineParsers
: DocumentParser.DefaultLineParsers);
Document inputDocument = Document.Parse(this.input, parser);
ChordProTransformer transformer = this.toType == "MobileSheets"
? new MobileSheetsTransformer(inputDocument)
: new ChordProTransformer(inputDocument);
DocumentTransformer transformer = this.toType switch
{
"MobileSheets" => new MobileSheetsTransformer(inputDocument),
"ChordOverLyric" => new ChordOverLyricTransformer(inputDocument),
_ => new ChordProTransformer(inputDocument),
};
Document outputDocument = transformer.Transform().Document;
TextFormatter formatter = new(outputDocument);
this.output = formatter.ToString();
Expand Down

0 comments on commit 7e13632

Please sign in to comment.