Skip to content

Commit

Permalink
docs: initial docs (#25)
Browse files Browse the repository at this point in the history
* docs: initial docs
- Add typedoc to package.json.
- Add typedoc-plugin-markdown to package.json to generate markdown from TypeDoc in src.
- Add initial generated TypeDoc markdown to /docs.
- Add typedoc.json to configure out directory, markdown generation, and project entry point.

- Add docusaurus 'classic' for documentation UI.
  - Remove and update boilerplate code generated from Docusaurus initialization.
    - Update docs path to read markdown from /docs.
    - Remove blog and other irrelevant components.
    - Update links.
    - Ensure user is redirected to /docs from index.
- Add initial config for docusaurus

- Add new scripts to package.json
  - `docs:generate` - run shell script generate-docs.sh
  - `docs:dev` - launch the docusaurus dev server to view the docs
- Add generate-docs.sh
  - Run typedoc with npx to generate markdown files in /docs.
  - Ensures README.md in root of /docs is preserved.

* docs: customize output path
- Customize output path to rename default /functions directory to /Components.
  - /functions contains all TypeDoc converted to markdown in src.
  - Add custom-output.mjs to update name of directory.
- Ensure Welcome doc is in position 1 in sidebar.
  - Renaming /functions after markdown is generated repositions it to position 2.

- Create scripts/typedoc directory to organize scripts.
  - Move generate-docs.sh with updated paths.
  - Add custom-output.mjs
  - Update paths in package.json script docs:generate.

- Update Home Component in src/app/page.tsx.
  - Rename to Index.
  - Add return type.
  - Add TypeDoc
  - Generate markdown to docs/Components.

- Remove file extension from url using cleanUrl option in docusaurus.config.js.
- Clean up comments in docusaurus/sidebars.js.

* docs(build): fix build error on broken links
- Allow docusaurus to build onBrokenLinks.
  - Update option from `throw` to `warn`.

- Fix redirect bug using plugin-client-redirects.
  - Served with build files, docusaurus does not redirect from / to /docs using custom plugin `redirectToDocs`.
  - Install package plugin-client-redirects in docusaurus/package.json.
  - Setup redirect using plugin-client-redirects.

- Remove Functions section on Welcome page.
  - Section will need to be maintained with every new component and is not needed with sidebar.

- Reorganize scripts in package.json.
  - Move all docs scripts to bottom.

* docs(dev): restore redirectToDocs for docs dev server
- Add `redirectToDocs` back to `plugins` in docusaurus.config.js.
  - `redirectToDocs` redirects to /docs only in the dev server otherwise the server launches on / to a Not Found page requiring manual renavigation to main index page /docs.

* docs(gh-pages): configure docs website
- Install `gh-pages` as dev dependency.

- Fix url confliction preventing styles from rendering in docusaurus.config.js.
  - Merge docusaurus.config.js files into single config in /docusaurus.
  - Update base url.
    - Specify respository /the-cdj-ui.
    - Simplify `routeBasePath` to / from /docs.
      - Remove redirect `plugins`.

* docs(clean): remove unused static files
  • Loading branch information
hiyaryan authored Jan 1, 2025
1 parent e78e9c8 commit b7e44ab
Show file tree
Hide file tree
Showing 17 changed files with 19,061 additions and 2 deletions.
21 changes: 21 additions & 0 deletions docs/Components/default.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
[**the-cdj-ui**](../README.md)

***

[the-cdj-ui](../README.md) / default

# Function: default()

> **default**(): `JSX.Element`
The root component of the application. Serves as the entry point for
rendering all child components and establishing the primary structure of the
application.

## Returns

`JSX.Element`

## Defined in

[page.tsx:8](https://github.com/hiyaryan/the-cdj-ui/blob/b8e1b6af9ddc33969bbe4132b67de35ad0c004db/src/app/page.tsx#L8)
13 changes: 13 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: The CDJ UI
sidebar_label: Welcome
sidebar_position: 1
---

**Official Documentation**

---

# Welcome

This is the official documentation for [The CDJ UI](https://github.com/cognovi-ai/the-cdj-ui). These docs are intended to provide a comprehensive guide to the user interface of [The CDJ](https://github.com/cognovi-ai/the-cdj), including installation instructions, usage guides, and API references.
20 changes: 20 additions & 0 deletions docusaurus/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Dependencies
/node_modules

# Production
/build

# Generated files
.docusaurus
.cache-loader

# Misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*
41 changes: 41 additions & 0 deletions docusaurus/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Website

This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.

### Installation

```
$ yarn
```

### Local Development

```
$ yarn start
```

This command starts a local development server and opens up a browser window. Most changes are reflected live without having to restart the server.

### Build

```
$ yarn build
```

This command generates static content into the `build` directory and can be served using any static contents hosting service.

### Deployment

Using SSH:

```
$ USE_SSH=true yarn deploy
```

Not using SSH:

```
$ GIT_USER=<Your GitHub username> yarn deploy
```

If you are using GitHub pages for hosting, this command is a convenient way to build the website and push to the `gh-pages` branch.
95 changes: 95 additions & 0 deletions docusaurus/docusaurus.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
import { themes as prismThemes } from 'prism-react-renderer';

/** @type {import('@docusaurus/types').Config} */
const config = {
title: 'The CDJ UI Docs',
tagline: 'Official documentation for The CDJ UI',
favicon: 'img/favicon.ico',

url: 'https://cognovi-ai.github.io',
baseUrl: '/the-cdj-ui/',

// GitHub pages deployment config.
organizationName: 'Cognovi',
projectName: 'the-cdj-ui',

onBrokenLinks: 'warn',
onBrokenMarkdownLinks: 'warn',

i18n: {
defaultLocale: 'en',
locales: ['en'],
},

presets: [
[
'classic',
/** @type {import('@docusaurus/preset-classic').Options} */
({
docs: {
path: '../docs',
routeBasePath: '/',
sidebarPath: require.resolve('./sidebars.js'),
},
blog: false,
theme: {
customCss: require.resolve('./src/css/custom.css'),
},
}),
],
],

themeConfig:
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
({
navbar: {
items: [
{
type: 'docSidebar',
sidebarId: 'tutorialSidebar',
position: 'left',
label: 'The CDJ UI Docs',
style: {
fontSize: '1.2em',
fontWeight: 'bold',
},
},
{
href: 'https://github.com/cognovi-ai/the-cdj-ui',
label: 'GitHub',
position: 'right',
},
],
},
footer: {
style: 'dark',
links: [
{
title: 'About',
items: [
{
label: 'Cognovi',
href: 'https://github.com/cognovi-ai',
},
],
},
{
title: 'More',
items: [
{
label: 'GitHub',
href: 'https://github.com/cognovi-ai/the-cdj-ui',
},
],
},
],
copyright: `Copyright © ${new Date().getFullYear()} The CDJ UI Docs. Built with Docusaurus.`,
},
prism: {
theme: prismThemes.github,
darkTheme: prismThemes.dracula,
},
}),
};

export default config;
Loading

0 comments on commit b7e44ab

Please sign in to comment.