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
33 changes: 30 additions & 3 deletions app/components/Code.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,42 @@
import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
import { atomDark } from 'react-syntax-highlighter/dist/esm/styles/prism';
import RenderMermaid from "react-x-mermaid";

export default function Index({
export default function Code({
code,
language = 'javascript'
}: {
code: string;
language?: string;
}) {
// Render Mermaid diagram at build time
if (language === 'mermaid') {
return (
<section className="text-sm bg-white rounded-lg p-0 mb-4">
<RenderMermaid
mermaidCode={code}
disableCopy={true}
disableDownload={true}
mermaidConfig={{
theme: "dark",
themeVariables: {
background: "transparent",
primaryColor: "#1e1e1e",
primaryTextColor: "#f2f2f2",
primaryBorderColor: "#333",
lineColor: "#666",
secondaryColor: "#2a2a2a",
tertiaryColor: "#141414"
}
}}
/>
</section>
);
}

// Render syntax-highlighted code
return (
<section className="text-sm">
<section className="text-sm bg-neutral-900/50 rounded-lg p-4 border border-neutral-600/30 mb-4">
<SyntaxHighlighter
language={language}
style={atomDark}
Expand All @@ -21,5 +48,5 @@ export default function Index({
{code}
</SyntaxHighlighter>
</section>
)
);
}
1 change: 0 additions & 1 deletion app/components/Markdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ function getMarkdownComponents() {

return (
<div
className="bg-neutral-900/50 rounded-lg p-4 border border-neutral-600/30 mb-4"
{...props}
>
<Code code={codeString} language={lang} />
Expand Down
17 changes: 16 additions & 1 deletion articles/architecture/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,21 @@ layout: coming-soon

We're building something amazing! The technical architecture documentation is coming soon.

Here's a screenshot of DocumentDB's [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-documentdb).
Pull the latest DocumentDB Docker container image:

```bash
docker pull ghcr.io/documentdb/documentdb/documentdb-local:latest
```

Here's a Mermaid diagram of a sample application you can build with DocumentDB:

```mermaid
graph LR
A[🌐 Web App] -->|MongoDB Protocol| D[(🗃️ DocumentDB)]
B[🚀 API Service] -->|MongoDB Protocol| D
C[⚙️ Worker Service] -->|MongoDB Protocol| D
```

Here's a screenshot of DocumentDB's [Visual Studio Code extension](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-documentdb):

![Screenshot of DocumentDB extension in Visual Studio Code.](media/index/vscode-extension-documentdb.png)
Loading