Skip to content

Commit

Permalink
Merge branch 'master' into feature/buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
Daviiddoo committed May 21, 2024
2 parents 7bb16f2 + c38ac24 commit c553daf
Show file tree
Hide file tree
Showing 19 changed files with 2,454 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/docs_deploy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Docs Deploy

on:
push:
branches: [master]
workflow_dispatch:

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages.
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: pages
cancel-in-progress: false

jobs:
build:
name: Build
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./docs
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: 20
- uses: pnpm/action-setup@v4
with:
version: 9
- uses: actions/configure-pages@v4

- run: pnpm install
- run: pnpm export

- uses: actions/upload-pages-artifact@v3
with:
path: ./docs/out

deploy:
name: Deploy
runs-on: ubuntu-latest
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.next
node_modules
out
21 changes: 21 additions & 0 deletions docs/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2022 Shu Ding

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.
6 changes: 6 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Forui Documentation
## Local Development

First, run `pnpm i` to install the dependencies.

Then, run `pnpm dev` to start the development server and visit localhost:3000.
6 changes: 6 additions & 0 deletions docs/components/counters.module.css
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;
}
24 changes: 24 additions & 0 deletions docs/components/counters.tsx
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 />
}
5 changes: 5 additions & 0 deletions docs/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
11 changes: 11 additions & 0 deletions docs/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
const withNextra = require('nextra')({
theme: 'nextra-theme-docs',
themeConfig: './theme.config.tsx',
});

module.exports = {
...withNextra(),
images: {
unoptimized: true,
},
};
26 changes: 26 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"name": "forui-docs",
"version": "0.0.1",
"description": "Documentation for Forui.",
"scripts": {
"dev": "next dev",
"build": "next build",
"export": "next build && next export",
"start": "next start"
},
"bugs": {
"url": "https://github.com/forus-labs/forui/issues"
},
"homepage": "https://forui.dev",
"dependencies": {
"next": "^13.0.6",
"nextra": "latest",
"nextra-theme-docs": "latest",
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/node": "18.11.10",
"typescript": "^4.9.3"
}
}
16 changes: 16 additions & 0 deletions docs/pages/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"index": {
"title": "Home",
"type": "page"
},
"docs": {
"title": "Documentation",
"type": "page"
},
"contact": {
"title": "About ↗",
"type": "page",
"href": "https://foruslabs.com",
"newWindow": true
}
}
5 changes: 5 additions & 0 deletions docs/pages/docs/_meta.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"index": "Introduction",
"another": "Another Page",
"advanced": "Advanced (A Folder)"
}
3 changes: 3 additions & 0 deletions docs/pages/docs/advanced.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Advanced

This is the index page for the Advanced folder!
3 changes: 3 additions & 0 deletions docs/pages/docs/advanced/satori.mdx
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".
31 changes: 31 additions & 0 deletions docs/pages/docs/another.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Another Page

```js filename="demo.js" {3} copy
let a = 1;

console.log(a);
```

## 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 />
11 changes: 11 additions & 0 deletions docs/pages/docs/index.mdx
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).
11 changes: 11 additions & 0 deletions docs/pages/index.mdx
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).
Loading

0 comments on commit c553daf

Please sign in to comment.