feat(Docs) Notes and Docs are now Markdown. SQL is just for page Navigation
This commit is contained in:
@@ -34,7 +34,56 @@ else
|
||||
}
|
||||
|
||||
<style>
|
||||
|
||||
pre code {
|
||||
color: white;
|
||||
}
|
||||
|
||||
h1 {
|
||||
display: block;
|
||||
font-size: 2em;
|
||||
margin-top: 0.67em;
|
||||
margin-bottom: 0.67em;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
h2 {
|
||||
display: block;
|
||||
font-size: 1.5em;
|
||||
margin-top: 0.83em;
|
||||
margin-bottom: 0.83em;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
li {
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
p {
|
||||
display: block;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
}
|
||||
|
||||
ul {
|
||||
display: block;
|
||||
list-style-type: disc;
|
||||
margin-top: 1em;
|
||||
margin-bottom: 1em;
|
||||
margin-left: 0;
|
||||
margin-right: 0;
|
||||
padding-left: 40px;
|
||||
}
|
||||
|
||||
pre {
|
||||
background: black;
|
||||
padding: 2px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
@@ -1,14 +1,23 @@
|
||||
<div class="note">
|
||||
<div class="noteHeader">
|
||||
<div class="noteTitle">@NoteContentModel.Name</div>
|
||||
@inject HttpClient httpClient
|
||||
|
||||
<div class="noteDates">
|
||||
<div class="noteDateUpdated"><b>Updated</b>: @NoteContentModel.UpdatedDate.ToString("MM/dd/yyyy")</div>
|
||||
<div class="noteDateCreated"><b>Created</b>: @NoteContentModel.CreatedDate.ToString("MM/dd/yyyy")</div>
|
||||
@if (content == null)
|
||||
{
|
||||
<LoadingComponent/>
|
||||
}
|
||||
else
|
||||
{
|
||||
<div class="note">
|
||||
<div class="noteHeader">
|
||||
<div class="noteTitle">@NoteContentModel.Name</div>
|
||||
|
||||
<div class="noteDates">
|
||||
<div class="noteDateUpdated"><b>Updated</b>: @NoteContentModel.UpdatedDate.ToString("MM/dd/yyyy")</div>
|
||||
<div class="noteDateCreated"><b>Created</b>: @NoteContentModel.CreatedDate.ToString("MM/dd/yyyy")</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="noteContent">@((MarkupString)Markdown.ToHtml(content, pipeline))</div>
|
||||
</div>
|
||||
<div class="noteContent">@((MarkupString)Markdown.ToHtml(NoteContentModel.Content))</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
<style>
|
||||
.noteTitle {
|
||||
@@ -28,8 +37,13 @@
|
||||
</style>
|
||||
|
||||
@code {
|
||||
|
||||
[Parameter]
|
||||
public NoteContentModel NoteContentModel { get; set; } = default!;
|
||||
|
||||
string? content = null;
|
||||
MarkdownPipeline pipeline = new MarkdownPipelineBuilder().UseAdvancedExtensions().Build();
|
||||
private async Task<string> LoadContent() => content = await httpClient.GetStringAsync($"content/notes/{NoteContentModel.Content}.md");
|
||||
protected override async Task OnParametersSetAsync() => await LoadContent();
|
||||
protected override async Task OnInitializedAsync() => await LoadContent();
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user