diff --git a/api/content-markdown.ts b/api/content-markdown.ts index 74fa7f6..c88c125 100644 --- a/api/content-markdown.ts +++ b/api/content-markdown.ts @@ -123,8 +123,6 @@ function readTemplateMarkdown(rootDir: string, slug: string): string { ); } - lines.push(`## ${recipe.name}`); - lines.push(""); lines.push(recipeContent.trim()); lines.push(""); } diff --git a/docusaurus.config.ts b/docusaurus.config.ts index 2acf8a0..064419d 100644 --- a/docusaurus.config.ts +++ b/docusaurus.config.ts @@ -18,15 +18,15 @@ const config: Config = { }, // Set the production url of your site here - url: "https://your-docusaurus-site.example.com", + url: "https://dev.databricks.com", // Set the // pathname under which your site is served // For GitHub pages deployment, it is often '//' baseUrl: "/", // GitHub pages deployment config. // If you aren't using GitHub pages, you don't need these. - organizationName: "facebook", // Usually your GitHub org/user name. - projectName: "docusaurus", // Usually your repo name. + organizationName: "databricks", // Usually your GitHub org/user name. + projectName: "devhub", // Usually your repo name. onBrokenLinks: "throw", diff --git a/src/css/custom.css b/src/css/custom.css index c39f890..f353e54 100644 --- a/src/css/custom.css +++ b/src/css/custom.css @@ -886,6 +886,19 @@ @apply bg-black/2 dark:bg-white/3; } + .theme-code-block [class*="buttonGroup"] { + right: 0.5rem !important; + top: 0.5rem !important; + } + + .theme-code-block [class*="buttonGroup"] button { + opacity: 0.5 !important; + } + + .theme-code-block:hover [class*="buttonGroup"] button { + opacity: 1 !important; + } + .recipe-content-card .theme-code-block { @apply my-8 min-w-0 w-full overflow-hidden rounded-xl border border-black/12 shadow-md dark:border-white/12; } diff --git a/src/theme/MDXComponents/index.tsx b/src/theme/MDXComponents/index.tsx index 62dd358..76efedb 100644 --- a/src/theme/MDXComponents/index.tsx +++ b/src/theme/MDXComponents/index.tsx @@ -1,5 +1,6 @@ import MDXComponents from "@theme-original/MDXComponents"; import type { MDXComponentsObject } from "@theme/MDXComponents"; +import CodeBlock from "@theme/CodeBlock"; import type { ComponentPropsWithoutRef } from "react"; import { cn } from "@/lib/utils"; @@ -164,18 +165,29 @@ function Img({ className, ...props }: ComponentPropsWithoutRef<"img">) { ); } -function InlineCode({ className, ...props }: ComponentPropsWithoutRef<"code">) { - const isLikelyCodeBlock = Boolean(className?.includes("language-")); +function InlineCode({ + className, + children, + ...props +}: ComponentPropsWithoutRef<"code">) { + const languageMatch = className?.match(/language-(\w+)/); + + if (languageMatch) { + const code = + typeof children === "string" ? children.replace(/\n$/, "") : children; + return {code}; + } return ( + > + {children} + ); } diff --git a/vercel.json b/vercel.json index 123d08c..8b22bad 100644 --- a/vercel.json +++ b/vercel.json @@ -1,5 +1,5 @@ { - "devCommand": "docusaurus start --port $PORT", + "devCommand": "docusaurus start --port $PORT --no-open", "functions": { "api/mcp.ts": { "includeFiles": "docs/**",