Skip to content

Commit 601ebed

Browse files
committed
Initial commit
0 parents  commit 601ebed

24 files changed

Lines changed: 10061 additions & 0 deletions

.github/workflows/deploy.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
# Sample workflow for building and deploying a Next.js site to GitHub Pages
2+
#
3+
# To get started with Next.js see: https://nextjs.org/docs/getting-started
4+
#
5+
name: Deploy Next.js site to Pages
6+
7+
on:
8+
# Runs on pushes targeting the default branch
9+
push:
10+
branches: ["main"]
11+
12+
# Allows you to run this workflow manually from the Actions tab
13+
workflow_dispatch:
14+
15+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
16+
permissions:
17+
contents: read
18+
pages: write
19+
id-token: write
20+
21+
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
22+
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
23+
concurrency:
24+
group: "pages"
25+
cancel-in-progress: false
26+
27+
jobs:
28+
# Build job
29+
build:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- name: Checkout
33+
uses: actions/checkout@v4
34+
- name: Detect package manager
35+
id: detect-package-manager
36+
run: |
37+
if [ -f "${{ github.workspace }}/yarn.lock" ]; then
38+
echo "manager=yarn" >> $GITHUB_OUTPUT
39+
echo "command=install" >> $GITHUB_OUTPUT
40+
echo "runner=yarn" >> $GITHUB_OUTPUT
41+
exit 0
42+
elif [ -f "${{ github.workspace }}/package.json" ]; then
43+
echo "manager=npm" >> $GITHUB_OUTPUT
44+
echo "command=ci" >> $GITHUB_OUTPUT
45+
echo "runner=npx --no-install" >> $GITHUB_OUTPUT
46+
exit 0
47+
else
48+
echo "Unable to determine package manager"
49+
exit 1
50+
fi
51+
- name: Setup Node
52+
uses: actions/setup-node@v4
53+
with:
54+
node-version: "20"
55+
cache: ${{ steps.detect-package-manager.outputs.manager }}
56+
- name: Setup Pages
57+
uses: actions/configure-pages@v5
58+
59+
- name: Restore cache
60+
uses: actions/cache@v4
61+
with:
62+
path: |
63+
.next/cache
64+
# Generate a new cache whenever packages or source files change.
65+
key: ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-${{ hashFiles('**.[jt]s', '**.[jt]tsx') }}
66+
# If source files changed but packages didn't, rebuild from a prior cache.
67+
restore-keys: |
68+
${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json', '**/yarn.lock') }}-
69+
- name: Install dependencies
70+
run: ${{ steps.detect-package-manager.outputs.manager }} ${{ steps.detect-package-manager.outputs.command }}
71+
- name: Build with Next.js
72+
run: ${{ steps.detect-package-manager.outputs.runner }} next build
73+
- name: Upload artifact
74+
uses: actions/upload-pages-artifact@v3
75+
with:
76+
path: ./out
77+
78+
# Deployment job
79+
deploy:
80+
environment:
81+
name: github-pages
82+
url: ${{ steps.deployment.outputs.page_url }}
83+
runs-on: ubuntu-latest
84+
needs: build
85+
steps:
86+
- name: Deploy to GitHub Pages
87+
id: deployment
88+
uses: actions/deploy-pages@v4

.gitignore

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
.pnpm-debug.log*
32+
33+
# env files (can opt-in for committing if needed)
34+
.env*
35+
36+
# vercel
37+
.vercel
38+
39+
# typescript
40+
*.tsbuildinfo
41+
next-env.d.ts

README.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# MathStudio
2+
3+
**A professional Markdown editor designed for mathematics and coding.**
4+
5+
[**Live Demo / 在线体验**](https://matrixcqy.github.io/MathStudio/)
6+
7+
![MathStudio Preview](https://matrixcqy.github.io/MathStudio/preview-image-placeholder)
8+
*(Note: You can add a screenshot here later)*
9+
10+
## Features
11+
12+
- **LaTeX Support**: Write mathematical formulas easily with inline `$E=mc^2$` or block syntax.
13+
- **Code Highlighting**: Syntax highlighting for various programming languages.
14+
- **VS Code Style**: A clean, professional editing experience with dark mode support.
15+
- **Live Preview**: Real-time rendering of your Markdown content.
16+
- **File Management**:
17+
- Virtual file system (files/folders) persisted in browser.
18+
- Search functionality.
19+
- Import/Export capability (download `.md` files).
20+
- **Responsive Design**: Works on desktop, tablets, and mobile devices (with split-view support).
21+
22+
## Getting Started
23+
24+
To run this project locally:
25+
26+
1. Clone the repository:
27+
```bash
28+
git clone https://github.com/MatrixCQY/MathStudio.git
29+
```
30+
31+
2. Install dependencies:
32+
```bash
33+
npm install
34+
# or
35+
yarn install
36+
```
37+
38+
3. Run the development server:
39+
```bash
40+
npm run dev
41+
```
42+
43+
4. Open [http://localhost:3000](http://localhost:3000) with your browser.
44+
45+
## Deployment
46+
47+
This project is automatically deployed to GitHub Pages using GitHub Actions.
48+
49+
## Tech Stack
50+
51+
- **Framework**: [Next.js](https://nextjs.org) (App Router)
52+
- **Styling**: [Tailwind CSS v4](https://tailwindcss.com)
53+
- **Editor**: [Monaco Editor](https://microsoft.github.io/monaco-editor/)
54+
- **Markdown**: `react-markdown`, `remark-math`, `rehype-katex`, `rehype-highlight`
55+
- **Icons**: [Lucide React](https://lucide.dev)

eslint.config.mjs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { defineConfig, globalIgnores } from "eslint/config";
2+
import nextVitals from "eslint-config-next/core-web-vitals";
3+
import nextTs from "eslint-config-next/typescript";
4+
5+
const eslintConfig = defineConfig([
6+
...nextVitals,
7+
...nextTs,
8+
// Override default ignores of eslint-config-next.
9+
globalIgnores([
10+
// Default ignores of eslint-config-next:
11+
".next/**",
12+
"out/**",
13+
"build/**",
14+
"next-env.d.ts",
15+
]),
16+
]);
17+
18+
export default eslintConfig;

next.config.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
/* config options here */
5+
output: "export",
6+
// Ensure basePath matches the repository name
7+
basePath: "/MathStudio",
8+
// Optional: assetPrefix usually defaults to basePath, but setting it explicitly can help
9+
assetPrefix: "/MathStudio/",
10+
images: {
11+
unoptimized: true,
12+
},
13+
};
14+
15+
export default nextConfig;

0 commit comments

Comments
 (0)