You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*Syntax highlighting and autosave for comments on GitHub (and other other markdown-friendly places).*
3
+
*Syntax highlighting and autosave for comments on GitHub (and other other markdown-friendly websites).*
4
4
5
5
- "Syntax highlighting is the lie that enables us to see the truth."
6
6
- "The meaning of life is to find your lost comment drafts. The purpose of life is to post them."
@@ -12,6 +12,6 @@ TODO: screenshot of comment draft storage and restoration
12
12
If there's something you'd like to add or fix, see [CONTRIBUTING.md](CONTRIBUTING.md).
13
13
14
14
Special thanks to:
15
-
-[overtype](https://github.com/panphora/overtype) for the trick which makes syntax highlighting possible
16
-
-[shiki](https://github.com/shikijs/shiki) for the broad library of syntax highlighters
15
+
-[overtype](https://overtype.dev/) for doing `textarea`syntax highlighting of `md`
16
+
-[highlight.js](https://highlightjs.org/) for the broad library of syntax highlighters
17
17
-[Yukai Huang](https://github.com/Yukaii) for [the PRs](https://github.com/panphora/overtype/issues?q=is%3Apr+author%3AYukaii) which made the two work together
Copy file name to clipboardExpand all lines: browser-extension/README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,7 +17,7 @@
17
17
-`npm run biome` - runs `biome check` (lint & formatting)
18
18
-`npm run biome:fix` - fixes most of what `biome check` finds
19
19
-`npm run compile` - typechecking
20
-
-`npm run test` - vitest
20
+
-`npm test` - vitest
21
21
22
22
### Deployment
23
23
-`npm run build` - build for mv3 for most browsers
@@ -27,10 +27,18 @@
27
27
28
28
This is a [WXT](https://wxt.dev/)-based browser extension that
29
29
30
-
- finds `textarea` components and decorates them with [overtype](https://overtype.dev/) and [shiki](https://github.com/shikijs/shiki).
30
+
- finds `textarea` components and decorates them with [overtype](https://overtype.dev/) and [highlight.js](https://highlightjs.org/)
31
31
- stores unposted comment drafts, and makes them easy to find via the extension popup
32
32
33
33
### Entry points
34
34
35
-
- src/entrypoints/content.ts - injected into every webpage
36
-
- src/entrypoints/popup - html/css/ts which opens when the extension's button gets clicked
35
+
-`src/entrypoints/content.ts` - injected into every webpage
36
+
-`src/entrypoints/popup` - html/css/ts which opens when the extension's button gets clicked
37
+
38
+
### Architecture
39
+
40
+
Every time a `textarea` shows up on a page, on initial load or later on, it gets passed to a list of `CommentEnhancer`s. Each one gets a turn to say "I can enhance this box!". They show that they can enhance it by returning a [`CommentSpot`, `Overtype`].
41
+
42
+
Those values get bundled up with the `HTMLTextAreaElement` itself into an `EnhancedTextarea`, which gets added to the `TextareaRegistry`. At some interval, draft edits will get saved by the browser extension (TODO).
43
+
44
+
When the `textarea` gets removed from the page, the `TextareaRegistry` is notified so that the `CommentSpot` can be marked as abandoned or submitted as appropriate (TODO).
0 commit comments