Skip to content

Commit

Permalink
doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
Leo5661 committed Nov 5, 2024
1 parent 474ba2b commit 1cb66a0
Show file tree
Hide file tree
Showing 24 changed files with 710 additions and 439 deletions.
File renamed without changes.
7 changes: 4 additions & 3 deletions apps/docs/content/docs/cli.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@
title: CodeGen CLI
description: Use CLI to quickly generate pre-built templates.
---
<Callout>
**Note:** The `codegen` CLI is stil in development. More features will be added.
</Callout>

To use the `codegen-cli` you have to use `cgen` shorthand command. The syntax is.

```sh
cgen [options] [command]

```
<Callout>
**Note:** The `codegen` CLI is stil in development. More features will be added.
</Callout>

## Command
---
### init
Expand Down
37 changes: 25 additions & 12 deletions apps/docs/content/docs/installation.mdx
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
---
title: Installation
description: Install CodeGen CLI
---


<div className="steps">
<div className="step">Install CLI</div>
<Steps>

```package-install
<Step>
### Install CodeGen CLI
Let's start by installing the CodeGen CLI globally:

```package-install
npm i codegen-cli -g
```
<div className="step">Initialize project</div>
```
</Step>

<Step>
### Initialize project

Run the ```init``` command to create a new project of your choice:
Run the ```init``` command to create a new project of your choice:

```sh
cgen init
```
</Step>

<div className="step">Configure project</div>
<Step>
### Configure project

You will be prompted few quusetion to configure your project:
You will be prompted few quusetion to configure your project:

```html
1. Name your project?
Expand All @@ -34,11 +41,17 @@ description: Install CodeGen CLI
5. Which database and ORM do you want to use for my-project?

```
</Step>

<Step>
### That's It

You can now start working on your project 🎉 Happy coding.

</Step>

<div className="step">That's It</div>
</Steps>

You can now start working on your project 🎉 Happy coding.
</div>



8 changes: 5 additions & 3 deletions apps/docs/content/docs/introduction.mdx
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
---
title: Introduction
description: Quickly generate pre-built templates with database integration and customizable styles. Start your projects faster and focus on building amazing applications!
---
import { File, Folder, Files } from 'fumadocs-ui/components/files';

CodeGen is a universal create-app CLI designed to swiftly generate production-ready templates. It seamlessly integrates databases with various ORMs and allows full customization of project styles. With CodeGen, you can expedite your project setup, enabling you to concentrate on developing outstanding applications. Streamline your development process, minimize repetitive tasks, and implement best practices from the start.

## Why CodeGen?.
## Why CodeGen?

As a developer, we have a lot to take care of, when starting a new project there are many things to configure and setup it's boring and time-consuming. many frameworks, languages, styling, databases, or other packages. Solution?

**CodeGen** to automate and streamline all this setup and config 🚀.

## Features
CodeGen is a universal create-app CLI to quickly genrate production level TypeScript/JavaScript projects. Here are the some of the features:

<Features/>


2 changes: 1 addition & 1 deletion apps/docs/content/docs/meta.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Guid",
"root": true,
"pages": ["introduction", "--- Guide ---", "installation", "cli", "templates"]
"pages": ["---Getting Started---","introduction", "--- Guide ---", "installation", "cli", "templates"]
}
1 change: 0 additions & 1 deletion apps/docs/content/docs/templates.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
---
title: Templates
description: All the templates and configurations available in CodeGen.
---
import TemplatesList from '../../src/components/template-list';

Expand Down
13 changes: 11 additions & 2 deletions apps/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"type-check": "tsc --noEmit"
},
"dependencies": {
"@codegen/ui": "workspace:*",
"@types/mdx": "^2.0.13",
"@vercel/og": "^0.6.3",
"fumadocs-core": "^13.4.10",
"fumadocs-docgen": "^1.2.0",
"fumadocs-mdx": "^10.0.2",
Expand All @@ -23,7 +23,16 @@
"nextra-theme-docs": "^2.13.4",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"sharp": "^0.33.5"
"sharp": "^0.33.5",
"@radix-ui/react-icons": "^1.3.0",
"@tabler/icons-react": "^3.21.0",
"class-variance-authority": "^0.7.0",
"clsx": "^2.1.1",
"cobe": "^0.6.3",
"framer-motion": "^11.11.11",
"tailwind-merge": "^2.5.2",
"tailwindcss-animate": "^1.0.7",
"zod": "^3.23.8"
},
"devDependencies": {
"@codegen/eslint-config": "workspace:*",
Expand Down
21 changes: 9 additions & 12 deletions apps/docs/source.config.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
import { remarkInstall } from 'fumadocs-docgen';
import { defineDocs, defineConfig } from 'fumadocs-mdx/config';
import { remarkInstall } from "fumadocs-docgen";
import { defineDocs, defineConfig } from "fumadocs-mdx/config";

export const { docs, meta } = defineDocs();

export default defineConfig({
generateManifest: true,
lastModifiedTime: 'git',
mdxOptions: {
remarkPlugins: [
[remarkInstall, {persist: { id: 'package-manager'}}]
]
}

})
generateManifest: true,
lastModifiedTime: "git",
mdxOptions: {
remarkPlugins: [[remarkInstall, { persist: { id: "package-manager" } }]],
},
});
76 changes: 52 additions & 24 deletions apps/docs/src/app/docs/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,56 +1,84 @@
import { source } from '@/src/app/source';
import type { Metadata } from 'next';
import { source } from "@/src/app/source";
import type { Metadata } from "next";
import {
DocsPage,
DocsBody,
DocsTitle,
DocsDescription,
} from 'fumadocs-ui/page';
import { notFound } from 'next/navigation';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import { Tab, Tabs } from 'fumadocs-ui/components/tabs';

} from "fumadocs-ui/page";
import { notFound } from "next/navigation";
import defaultMdxComponents from "fumadocs-ui/mdx";
import { Tab, Tabs } from "fumadocs-ui/components/tabs";
import { Features } from "@/src/components/block/features";
import { Step, Steps } from "fumadocs-ui/components/steps";

export default async function Page({
params,
}: {
params: { slug?: string[] };
}) {
console.log(params.slug);

const page = source.getPage(params.slug);

console.log(page);

if (!page) notFound();

const MDX = page.data.body;

return (
<DocsPage
toc={page.data.toc}
tableOfContent={{style: 'clerk'}}
tableOfContentPopover={{style: 'clerk'}}
<DocsPage
toc={page.data.toc}
tableOfContent={{
style: "clerk",
}}
tableOfContentPopover={{ style: "clerk" }}
full={page.data.full}
editOnGithub={{
owner: "Leo5661",
repo: "codegen",
path: "apps/docs/content/docs",
}}
>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={{Tab, Tabs, ...defaultMdxComponents }} />
<MDX
components={{
...defaultMdxComponents,
Step,
Steps,
Tab,
Tabs,
Features,
}}
/>
</DocsBody>
</DocsPage>
);
}

export async function generateStaticParams() {
return source.generateParams();
}

export function generateMetadata({ params }: { params: { slug?: string[] } }) {
const page = source.getPage(params.slug);

if (!page) notFound();


const { title, description } = page.data;
const pageSlug = page.file.path;

return {
title: page.data.title,
title,
description,
openGraph: {
title,
description,
type: "website",
url: `https://codegen-beta.vercel.app/docs/${pageSlug}`,
},
twitter: {
card: "summary",
title,
description,
},
} satisfies Metadata;
}
}
Loading

0 comments on commit 1cb66a0

Please sign in to comment.