Releases: hashicorp/swingset
0.8.0
0.7.3
0.7.2
0.7.1
0.7.0
Minor Changes
- Add mdx options to
createStaticProps
: #20 (details) - Add
peerComponents
frontmatter attribute: #21 (details)
Patches
- Bugfix: remove hardcoded
/
from swingset page route: #19
New MDX Options
You can now pass mdxOptions
to swingset/createStaticProps
in order to customize the Markdown rendering on your documentation pages. The options are passed directly to the MDX compiler via next-mdx-remote
. For example, the following configuration would add code highlighting to any fenced code blocks:
import createPage from 'swingset/page'
import createStaticProps from 'swingset/getStaticProps'
import highlight from '@mapbox/rehype-prism'
export default createPage()
export const getStaticProps = createStaticProps({
mdxOptions: {
rehypePlugins: [[highlight, { ignoreMissing: true }]],
},
})
peerComponents
Previously, the only components available on a docs.mdx
page were the main component (componentName
in frontmatter), and any global components you pass to Swingset (like the default <PropsTable />
). Now, you can inject arbitrary components at the page level by specifying them in the new peerComponents
frontmatter attribute.
---
componentName: Button
peerComponents:
- AnimatedLoaderIcon
---
Welcome to the `Button` docs page! `Button` wraps its `children` in a button UI. Example:
<Button text="Click me">
<AnimatedLoaderIcon />
</Button>
Note: peerComponents
must also be present in Swingset (i.e., they have their own docs.mdx
page).
0.6.1
v0.6.0
0.5.1
0.5.0
This release exposes a new packageJson
prop to each component's page scope, if that component has a package.json
in its component.path
.
Minor Changes
- Expose package.json in component' docs page scopes: #13