@quietmind/mdx-docs 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +277 -0
- package/dist/404.html +21 -0
- package/dist/index.css +1 -0
- package/dist/index.js +1265 -0
- package/dist/vite.svg +1 -0
- package/package.json +80 -0
- package/src/vite.config.helper.js +38 -0
package/README.md
ADDED
|
@@ -0,0 +1,277 @@
|
|
|
1
|
+
# Quietmind Wiki
|
|
2
|
+
|
|
3
|
+
https://quietmind.dev/
|
|
4
|
+
|
|
5
|
+
## ๐ Quick Start
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js (version 16 or higher)
|
|
10
|
+
- Yarn package manager
|
|
11
|
+
|
|
12
|
+
### Installation
|
|
13
|
+
|
|
14
|
+
Clone the repository:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
git clone https://github.com/ezrafree/quietmind-dev.git && \
|
|
18
|
+
cd quietmind-dev
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Install dependencies:
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
yarn
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Start the development server:
|
|
28
|
+
|
|
29
|
+
```sh
|
|
30
|
+
yarn dev
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Open [http://localhost:5173](http://localhost:5173) in your browser
|
|
34
|
+
|
|
35
|
+
## ๐ Available Scripts
|
|
36
|
+
|
|
37
|
+
| Command | Description |
|
|
38
|
+
|---------|-------------|
|
|
39
|
+
| `yarn dev` | Start development server |
|
|
40
|
+
| `yarn build` | Build for production |
|
|
41
|
+
| `yarn preview` | Preview production build locally |
|
|
42
|
+
| `yarn serve` | Preview production build with network access |
|
|
43
|
+
| `yarn lint` | Run ESLint |
|
|
44
|
+
| `yarn test` | Run tests |
|
|
45
|
+
| `yarn test:watch` | Run tests in watch mode |
|
|
46
|
+
| `yarn test:coverage` | Run tests with coverage |
|
|
47
|
+
| `yarn test:ui` | Run tests with UI |
|
|
48
|
+
| `yarn deploy` | Deploy to GitHub Pages |
|
|
49
|
+
|
|
50
|
+
## ๐ Tech Stack
|
|
51
|
+
|
|
52
|
+
- **Frontend**: React 19, Material-UI 7, Emotion
|
|
53
|
+
- **Build Tool**: Vite 6
|
|
54
|
+
- **Routing**: React Router DOM 7
|
|
55
|
+
- **Documentation**: MDX 3
|
|
56
|
+
- **Testing**: Vitest, Testing Library
|
|
57
|
+
- **Deployment**: GitHub Pages
|
|
58
|
+
|
|
59
|
+
## ๐ Documentation Structure
|
|
60
|
+
|
|
61
|
+
### Adding New Pages
|
|
62
|
+
|
|
63
|
+
Create a new MDX file in `src/contents/`:
|
|
64
|
+
|
|
65
|
+
```mdx
|
|
66
|
+
# My New Page
|
|
67
|
+
|
|
68
|
+
This is my new documentation page with **markdown** and React components.
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
Update the pages configuration in `src/config/pages.js`:
|
|
72
|
+
|
|
73
|
+
```js
|
|
74
|
+
import MyNewPageMDX from "../contents/my-new-page.mdx";
|
|
75
|
+
|
|
76
|
+
export const pages = [
|
|
77
|
+
// ... existing pages
|
|
78
|
+
{
|
|
79
|
+
name: "My New Page",
|
|
80
|
+
route: "/my-new-page",
|
|
81
|
+
component: MyNewPageMDX,
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### MDX Features
|
|
87
|
+
|
|
88
|
+
- **Code Blocks**: Syntax highlighting with copy buttons
|
|
89
|
+
- **Inline Code**: Styled inline code snippets
|
|
90
|
+
- **React Components**: Embed any React component directly in MDX
|
|
91
|
+
- **External Links**: Automatically open in new tabs
|
|
92
|
+
|
|
93
|
+
## ๐จ Theming
|
|
94
|
+
|
|
95
|
+
### Customizing Colors
|
|
96
|
+
|
|
97
|
+
Update the theme files to customize the appearance:
|
|
98
|
+
|
|
99
|
+
- **Light Theme**: `src/themes/lightTheme.js`
|
|
100
|
+
- **Dark Theme**: `src/themes/darkTheme.js`
|
|
101
|
+
|
|
102
|
+
Example theme customization:
|
|
103
|
+
|
|
104
|
+
```js
|
|
105
|
+
export const lightTheme = {
|
|
106
|
+
palette: {
|
|
107
|
+
primary: {
|
|
108
|
+
main: '#1976d2',
|
|
109
|
+
},
|
|
110
|
+
secondary: {
|
|
111
|
+
main: '#dc004e',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### Theme Hook
|
|
118
|
+
|
|
119
|
+
Use the `useTheme` hook to access theme state:
|
|
120
|
+
|
|
121
|
+
```js
|
|
122
|
+
import { useTheme } from './hooks/useTheme';
|
|
123
|
+
|
|
124
|
+
function MyComponent() {
|
|
125
|
+
const { darkMode, setDarkMode } = useTheme();
|
|
126
|
+
// ...
|
|
127
|
+
}
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## ๐๏ธ Project Structure
|
|
131
|
+
|
|
132
|
+
```none
|
|
133
|
+
src/
|
|
134
|
+
โโโ components/ # React components
|
|
135
|
+
โ โโโ AppBar.jsx # Top navigation bar
|
|
136
|
+
โ โโโ CodeBlock.jsx # Syntax highlighted code blocks
|
|
137
|
+
โ โโโ InlineCode.jsx # Inline code styling
|
|
138
|
+
โ โโโ MDXContent.jsx # MDX content renderer
|
|
139
|
+
โ โโโ SideNavigation.jsx # Sidebar navigation
|
|
140
|
+
โโโ config/
|
|
141
|
+
โ โโโ pages.js # Page configuration
|
|
142
|
+
โโโ contents/ # MDX documentation files
|
|
143
|
+
โ โโโ button.mdx
|
|
144
|
+
โ โโโ colors.mdx
|
|
145
|
+
โ โโโ home.mdx
|
|
146
|
+
โ โโโ typography.mdx
|
|
147
|
+
โโโ hooks/
|
|
148
|
+
โ โโโ useTheme.js # Theme management hook
|
|
149
|
+
โโโ themes/ # Material-UI themes
|
|
150
|
+
โ โโโ darkTheme.js
|
|
151
|
+
โ โโโ lightTheme.js
|
|
152
|
+
โ โโโ index.js
|
|
153
|
+
โโโ utils/
|
|
154
|
+
โโโ navigation.js # Navigation utilities
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
## ๐งช Testing
|
|
158
|
+
|
|
159
|
+
The project includes comprehensive tests with good coverage thresholds:
|
|
160
|
+
|
|
161
|
+
- **Unit Tests**: Component and utility testing
|
|
162
|
+
- **Coverage**: 70% minimum for branches, functions, lines, and statements
|
|
163
|
+
- **Tools**: Vitest, Testing Library, jsdom
|
|
164
|
+
|
|
165
|
+
Run tests:
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
# Run all tests
|
|
169
|
+
yarn test
|
|
170
|
+
|
|
171
|
+
# Watch mode
|
|
172
|
+
yarn test:watch
|
|
173
|
+
|
|
174
|
+
# With coverage
|
|
175
|
+
yarn test:coverage
|
|
176
|
+
|
|
177
|
+
# Interactive UI
|
|
178
|
+
yarn test:ui
|
|
179
|
+
```
|
|
180
|
+
|
|
181
|
+
## ๐ Deployment
|
|
182
|
+
|
|
183
|
+
### GitHub Pages
|
|
184
|
+
|
|
185
|
+
The project is configured for GitHub Pages deployment:
|
|
186
|
+
|
|
187
|
+
1. Update the `homepage` field in `package.json`
|
|
188
|
+
2. Run the deploy command:
|
|
189
|
+
|
|
190
|
+
```sh
|
|
191
|
+
yarn deploy
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
### Production Serving
|
|
195
|
+
|
|
196
|
+
To serve the app in production mode locally:
|
|
197
|
+
|
|
198
|
+
#### Option 1: Using Vite Preview (Recommended)
|
|
199
|
+
|
|
200
|
+
```sh
|
|
201
|
+
yarn build
|
|
202
|
+
yarn preview
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
This serves the production build at `http://localhost:4173` (or another port if 4173 is taken).
|
|
206
|
+
|
|
207
|
+
#### Option 2: Using Vite Preview with Network Access
|
|
208
|
+
|
|
209
|
+
```sh
|
|
210
|
+
yarn build
|
|
211
|
+
yarn serve
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
This serves the production build and makes it accessible on your local network.
|
|
215
|
+
|
|
216
|
+
#### Option 3: Using a Static File Server
|
|
217
|
+
|
|
218
|
+
Install a static server globally:
|
|
219
|
+
|
|
220
|
+
```sh
|
|
221
|
+
npm install -g serve
|
|
222
|
+
# or
|
|
223
|
+
yarn global add serve
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
Then build and serve:
|
|
227
|
+
|
|
228
|
+
```sh
|
|
229
|
+
yarn build
|
|
230
|
+
serve -s dist -l 3000
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
### Custom Deployment
|
|
234
|
+
|
|
235
|
+
For other hosting platforms (Netlify, Vercel, AWS S3, etc.), build the project and serve the `dist` folder:
|
|
236
|
+
|
|
237
|
+
```sh
|
|
238
|
+
yarn build
|
|
239
|
+
# Upload the dist/ directory to your hosting platform
|
|
240
|
+
```
|
|
241
|
+
|
|
242
|
+
## ๐ง Configuration
|
|
243
|
+
|
|
244
|
+
### Vite Configuration
|
|
245
|
+
|
|
246
|
+
The Vite config (`vite.config.js`) includes:
|
|
247
|
+
|
|
248
|
+
- MDX plugin configuration
|
|
249
|
+
- Emotion JSX runtime
|
|
250
|
+
- Dynamic base URL for GitHub Pages
|
|
251
|
+
|
|
252
|
+
### ESLint
|
|
253
|
+
|
|
254
|
+
ESLint is configured with:
|
|
255
|
+
|
|
256
|
+
- React and React Hooks rules
|
|
257
|
+
- Import organization
|
|
258
|
+
- Modern JavaScript standards
|
|
259
|
+
|
|
260
|
+
## ๐ค Contributing
|
|
261
|
+
|
|
262
|
+
1. Fork the repository
|
|
263
|
+
2. Create a feature branch: `git checkout -b feature/amazing-feature`
|
|
264
|
+
3. Commit your changes: `git commit -m 'Add amazing feature'`
|
|
265
|
+
4. Push to the branch: `git push origin feature/amazing-feature`
|
|
266
|
+
5. Open a Pull Request
|
|
267
|
+
|
|
268
|
+
## ๐ License
|
|
269
|
+
|
|
270
|
+
This project is open source and available under the [MIT License](LICENSE).
|
|
271
|
+
|
|
272
|
+
## ๐ Acknowledgments
|
|
273
|
+
|
|
274
|
+
- [MDX](https://mdxjs.com/) for the amazing documentation framework
|
|
275
|
+
- [Material-UI](https://mui.com/) for the beautiful component library
|
|
276
|
+
- [Vite](https://vitejs.dev/) for the lightning-fast build tool
|
|
277
|
+
- [Prism React Renderer](https://github.com/FormidableLabs/prism-react-renderer) for syntax highlighting
|
package/dist/404.html
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8" />
|
|
5
|
+
<title>Redirecting...</title>
|
|
6
|
+
</head>
|
|
7
|
+
<body>
|
|
8
|
+
<script>
|
|
9
|
+
// Get the current path
|
|
10
|
+
const path = window.location.pathname;
|
|
11
|
+
|
|
12
|
+
// Redirect to the main app with the route as a URL parameter
|
|
13
|
+
if (path && path !== "/") {
|
|
14
|
+
window.location.href = "/?redirect=" + encodeURIComponent(path);
|
|
15
|
+
} else {
|
|
16
|
+
window.location.href = "/";
|
|
17
|
+
}
|
|
18
|
+
</script>
|
|
19
|
+
<p>Redirecting...</p>
|
|
20
|
+
</body>
|
|
21
|
+
</html>
|
package/dist/index.css
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
:root{font-family:system-ui,Avenir,Helvetica,Arial,sans-serif;line-height:1.5;font-weight:400;color-scheme:light dark;color:#ffffffde;background-color:#242424;font-synthesis:none;text-rendering:optimizeLegibility;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}::selection{background-color:#1976d233;color:inherit}::-moz-selection{background-color:#1976d233;color:inherit}@media (prefers-color-scheme: dark){::selection{background-color:#90caf94d;color:inherit}::-moz-selection{background-color:#90caf94d;color:inherit}}a{font-weight:500;color:#646cff;text-decoration:inherit}a:hover{color:#535bf2}html,body{min-height:100vh;width:100%;margin:0;padding:0}h1{font-size:3.2em;line-height:1.1}button{border-radius:8px;border:1px solid transparent;padding:.6em 1.2em;font-size:1em;font-weight:500;font-family:inherit;background-color:#1a1a1a;cursor:pointer;transition:border-color .25s}button:hover{border-color:#646cff}button:focus,button:focus-visible{outline:4px auto -webkit-focus-ring-color}@media (prefers-color-scheme: light){:root{color:#213547;background-color:#fff}a:hover{color:#747bff}button{background-color:#f9f9f9}}@media (max-width: 600px){*{word-wrap:break-word;overflow-wrap:break-word}body{word-wrap:break-word;overflow-wrap:break-word;overflow-x:hidden}pre,code{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word}h1,h2,h3,h4,h5,h6,p{word-wrap:break-word;overflow-wrap:break-word}}@media (max-width: 378px){html,body{overflow-x:hidden;width:100%}*{word-wrap:break-word;overflow-wrap:break-word;max-width:100%}pre,code{white-space:pre-wrap;word-wrap:break-word;overflow-wrap:break-word;max-width:100%}}
|