Skip to content

Commit 31c3ab9

Browse files
committed
add Markdown links
1 parent 21830c9 commit 31c3ab9

File tree

4 files changed

+28
-5
lines changed

4 files changed

+28
-5
lines changed

scripts/generate-md-exports.mjs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,6 @@ async function createWork() {
3535
await mkdir(OUTPUT_DIR, {recursive: true});
3636

3737
// On a 16-core machine, 8 workers were optimal (and slightly faster than 16)
38-
// Putting 4 as the minimum as Vercel has 4 cores per builder and it may help
39-
// us cut down some of the time there.
40-
// Source: https://vercel.com/docs/limits#build-container-resources
4138
const numWorkers = Math.max(Math.floor(cpus().length / 2), 2);
4239
const workerTasks = new Array(numWorkers).fill(null).map(() => []);
4340

src/components/breadcrumbs/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export function Breadcrumbs({leafNode}: BreadcrumbsProps) {
2424
}
2525

2626
return (
27-
<ul className="list-none flex p-0 flex-wrap" style={{margin: 0}}>
27+
<ul className="list-none flex p-0 flex-wrap float-left" style={{margin: 0}}>
2828
{breadcrumbs.map(b => {
2929
return (
3030
<li className={styles['breadcrumb-item']} key={b.to}>

src/components/docPage/index.tsx

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import {ReactNode} from 'react';
2+
import Link from 'next/link';
23

34
import {getCurrentGuide, getCurrentPlatform, nodeForPath} from 'sentry-docs/docTree';
5+
import Markdown from 'sentry-docs/icons/Markdown';
46
import {serverContext} from 'sentry-docs/serverContext';
57
import {FrontMatter} from 'sentry-docs/types';
68
import {PaginationNavNode} from 'sentry-docs/types/paginationNavNode';
@@ -81,7 +83,16 @@ export function DocPage({
8183
<div className="mb-4">
8284
<Banner />
8385
</div>
84-
{leafNode && <Breadcrumbs leafNode={leafNode} />}
86+
<div className="overflow-hidden">
87+
{leafNode && <Breadcrumbs leafNode={leafNode} />}{' '}
88+
<Link
89+
className="float-right"
90+
href={`/${pathname}.md`}
91+
title="Markdown version of this page"
92+
>
93+
<Markdown className="flex p-0 flex-wrap" width={24} height={24} />
94+
</Link>
95+
</div>
8596
<div>
8697
<hgroup>
8798
<h1>{frontMatter.title}</h1>

src/icons/Markdown.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
function Markdown({width = 16, height = 16, ...props}: React.SVGAttributes<SVGElement>) {
2+
return (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
width={width}
6+
height={height}
7+
viewBox="0 0 32 32"
8+
fill="currentColor"
9+
{...props}
10+
>
11+
<path d="M 2.875 6 C 1.320313 6 0 7.253906 0 8.8125 L 0 23.1875 C 0 24.746094 1.320313 26 2.875 26 L 29.125 26 C 30.679688 26 32 24.746094 32 23.1875 L 32 8.8125 C 32 7.253906 30.679688 6 29.125 6 Z M 2.875 8 L 29.125 8 C 29.640625 8 30 8.382813 30 8.8125 L 30 23.1875 C 30 23.617188 29.640625 24 29.125 24 L 2.875 24 C 2.359375 24 2 23.617188 2 23.1875 L 2 8.8125 C 2 8.382813 2.359375 8 2.875 8 Z M 5 11 L 5 21 L 8 21 L 8 14.34375 L 11 18.3125 L 14 14.34375 L 14 21 L 17 21 L 17 11 L 14 11 L 11 15 L 8 11 Z M 22 11 L 22 16 L 19 16 L 23.5 21 L 28 16 L 25 16 L 25 11 Z" />
12+
</svg>
13+
);
14+
}
15+
export default Markdown;

0 commit comments

Comments
 (0)