From 27572b3c217e8774d1358dd7886666b8d3e048e4 Mon Sep 17 00:00:00 2001 From: Guyutongxue Date: Tue, 30 Jan 2024 16:39:44 +0800 Subject: [PATCH] lots of updates --- README.md | 2 +- docs/embed.md | 24 +++++++++++++++++++ docs/params.md | 23 ++++++++++++++++++ src/client.ts | 1 + src/config.ts | 17 ++++++++++++-- src/editor.ts | 17 ++++++++++---- src/embed.ts | 55 +++++++++++++++++++++++++++++++++++++++++++ src/main.ts | 56 +++++++++++++++++++++++++++++++++++--------- src/search_params.ts | 11 +++++++++ src/style.css | 19 +++++++++++++++ src/ui.ts | 28 +++++++++++++++++----- 11 files changed, 229 insertions(+), 24 deletions(-) create mode 100644 docs/embed.md create mode 100644 docs/params.md create mode 100644 src/embed.ts create mode 100644 src/search_params.ts diff --git a/README.md b/README.md index e8ab06e..665efea 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ I've publish a [GitHub Page](https://clangd.guyutongxue.site/) for demonstrating Notice that clangd is a multi-thread program, so we need `SharedArrayBuffer` -- and more over, a strict context called `crossOriginIsolated`. GitHub Pages do not send COOP/COEP headers for us to enabling that context, so I served this site through CloudFlare with a custom rule adding those headers. If you want to deploy this project by yourself, make sure correct COOP/COEP header is set on the server side, or you can use [`coi-serviceworker`](https://github.com/gzuidhof/coi-serviceworker). - +You can pass URL search parameters to control the initial state of this page ([see here](./docs/params.md)), or embed it in your website ([see here](./docs/embed.md), **your website needs to be cross-origin-isolated too**) ## Acknowledgement diff --git a/docs/embed.md b/docs/embed.md new file mode 100644 index 0000000..0abfbaf --- /dev/null +++ b/docs/embed.md @@ -0,0 +1,24 @@ +# Embed to `