diff --git a/app/documentation/page.tsx b/app/documentation/page.tsx index 92378150..6edb87d1 100644 --- a/app/documentation/page.tsx +++ b/app/documentation/page.tsx @@ -3,10 +3,27 @@ import path from "path" import matter from "gray-matter" import Link from "next/link" import { ContentWithToc } from "@/components/content-with-toc" +import { ArrowRight, BookOpen, FileText, Package, Printer, ScanLine, Settings } from "lucide-react" const PAGE_MD = path.join(process.cwd(), "contents", "pages", "documentation.md") const DOCS_DIR = path.join(process.cwd(), "contents", "documentation") +const iconsMap = { + "01-printer-application": Printer, + "02-designing-printer-drivers": Settings, + "03-designing-scanner-drivers": ScanLine, + "04-packaging-drivers": Package, + "05-User-Manual": BookOpen +} as const + +const descriptionMap = { + "01-printer-application":"Learn how printer applications work, why they replace traditional CUPS drivers and how they simplify Linux printing", + "02-designing-printer-drivers": "A step-by-step tutorial to build, run, and test a basic printer driver", + "03-designing-scanner-drivers": "Best practices and key steps for implementing SANE-compatible scanner drivers", + "04-packaging-drivers": "Package your driver as a Snap and publish it to the Snap Store", + "05-User-Manual": "Technical specifications, configuration keys, and command-line options for Printer Applications", +} as const + export default async function DocumentationPage() { const raw = await fs.readFile(PAGE_MD, "utf8") const { data, content } = matter(raw) @@ -32,33 +49,87 @@ export default async function DocumentationPage() { const hasContent = content != null && content.trim().length > 0 - return ( -
-
-

- {typeof data.title === "string" ? data.title : "Documentation"} -

+ return ( +
+
+ + {/* Documentation header */} +
+
+
+ +
+ +

+ {typeof data.title === "string" + ? data.title + : "Documentation"} +

+
{hasContent && ( -
- +
+
)} +
+ +
+ {docs.map((doc) => { + const Icon = + iconsMap[doc.slug as keyof typeof iconsMap] ?? FileText; -
    - {docs.map((doc) => ( -
  • - - {doc.title} - -
  • - ))} -
+ const description = + descriptionMap[ + doc.slug as keyof typeof descriptionMap + ]; + + return ( + + +
+ +
+ +
+

+ {doc.title} +

+ + {description && ( +

+ {description} +

+ )} +
+ +
+ +
+ + ); + })}
-
- ) -} + +
+
+) +}; \ No newline at end of file diff --git a/contents/documentation/01-printer-application.md b/contents/documentation/01-printer-application.md index b3d6ab4c..ded7ce85 100644 --- a/contents/documentation/01-printer-application.md +++ b/contents/documentation/01-printer-application.md @@ -1,5 +1,5 @@ --- -title: Printer Applications - A new way to print in Linux +title: Overview of printer applications toc: true toc_sticky: true --- diff --git a/contents/documentation/02-designing-printer-drivers.md b/contents/documentation/02-designing-printer-drivers.md index 153ce0a8..73fc4a01 100644 --- a/contents/documentation/02-designing-printer-drivers.md +++ b/contents/documentation/02-designing-printer-drivers.md @@ -1,5 +1,5 @@ --- -title: Designing Printer Drivers +title: Creating your first printer driver toc: true toc_sticky: true h_range: [1,2] diff --git a/contents/documentation/03-designing-scanner-drivers.md b/contents/documentation/03-designing-scanner-drivers.md index e700de4b..d85934cd 100644 --- a/contents/documentation/03-designing-scanner-drivers.md +++ b/contents/documentation/03-designing-scanner-drivers.md @@ -1,5 +1,5 @@ --- -title: Designing Scanner Drivers +title: Scanner driver architecture and guidelines toc: true toc_sticky: true h_range: [1,3] diff --git a/contents/documentation/04-packaging-drivers.md b/contents/documentation/04-packaging-drivers.md index 128c120d..c353ca31 100644 --- a/contents/documentation/04-packaging-drivers.md +++ b/contents/documentation/04-packaging-drivers.md @@ -1,5 +1,5 @@ --- -title: Packaging Drivers and Release them to the Snap Store +title: Packaging and publishing drivers toc: true toc_sticky: true h_range: [1,3] diff --git a/contents/documentation/05-User-Manual.md b/contents/documentation/05-User-Manual.md index db755169..38c95176 100644 --- a/contents/documentation/05-User-Manual.md +++ b/contents/documentation/05-User-Manual.md @@ -1,5 +1,5 @@ --- -title: User Manual for Printer Applications +title: Printer application reference toc: true toc_sticky: true h_range: [1,3]