PrismJs Blazor integration
MIT License
Code Highliter component library for Blazor. Integrating PrismJs.
Add a reference to the library from
Add the following in _Imports.razor
:
@using Skclusive.Script.Prism
Make the registration in Startup.cs
public class Startup
{
public void ConfigureServices(IServiceCollection services)
{
services.AddPrism();
}
public void Configure(IComponentsApplicationBuilder app)
{
app.AddComponent<App>("app");
}
}
Add the resources in App.razor
<PrismStyles />
<PrismScript />
<Router AppAssembly="@typeof(Program).Assembly">
....
</Router>
you can use the PrismCode component to render code block as blow
<PrismCode
Code="@(@"<body>
<div style=""padding: 20px;"">
<Grid Container Spacing=""@Spacing.Five"">
//...
</Grid>
</div>
</body>")"
/>
Following is the rendered output in dark theme.
Skclusive.Script.Prism is licensed under MIT license