Skip to content

Commit b52f3b0

Browse files
committed
Found out what the bug in MDX is
1 parent f290891 commit b52f3b0

File tree

4 files changed

+9
-167
lines changed

4 files changed

+9
-167
lines changed

docs/Markdown.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ const createCode = memoize((doShowLineNumber: boolean) => {
113113
"display": doShowLineNumber ? undefined : "none !important"
114114
},
115115
'& [data="highlight"]': {
116-
// Your custom line highlight styles here
117116
"background": isDark ? "#37394e" : "#efefef",
118117
"margin": "0 -1.5rem",
119118
"padding": "0 1.5rem"

docs/quick-start.stories copy.mdx.2.disabled

Lines changed: 0 additions & 100 deletions
This file was deleted.

docs/quick-start.stories.mdx

Lines changed: 9 additions & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -21,81 +21,26 @@ import { Markdown } from "./Markdown";
2121
# 🔧 Initial setup
2222

2323
_Setup `@codegouvfr/react-dsfr` in your project_
24-
25-
<Alert
26-
severity="warning"
27-
title="Warning: If you already had the DSFR installed in your project"
28-
isClosable
29-
description={<Markdown>{`
30-
* Remove [\`@gouvfr/dsfr\`](https://www.npmjs.com/package/@gouvfr/dsfr) from your dependencies.
31-
* Remove all imports: \`dsfr.css\`, \`dsfr.module.js\` the favicon and the fonts.
32-
* Remove the \`data-fr-scheme\` (and \`data-fr-theme\` ) attribude from your \`<html/>\` tag.`
33-
}</Markdown>}
34-
/>
3524

36-
```bash
25+
26+
<Markdown>{`
27+
\`\`\`bash {0}
3728
yarn add @codegouvfr/react-dsfr # Or: 'npm install --save @codegouvfr/react-dsfr'
38-
```
29+
\`\`\`
30+
`}</Markdown>
3931

40-
export const craContent = <Markdown>{`
32+
33+
<Markdown>{`
4134
#### package.json
4235
43-
\`\`\`diff {0}
36+
\`\`\`diff
4437
"scripts": {
4538
+ "postinstall": "copy-dsfr-to-public"
4639
+ "prestart": "only-include-used-icons",
4740
+ "prebuild": "only-include-used-icons"
4841
}
4942
\`\`\`
5043
51-
\`copy-dsfr-to-public\` is a \`bin\` script of \`@codegouvfr/react-dsfr\` that copies \`@gouvfr/dsfr/dist\` into \`public/dsfr\`
52-
53-
#### .gitignore
54-
55-
\`\`\`diff {0}
56-
+ /public/dsfr
57-
\`\`\`
58-
59-
#### public/index.html
60-
61-
Add the following code in the \`<head />\`
6244
63-
\`\`\`ejs {0}
64-
<link rel="apple-touch-icon" href="%PUBLIC_URL%/dsfr/favicon/apple-touch-icon.png" />
65-
<link rel="icon" href="%PUBLIC_URL%/dsfr/favicon/favicon.svg" type="image/svg+xml" />
66-
<link rel="shortcut icon" href="%PUBLIC_URL%/dsfr/favicon/favicon.ico" type="image/x-icon" />
67-
<link rel="manifest" href="%PUBLIC_URL%/dsfr/favicon/manifest.webmanifest" crossorigin="use-credentials" />
68-
<link rel="stylesheet" href="%PUBLIC_URL%/dsfr/dsfr.min.css" />
69-
<link rel="stylesheet" href="%PUBLIC_URL%/dsfr/utility/icons/icons.min.css" />
70-
\`\`\`
71-
72-
#### src/index.tsx
73-
74-
\`\`\`diff {0}
75-
import React from 'react';
76-
import ReactDOM from 'react-dom/client';
77-
import App from './App';
78-
+import { startDsfrReact } from "@codegouvfr/react-dsfr";
79-
+startDsfrReact({ "defaultColorScheme": "system" });
80-
const root = ReactDOM.createRoot(
81-
document.getElementById('root') as HTMLElement
82-
);
83-
root.render(
84-
<React.StrictMode>
85-
<App />
86-
</React.StrictMode>
87-
);
88-
\`\`\`
89-
90-
You can find an example setup [here](https://github.com/codegouvfr/dsfr-react/tree/main/src/test/frameworks/cra).
91-
92-
`}</Markdown>;
45+
`}</Markdown>
9346

94-
95-
<Tabs
96-
tabs={[
97-
{ "label": "Create React App", "content": craContent },
98-
{ "label": "Tab 2", "iconId": "fr-icon-ball-pen-fill", "content": <p>Content of tab2</p> },
99-
{ "label": "Tab 3", "content": <p>Content of tab3</p> }
100-
]}
101-
/>

src/lib/tools/memoize.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ export function memoize<Args extends (number | boolean | string)[], R>(
1111
return ((...args: Args) => {
1212
const key = JSON.stringify(args.slice(0, argsLength).join("-sIs9sAslOdeWlEdIos3-"));
1313

14-
console.log(key, JSON.stringify({ argsLength, args }));
15-
1614
if (key in cache) {
1715
return cache[key];
1816
}

0 commit comments

Comments
 (0)