-
Notifications
You must be signed in to change notification settings - Fork 0
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
Update with-markdoc example #1
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PTAL @hideokamoto 🙏
@@ -4,20 +4,27 @@ This example shows using [Markdoc](https://github.com/markdoc/markdoc) as top le | |||
|
|||
## Deploy your own | |||
|
|||
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/markdoc) | |||
Deploy the example using [Vercel](https://vercel.com?utm_source=github&utm_medium=readme&utm_campaign=next-example) or preview live with [StackBlitz](https://stackblitz.com/github/vercel/next.js/tree/canary/examples/with-markdoc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hideokamoto I think I would prefer that these files are under markdoc/
, not with-markdoc/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the Next.js examples dir, all integration examples names start from with-XXX
.
- with-electron
- with-firebase
- with-stripe-typescript
- etc...
So I think with-markdoc
is better.
@@ -0,0 +1,6 @@ | |||
export const upper = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep the example even more minimal?
/* Use this file to export your markdoc functions */
@@ -0,0 +1,26 @@ | |||
/* Use this file to export your markdoc nodes */ | |||
const { nodes } = require('@markdoc/markdoc') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this file even more minimal? How I had it before.
@@ -0,0 +1,44 @@ | |||
const TYPE_MAP = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we keep this file even more minimal? How I had it before.
* @see https://markdoc.io/docs/nextjs#options | ||
*/ | ||
mode: 'server', // 'static' | 'server', | ||
//schemaPath: path.join(__dirname, 'markdoc') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please remove the options here. We want static
(the default). We also should remove the commented out schemaPath
I like the @see
comment you have here
mode: 'server', // 'static' | 'server', | ||
//schemaPath: path.join(__dirname, 'markdoc') | ||
})({ | ||
pageExtensions: ['js', 'tsx', 'md'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pageExtensions: ['js', 'tsx', 'md'], | |
pageExtensions: ['js', 'ts', 'md', 'mdoc'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's mdoc
?
I can't find any file like .mdoc
.
If we don't use this file extensions, we should remove it.
And also we must remain tsx
, because we're using this extension in pages/_app.tsx
@@ -1,4 +1,5 @@ | |||
{ | |||
"name": "with-markdoc", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can just remove this name I think
@@ -0,0 +1,6 @@ | |||
import type { AppProps } from 'next/app' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this _app
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For import '../public/globals.css'
.
@@ -16,3 +16,15 @@ If you want to get started right away with this boilerplate, either clone the [G | |||
## Get started from scratch | |||
|
|||
If you'd prefer to start from scratch, feel free to check out the [official repository](https://github.com/markdoc/markdoc) and [documentation site](https://markdoc.io/docs/getting-started). | |||
|
|||
## Custom Tag and node examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would remove this too
@mfix-stripe |
@hideokamoto we should explain how to use these features in the docs (https://markdoc.io/docs). The boilerplate should be minimal so folks can get up and running immediately, without having to delete a bunch of stuff we don't need. @charliegerard-stripe already created a Next.js boilerplate for us, which I'm happy with: https://github.com/markdoc/next.js-starter |
Your branch seems already updated to add the TypeScript feature. |
nodes
exampletags
examplefunctions
examplePlease feel free to merge this PR and mention it to the Next.js maintainers.
Thanks.