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 with-markdoc/ example #36867

Merged
merged 15 commits into from
May 18, 2022
33 changes: 33 additions & 0 deletions examples/with-markdoc/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Next.js example

This is a boilerplate for a creating a documentation website using Markdoc and Next.js.
leerob marked this conversation as resolved.
Show resolved Hide resolved

## Setup

First, download this example and install the dependencies required:

```bash
npm install
# or
yarn install
```

Then, run the development server:

```bash
npm run dev
# or
yarn dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

You can start editing the page by modifying `index.md`. The page auto-updates as you edit the file.

## Deploy

The quickest way to deploy your own version of this boilerplate is by deploying it with [Vercel](https://vercel.com) by clicking the button below.

### Deploy with Vercel

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/markdoc/docs/tree/main/examples/simple-nextjs)
2 changes: 2 additions & 0 deletions examples/with-markdoc/markdoc/nodes/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Use this file to export your markdoc nodes */
export default {};
2 changes: 2 additions & 0 deletions examples/with-markdoc/markdoc/tags/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/* Use this file to export your markdoc tags */
export default {};
5 changes: 5 additions & 0 deletions examples/with-markdoc/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
const withMarkdoc = require('@markdoc/next.js');

module.exports = withMarkdoc()({
pageExtensions: ['js', 'md']
});
15 changes: 15 additions & 0 deletions examples/with-markdoc/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"private": true,
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
},
"dependencies": {
"@markdoc/markdoc": "*",
leerob marked this conversation as resolved.
Show resolved Hide resolved
"@markdoc/next.js": "*",
"next": "latest",
"react": "*",
"react-dom": "*"
}
}
5 changes: 5 additions & 0 deletions examples/with-markdoc/pages/_app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import '../public/globals.css';

export default function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />;
}
18 changes: 18 additions & 0 deletions examples/with-markdoc/pages/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Get started with Markdoc
description: How to get started with Markdoc
---

# Markdoc

This website is a lightweight boilerplate to spin up a documentation website with Markdoc.

## Quick start

If you want to get started right away with this boilerplate, either clone the [GitHub repository](https://github.com/markdoc/docs/tree/main/examples/simple-nextjs) or deploy a version of this site to Vercel by clicking the button below.

[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/markdoc/docs/tree/main/examples/simple-nextjs)

## 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).
Binary file added examples/with-markdoc/public/favicon.ico
Binary file not shown.
38 changes: 38 additions & 0 deletions examples/with-markdoc/public/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
body {
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'Noto Sans', sans-serif,
'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
color: rgba(60, 66, 87, 1);
margin: 0;
}

#__next {
display: grid;
grid-template-columns: 0.1fr 1fr 0.15fr;
grid-template-rows: 1fr 0.05fr;
height: 100vh;
}

article {
grid-column: 2 / 3;
grid-row: 1;
font-size: 16px;
padding: 4em 2em;
}

h1 {
font-size: 40px;
}

a {
color: rgba(75, 85, 99, 1);
}

h2 {
margin: 2em 0;
}

p {
line-height: 1.5em;
font-weight: 300;
}