A host from the web site; the same page kept once; deleting from the Notebooks chooser
From the development repository at 299f73d, 2026-10-11: hosting from the site documented; a page loaded from a notebook and left unchanged is not kept again; notebooks and pages are deleted from the chooser, to the system's Trash (--trash); the Notebooks button. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
1 parent
4e3a281d65
commit
0d01e23d7c
15 files changed
+711
-63
No files matched your search
+6
-3
@@ -257,7 +257,7 @@ If you would rather have your pages as files in a directory on your own
|
||||
computer, where you can open, copy and back them up as you do any file,
|
||||
install the Kokkoja program. It is small and needs only Python, which
|
||||
Linux and macOS have or can quickly get; [A host's Kokkoja](host.md)
|
||||
tells how, since every host needs it. Then join from the program's own
|
||||
tells how. Then join from the program's own
|
||||
start screen, pasting the invitation, or follow the start screen's offer
|
||||
to open the invitation in the installed program.
|
||||
|
||||
@@ -300,10 +300,13 @@ right of your toolbar:
|
||||
size, centred, 5 mm below the image above or at the top of the page;
|
||||
one wider than the page widens it. To put an image on a page of its
|
||||
own, press **New** first.
|
||||
* **Notebook** starts a new page for everyone from a page kept in one of
|
||||
* **Notebooks** starts a new page for everyone from a page kept in one of
|
||||
your notebooks, with everything that was written on it. A chooser
|
||||
shows your notebooks and small pictures of their kept pages. The kept
|
||||
page itself is not changed: the session works on a copy.
|
||||
page itself is not changed: the session works on a copy. The same
|
||||
chooser deletes pages and notebooks of yours, marked with their ×
|
||||
and then the **Delete** button, pressed twice; the host's part says
|
||||
more.
|
||||
* **Hide**, among the tools, hides part of the page for everyone: drag
|
||||
open a rectangle and whatever lies under it, writing included, is
|
||||
covered in white, marked by blue corners so that nobody writes there
|
||||
|
||||
+45
-12
@@ -4,17 +4,32 @@ The host starts a session, invites the guests and drives the session:
|
||||
puts images on the page, starts new pages, loads pages from a notebook,
|
||||
and decides which guests may do the same. In a lesson, the teacher is
|
||||
the host. Everything in [A guest's Kokkoja](guest.md) applies to the host
|
||||
too; this part describes what is added, and how to install the Kokkoja
|
||||
program, which a host needs.
|
||||
too; this part describes what is added.
|
||||
|
||||
## Hosting from the web site, or with the Kokkoja program
|
||||
|
||||
A host, like a guest, can use Kokkoja with nothing installed: open
|
||||
`https://kokkoja.andykopra.com/` in a browser, enter a name, press
|
||||
**Start a session**, and the invitation is ready in the Session window.
|
||||
Your notebooks are then kept inside that browser, as a guest's are (see
|
||||
"Your notebook" in the guest's part): they belong to that browser on
|
||||
that computer, and a page leaves it by **Keep** or **Export**, which
|
||||
download it. "Image" asks for the file with the browser's own chooser.
|
||||
|
||||
If you would rather have your notebooks as ordinary directories of
|
||||
files, where you can open, copy, back up and send them, run the Kokkoja
|
||||
program on your own computer. It is a small Python program with two
|
||||
jobs: it shows Kokkoja in your web browser, and it reads and writes
|
||||
your notebooks as directories and files. It listens only to your own
|
||||
computer and talks to nothing else but the relay you name. Your
|
||||
identity, too, then belongs to your computer rather than to one
|
||||
browser, so your writing from an earlier lesson is yours from any
|
||||
browser there. A teacher who keeps notebooks of exercises and a
|
||||
notebook per student will want the program; for a first session the
|
||||
web site is enough.
|
||||
|
||||
## Installing the Kokkoja program
|
||||
|
||||
A guest can join from a web site with nothing installed. A host runs the
|
||||
Kokkoja program on their own computer. It is a small Python program with
|
||||
two jobs: it shows Kokkoja in your web browser, and it reads and writes
|
||||
your notebooks as ordinary directories and files. It listens only to
|
||||
your own computer and talks to nothing else but the relay you name.
|
||||
|
||||
You need:
|
||||
|
||||
* **Linux or macOS.** Windows has not been tried yet.
|
||||
@@ -97,6 +112,8 @@ Other options, all optional:
|
||||
yourself.
|
||||
* `--site ADDRESS` names the web site that invitations link to. You
|
||||
need it only if your server's web site is not at the relay's host.
|
||||
* `--trash DIRECTORY` is where deleted notebooks and pages are moved,
|
||||
instead of your system's Trash; `--trash none` deletes them outright.
|
||||
|
||||
## Starting a session
|
||||
|
||||
@@ -217,7 +234,7 @@ just large enough for everything on it, images and writing, with the
|
||||
margin of 5 mm around, which trims a page down to its exercise before you keep
|
||||
or export it. A blank page cannot shrink.
|
||||
|
||||
**Notebook** starts a new page for everyone from a page kept in one of
|
||||
**Notebooks** starts a new page for everyone from a page kept in one of
|
||||
your notebooks, with everything that was written on it. A chooser shows
|
||||
your notebooks on the left and small pictures of the chosen notebook's
|
||||
kept pages on the right. The loaded page is a copy: the kept page is
|
||||
@@ -226,9 +243,23 @@ belongs to the participant who wrote it, so a student's answers from an
|
||||
earlier lesson are still theirs, and your corrections still yours.
|
||||
|
||||
This is also how you return to an earlier page of the session: the page
|
||||
was kept when you left it, and **Notebook** brings it back as a new page.
|
||||
was kept when you left it, and **Notebooks** brings it back as a new page.
|
||||
A lesson might go: **New**, **Image** for the exercise, work, **New**
|
||||
for a point of grammar, work, **Notebook** to return to the exercise.
|
||||
for a point of grammar, work, **Notebooks** to return to the exercise.
|
||||
|
||||
The same chooser deletes. Every page card and every notebook in the
|
||||
list carries a small × mark; a tap marks it, a second tap unmarks it,
|
||||
and a marked notebook goes with every page in it. As soon as something
|
||||
is marked, a **Delete** button in the chooser's header says how much:
|
||||
"Delete 3 pages?", "Delete 1 notebook and 3 pages?". The first press
|
||||
says what will happen, "Press again to move 3 pages to the Trash";
|
||||
the second does it. With the Kokkoja program, deleted notebooks and
|
||||
pages are moved to your system's Trash, where the
|
||||
file manager can put them back; the program's `--trash` option
|
||||
names another directory, or `none` to delete outright. In the browser
|
||||
there is no Trash, and the button says "for good". The notebook
|
||||
you are writing in cannot be deleted while you are: choose another
|
||||
notebook in the toolbar first.
|
||||
|
||||
## Co-hosts
|
||||
|
||||
@@ -257,7 +288,9 @@ The page you are on is written continuously to `Current.svg` in the
|
||||
current notebook, and copied to a dated file whenever the session moves
|
||||
on. **Keep** makes such a copy now, named for the day and a serial
|
||||
number, such as `2026_10_06_02.svg`; pressing it again before anything
|
||||
has changed makes no second copy. Any mark counts as a change, even a
|
||||
has changed makes no second copy, and neither does moving on from a
|
||||
page that is already kept, such as one loaded from the notebook and left
|
||||
as it was. Any mark counts as a change, even a
|
||||
dot from a stray touch of the pen. Use it to mark a state worth keeping
|
||||
on its own, or to add a finished page to a notebook of exercises.
|
||||
|
||||
|
||||
+11
-3
@@ -26,8 +26,9 @@ Kokkoja is three programs and a few static files.
|
||||
session and nothing more: it cannot read them and it stores nothing.
|
||||
It is Python with one library, `websockets`.
|
||||
* **The web site** is the `client/` directory served over HTTPS, with a
|
||||
`config.json` beside it, so that a guest can join without the local
|
||||
program. `deploy/` has the server setup.
|
||||
`config.json` beside it, so that a guest can join, and a host can
|
||||
start a session, without the local program. `deploy/` has the server
|
||||
setup.
|
||||
|
||||
Every participant's computer holds the whole page. Only changes travel:
|
||||
a stroke as it is drawn, a text block as it is typed, an erasure, a new
|
||||
@@ -173,7 +174,14 @@ the user asks (**Keep**), and by the program whenever `Current.svg`
|
||||
is about to be given to another page: when the session moves to a new
|
||||
page, when the notebook is changed, and when a session begins and finds
|
||||
a page of another session in the notebook. Nothing is copied if the
|
||||
page is blank or an identical copy already exists.
|
||||
page is blank or the same page is already kept in that notebook; a
|
||||
page loaded from a notebook and left unchanged is therefore not kept
|
||||
again, although the file names it as a new page. A kept page or a
|
||||
whole notebook can be deleted from the Notebooks chooser; the local
|
||||
program moves it to the system's Trash (the freedesktop Trash on
|
||||
Linux, with the info file the file manager wants for putting it back;
|
||||
`~/.Trash` on macOS) unless `--trash` says otherwise, and the
|
||||
browser's notebook, having none, deletes for good.
|
||||
|
||||
The file is an SVG document that any viewer displays: the images as
|
||||
embedded `<image>` elements, each layer as a group with the participant's
|
||||
|
||||
+10
-7
@@ -55,10 +55,11 @@ on their own computers. The relay server that passes the messages cannot
|
||||
read them. The invitation to a session carries the key, so only those
|
||||
who were invited can read the page.
|
||||
|
||||
**Nothing to install for guests.** A guest joins by opening a link in a
|
||||
web browser. Someone who wants a notebook of real files on their own
|
||||
computer installs the small Kokkoja program instead; that is also how a
|
||||
host runs Kokkoja.
|
||||
**Nothing to install.** A guest joins by opening a link in a web
|
||||
browser, and a host can start a session from the web site in the same
|
||||
way. Someone who wants a notebook of real files on their own computer,
|
||||
a teacher with a notebook per student for instance, installs the small
|
||||
Kokkoja program instead.
|
||||
|
||||
**Free software.** Kokkoja is free and open-source. Anyone can use it
|
||||
without paying, and nobody depends on a company's service. It runs in
|
||||
@@ -120,11 +121,13 @@ mind before reading on.
|
||||
the client's files
|
||||
```
|
||||
|
||||
* **The host** runs the small Kokkoja program on their own computer.
|
||||
It shows Kokkoja in the host's browser, at the address
|
||||
* **The host** in the picture runs the small Kokkoja program on their
|
||||
own computer. It shows Kokkoja in the host's browser, at the address
|
||||
`http://localhost:8760/`, and it keeps the host's notebooks as
|
||||
directories of files. It must be running for as long as the host is
|
||||
in a session; the browser alone cannot reach the notebooks.
|
||||
in a session; the browser alone cannot reach the notebooks. A host
|
||||
can also do without it and start the session from the web site, like
|
||||
guest A, with the notebooks in the browser.
|
||||
|
||||
* **The server** does two things for everyone. Its *relay* passes the
|
||||
participants' messages, which are encrypted before they leave each
|
||||
|
||||
+9
-4
@@ -10,9 +10,10 @@ works](implementation.md).
|
||||
Kokkoja has three parts. The **client** is plain JavaScript that runs
|
||||
in a browser. The **local program**, `kokkoja.py`, serves the client to
|
||||
your own browser and keeps your notebooks as directories of SVG files;
|
||||
a host needs it, a guest does not. The **relay** passes the
|
||||
participants' messages, encrypted end to end so that it cannot read
|
||||
them, and serves the client to guests as a web site; Andy's relay at
|
||||
without it the notebooks live in the browser's storage. The **relay**
|
||||
passes the participants' messages, encrypted end to end so that it
|
||||
cannot read them, and serves the client as a web site, from which anyone
|
||||
can host or join with nothing installed; Andy's relay at
|
||||
`kokkoja.andykopra.com` is there for you, and you can run your own.
|
||||
|
||||
## Requirements
|
||||
@@ -36,6 +37,10 @@ the directory.
|
||||
|
||||
## Host a session
|
||||
|
||||
With nothing installed: open `https://kokkoja.andykopra.com/`, enter a
|
||||
name, press **Start a session**; the notebooks are then in the browser.
|
||||
With the program, for notebooks as files:
|
||||
|
||||
python3 kokkoja.py --relay wss://kokkoja.andykopra.com/relay
|
||||
|
||||
The program prints `http://localhost:8760/#token=…` and opens your
|
||||
@@ -64,7 +69,7 @@ rather than in the browser's storage.
|
||||
|
||||
The toolbar holds the pen, text, eraser and hide tools, colours and
|
||||
line widths, the view commands (Fit, A4, Widen, Shrink, Extend), the
|
||||
host's page buttons (New, Image, Notebook), your notebook, Keep, Export
|
||||
host's page buttons (New, Image, Notebooks), your notebook, Keep, Export
|
||||
and Session. Rest the pointer on any button for two seconds for its
|
||||
explanation. Each participant writes on a layer of their own that
|
||||
nobody else can change. The page is saved continuously to the current
|
||||
|
||||
Reference in new issue
Block a user