summaryrefslogtreecommitdiff
path: root/Hutch/Views/More/ManPageBrowserView.swift
diff options
context:
space:
mode:
authorChristian Cleberg <[email protected]>2026-04-03 15:18:38 -0500
committerChristian Cleberg <[email protected]>2026-04-03 15:18:38 -0500
commit0914829ad4cfdbe85db9d54c4e5cc1fdd44b82be (patch)
tree4f5c1e7cea0737917e9db3fad458be58827842ba /Hutch/Views/More/ManPageBrowserView.swift
parent18a9f62c9acadced60657addb61c2d4d8c1aab17 (diff)
downloadhutch-0914829ad4cfdbe85db9d54c4e5cc1fdd44b82be.tar.gz
hutch-0914829ad4cfdbe85db9d54c4e5cc1fdd44b82be.tar.bz2
hutch-0914829ad4cfdbe85db9d54c4e5cc1fdd44b82be.zip
feat: add in-app man pages browser
Add a native Man Pages section to the More tab with in-app browsing for man.sr.ht documentation and srht.site pages. - add ManPageService for fetching and extracting public docs content - add ManPageBrowserView and ManPageDetailView - add More tab navigation for Man Pages - support in-place navigation for internal documentation links - allow HTMLWebView to intercept internal links and use a base URL - support man.sr.ht and srht.site content extraction - remove heading permalink "#" anchors from man page rendering - fix relative links, fragment links, and srht.site CTA/icon layout
Diffstat (limited to 'Hutch/Views/More/ManPageBrowserView.swift')
-rw-r--r--Hutch/Views/More/ManPageBrowserView.swift33
1 files changed, 33 insertions, 0 deletions
diff --git a/Hutch/Views/More/ManPageBrowserView.swift b/Hutch/Views/More/ManPageBrowserView.swift
new file mode 100644
index 0000000..f854c79
--- /dev/null
+++ b/Hutch/Views/More/ManPageBrowserView.swift
@@ -0,0 +1,33 @@
+import SwiftUI
+
+/// Entry point for the man.sr.ht browser in the More tab.
+/// Shows a pre-populated list of official sr.ht man pages.
+struct ManPageBrowserView: View {
+ private let officialDocs: [(title: String, url: URL)] = [
+ ("sr.ht", URL(string: "https://man.sr.ht/sr.ht/")!),
+ ("hub.sr.ht", URL(string: "https://man.sr.ht/hub.sr.ht/")!),
+ ("git.sr.ht", URL(string: "https://man.sr.ht/git.sr.ht/")!),
+ ("hg.sr.ht", URL(string: "https://man.sr.ht/hg.sr.ht/")!),
+ ("lists.sr.ht", URL(string: "https://man.sr.ht/lists.sr.ht/")!),
+ ("todo.sr.ht", URL(string: "https://man.sr.ht/todo.sr.ht/")!),
+ ("builds.sr.ht", URL(string: "https://man.sr.ht/builds.sr.ht/")!),
+ ("paste.sr.ht", URL(string: "https://man.sr.ht/paste.sr.ht/")!),
+ ("man.sr.ht", URL(string: "https://man.sr.ht/man.sr.ht/")!),
+ ("meta.sr.ht", URL(string: "https://man.sr.ht/meta.sr.ht/")!),
+ ("srht.site", URL(string: "https://srht.site/")!)
+ ]
+
+ var body: some View {
+ List {
+ Section("Official Man Pages") {
+ ForEach(officialDocs, id: \.title) { doc in
+ NavigationLink(value: MoreRoute.manPage(doc.url)) {
+ Text(doc.title)
+ }
+ }
+ }
+ }
+ .navigationTitle("Man Pages")
+ .navigationBarTitleDisplayMode(.inline)
+ }
+}