Skip to content
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

snippet templates example #57

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

abvthecity
Copy link
Contributor

@abvthecity abvthecity commented Nov 25, 2024

This PR demonstrates the capability of MDX-based templates inside of Fern Docs.

View preview here: https://plantstore-preview-4060c464-0483-462b-8ff9-fb872582f36a.docs.buildwithfern.com/get-started/snippet-templates

This example should be cleaned up a bit before merging.


experimental:
mdx-components:
- ./docs/snippets
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is required at the moment for ESM imports to discover these files


Below are 2 code snippets that are templated using the `code-template` mdx-based component.

<Template title="Example 1" components={props.components}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the moment there's a bug where components={props.components} need to be passed in explicitly. We'll need to fix this on our side so it's handled automatically.

Copy link

@fern-api fern-api deleted a comment from github-actions bot Nov 25, 2024
@fern-api fern-api deleted a comment from github-actions bot Nov 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant