From 583a671485a0d12879be1ecf32861ad5bf4f8d48 Mon Sep 17 00:00:00 2001 From: Steven Petryk Date: Sun, 3 Mar 2024 17:34:29 -0800 Subject: [PATCH] Slight site improvements --- docs/app/guides/link.tsx | 2 ++ docs/app/layout.tsx | 11 ++++++++++- docs/components/PropTable.tsx | 11 +++++++++++ scripts/docgen.ts | 7 ++++++- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/docs/app/guides/link.tsx b/docs/app/guides/link.tsx index 937a4503..8d6d8ba0 100644 --- a/docs/app/guides/link.tsx +++ b/docs/app/guides/link.tsx @@ -23,6 +23,8 @@ export function GuideLink({ sectionTitle, guideSlug, children }: GuideLinkProps) hover:text-blue-700 focus:text-blue-700 focus:z-10 dark:text-slate-300 dark:focus:text-blue-300 dark:hover:text-blue-300 + transition + active:scale-[0.99] ${ active ? "text-blue-700 dark:text-blue-400 dark:focus:text-blue-400 dark:hover:text-blue-400 font-bold md:bg-slate-100 md:dark:bg-slate-800" diff --git a/docs/app/layout.tsx b/docs/app/layout.tsx index 1646f553..fcb4cdc7 100644 --- a/docs/app/layout.tsx +++ b/docs/app/layout.tsx @@ -5,6 +5,7 @@ import "./globals.css" import "../node_modules/@wooorm/starry-night/style/core.css" import "../node_modules/@wooorm/starry-night/style/dark.css" import { Metadata } from "next" +import mafsPkg from "../../package.json" export const metadata: Metadata = { title: "Mafs: React components for interactive math", @@ -21,8 +22,16 @@ export default function RootLayout({ children }: { children: React.ReactNode })
-
+
+ + + v{mafsPkg.version} +
{/* The world isn't ready for search */} diff --git a/docs/components/PropTable.tsx b/docs/components/PropTable.tsx index db750a5e..2b661441 100644 --- a/docs/components/PropTable.tsx +++ b/docs/components/PropTable.tsx @@ -2,6 +2,7 @@ import * as React from "react" import ReactMarkdown from "react-markdown" import DocgenInfo from "../generated-docgen" +import Link from "next/link" export interface Docgen { filePath: string @@ -55,6 +56,16 @@ export function PropTable({ of: displayName }: PropTableProps) { )} + +
+ + + View on GitHub +
diff --git a/scripts/docgen.ts b/scripts/docgen.ts index eb71d26e..316b0877 100644 --- a/scripts/docgen.ts +++ b/scripts/docgen.ts @@ -14,6 +14,11 @@ const parse = docgen.withCustomConfig(tsConfigPath, { export function writeDocgenResults(docgenInfo: docgen.ComponentDoc[]) { const writePath = path.join(projectRoot, "docs/generated-docgen.tsx") + docgenInfo = docgenInfo.map((inf) => ({ + ...inf, + filePath: path.relative(projectRoot, inf.filePath), + })) + fs.writeFileSync( writePath, [ @@ -26,7 +31,7 @@ export function writeDocgenResults(docgenInfo: docgen.ComponentDoc[]) { console.log(`Docgen updated ${writePath}`) } -const paths = fg.sync("src/**/*.tsx") +const paths = fg.sync("src/**/*.tsx", { ignore: ["src/index.tsx"] }) const docgenInfo = parse(paths) writeDocgenResults(docgenInfo)