Skip to content

Commit

Permalink
docs(Extension): convert md to mdx files (#2026)
Browse files Browse the repository at this point in the history
* docs:(Extension): convert md to mdx files

* chore: ensure correct referencing mdx files from other files

* chore: make config pick up mdx as doc files

* chore(Tests): update snapshots

---------

Co-authored-by: Tobias Høegh <tobias@tujo.no>
  • Loading branch information
joakbjerk and tujoworker authored Feb 28, 2023
1 parent bd1231c commit 68c54ee
Show file tree
Hide file tree
Showing 413 changed files with 46 additions and 284 deletions.
5 changes: 3 additions & 2 deletions packages/dnb-design-system-portal/gatsby-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ const plugins = [
{
resolve: 'gatsby-source-filesystem',
options: {
path: `${__dirname}/src/docs`, //for .md (mdx) files
path: `${__dirname}/src/docs`, // for .mdx files
name: 'docs',
ignore: ['**/Examples.*', '**/*_not_in_use*'],
},
Expand All @@ -62,6 +62,7 @@ const plugins = [
options: {
ignore: [
'**/*.md',
'**/*.mdx',
'**/Examples.*',
'**/*_not_in_use*',
'**/demos/layout/Layout.js',
Expand All @@ -77,7 +78,7 @@ const plugins = [
{
resolve: 'gatsby-plugin-mdx',
options: {
extensions: ['.md'],
extensions: ['.mdx'],
mdxOptions: {
// More info of using plugins: https://github.com/mdx-js/mdx/blob/d4154b8c4a546d0b675826826f85014cc04098c2/docs/plugins.md
// rehypePlugins: [], // hastPlugins
Expand Down
2 changes: 1 addition & 1 deletion packages/dnb-design-system-portal/scripts/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ async function createNewChangelogVersion() {
const packageJson = await fs.readJson(file)
const changelogFilePath = path.resolve(
__dirname,
'../src/docs/EUFEMIA_CHANGELOG.md'
'../src/docs/EUFEMIA_CHANGELOG.mdx'
)
const content = await fs.readFile(changelogFilePath, 'utf-8')

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ menuTitle: 'Change log'
description: 'Change log, contact, etc.'
---

import ChangeLog from './EUFEMIA_CHANGELOG.md'
import ChangeLog from './EUFEMIA_CHANGELOG.mdx'
import ReleasesInfo from './design-system/changelog/info-about-releases'

# Change log of Eufemia
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ draft: true
order: 1
---

import ChangeLog from '../EUFEMIA_CHANGELOG.md'
import ChangeLog from '../EUFEMIA_CHANGELOG.mdx'
import ReleasesInfo from './changelog/info-about-releases'

# Change log of Eufemia
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ order: 1

import InlineImg from 'dnb-design-system-portal/src/shared/tags/Img'
import IconNearestNeighbour from 'Docs/quickguide-designer/assets/icon-nearest-neighbour.svg'
import FormStatusIcons from 'Docs/icons/form-status.md'
import FormStatusIcons from 'Docs/icons/form-status.mdx'

# Icon Details

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ icon: 'helper_classes'
order: 4
---

import FormStatusIcons from 'Docs/icons/form-status.md'
import FormStatusIcons from 'Docs/icons/form-status.mdx'

# Other Icons

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ title: 'Colors'
icon: 'colors'
---

import ColorsTable from 'Docs/quickguide-designer/colors-table.md'
import ColorsTable from 'Docs/quickguide-designer/colors-table.mdx'

# Colors

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ title: 'Fonts & Typography'
icon: 'fonts'
---

import TypographicRules from 'Docs/quickguide-designer/typography/typographic-rules.md'
import TypographicElements from 'Docs/quickguide-designer/typography/typographic-elements.md'
import FontWeights from 'Docs/quickguide-designer/typography/font-weights.md'
import LineHeight from 'Docs/quickguide-designer/typography/line-height.md'
import FontFamilies from 'Docs/quickguide-designer/typography/font-families.md'
import TypographicRules from 'Docs/quickguide-designer/typography/typographic-rules.mdx'
import TypographicElements from 'Docs/quickguide-designer/typography/typographic-elements.mdx'
import FontWeights from 'Docs/quickguide-designer/typography/font-weights.mdx'
import LineHeight from 'Docs/quickguide-designer/typography/line-height.mdx'
import FontFamilies from 'Docs/quickguide-designer/typography/font-families.mdx'

# Fonts & Typography

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ title: 'UI Library'
description: 'Buttons, dropdowns, input fields, components etc.'
---

import WelcomeAdvice from 'Docs/welcome-advice.md'
import WatchingReleases from 'Docs/uilib/info/about-watching-releases.md'
import WelcomeAdvice from 'Docs/welcome-advice.mdx'
import WatchingReleases from 'Docs/uilib/info/about-watching-releases.mdx'

# UI Library

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ icon: 'about_the_lib'
order: 1
---

import WelcomeAdvice from 'Docs/welcome-advice.md'
import WatchingReleases from 'Docs/uilib/info/about-watching-releases.md'
import WelcomeAdvice from 'Docs/welcome-advice.mdx'
import WatchingReleases from 'Docs/uilib/info/about-watching-releases.mdx'

# About the library

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ redirect_from:
- /uilib/releases
---

import WelcomeAdvice from 'Docs/welcome-advice.md'
import WelcomeAdvice from 'Docs/welcome-advice.mdx'
import GithubLogo from 'Docs/contribute/assets/github-logo.js'
import { Icon } from '@dnb/eufemia/src'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ redirect_from:
- /uilib/components/status-message/info
---

import FormStatusIcons from 'Docs/icons/form-status.md'
import FormStatusIcons from 'Docs/icons/form-status.mdx'

## Description

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ redirect_from:
- /uilib/components/number/provider
---

import ProviderInfo from 'Docs/uilib/usage/customisation/provider-info.md'
import ProviderInfo from 'Docs/uilib/usage/customisation/provider-info.mdx'

<ProviderInfo></ProviderInfo>
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
showTabs: true
---

import SpacingTable from 'Docs/uilib/usage/layout/spacing-table.md'
import SpacingTable from 'Docs/uilib/usage/layout/spacing-table.mdx'

## Description

Expand Down
Loading

0 comments on commit 68c54ee

Please sign in to comment.