Skip to content

Commit cc4f7cc

Browse files
authored
fix(md): Remove md-links and AI rules from md output (#14301)
1 parent 00c0bfd commit cc4f7cc

File tree

9 files changed

+13
-8
lines changed

9 files changed

+13
-8
lines changed

platform-includes/llm-rules-logs/javascript.nextjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Logs in Code Editors" copy={true}>
1+
<Expandable title="AI Rules for Logs in Code Editors" copy={true} hideFromMd={true}>
22

33
When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

platform-includes/llm-rules-logs/javascript.node.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Logs in Code Editors" copy={true}>
1+
<Expandable title="AI Rules for Logs in Code Editors" copy={true} hideFromMd={true}>
22

33
When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

platform-includes/llm-rules-logs/javascript.react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Logs in Code Editors" copy={true}>
1+
<Expandable title="AI Rules for Logs in Code Editors" copy={true} hideFromMd={true}>
22

33
When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

platform-includes/llm-rules-platform/_default.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Code Editors" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true} hideFromMd={true}>
22

33
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration. When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

platform-includes/llm-rules-platform/javascript.nextjs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Code Editors" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true} hideFromMd={true}>
22

33
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration. When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

platform-includes/llm-rules-platform/javascript.node.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Code Editors" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true} hideFromMd={true}>
22

33
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration. When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

platform-includes/llm-rules-platform/javascript.react.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<Expandable title="AI Rules for Code Editors" copy={true}>
1+
<Expandable title="AI Rules for Code Editors" copy={true} hideFromMd={true}>
22

33
Sentry provides a set of rules you can use to help your LLM use Sentry correctly. Copy this file and add it to your projects rules configuration. When created as a rules file this should be placed alongside other editor specific rule files. For example, if you are using Cursor, place this file in the `.cursorrules` directory.
44

src/components/docPage/index.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export function DocPage({
8989
rel="nofollow"
9090
className="float-right"
9191
href={`/${pathname}.md`}
92+
data-mdast="ignore"
9293
title="Markdown version of this page"
9394
>
9495
<Markdown className="flex p-0 flex-wrap" width={24} height={24} />

src/components/expandable/index.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import * as Sentry from '@sentry/nextjs';
66

77
import {usePlausibleEvent} from 'sentry-docs/hooks/usePlausibleEvent';
88

9-
// explicitly not usig CSS modules here
9+
// explicitly not using CSS modules here
1010
// because there's some prerendered content that depends on these exact class names
1111
import '../callout/styles.scss';
1212
import styles from './style.module.scss';
@@ -17,6 +17,8 @@ type Props = {
1717
copy?: boolean;
1818
/** If defined, the expandable will be grouped with other expandables that have the same group. */
1919
group?: string;
20+
// If true, the expandable will not be rendered in the markdown version of the page
21+
hideFromMd?: boolean;
2022
level?: 'info' | 'warning' | 'success';
2123
permalink?: boolean;
2224
};
@@ -35,6 +37,7 @@ export function Expandable({
3537
permalink,
3638
group,
3739
copy,
40+
hideFromMd = false,
3841
}: Props) {
3942
const id = permalink ? slugify(title) : undefined;
4043

@@ -155,6 +158,7 @@ export function Expandable({
155158
open={isExpanded}
156159
onToggle={toggleIsExpanded}
157160
id={id}
161+
{...(hideFromMd ? {'data-mdast': 'ignore'} : {})}
158162
>
159163
<summary className={`${styles['expandable-header']} callout-header`}>
160164
<div className={styles['expandable-title-container']}>

0 commit comments

Comments
 (0)