Skip to content

tweedefloor/kale

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 

Repository files navigation

🥬 Kale

Kale is a very small web page for editing one file collaboratively in a GitHub repo.

You paste:

  • a GitHub personal access token
  • a GitHub file link, like https://github.com/tweedefloor/kale/blob/main/README.md

The app loads the latest GitHub file, syncs live edits between open browsers with CRDTs, and commits the current editor state back to the same branch when you click commit.

Everything runs in your browser. There is no backend server.

Token

Use a fine-grained personal access token.

  1. Go to GitHub token settings
  2. Set an expiration.
  3. Under Repository access, select Only select repositories, then pick the repo you want to edit (the same as in the Github file link above)
  4. Under Repository permissions, set:
  • Contents: Read and write
  • Issues: Read and write
  • Metadata: Read-only should already be included
  1. Generate the token and paste it into the app.

Caution

Note: the token can edit files in the repos you grant it access to, so keep the URL containing ?pat=... as secret. Actually.. probably you shouldnt use this app at all. I dont think its a good idea to go around the internet and paste your PAT into random github projects. Maybe I can even hack your repo now. Thats not so good.

Use

Open index.html in a browser or host it as a static website.

Paste the token and GitHub file link, load the file, edit it, then click commit.

On load, Kale fetches the latest GitHub file once. After that, open browsers sync through CRDT/WebRTC; GitHub is only used for signaling and for saving checkpoints when you click commit. Commit reads the latest branch head and writes the current editor state on top.

Once you pasted them, the url can be bookmarked like file:///Users/cf/dev/tweedefloor/kale/index.html?pat=<xxx>&repo=<xxx>

About

Kale is a highly nutritious, cold-hardy member of the cabbage family (cruciferous vegetables). It is celebrated as a "superfood" due to its exceptional density of Vitamins K, A, and C, calcium, and antioxidants

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages