-
Notifications
You must be signed in to change notification settings - Fork 2
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
89 changed files
with
10,805 additions
and
0 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,3 @@ | ||
{ | ||
"extends": "next/core-web-vitals" | ||
} |
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,36 @@ | ||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | ||
|
||
# dependencies | ||
/node_modules | ||
/.pnp | ||
.pnp.js | ||
.yarn/install-state.gz | ||
|
||
# testing | ||
/coverage | ||
|
||
# next.js | ||
/.next/ | ||
/out/ | ||
|
||
# production | ||
/build | ||
|
||
# misc | ||
.DS_Store | ||
*.pem | ||
|
||
# debug | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
|
||
# local env files | ||
.env*.local | ||
|
||
# vercel | ||
.vercel | ||
|
||
# typescript | ||
*.tsbuildinfo | ||
next-env.d.ts |
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,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2024 Mohd. Nisab | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,75 @@ | ||
## Documentation Template | ||
|
||
This feature-packed documentation template, built with Next.js, offers a sleek and responsive design, perfect for all your project documentation needs. | ||
|
||
<br/> | ||
|
||
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app). | ||
|
||
## Getting Started | ||
|
||
First, run the development server: | ||
|
||
```bash | ||
npm run dev | ||
# or | ||
yarn dev | ||
# or | ||
pnpm dev | ||
# or | ||
bun dev | ||
``` | ||
|
||
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. | ||
|
||
You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. | ||
|
||
This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font. | ||
|
||
## Learn More | ||
|
||
To learn more about Next.js, take a look at the following resources: | ||
|
||
- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. | ||
- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. | ||
|
||
You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome! | ||
|
||
## Deploy on Vercel | ||
|
||
The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. | ||
|
||
Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details. | ||
|
||
[![Deploy with Vercel](https://vercel.com/button)](https://vercel.com/new/clone?repository-url=https://github.com/nisabmohd/Documentation-Template) | ||
|
||
Got it! Here's a way to present the features in a more structured and visually appealing way using a table: | ||
|
||
|
||
|
||
|
||
## Features | ||
|
||
```plaintext | ||
Features | ||
├── MDX supported | ||
├── Syntax highlighting | ||
├── Table of contents | ||
├── Pagination | ||
├── Search | ||
├── Code line highlight & code title | ||
├── Static site generation | ||
├── Custom components | ||
├── Light mode & dark mode | ||
├── Code Switcher | ||
├── Code copy | ||
└── Table of content observer highlight | ||
``` | ||
|
||
|
||
|
||
<img src="./public/screely-1719313562121.png" /> | ||
<img src="./public/screely-1719313578041.png" /> | ||
<img src="./public/screely-1719313622174.png" /> | ||
<img src="./public/screely-1719313611520.png" /> | ||
<img src="./public/screely-1719313597608.png" /> |
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,14 @@ | ||
import { Leftbar } from "@/components/leftbar"; | ||
|
||
export default function DocsLayout({ | ||
children, | ||
}: Readonly<{ | ||
children: React.ReactNode; | ||
}>) { | ||
return ( | ||
<div className="flex items-start gap-14"> | ||
<Leftbar /> | ||
<div className="flex-[4]">{children}</div>{" "} | ||
</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,59 @@ | ||
import DocsBreadcrumb from '@/components/docs-breadcrumb' | ||
import Pagination from '@/components/pagination' | ||
import Toc from '@/components/toc' | ||
import { page_routes } from '@/lib/routes-config' | ||
import { notFound } from 'next/navigation' | ||
import { getMarkdownForSlug } from '@/lib/markdown' | ||
import { PropsWithChildren, cache } from 'react' | ||
|
||
type PageProps = { | ||
params: { slug: string[] } | ||
} | ||
|
||
const cachedGetMarkdownForSlug = cache(getMarkdownForSlug) | ||
|
||
export default async function DocsPage({ params: { slug = [] } }: PageProps) { | ||
const pathName = slug.join('/') | ||
const res = await cachedGetMarkdownForSlug(pathName) | ||
|
||
if (!res) notFound() | ||
return ( | ||
<div className="flex items-start gap-12"> | ||
<div className="flex-[3] pt-10"> | ||
<DocsBreadcrumb paths={slug} /> | ||
<Markdown> | ||
<h1>{res.frontmatter.title}</h1> | ||
<p className="-mt-4 text-muted-foreground text-[16.5px]">{res.frontmatter.description}</p> | ||
<div>{res.content}</div> | ||
<Pagination pathname={pathName} /> | ||
</Markdown> | ||
</div> | ||
<Toc path={pathName} /> | ||
</div> | ||
) | ||
} | ||
|
||
function Markdown({ children }: PropsWithChildren) { | ||
return ( | ||
<div className="prose prose-zinc dark:prose-invert prose-code:font-code dark:prose-code:bg-neutral-900 dark:prose-pre:bg-neutral-900 prose-code:bg-neutral-100 prose-pre:bg-neutral-100 prose-headings:scroll-m-20 w-[85vw] sm:w-full sm:mx-auto prose-code:text-sm prose-code:leading-6 dark:prose-code:text-white prose-code:text-neutral-800 prose-code:p-1 prose-code:rounded-md prose-pre:border pt-2 prose-code:before:content-none prose-code:after:content-none"> | ||
{children} | ||
</div> | ||
) | ||
} | ||
|
||
export async function generateMetadata({ params: { slug = [] } }: PageProps) { | ||
const pathName = slug.join('/') | ||
const res = await cachedGetMarkdownForSlug(pathName) | ||
if (!res) return null | ||
const { frontmatter } = res | ||
return { | ||
title: frontmatter.title, | ||
description: frontmatter.description, | ||
} | ||
} | ||
|
||
export function generateStaticParams() { | ||
return page_routes.map((item) => ({ | ||
slug: item.href.split('/'), | ||
})) | ||
} |
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,34 @@ | ||
"use client"; // Error components must be Client Components | ||
|
||
import { Button } from "@/components/ui/button"; | ||
import { useEffect } from "react"; | ||
|
||
export default function Error({ | ||
error, | ||
reset, | ||
}: { | ||
error: Error & { digest?: string }; | ||
reset: () => void; | ||
}) { | ||
useEffect(() => { | ||
// Log the error to an error reporting service | ||
console.error(error); | ||
}, [error]); | ||
|
||
return ( | ||
<div className="min-h-[99vh] px-2 py-8 flex flex-col gap-3 items-start"> | ||
<div> | ||
<h2 className="text-5xl font-bold">Oops!</h2> | ||
<p className="text-muted-foreground">Something went wrong!</p> | ||
</div> | ||
<Button | ||
onClick={ | ||
// Attempt to recover by trying to re-render the segment | ||
() => reset() | ||
} | ||
> | ||
Try again | ||
</Button> | ||
</div> | ||
); | ||
} |
Binary file not shown.
Oops, something went wrong.