-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
2,442 additions
and
2 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import styles from "./style.module.css"; | ||
|
||
export function OptionTable({ | ||
options, | ||
}: { | ||
options: [JSX.Element, JSX.Element, JSX.Element][]; | ||
}) { | ||
return ( | ||
<div | ||
className={ | ||
"-mx-6 mb-4 mt-6 overflow-x-auto overscroll-x-contain px-6 pb-4 " + | ||
styles.container | ||
} | ||
> | ||
<table className="w-full border-collapse text-sm"> | ||
<thead> | ||
<tr className="border-b py-4 text-left dark:border-neutral-700"> | ||
<th className="py-2 font-semibold">Option</th> | ||
<th className="py-2 pl-6 font-semibold">Type</th> | ||
<th className="px-6 py-2 font-semibold">Description</th> | ||
</tr> | ||
</thead> | ||
<tbody className="align-baseline text-gray-900 dark:text-gray-100"> | ||
{options.map(([option, type, description], index) => ( | ||
<tr | ||
key={index} | ||
className="border-b border-gray-100 dark:border-neutral-700/50" | ||
> | ||
<td className="whitespace-pre py-2 font-mono text-xs font-semibold leading-6 text-violet-600 dark:text-violet-500"> | ||
{option} | ||
</td> | ||
<td className="whitespace-pre py-2 pl-6 font-mono text-xs font-semibold leading-6 text-slate-500 dark:text-slate-400"> | ||
{type} | ||
</td> | ||
<td className="py-2 pl-6">{description}</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</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,13 @@ | ||
.container { | ||
mask-image: linear-gradient( | ||
to right, | ||
transparent 0.8em, | ||
white 1.5em, | ||
white calc(100% - 1.5em), | ||
transparent calc(100% - 0.8em) | ||
); | ||
} | ||
|
||
.container::-webkit-scrollbar { | ||
appearance: none; | ||
} |
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,6 @@ | ||
.counter { | ||
border: 1px solid #ccc; | ||
border-radius: 5px; | ||
padding: 2px 6px; | ||
margin: 12px 0 0; | ||
} |
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,24 @@ | ||
// Example from https://beta.reactjs.org/learn | ||
|
||
import { useState } from 'react' | ||
import styles from './counters.module.css' | ||
|
||
function MyButton() { | ||
const [count, setCount] = useState(0) | ||
|
||
function handleClick() { | ||
setCount(count + 1) | ||
} | ||
|
||
return ( | ||
<div> | ||
<button onClick={handleClick} className={styles.counter}> | ||
Clicked {count} times | ||
</button> | ||
</div> | ||
) | ||
} | ||
|
||
export default function MyApp() { | ||
return <MyButton /> | ||
} |
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 @@ | ||
import nextra from "nextra"; | ||
|
||
const withNextra = nextra({ | ||
theme: "nextra-theme-docs", | ||
themeConfig: "./theme.config.tsx", | ||
}); | ||
|
||
export default withNextra({ | ||
reactStrictMode: true, | ||
eslint: { ignoreDuringBuilds: true }, | ||
typescript: { ignoreBuildErrors: true }, | ||
}); |
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,32 @@ | ||
{ | ||
"name": "nextra-docs-template", | ||
"version": "0.0.1", | ||
"description": "Nextra docs template", | ||
"scripts": { | ||
"build": "next build", | ||
"dev": "next dev", | ||
"start": "next start" | ||
}, | ||
"prettier": "@rao-pics/prettier-config", | ||
"eslintConfig": { | ||
"extends": [ | ||
"@rao-pics/eslint-config/base", | ||
"@rao-pics/eslint-config/nextjs", | ||
"@rao-pics/eslint-config/react" | ||
], | ||
"root": true | ||
}, | ||
"dependencies": { | ||
"next": "^13.4.19", | ||
"nextra": "latest", | ||
"nextra-theme-docs": "latest", | ||
"react": "18.2.0", | ||
"react-dom": "18.2.0" | ||
}, | ||
"devDependencies": { | ||
"@rao-pics/eslint-config": "workspace:*", | ||
"@rao-pics/prettier-config": "workspace:*", | ||
"@rao-pics/tailwind-config": "workspace:*", | ||
"@rao-pics/tsconfig": "workspace:*" | ||
} | ||
} |
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,5 @@ | ||
import "../style.css"; | ||
|
||
export default function App({ Component, pageProps }) { | ||
return <Component {...pageProps} />; | ||
} |
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 @@ | ||
{ | ||
"index": "Introduction", | ||
"another": "Another Page", | ||
"advanced": "Advanced (A Folder)", | ||
"about": { | ||
"title": "About", | ||
"type": "page" | ||
}, | ||
"contact": { | ||
"title": "Contact ↗", | ||
"type": "page", | ||
"href": "https://twitter.com/shuding_", | ||
"newWindow": true | ||
} | ||
} |
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,3 @@ | ||
# About | ||
|
||
This is the about page! This page is shown on the navbar. |
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,3 @@ | ||
# Advanced | ||
|
||
This is the index page for the Advanced folder! |
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,3 @@ | ||
# Satori | ||
|
||
Satori (悟り) is a Japanese Buddhist term for awakening, "comprehension; understanding". |
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,37 @@ | ||
# Another Page | ||
|
||
```js filename="demo.js" {3} copy | ||
let a = 1; | ||
|
||
console.log(a); | ||
``` | ||
|
||
import { OptionTable } from "@components/OptionTable"; | ||
|
||
<OptionTable options={[[1, 2, 3]]} /> | ||
|
||
## Component | ||
|
||
import { useState } from "react"; | ||
|
||
{/* Import CSS modules */} | ||
import styles from '../components/counters.module.css' | ||
|
||
export const Counter = () => { | ||
const [count, setCount] = useState(0); | ||
return ( | ||
<div> | ||
<button onClick={() => setCount(count + 1)} className={styles.counter}> | ||
Clicked {count} times | ||
</button> | ||
</div> | ||
); | ||
}; | ||
|
||
<Counter /> | ||
|
||
## External Component | ||
|
||
import Counters from "../components/counters"; | ||
|
||
<Counters /> |
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,11 @@ | ||
# Introduction | ||
|
||
Welcome to Nextra! This is a basic docs template. You can use it as a starting point for your own project :) | ||
|
||
## What is Nextra? | ||
|
||
A **simple**, **powerful** and **flexible** site generation framework with everything you love from Next.js. | ||
|
||
## Documentation | ||
|
||
The documentation is available at [https://nextra.site](https://nextra.site). |
Oops, something went wrong.