-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Update dependencies - Fix talk page
- Loading branch information
Showing
30 changed files
with
1,283 additions
and
1,167 deletions.
There are no files selected for viewing
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
4 changes: 2 additions & 2 deletions
4
... App Example/Tavenem.Wiki.Blazor.Example.Client/Tavenem.Wiki.Blazor.Example.Client.csproj
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
10 changes: 5 additions & 5 deletions
10
sample/WebAssembly Example/Tavenem.Wiki.Blazor.Sample.csproj
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,95 @@ | ||
using Microsoft.AspNetCore.Components; | ||
using Microsoft.AspNetCore.Components.Rendering; | ||
using System.Diagnostics.CodeAnalysis; | ||
|
||
namespace Tavenem.Wiki.Blazor.Client.Pages; | ||
|
||
/// <summary> | ||
/// The article view. | ||
/// </summary> | ||
public class ArticleView : ComponentBase | ||
{ | ||
/// <summary> | ||
/// The article to display. | ||
/// </summary> | ||
[Parameter] public Page? Page { get; set; } | ||
|
||
/// <summary> | ||
/// Whether the current user has permission to edit this article. | ||
/// </summary> | ||
[Parameter] public bool CanEdit { get; set; } | ||
|
||
/// <summary> | ||
/// The content to display. | ||
/// </summary> | ||
[Parameter] public MarkupString Content { get; set; } | ||
|
||
/// <summary> | ||
/// Whether to display a diff. | ||
/// </summary> | ||
[Parameter] public bool IsDiff { get; set; } | ||
|
||
/// <summary> | ||
/// The current user (may be null if the current user is browsing anonymously). | ||
/// </summary> | ||
[Parameter] public IWikiUser? User { get; set; } | ||
|
||
[Inject, NotNull] private WikiBlazorOptions? WikiBlazorClientOptions { get; set; } | ||
|
||
[Inject, NotNull] private WikiOptions? WikiOptions { get; set; } | ||
|
||
/// <inheritdoc/> | ||
[UnconditionalSuppressMessage( | ||
"ReflectionAnalysis", | ||
"IL2111:RequiresUnreferencedCode", | ||
Justification = "OpenComponent already has the right set of attributes")] | ||
protected override void BuildRenderTree(RenderTreeBuilder builder) | ||
{ | ||
builder.OpenElement(0, "div"); | ||
builder.AddAttribute(1, "class", "wiki-site-subtitle"); | ||
builder.AddContent(2, "From "); | ||
builder.AddContent(3, WikiOptions.SiteName); | ||
builder.CloseElement(); | ||
|
||
if (!IsDiff && Page is not null) | ||
{ | ||
var frontMatterType = WikiBlazorClientOptions.GetArticleFrontMatter(Page); | ||
if (frontMatterType is not null) | ||
{ | ||
var frontMatterRenderMode = WikiBlazorClientOptions.GetArticleFrontMatterRenderMode(Page); | ||
builder.OpenComponent(4, frontMatterType); | ||
builder.AddAttribute(5, nameof(WikiComponent.Page), Page); | ||
builder.AddAttribute(6, nameof(WikiComponent.CanEdit), CanEdit); | ||
builder.AddAttribute(7, nameof(WikiComponent.User), User); | ||
if (frontMatterRenderMode is not null) | ||
{ | ||
builder.AddComponentRenderMode(frontMatterRenderMode); | ||
} | ||
builder.CloseComponent(); | ||
} | ||
} | ||
|
||
builder.OpenElement(8, "tf-syntax-highlight"); | ||
builder.AddAttribute(9, "class", "wiki-parser-output"); | ||
builder.AddContent(10, Content); | ||
builder.CloseElement(); | ||
|
||
if (!IsDiff && Page is not null) | ||
{ | ||
var endMatterType = WikiBlazorClientOptions.GetArticleFrontMatter(Page); | ||
if (endMatterType is not null) | ||
{ | ||
var endMatterRenderMode = WikiBlazorClientOptions.GetArticleFrontMatterRenderMode(Page); | ||
builder.OpenComponent(11, endMatterType); | ||
builder.AddAttribute(12, nameof(WikiComponent.Page), Page); | ||
builder.AddAttribute(13, nameof(WikiComponent.CanEdit), CanEdit); | ||
builder.AddAttribute(14, nameof(WikiComponent.User), User); | ||
if (endMatterRenderMode is not null) | ||
{ | ||
builder.AddComponentRenderMode(endMatterRenderMode); | ||
} | ||
builder.CloseComponent(); | ||
} | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.