Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add zero docs and example * added link to sidebar * Update docs/getting-started/zero.md Co-Authored-By: asadm <asad.lionpk@gmail.com>
- Loading branch information
Showing
7 changed files
with
75 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# Zero | ||
|
||
[Zero](https://zeroserver.io) is a no-config web framework for React, MDX, Nodejs, and Vue. It has built in support for MDX. To get started, install Zero (globally or locally in your project). | ||
|
||
## Installation | ||
|
||
```shell | ||
npm install -g zero | ||
``` | ||
|
||
## Writing MDX files | ||
|
||
Create a new directory for your project and add an `index.mdx` file with the following markdown: | ||
|
||
```markdown | ||
# My first MDX Page | ||
|
||
some awesome content | ||
``` | ||
|
||
Now, `cd` into your project directory and run `zero`. | ||
|
||
Zero has some additional features for MDX, you can [read them here](https://github.com/remoteinterview/zero/tree/master/docs/mdx). | ||
|
||
# Resources | ||
- [Example Project](https://github.com/mdx-js/mdx/tree/master/examples/zero) | ||
- [Zero GitHub](https://github.com/remoteinterview/zero/) | ||
- [Zero Website](https://zeroserver.io/) | ||
- [Zero MDX Docs](https://github.com/remoteinterview/zero/tree/master/docs/mdx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import React, { useState } from 'react'; | ||
|
||
module.exports = function Counter() { | ||
// Declare a new state variable, which we'll call "count" | ||
const [count, setCount] = useState(0); | ||
|
||
return ( | ||
<div> | ||
<p>You clicked {count} times</p> | ||
<button onClick={() => setCount(count + 1)}> | ||
Click me | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import Counter from './_counter.jsx'; | ||
|
||
# Hello, world! | ||
|
||
Zero supports MDX natively. | ||
You can import React components in an `.mdx` file. | ||
|
||
<Counter /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"private": true, | ||
"name": "zero-mdx", | ||
"version": "0.0.1", | ||
"scripts": { | ||
"start": "zero" | ||
}, | ||
"license": "MIT", | ||
"dependencies": { | ||
"zero": "latest" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Zero + MDX | ||
|
||
```shell | ||
npm install | ||
npm run dev | ||
``` | ||
|
||
[See documentation](https://mdxjs.com/getting-started/zero) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7f4f5b1
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.
Successfully aliased the URL https://mdx-mmt9f55oy.now.sh to the following aliases.