-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
[docs] Parse markdown on mount #20601
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 28 commits
Commits
Show all changes
35 commits
Select commit
Hold shift + click to select a range
57884a1
[docs] render /components/buttons markdown at build time
eps1lon b70eb0e
temp: build all locales
eps1lon 1489e85
fix: Move prepareMarkdown into own file
eps1lon d62f0d4
chore: name require methods
eps1lon c6dabe3
chore: extract MarkdownElement
eps1lon 934cf67
feat: prepared markdown works without MarkdownDocs.new
eps1lon 5038793
fix: reintroduce bundler level raw loader
eps1lon 7977914
[docs] Switch /company to new markdown handling
eps1lon 835509c
f
eps1lon 2b142db
[docs] Apply MarkdownDocs.new to all pages
eps1lon 6ebc7b9
MarkdownDocs.new -> MarkdownDocs
eps1lon daad550
fix: restore /versions
eps1lon d5fc434
docs: move blog to new markdown handling
eps1lon 619ce95
chore: cleanup markdown handling
eps1lon 4b83e3c
chore: use dedicated prop for rendered markdown
eps1lon 1d107cb
fix: /versions cleanup
eps1lon 7dc0f59
MarkdownElement.new -> MarkdownElement
eps1lon 93ab66f
format
eps1lon 1c83763
f markdown element
eps1lon c959c5c
fix: /api/ pages
eps1lon b79dec6
fix(MarkdownDocs): requireDemo is only required for demos
eps1lon 8342259
fix: never flip markdown element text
eps1lon 8fef6c4
fix: restore backers for landing page
eps1lon 707b037
fix: Highlight code at runtime
eps1lon e485fac
fix: fallback to english for untranslated pages
eps1lon f53d164
fix: fix prop type error in grid
eps1lon f787291
fix: update docs:api
eps1lon b4f1645
chore: explain raw-loader
eps1lon 11d35cd
only send the locales we need to
oliviertassinari c918ae7
Revert "only send the locales we need to"
oliviertassinari 95ba579
fix ssr mismatch
oliviertassinari 3ca42c3
Remove unnecessary async
eps1lon 5eb4c33
AppTableOfContents.new -> AppTableOfContents
eps1lon d4cf31f
fix: trim code before highlighting
eps1lon 4d63852
chore: explain `more` workaround
eps1lon File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './alert-title.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/alert-title'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /alert-title\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
eps1lon marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './alert.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/alert'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /alert\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './app-bar.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/app-bar'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /app-bar\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './autocomplete.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/autocomplete'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /autocomplete\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './avatar-group.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/avatar-group'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /avatar-group\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './avatar.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/avatar'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /avatar\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './backdrop.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/backdrop'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /backdrop\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './badge.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/badge'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /badge\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './bottom-navigation-action.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/bottom-navigation-action'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /bottom-navigation-action\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './bottom-navigation.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/bottom-navigation'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /bottom-navigation\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './breadcrumbs.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/breadcrumbs'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /breadcrumbs\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './button-base.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/button-base'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /button-base\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './button-group.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/button-group'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /button-group\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './button.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/button'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /button\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './card-action-area.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/card-action-area'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /card-action-area\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './card-actions.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/card-actions'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /card-actions\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './card-content.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/card-content'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /card-content\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './card-header.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/card-header'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /card-header\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,16 @@ | ||
| import React from 'react'; | ||
| import MarkdownDocs from 'docs/src/modules/components/MarkdownDocs'; | ||
| import markdown from './card-media.md'; | ||
| import { prepareMarkdown } from 'docs/src/modules/utils/parseMarkdown'; | ||
|
|
||
| export default function Page() { | ||
| return <MarkdownDocs markdown={markdown} />; | ||
| const pageFilename = 'api/card-media'; | ||
| const requireRaw = require.context('!raw-loader!./', false, /card-media\.md$/); | ||
|
|
||
| // eslint-disable-next-line react/prop-types | ||
| export default function Page({ docs }) { | ||
| return <MarkdownDocs docs={docs} />; | ||
| } | ||
|
|
||
| Page.getInitialProps = async () => { | ||
| const { demos, docs } = prepareMarkdown({ pageFilename, requireRaw }); | ||
| return { demos, docs }; | ||
| }; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.