MudBlazor.Markdown

repository·main·Indexed 41 days ago

https://github.com/mynihongo/mudblazor.markdown

A specialized Markdown rendering component for the MudBlazor ecosystem, version 1.0.0. It provides the <MudMarkdown /> component to render Markdown content using standard MudBlazor styling and providers. Features include support for headings, text styling, lists, tables, and fenced code blocks, with options to configure a custom clipboard service via AddMudMarkdownClipboardService<T>.

Tokens
3.3K
Snippets
9
Records
17
Agent score
52%

What's inside MudBlazor.Markdown

  1. Run the MudBlazor.Markdown samples

    main

    To run the provided sample projects, you must set up the Node.js environment to handle dependencies and builds. Follow these steps:

    1. Install Node.js from the official downloads page.
    2. Navigate to the src\MudBlazor.Markdown directory in your terminal.
    3. Install dependencies using npm ci.
    4. Build the assets using npm run build.
    npm ci
    npm run build
  2. Install Enderal - My Way using Wabbajack

    main

    Follow these steps to install the modlist using Wabbajack:

    1. Prepare Wabbajack: Download the latest Wabbajack.exe and place it in a dedicated working folder (e.g., C:/Wabbajack).
    2. Load Modlist: Run Wabbajack, select Browse Modlists, and find Enderal - My Way.
    3. Configure Paths:
      • Download Location: Where the mod files will be stored. You can reuse one download location for multiple lists.
      • Installation Location: Where the modlist will be installed. IMPORTANT: This must NOT be your Skyrim folder.
    4. Execute: Click the Go/Begin button and wait for completion.

    Troubleshooting Wabbajack Errors:

    • Could not download x: The mod may have updated and old files are unavailable. Wait for a modlist update.
    • x is not a whitelisted download: A new update is likely available; check for modlist updates.
    • Wabbajack could not find my game folder: Ensure you are using a legitimate Steam version of the game.
  3. Configure MudBlazor.Markdown for Blazor Server or WebAssembly

    main

    Follow these steps to integrate MudBlazor.Markdown into your project:

    1. Add Using Statement

    Add the following to your _Imports.razor file:

    @using MudBlazor

    2. Add MudBlazor Providers

    Add these components to App.razor or MainLayout.razor:

    <MudThemeProvider />
    <MudPopoverProvider />
    <MudDialogProvider />
    <MudSnackbarProvider />

    3. Add Static Assets

    In the <head> node of Pages/_Host.cshtml (Server) or wwwroot/index.html (WebAssembly), add these stylesheets:

    <link href="https://fonts.googleapis.com/css?family=Roboto:300,400,500,700&display=swap" rel="stylesheet" />
    <link href="_content/MudBlazor/MudBlazor.min.css" rel="stylesheet" />
    <link href="_content/MudBlazor.Markdown/MudBlazor.Markdown.min.css" rel="stylesheet" />

    At the bottom of the <body> node, add these scripts:

    <script src="_content/MudBlazor/MudBlazor.min.js"></script>
    <script src="_content/MudBlazor.Markdown/MudBlazor.Markdown.min.js"></script>

    4. Register Services

    Register the required services in your DI container.

    Blazor Server (Startup.cs):

    public void ConfigureServices(IServiceCollection services)
    {
        services.AddMudServices();
        services.AddMudMarkdownServices();
        // Optionally add a custom clipboard service if the default fails
        services.AddMudMarkdownClipboardService<MauiClipboardService>();
    }

    Blazor WebAssembly (Program.cs):

    var builder = WebAssemblyHostBuilder.CreateDefault(args);
    builder.Services.AddMudServices();
    builder.Services.AddMudMarkdownServices();
    // Optionally add a custom clipboard service if the default fails
    builder.Services.AddMudMarkdownClipboardService<MauiClipboardService>();
  4. Pre-Installation requirements for Enderal - My Way

    main

    Before installing the Enderal - My Way modlist, ensure the following prerequisites are met:

    1. Microsoft Visual C++ Redistributable Package: Required for Mod Organizer 2 (MO2). Download the x64 version for 'Visual Studio 2015, 2017 and 2019' from Microsoft.
    2. Steam Configuration:
      • Disable Steam Overlay: Right-click the game in Steam Library -> Properties -> General -> Uncheck 'Enable the Steam Overlay while in-game'.
      • Change Update Behavior: Properties -> Updates -> Set 'Automatic updates' to 'Only update this game when I launch it'. Disable Steam Cloud.
      • Set Language: Properties -> Language -> Select 'English'.
    3. Clean Skyrim Installation:
      • Uninstall the game via Steam.
      • Delete the game folder manually.
      • Clean up the Skyrim Special Edition folder in Documents/My Games/.
      • Reinstall the game.
    4. Initial Launcher Setup:
      • Open the Skyrim Launcher -> Options.
      • Set Preset to High.
      • Set Aspect Ratio and Resolution to your monitor's native values.
      • Set Antialiasing to Off.
      • Enable Windowed Mode and Borderless.
  5. Use MudMarkdown component

    main

    To render markdown, use the <MudMarkdown /> component and provide the markdown string via the Value parameter.

    Important for Static SSR: Because MudBlazor relies on code executed in OnAfterRender or OnAfterRenderAsync, it may not work correctly with static SSR. To ensure interactivity, specify @rendermode="InteractiveServer" (or the appropriate interactive mode for your setup) on the component.

    Example:

    <MudMarkdown @rendermode="InteractiveServer" Value="some markdown here" />
    <MudText Typo="Typo.h3">My markdown</MudText>
    <MudMarkdown Value="@Value" />
    
    @code
    {
        private string Value { get; } = "text *italics* and **bold*";
    }
  6. Post-Installation steps for Enderal - My Way

    main

    After Wabbajack finishes the installation, complete these steps to launch the game:

    1. Copy Game Files: Locate the Game Folder Files directory inside your Enderal installation folder. Copy its contents into your Skyrim installation directory (where Skyrim.exe is located).
    2. Launch via Mod Organizer 2 (MO2):
      • Open the installation folder and run ModOrganizer.exe.
      • If using Enderal: Forgotten Stories (Special Edition), activate the Enderal SE - Steam Time Tracking and Achievements mod in the left pane.
      • In the top-right dropdown of MO2, ensure EMW - Push Run To Play is selected.
      • Click the Run button.
  7. Update or Remove the Enderal - My Way modlist

    main

    Updating the Modlist

    When an update is released:

    1. Check the Changelog first.
    2. Backup your saves or start a new game.
    3. Run Wabbajack and select the same paths used previously.
    4. Tick the overwrite existing Modlist button.

    WARNING: Wabbajack will delete all files that are not part of the Modlist during an update. Any additional mods you installed manually will be lost. Your downloads folder will remain untouched.

    Removing the Modlist

    • To remove the modlist, simply delete the MO2 folder.
    • To clean up ENB and ReShade files from your game folder, it is recommended to use ENB and ReShade Manager.
  8. Tweaking performance for Enderal - My Way

    main

    To improve FPS, you can tweak the ENB settings or the game's internal settings.

    ENB Tweaking

    Open the ENB GUI using Right Shift + Enter. High-impact settings to consider disabling:

    • Ambient Occlusion: Can save up to 20 FPS.
    • DepthOfField: Can save up to 10 FPS.
    • Bloom: Can save up to 3 FPS.
    • Distant/DetailedShadow: Significant impact depending on shader settings.
    • ComplexFire/ParticleLights: Impact is most noticeable during magic use or near light sources.

    Game Setting Tweaking (via BethINI)

    Use the included BethINI tool (found in MO2/tools/BethINI) to adjust the Detail section:

    • Shadow Resolution: A balance of 2048 is recommended.
    • Ambient Occlusion: Set to None (the modlist uses ENB SAO instead).
    • Detailed Draw Distance: Try 2000 instead of 2800.
    • Remove Shadows: Use only if struggling significantly (not recommended).
  9. Known Markdown Rendering Issues

    main

    The following edge cases have been identified as potential rendering issues in MudBlazor.Markdown based on reported issues:

    • Indented code blocks: Issues with rendering blocks that use indentation for code (e.g., if statements).
    • Unknown language syntax: Potential issues when encountering specific syntax like Razor (@page, @model) within code blocks.
    • Nested text in blockquotes: Complex structures inside blockquotes, such as nested lists and code blocks.
    • Tables within lists: Rendering tables that are part of a list item (indented tables).
    • Non-indented tables in lists: Tables that appear within a list context but are not properly indented.