|
1 | 1 | # coderchart |
2 | 2 |
|
3 | | -> a chrome extension tools built with Vite + React, and Manifest v3 |
| 3 | +Chrome extension that renders Mermaid diagrams inline wherever ChatGPT (or another whitelisted site) shows a Mermaid code fence. Built with Vite, React, and Manifest V3. |
4 | 4 |
|
5 | | -## Installing |
| 5 | +## Features |
6 | 6 |
|
7 | | -1. Check if your `Node.js` version is >= **14**. |
8 | | -2. Change or configurate the name of your extension on `src/manifest`. |
9 | | -3. Run `npm install` to install the dependencies. |
| 7 | +- Auto-detects Mermaid snippets on supported pages and renders them beneath the original code block. |
| 8 | +- Handles live chat updates via a MutationObserver and avoids duplicate work with lightweight bookkeeping. |
| 9 | +- Resilient error messaging when Mermaid parsing fails. |
| 10 | +- Options page to toggle auto-rendering and manage the site whitelist powered by `chrome.storage.sync`. |
| 11 | +- Download rendered diagrams as SVG or PNG straight from the inline toolbar. |
10 | 12 |
|
11 | | -## Developing |
| 13 | +## Getting Started |
12 | 14 |
|
13 | | -run the command |
14 | | - |
15 | | -```shell |
16 | | -$ cd coderchart |
17 | | - |
18 | | -$ npm run dev |
| 15 | +```bash |
| 16 | +pnpm install |
| 17 | +pnpm dev |
19 | 18 | ``` |
20 | 19 |
|
21 | | -### Chrome Extension Developer Mode |
22 | | - |
23 | | -1. set your Chrome browser 'Developer mode' up |
24 | | -2. click 'Load unpacked', and select `coderchart/build` folder |
25 | | - |
26 | | -### Nomal FrontEnd Developer Mode |
| 20 | +The dev server pipes hot reloads into the extension. Load the unpacked folder shown in the terminal (usually `dist`) via Chrome's Extensions page while Developer Mode is enabled. |
27 | 21 |
|
28 | | -1. access `http://0.0.0.0:3000/` |
29 | | -2. when debugging popup page, open `http://0.0.0.0:3000//popup.html` |
30 | | -3. when debugging options page, open `http://0.0.0.0:3000//options.html` |
| 22 | +### Options & Settings |
31 | 23 |
|
32 | | -## Packing |
| 24 | +- Open `options.html` during development (served at `http://localhost:5173/options.html`) to manage the whitelist or disable auto rendering. |
| 25 | +- Saved settings sync across Chrome instances via `chrome.storage.sync`. |
33 | 26 |
|
34 | | -After the development of your extension run the command |
| 27 | +## Building |
35 | 28 |
|
36 | | -```shell |
37 | | -$ npm run build |
| 29 | +```bash |
| 30 | +pnpm run build |
38 | 31 | ``` |
39 | 32 |
|
40 | | -Now, the content of `build` folder will be the extension ready to be submitted to the Chrome Web Store. Just take a look at the [official guide](https://developer.chrome.com/webstore/publish) to more infos about publishing. |
| 33 | +The production bundle lands in `dist/`. Package it manually or use `pnpm run zip` for a distributable archive. |
41 | 34 |
|
42 | 35 | --- |
43 | 36 |
|
44 | | -Generated by [create-chrome-ext](https://github.com/guocaoyi/create-chrome-ext) |
| 37 | +Bootstrapped with [create-chrome-ext](https://github.com/guocaoyi/create-chrome-ext) |
0 commit comments