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

add mdx support #16

Closed
wants to merge 6 commits into from
Closed

add mdx support #16

wants to merge 6 commits into from

Conversation

michaelglass
Copy link
Collaborator

@michaelglass michaelglass commented Mar 1, 2024

adding mdx support for easier documentation writing (and proper markdown syntax highlighting)

quick side-track while writing voice compass docs

@michaelglass michaelglass changed the title markdown templating add mdx support Mar 1, 2024
@michaelglass michaelglass force-pushed the markdown-templating branch from 6bd9390 to 02a91e3 Compare March 1, 2024 17:39
@@ -40,17 +41,21 @@ export const Prose: FC<{ children: ReactNode; className?: string }> = ({
</div>
);

export const PageContent: FC<{ md: string }> = ({ md }) => (
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

this is backwards compatible until / if we migrate documentation to support mdx

@@ -6,7 +6,10 @@
"dev": "vite --force",
"build": "tsc && vite build"
},
"type": "module",
"dependencies": {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

mdxjs plays nicer with ESM

@@ -3,20 +3,14 @@ import { PageTitle } from "../components/PageTitle";
import { PageContent } from "../components/PageContent";
import { packageUrls } from "../constants";

export const content = `

<PageTitle pretitle="Introduction" title="Getting started" />
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

example mdx translation

@@ -160,7 +160,7 @@ export const routes: {
{
label: "Getting started",
url: "/headless-getting-started",
element: <HeadlessSetup />,
element: <HeadlessGettingStarted />,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

unrelated cleanup I did along the way

@michaelglass michaelglass force-pushed the markdown-templating branch from 2f7d94f to c04c95c Compare March 1, 2024 20:30
@michaelglass michaelglass marked this pull request as ready for review March 1, 2024 20:30
@michaelglass michaelglass force-pushed the markdown-templating branch from c04c95c to 78d99f3 Compare March 1, 2024 20:34
@michaelglass michaelglass marked this pull request as draft March 1, 2024 21:07
@michaelglass michaelglass marked this pull request as ready for review March 1, 2024 22:26
@michaelglass michaelglass force-pushed the markdown-templating branch from 20f620c to 417143a Compare March 1, 2024 22:28
@michaelglass michaelglass requested a review from jakub-nlx March 4, 2024 09:28
@michaelglass michaelglass marked this pull request as draft March 4, 2024 10:38
@michaelglass michaelglass deleted the markdown-templating branch March 4, 2024 11:04
@michaelglass
Copy link
Collaborator Author

this seems to be a bad fit considering mdx doesn't have native interpolation in code blocks

the workarounds make dealing with code / pre decoration annoying. So stick with the status quo

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.

3 participants