Skip to content

Commit

Permalink
Docs site updates
Browse files Browse the repository at this point in the history
  • Loading branch information
sdcondon committed Jan 7, 2024
1 parent 9f28289 commit b8d872b
Show file tree
Hide file tree
Showing 10 changed files with 74 additions and 35 deletions.
8 changes: 4 additions & 4 deletions src/FlUnit.Documentation/FlUnit.Documentation.csproj
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk.BlazorWebAssembly">

<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Markdig" Version="0.31.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.8" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="7.0.8" PrivateAssets="all" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="8.0.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly.DevServer" Version="8.0.0" PrivateAssets="all" />
<PackageReference Include="Microsoft.Web.LibraryManager.Build" Version="2.1.175" />
</ItemGroup>

</Project>
4 changes: 2 additions & 2 deletions src/FlUnit.Documentation/Shared/Markdown.razor
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@

public void Setup(MarkdownPipeline pipeline, IMarkdownRenderer renderer)
{
HtmlRenderer? htmlRenderer = renderer as HtmlRenderer;
var htmlRenderer = renderer as Markdig.Renderers.HtmlRenderer;
////if (htmlRenderer != null)
////{
//// htmlRenderer.BaseUrl = new Uri(baseUrl);
Expand All @@ -69,7 +69,7 @@
this.innerRenderer = innerRenderer;
}

protected override void Write(HtmlRenderer renderer, CodeBlock obj)
protected override void Write(Markdig.Renderers.HtmlRenderer renderer, CodeBlock obj)
{
if (obj is FencedCodeBlock fencedCodeBlock)
{
Expand Down
38 changes: 23 additions & 15 deletions src/FlUnit.Documentation/Shared/NavMenu.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<div class="top-row ps-3 navbar navbar-dark">
<div class="container-fluid">
<a class="navbar-brand" href=""><img src="FlUnit-32.png" alt="FlUnit icon" /> FlUnit</a>
<div class="top-row ps-1 navbar navbar-dark">
<div class="container-fluid ps-2 dropdown">
<a class="navbar-brand dropdown-toggle" href="" id="dropdown01" data-bs-toggle="dropdown" aria-expanded="false"><img src="img/FlUnit-32.png" alt="FlUnit icon" /> FlUnit</a>
<ul class="dropdown-menu" aria-labelledby="dropdown01">
<li><a class="dropdown-item" href="https://sdcondon.net/SCClassicalPlanning">SCClassicalPlanning</a></li>
<li><a class="dropdown-item" href="https://sdcondon.net/SCFirstOrderLogic">SCFirstOrderLogic</a></li>
<li><a class="dropdown-item" href="https://sdcondon.net/SCGraphTheory">SCGraphTheory</a></li>
<li><a class="dropdown-item" href="https://sdcondon.net/SCSetTrie">SCSetTrie</a></li>
<li><hr class="dropdown-divider"></li>
<li><a class="dropdown-item" href="https://sdcondon.net/">Personal Homepage</a></li>
</ul>
<button title="Navigation menu" class="navbar-toggler" @onclick="ToggleNavMenu">
<span class="navbar-toggler-icon"></span>
</button>
Expand All @@ -9,33 +17,33 @@

<div class="@NavMenuCssClass" @onclick="ToggleNavMenu">
<nav class="flex-column">
<div class="nav-item px-3">
<NavLink class="nav-link" href="" Match="NavLinkMatch.All">
<div class="nav-item px-1">
<NavLink class="nav-link px-2" href="" Match="NavLinkMatch.All">
<span class="bi bi-house-door-fill" aria-hidden="true"></span> Home
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user-guide/getting-started.md">
<div class="nav-item px-1">
<NavLink class="nav-link px-2" href="user-guide/getting-started.md">
<span class="bi bi-info-circle" aria-hidden="true"></span> Getting Started
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user-guide/useful-patterns.md">
<div class="nav-item px-1">
<NavLink class="nav-link px-2" href="user-guide/useful-patterns.md">
<span class="bi bi-info-circle" aria-hidden="true"></span> Useful Patterns
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user-guide/advanced-functionality.md">
<div class="nav-item px-1">
<NavLink class="nav-link px-2" href="user-guide/advanced-functionality.md">
<span class="bi bi-info-circle" aria-hidden="true"></span> Advanced Functionality
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="user-guide/other-notes.md">
<div class="nav-item px-1">
<NavLink class="nav-link px-2" href="user-guide/other-notes.md">
<span class="bi bi-info-circle" aria-hidden="true"></span> Other Notes
</NavLink>
</div>
<div class="nav-item px-3">
<NavLink class="nav-link" href="roadmap.md">
<div class="nav-item px-1">
<NavLink class="nav-link px-2" href="roadmap.md">
<span class="bi bi-signpost-split-fill" aria-hidden="true"></span> Roadmap
</NavLink>
</div>
Expand Down
3 changes: 1 addition & 2 deletions src/FlUnit.Documentation/wwwroot/app.css
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
@import url('css/bootstrap/bootstrap.min.css');
@import url('lib/bootstrap-icons/font/bootstrap-icons.min.css');
@import url('lib/bootstrap-icons/font/bootstrap-icons.min.css');

html, body {
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
Expand Down

This file was deleted.

This file was deleted.

48 changes: 44 additions & 4 deletions src/FlUnit.Documentation/wwwroot/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,18 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title>FlUnit</title>
<base href="/" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link href="app.css" rel="stylesheet" />
<link href="FlUnit.Documentation.styles.css" rel="stylesheet" />
<link href="FlUnit-32.png" rel="icon" type="image/png" />
<link href="img/FlUnit-32.png" rel="icon" type="image/png" />
</head>

<body>
<div id="app">
<div id="loading-placeholder" style="position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center">
<img src="FlUnit-128.png" alt="FlUnit icon" />
<br /><br />Loading, please wait.
<img src="img/FlUnit-128.png" alt="FlUnit icon" />
<div><span id="progressLabel">Loading,&nbsp;please&nbsp;wait..</span></div>
<div><span id="progressDetail" class="text-muted"></span></div>
</div>
</div>

Expand All @@ -25,9 +27,47 @@
<a class="dismiss">🗙</a>
</div>

<script src="_framework/blazor.webassembly.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>

<script src="_framework/blazor.webassembly.js" autostart="false"></script>

<link rel="stylesheet" type="text/css" href="lib/google-code-prettify/bin/prettify.min.css">
<script type="text/javascript" src="lib/google-code-prettify/bin/prettify.min.js"></script>

<script>
// Shamelessly nabbed and adapted from https://swharden.com/blog/2022-05-29-blazor-loading-progress/
function StartBlazor() {
let loadedCount = 0;
const resourcesToLoad = [];
Blazor.start({
loadBootResource:
function (type, filename, defaultUri, integrity) {
if (type == "dotnetjs")
return defaultUri;

const fetchResources = fetch(defaultUri, {
cache: 'no-cache',
integrity: integrity
});

resourcesToLoad.push(fetchResources);

fetchResources.then((r) => {
loadedCount += 1;
if (filename == "blazor.boot.json")
return;
const totalCount = resourcesToLoad.length;
document.getElementById('progressLabel').innerHTML = `Loading,&nbsp;please&nbsp;wait.. (${loadedCount}/${totalCount})`;
document.getElementById('progressDetail').innerText = filename;
});

return fetchResources;
}
});
}

StartBlazor();
</script>
</body>

</html>

0 comments on commit b8d872b

Please sign in to comment.