-
Notifications
You must be signed in to change notification settings - Fork 0
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
22 changed files
with
4,383 additions
and
1 deletion.
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,36 @@ | ||
name: GitHub Pages deploy | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Use Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: "20" | ||
|
||
- uses: pnpm/action-setup@v4 | ||
with: | ||
version: 8 | ||
|
||
- name: Change working directory | ||
run: cd website | ||
|
||
- name: Installing packages | ||
run: pnpm ci | ||
|
||
- name: Build | ||
run: pnpm run build | ||
|
||
- name: Deploy 🚀 | ||
uses: JamesIves/github-pages-deploy-action@v4.6.0 | ||
with: | ||
branch: gh-pages | ||
folder: out |
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
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 @@ | ||
.next | ||
node_modules | ||
out/ |
Empty file.
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 @@ | ||
// export { locales as middleware } from "nextra/locales"; |
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 @@ | ||
/// <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. |
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,27 @@ | ||
const withNextra = require("nextra")({ | ||
theme: "nextra-theme-docs", | ||
themeConfig: "./theme.config.tsx", | ||
}); | ||
|
||
module.exports = withNextra({ | ||
output: "export", | ||
// i18n: { | ||
// locales: ["en", "zh"], | ||
// defaultLocale: "en", | ||
// }, | ||
assetPrefix: "./", | ||
basePath: "https://github.com/ziteh/elebox", | ||
images: { | ||
loader: "akamai", | ||
path: "", | ||
unoptimized: true, | ||
remotePatterns: [ | ||
{ | ||
protocol: "https", | ||
hostname: "i.imgur.com", | ||
port: "", | ||
pathname: "/**", | ||
}, | ||
], | ||
}, | ||
}); |
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,22 @@ | ||
{ | ||
"name": "elebox-website", | ||
"scripts": { | ||
"dev": "next dev", | ||
"build": "next build", | ||
"start": "next start" | ||
}, | ||
"dependencies": { | ||
"@emotion/react": "^11.13.0", | ||
"@emotion/styled": "^11.13.0", | ||
"@mui/material": "^5.16.5", | ||
"next": "^14.2.5", | ||
"nextra": "^2.13.4", | ||
"nextra-theme-docs": "^2.13.4", | ||
"react": "^18.3.1", | ||
"react-dom": "^18.3.1" | ||
}, | ||
"devDependencies": { | ||
"@types/node": "^20.14.12", | ||
"typescript": "^5.5.4" | ||
} | ||
} |
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,19 @@ | ||
import * as React from "react"; | ||
import { ThemeProvider, createTheme, CssBaseline } from "@mui/material"; | ||
|
||
const App = ({ Component, pageProps }) => { | ||
const muiTheme = createTheme({ | ||
palette: { | ||
mode: "dark", | ||
}, | ||
}); | ||
|
||
return ( | ||
<ThemeProvider theme={muiTheme}> | ||
<CssBaseline /> | ||
<Component {...pageProps} /> | ||
</ThemeProvider> | ||
); | ||
}; | ||
|
||
export default App; |
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,18 @@ | ||
{ | ||
"index": { | ||
"title": "Home", | ||
"type": "page", | ||
"display": "hidden", | ||
"theme": { | ||
"layout": "raw" | ||
} | ||
}, | ||
"docs": { | ||
"title": "Docs", | ||
"type": "page" | ||
}, | ||
"about": { | ||
"title": "About", | ||
"type": "page" | ||
} | ||
} |
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 @@ | ||
# About | ||
|
||
Elebox is licensed under either [Apache-2.0](https://github.com/ziteh/elebox/blob/main/LICENSE-APACHE) or [MIT license](https://github.com/ziteh/elebox/blob/main/LICENSE-MIT). | ||
|
||
This website built with [Next.js](https://nextjs.org/) and [Nextra](https://github.com/shuding/nextra) theme. |
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,7 @@ | ||
{ | ||
"overview": "Overview", | ||
"get-started": "Get started", | ||
"gui": "GUI", | ||
"cli": "CLI", | ||
"data-field": "Data Field" | ||
} |
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,101 @@ | ||
import Alert from "@mui/material/Alert"; | ||
import AlertTitle from "@mui/material/AlertTitle"; | ||
import Box from "@mui/material/Box"; | ||
|
||
# CLI | ||
|
||
Command line edition of Elebox, powered by [clap](https://docs.rs/clap/latest/clap/). | ||
|
||
<Box mt={4}> | ||
<Alert severity="warning">CLI currently has limited functionality.</Alert> | ||
</Box> | ||
|
||
## Usage | ||
|
||
<Box mt={4}> | ||
<Alert severity="info"> | ||
If you're run via Cargo workspace (i.e. not using the released executable), | ||
replace `elebox` with `cargo run -p elebox-cli --` in the following command. | ||
For example, use `cargo run -p elebox-cli -- help` instead of `elebox help`. | ||
</Alert> | ||
</Box> | ||
|
||
### Basic | ||
|
||
Print help message: | ||
|
||
```bash copy | ||
elebox help | ||
``` | ||
|
||
Use and operate on the default database path and filename `./elebox.db`: | ||
|
||
```bash copy | ||
elebox COMMAND | ||
``` | ||
|
||
or a specified `./my_box.db`: | ||
|
||
```bash copy | ||
elebox my_box.db COMMAND | ||
``` | ||
|
||
where `COMMAND` can be `init`, `part`, `category`, `export` or `import`. | ||
|
||
### Init | ||
|
||
You need to initialize a database before you can proceed with the next steps. | ||
|
||
Create and initialize a new database with the default path: | ||
|
||
```bash copy | ||
elebox init | ||
``` | ||
|
||
### Category | ||
|
||
List part categories: | ||
|
||
```bash copy | ||
elebox category | ||
``` | ||
|
||
Create a new part category named `MCU`: | ||
|
||
```bash copy | ||
elebox category new MCU | ||
``` | ||
|
||
Create new part category named `ARM` and `RISC-V`, and designate them as a subcategory of `MCU`: | ||
|
||
```bash copy | ||
elebox category new ARM -p MCU | ||
elebox category new "RISC-V" -p MCU | ||
``` | ||
|
||
### Part | ||
|
||
List parts: | ||
|
||
```bash copy | ||
elebox part | ||
``` | ||
|
||
Create a new part named `RP2040` with a part category of `ARM`, and a quantity of `25`: | ||
|
||
```bash copy | ||
elebox part new RP2040 25 ARM | ||
``` | ||
|
||
Consume or restock 10 `RP2040`: | ||
|
||
```bash copy | ||
elebox part use RP2040 10 | ||
elebox part add RP2040 10 | ||
``` | ||
|
||
Rename `RP2040` to `rpi-RP2040`: | ||
|
||
```bash copy | ||
elebox part update RP2040 "rpi-RP2040" | ||
``` |
Oops, something went wrong.