Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions api/content-markdown.ts
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ function readTemplateMarkdown(rootDir: string, slug: string): string {
);
}

lines.push(`## ${recipe.name}`);
lines.push("");
lines.push(recipeContent.trim());
lines.push("");
}
Expand Down
6 changes: 3 additions & 3 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
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",

Expand Down
13 changes: 13 additions & 0 deletions src/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
22 changes: 17 additions & 5 deletions src/theme/MDXComponents/index.tsx
Original file line number Diff line number Diff line change
@@ -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";
Expand Down Expand Up @@ -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 <CodeBlock language={languageMatch[1]}>{code}</CodeBlock>;
}

return (
<code
className={cn(
!isLikelyCodeBlock &&
"rounded-md border border-db-border bg-db-bg px-1.5 py-0.5 font-mono text-[0.88em] text-db-navy dark:bg-db-navy/35 dark:text-white",
"rounded-md border border-db-border bg-db-bg px-1.5 py-0.5 font-mono text-[0.88em] text-db-navy dark:bg-db-navy/35 dark:text-white",
className,
)}
{...props}
/>
>
{children}
</code>
);
}

Expand Down
2 changes: 1 addition & 1 deletion vercel.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"devCommand": "docusaurus start --port $PORT",
"devCommand": "docusaurus start --port $PORT --no-open",
"functions": {
"api/mcp.ts": {
"includeFiles": "docs/**",
Expand Down
Loading