Skip to content

Commit

Permalink
MudBlazor components
Browse files Browse the repository at this point in the history
  • Loading branch information
danzuep committed Jan 29, 2024
1 parent 13a6c83 commit 981d7e3
Show file tree
Hide file tree
Showing 23 changed files with 816 additions and 265 deletions.
10 changes: 10 additions & 0 deletions Bible.Core/Models/BibleReference.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,16 @@ public string ToReference()
return $"{BookName} {Reference} ({Translation})";
}

public string ToPath()
{
if (string.IsNullOrEmpty(Reference))
return BookName;
var ch = Reference.Split(new char[] { ':', ' ' });
if (ch.Length > 1)
return $"{BookName}/{Reference[0]}";
return $"{BookName}/{Reference}";
}

public override string ToString()
{
if (string.IsNullOrEmpty(Reference))
Expand Down
1 change: 1 addition & 0 deletions Bible.Data/Bible.Data.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="Json\BibleContentsCanonBookChapters.json" />
<EmbeddedResource Include="Json\kjv.json" />
</ItemGroup>

Expand Down
9 changes: 6 additions & 3 deletions Bible.Data/Converter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,12 @@ public static (string, BibleFootnote[]) SplitVerseFootnotes(this BibleVerse bibl
break;
fragmentStartIndex = noteEndIndex + 1;
var footnote = bibleVerse.Text[++noteStartIndex..noteEndIndex];
var fnId = $"{bibleVerse.Id}{(char)('a' + footnotes.Count)}";
verse.Append("<sup><a href=\"#footnote-").Append(fnId)
.Append("\">[").Append(fnId).Append("]</a></sup>");
var fnChar = (char)('a' + footnotes.Count);
var fnId = $"{bibleVerse.Id}{fnChar}";
var page = bibleVerse.Reference.ToPath();
verse.Append("<sup><a href=\"").Append(page)
.Append("#footnote-").Append(fnId)
.Append("\">[").Append(fnChar).Append("]</a></sup>");
footnotes.Add(new BibleFootnote(fnId, footnote));
// $"<li id=\"footnote-{fnId}\">[{fnId}] {footnote}</li>";
noteStartIndex = bibleVerse.Text.IndexOf(start, noteEndIndex);
Expand Down
Loading

0 comments on commit 981d7e3

Please sign in to comment.