Skip to content

Commit

Permalink
doc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Mar 15, 2024
1 parent 0f1790e commit 985dedf
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
15 changes: 11 additions & 4 deletions core/README.md
Expand Up @@ -45,7 +45,7 @@ const source = `

export default function Demo() {
return (
<MarkdownPreview source={source} />
<MarkdownPreview source={source} style={{ padding: 16 }} />
)
}
```
Expand All @@ -68,6 +68,7 @@ export default function Demo() {
return (
<MarkdownPreview
source={source}
style={{ padding: 16 }}
rehypeRewrite={(node, index, parent) => {
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
parent.children = parent.children.slice(1)
Expand Down Expand Up @@ -103,6 +104,7 @@ export default function Demo() {
return (
<MarkdownPreview
source={source}
style={{ padding: 16 }}
rehypeRewrite={(node, index, parent) => {
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
parent.children = parent.children.slice(1)
Expand Down Expand Up @@ -138,6 +140,7 @@ export default function Demo() {
return (
<MarkdownPreview
source={source}
style={{ padding: 16 }}
rehypeRewrite={(node, index, parent) => {
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
parent.children = parent.children.slice(1)
Expand Down Expand Up @@ -169,7 +172,7 @@ function () {

export default function Demo() {
return (
<MarkdownPreview source={source} />
<MarkdownPreview source={source} style={{ padding: 16 }} />
);
}
```
Expand Down Expand Up @@ -199,6 +202,7 @@ export default function Demo() {
return (
<MarkdownPreview
source={source}
style={{ padding: 16 }}
rehypeRewrite={(node, index, parent) => {
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
parent.children = parent.children.slice(1)
Expand Down Expand Up @@ -228,6 +232,7 @@ export default function Demo() {
return (
<MarkdownPreview
source={source}
style={{ padding: 16 }}
rehypeRewrite={(node, index, parent) => {
if (node.tagName === "a" && parent && /^h(1|2|3|4|5|6)/.test(parent.tagName)) {
parent.children = parent.children.slice(1)
Expand Down Expand Up @@ -271,6 +276,7 @@ export default function Demo() {
return (
<MarkdownPreview
source={source}
style={{ padding: 16 }}
components={{
code: ({ children = [], className, ...props }) => {
if (typeof children === 'string' && /^\$\$(.*)\$\$/.test(children)) {
Expand Down Expand Up @@ -384,6 +390,7 @@ export default function Demo() {
return (
<MarkdownPreview
source={source}
style={{ padding: 16 }}
components={{
code: Code
}}
Expand Down Expand Up @@ -414,7 +421,7 @@ const source = `
const rehypePlugins = [rehypeSanitize];
export default function Demo() {
return (
<MarkdownPreview source={source} rehypePlugins={rehypePlugins} />
<MarkdownPreview source={source} rehypePlugins={rehypePlugins} style={{ padding: 16 }} />
)
}
```
Expand Down Expand Up @@ -638,7 +645,7 @@ const source = `>

export default function Demo() {
return (
<MarkdownPreview source={source} />
<MarkdownPreview source={source} style={{ padding: 16 }} />
)
}
```
Expand Down
4 changes: 2 additions & 2 deletions website/package.json
Expand Up @@ -8,7 +8,7 @@
"map": "source-map-explorer build/static/js/*.js --html build/website-result.html"
},
"dependencies": {
"@uiw/react-markdown-preview-example": "^2.0.0",
"@uiw/react-markdown-preview-example": "^2.1.3",
"@uiw/react-shields": "^2.0.1",
"katex": "^0.16.9",
"mermaid": "^10.6.1",
Expand All @@ -21,7 +21,7 @@
"@kkt/less-modules": "^7.4.7",
"@kkt/scope-plugin-options": "^7.4.7",
"kkt": "^7.4.7",
"markdown-react-code-preview-loader": "^2.1.5",
"markdown-react-code-preview-loader": "^2.1.8",
"prettier": "^2.8.4",
"pretty-quick": "^3.1.3",
"react-test-renderer": "^18.2.0",
Expand Down

0 comments on commit 985dedf

Please sign in to comment.