├── .prettierrc.json ├── .gitignore ├── .eslintignore ├── commitlint.config.cjs ├── docs ├── icon.psd ├── icon-large.png ├── icon-chatgpt.png ├── demo-recording.gif ├── demo-screenshot.png ├── demo-show-diagram.png ├── screenshot-debugging-xpath.png ├── screenshots │ ├── 2-class-diagram.png │ ├── 3-graph-diagram.png │ ├── 4-sequence-diagram.png │ └── 1-flowchart-diagram.png ├── chrome-web-store-assets │ └── extension-details.md └── icon-mermaidjs.svg ├── .husky ├── pre-commit └── commit-msg ├── src ├── images │ ├── icon16.png │ ├── icon32.png │ ├── icon48.png │ └── icon128.png ├── lib │ ├── configuration.ts │ ├── __test_files__ │ │ └── code-blocks.html │ ├── test-utils.ts │ ├── extension.ts │ ├── render-diagram.ts │ ├── extension.test.ts │ ├── chatgpt-dom.ts │ ├── prepare-code-block.ts │ ├── chatgpt-dom.test.ts │ ├── prepare-code-block.test.ts │ └── render-diagram.test.ts ├── setup-jest.js ├── options.html ├── manifest.json ├── content.ts └── options.ts ├── .prettierignore ├── .eslintrc.yaml ├── tsconfig.json ├── makefile ├── LICENSE ├── .github └── workflows │ ├── pull-request.yaml │ └── main.yaml ├── jest.config.mjs ├── package.json ├── webpack.config.js ├── CHANGELOG.md └── README.md /.prettierrc.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | dist/ 3 | release/ 4 | node_modules/ 5 | coverage/ 6 | -------------------------------------------------------------------------------- /.eslintignore: -------------------------------------------------------------------------------- 1 | # Ignore artifacts. 2 | build 3 | coverage 4 | dist 5 | CHANGELOG.md 6 | -------------------------------------------------------------------------------- /commitlint.config.cjs: -------------------------------------------------------------------------------- 1 | module.exports = { extends: ["@commitlint/config-conventional"] }; 2 | -------------------------------------------------------------------------------- /docs/icon.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/icon.psd -------------------------------------------------------------------------------- /.husky/pre-commit: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx lint-staged 5 | -------------------------------------------------------------------------------- /docs/icon-large.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/icon-large.png -------------------------------------------------------------------------------- /docs/icon-chatgpt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/icon-chatgpt.png -------------------------------------------------------------------------------- /src/images/icon16.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/src/images/icon16.png -------------------------------------------------------------------------------- /src/images/icon32.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/src/images/icon32.png -------------------------------------------------------------------------------- /src/images/icon48.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/src/images/icon48.png -------------------------------------------------------------------------------- /.husky/commit-msg: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | . "$(dirname -- "$0")/_/husky.sh" 3 | 4 | npx --no -- commitlint --edit 5 | -------------------------------------------------------------------------------- /docs/demo-recording.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/demo-recording.gif -------------------------------------------------------------------------------- /docs/demo-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/demo-screenshot.png -------------------------------------------------------------------------------- /src/images/icon128.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/src/images/icon128.png -------------------------------------------------------------------------------- /docs/demo-show-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/demo-show-diagram.png -------------------------------------------------------------------------------- /docs/screenshot-debugging-xpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/screenshot-debugging-xpath.png -------------------------------------------------------------------------------- /docs/screenshots/2-class-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/screenshots/2-class-diagram.png -------------------------------------------------------------------------------- /docs/screenshots/3-graph-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/screenshots/3-graph-diagram.png -------------------------------------------------------------------------------- /docs/screenshots/4-sequence-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/screenshots/4-sequence-diagram.png -------------------------------------------------------------------------------- /docs/screenshots/1-flowchart-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/dwmkerr/chatgpt-diagrams-extension/HEAD/docs/screenshots/1-flowchart-diagram.png -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Ignore artifacts. 2 | build 3 | coverage 4 | dist 5 | CHANGELOG.md 6 | makefile 7 | .eslintignore 8 | 9 | # We need to keep the samples as close to the origin ChatGPT page as possible. 10 | samples/ 11 | src/lib/__test_files__/ 12 | -------------------------------------------------------------------------------- /src/lib/configuration.ts: -------------------------------------------------------------------------------- 1 | export enum DisplayMode { 2 | BelowDiagram = "BelowDiagram", 3 | AsTabs = "AsTabs", 4 | } 5 | 6 | export class Configuration { 7 | displayMode: DisplayMode; 8 | 9 | constructor(displayMode: DisplayMode) { 10 | this.displayMode = displayMode; 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /src/setup-jest.js: -------------------------------------------------------------------------------- 1 | // Polyfill the TextEncoder/TextDecoder as this is no longer done by jsdom. 2 | // https://stackoverflow.com/questions/68468203/why-am-i-getting-textencoder-is-not-defined-in-jest 3 | import { TextEncoder, TextDecoder } from "util"; 4 | Object.assign(global, { TextDecoder, TextEncoder }); 5 | -------------------------------------------------------------------------------- /.eslintrc.yaml: -------------------------------------------------------------------------------- 1 | extends: 2 | - "prettier" 3 | - "plugin:@typescript-eslint/recommended" 4 | plugins: 5 | - "prettier" 6 | - "@typescript-eslint" 7 | env: 8 | browser: true 9 | node: true 10 | parser: "@typescript-eslint/parser" 11 | parserOptions: 12 | ecmaVersion: 2019 13 | sourceType: module 14 | rules: 15 | prettier/prettier: ["error"] 16 | -------------------------------------------------------------------------------- /src/lib/__test_files__/code-blocks.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 |Sample One
6 | Sample Two
9 | Sample Three
12 | Here's a simple diagram:
11 |12 |24 | 25 |13 |23 |14 | mermaid 15 | 16 |17 |18 |22 |graph LR 19 | A[Browser] --> B{Send HTTP Request} 20 |21 |
This flowchart illustrates a basic web request.
26 |Here's a simple diagram:
48 |49 |64 | 65 |50 |63 |51 | mermaid 52 | 53 | 54 | 55 |56 |57 |61 | 62 |graph LR 58 | A[Browser] --> B{Send HTTP Request} 59 |60 |
This flowchart illustrates a basic web request.
66 |Here's a simple diagram:
32 |33 |46 | 47 | 48 |34 |45 |35 | mermaid 36 | 37 | 38 |39 |40 |44 |graph LR 41 | A[Browser] --> B{Send HTTP Request} 42 |43 |
This flowchart illustrates a basic web request.
49 |Here's an invalid diagram:
73 |74 |90 | 91 | 92 |75 |89 |76 | mermaid 77 | 78 | 79 |80 |81 |88 |82 | type Vector2D = { 83 | x: number; 84 | y: number; 85 | }; 86 |87 |
This flowchart illustrates a basic web request.
93 |Here's an invalid diagram:
113 |114 |130 | 131 | 132 |115 |129 |116 | mermaid 117 | 118 | 119 |120 |121 |128 |122 | type Vector2D = { 123 | x: number; 124 | y: number; 125 | }; 126 |127 |
This flowchart illustrates a basic web request.
133 |