Repository navigation
Expand file tree
/
Copy pathProgram.cs
More file actions
75 lines (62 loc) · 4.15 KB
/
Copy pathProgram.cs
File metadata and controls
75 lines (62 loc) · 4.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
using ShellDocs.Components;
using ShellDocs.Preview.Components;
var builder = WebApplication.CreateBuilder(args);
builder.WebHost.UseStaticWebAssets();
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents();
builder.Services.AddShellDocs(o =>
{
o.ContentRoot = Path.Combine(builder.Environment.ContentRootPath, "content");
o.SiteName = "ShellDocs";
o.SiteTagline = "the docs framework for .NET";
o.GitHubRepo = "shellui-dev/shelldocs";
// Flip to TopNav for the classic header layout.
o.LayoutVariant = DocsLayoutVariant.Sidebar;
o.AddNavMenu("Documentation",
new NavMenuItem("Getting Started", "/docs/introduction",
"Install, configure, and ship your first ShellDocs site.",
"<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M13 2 3 14h9l-1 8 10-12h-9l1-8z\"/></svg>"),
new NavMenuItem("Markdown Pipeline", "/docs/markdown",
"Frontmatter, MDX-style slots, and custom components.",
"<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M4 4h16v16H4z\"/><path d=\"M4 9h16M9 4v16\"/></svg>"),
new NavMenuItem("Components", "/docs/components/callout",
"Callouts, cards, tabs, code groups — the essentials.",
"<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\"/><rect x=\"14\" y=\"3\" width=\"7\" height=\"7\" rx=\"1\"/><rect x=\"3\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\"/><rect x=\"14\" y=\"14\" width=\"7\" height=\"7\" rx=\"1\"/></svg>"),
new NavMenuItem("Theming", "/docs/theming",
"Palette tokens, dark mode, and shadcn compatibility.",
"<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.75\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"12\" r=\"9\"/><path d=\"M12 3v18M3 12h18\"/></svg>")
);
o.AddNavLink("Showcase", "/showcase");
o.AddNavLink("Blog", "/blog");
o.AddPackage("shelldocs", "ShellDocs", "The docs framework itself.", "/docs/introduction",
"M12 2 4 6v6c0 5 3.5 9.5 8 10 4.5-.5 8-5 8-10V6z");
o.AddPackage("shelldocs.markdown", "ShellDocs.Markdown", "Markdig extensions, slots, MDX.", "/docs/markdown",
"M4 4h16v16H4z M4 9h16 M9 4v16");
// "{version}" resolves to the current version's Id, so switching packages keeps the version.
o.AddPackage("shelldocs.core", "ShellDocs.Core", "Navigation graph + content model.", "/docs/{version}/core",
"M12 2 2 7l10 5 10-5-10-5z M2 17l10 5 10-5 M2 12l10 5 10-5");
o.AddPackage("shelldocs.cli", "ShellDocs.CLI", "Scaffold, build, publish.", "/docs/{version}/cli",
"m8 6-6 6 6 6 M16 6l6 6-6 6");
o.AddPackage("shelldocs.components","ShellDocs.Components","Layouts, header, sidebar, TOC.", "/docs/components",
"M3 3h7v7H3z M14 3h7v7h-7z M3 14h7v7H3z M14 14h7v7h-7z");
o.AddVersion("v2.0", "v2.0.0", "/docs/v2.0", "Current stable", latest: true);
o.AddVersion("v1.9.1", "v1.9.1", "/docs/v1.9.1", "Previous release");
// Page-level MAUI | Avalonia tabs on pages whose blocks use SyncKey="platform".
o.AddSyncSwitch("platform", "MAUI", "Avalonia");
// Built-in primitives (Callout, Card, Steps, …) are registered by AddShellDocs.
o.RegisterComponentsFromAssembly<App>("ShellDocs.Preview.Ui");
o.RegisterComponentsFromAssembly<App>("ShellDocs.Preview.Demos");
o.DemoSourceRoot = Path.Combine(builder.Environment.ContentRootPath, "Demos");
// /llms.txt, /llms-full.txt, every page as Markdown, agent files and the page ⋯ menu.
o.EnableLlmsTxt(l =>
{
l.RulesFile = "llms-rules.md";
l.InstallCommandPattern = @"dotnet tool install [^\n]+";
});
});
var app = builder.Build();
app.UseStaticFiles();
app.UseAntiforgery();
app.MapRazorComponents<App>()
.AddInteractiveServerRenderMode();
app.Run();