Wisp Study 中文 GitHub

Tutorial 27 · Follow up

Share one library with a group: a shared folder and the group's server

A few people in a lab work in one field and want their papers, tags and manuscripts in one place, while each still reads offline and screens on their own. This tutorial first shares a library with Zhou Yuan through a folder a cloud drive keeps in step: he joins, the papers and tags Lin Xia adds reach him, and when both change the same paragraph neither loses their words. Then it moves to the group's own server, wisp serve: tokens, roles, and who is writing which section.

Scenario
Lin Xia's (林夏) library “植物单细胞转录组” (plant single-cell transcriptomics), 29 papers and a manuscript, to be shared with Zhou Yuan (周远).
Needs
Wisp Study on both sides; for the shared folder a cloud drive or NAS folder both can sync, for the server an always-on computer everyone can reach and some comfort with the terminal. No model.
Time
About 10 minutes for the shared folder, 10 more for the server.

1Share the library through a synced folder

First make an empty folder on a cloud drive: Jianguoyun, OneDrive, iCloud Drive or the lab's NAS, as long as Zhou Yuan's computer syncs it too. Here it is called “植物单细胞转录组”.

Lin Xia opens the library and clicks “Export” at the top right. Below the divider are the two ways of using it together:

The library list with the Export menu open at the top right: BibTeX, spreadsheet, whole library with and without PDFs, then below a divider share through a folder and connect to the group's server.
Figure 1 The library's “Export” menu. The four items above send a copy; the two below keep in step for good.

She chooses “Share through a folder (with others)…” and picks the empty folder. A few seconds later:

Notice

Shared through “植物单细胞转录组”: 65 changes and 24 files sent. Co-authors choose the same folder with Join a shared folder on their home page.

A notice at the top of the library list: shared through the folder, 65 changes and 24 files sent, co-authors choose the same folder on their home page.
Figure 2 Shared. The 24 files are the library's PDFs and the pictures of its picture library, each kept once by its content.

There is no database in the folder: only a wisp-share.json (the share's number and name), a subfolder devices/<device>/ per computer holding the change records that computer wrote, one per line and never rewritten, and files/ for the PDFs and pictures. Each computer only appends to its own subfolder, so the cloud drive never has two people writing one file.

2A second person joins

Once his cloud drive has synced the folder, Zhou Yuan clicks “Join a shared folder” (the folder icon) at the top right of the Wisp Study home page and picks the same folder.

Zhou Yuan's home page with no library yet; in the row of icons at the top right, the folder icon shows the tooltip for joining a shared folder.
Figure 3 “Join a shared folder” on the home page. He does not need to make a library first.

His Wisp Study makes a library of the same name, puts the folder's records into it one by one and fetches the PDFs:

Zhou Yuan's library: all 29 papers, with the same journals, impact factors and full-text states as on Lin Xia's side, and every paper pending in the screening column; the tag 玉米 (maize) with 4 papers on the left.
Figure 4 After joining. Papers, tags and PDFs are there, but every paper is “Pending” in the screening column: screening is each person's own.

The papers the library held when he joined are straight in his “All papers”. Lin Xia's “Included” and “Excluded” decisions did not come along, nor her reading states, stars, highlights and notes on PDFs or conversations with the assistant: those are each person's own, and two people can screen the same papers independently.

3Added on one side, there on the other

Lin Xia does three things in her library: she drops a .bib file on the window, adding a 2026 paper by Robertson et al. on how drought and salinity remodel rice leaf development (the notice says one paper was imported); she tags it “水稻” (rice); and on the Writing page she puts “recent” before “a single-nucleus atlas” in the second paragraph of the introduction.

While a shared library is open, it syncs with the folder every 30 seconds; to not wait, click “Sync the shared folder “植物单细胞转录组” now” in “Export”. On Lin Xia's side:

Notice

Synced: 3 changes sent, nothing new came in.

On Zhou Yuan's next round, a notice at the bottom right says whose changes came and how many; when nothing came from others it says nothing:

A notice at the top of Zhou Yuan's Writing page: synced 3 changes from 林夏, of which you both changed 1 paragraph, yours stays and theirs waits in the comments; the second paragraph of the introduction is shaded.
Figure 5 Zhou Yuan receives Lin Xia's 3 changes. He had changed the paragraph of the introduction too; see section 4.

The new paper is not in his “All papers” but in “Screening”, waiting for his decision like a paper his own searches brought; the tag is already on the left:

Zhou Yuan's screening page: 30 pending, with the line that 1 new paper from searches or sharing waits here and joins the list once decided; on the left the new tag 水稻 with 1 paper.
Figure 6 In the English interface: “1 new papers (from searches or sharing) wait here and join the list once decided.”

Once he includes it, it joins his “All papers”. The other way round, papers your own searches brought that still wait in your screening are not sent to others until you include or exclude them (or attach a file to them): one person's unscreened search results never show up for the rest. A citation in someone else's manuscript of a paper still in your screening resolves all the same. When both change the same field of a paper (title, journal, tags…), the last change wins; when both add the same paper (the same DOI and so on), they become one.

4Both changed the same paragraph

Before Lin Xia synced, Zhou Yuan had changed the second paragraph of the introduction too: “many species and organs” became “a growing range of species and organs”. Manuscripts merge by paragraph: a paragraph someone else changed and you did not is replaced; one you changed too keeps your words where they are, and theirs become a signed proposal in “Comments”. On Zhou Yuan's side:

Zhou Yuan's Writing page: the second paragraph of the introduction still holds his words; on the right a card by 林夏 saying you both changed this paragraph, with her version below where many and recent are marked, and the buttons to apply or dismiss.
Figure 7 Zhou Yuan's side: his version in the manuscript, Lin Xia's as a proposal. Her side is the other way round.

After both have synced, each has their own version in the manuscript and the other's in the comments; nothing is lost. One person merging is enough: Zhou Yuan clicks “Apply” to take Lin Xia's version (with “recent”), puts his “a growing range of” back in, and syncs.

On Lin Xia's next round, the paragraph is one only he changed since, so it is simply replaced by the merged words. The card of his she still had now says “This text has changed; the comment no longer points to a place in the manuscript.” and only offers “Dismiss”; click it.

Lin Xia's Writing page: a notice that 1 change from 周远 was synced; the second paragraph of the introduction now holds the merged words with an amber margin line; on the right Zhou Yuan's card with an orange line saying the text has changed and the comment no longer points to the manuscript, and only dismiss.
Figure 8 The merged paragraph reaches Lin Xia. The notice counts Zhou Yuan's one change only: he applied her own words, which come back to her as hers, not as someone else's change, and her name is not among the senders.

If someone deletes a paragraph or section you changed, you only get a note; nothing is deleted. Changes written by a newer Wisp Study are refused, with a word that you need to update. To stop syncing, click “Stop sharing…” in “Export”: only the link goes, the library and the folder stay. From the command line: share_folder and sync_shared_folder.

5Move to the group's server: wisp serve

When there are more people, a cloud drive is awkward, or you want to see who is writing which section, let an always-on computer in the group be the server. It holds a central library; everyone connects to it and keeps a copy of their own, writes offline as usual, and syncs with the server every 30 seconds while the library is open. The server puts everyone's changes in one order and hands each member what they lack; the merge rules are those of the shared folder.

In that computer's terminal, make an empty library, give each person a token, then start the server:

The server computer's terminal (the tokens were made for this run and have all been revoked since)
$ wisp create_library --name 植物单细胞转录组   # the central library on the server, empty for now
$ wisp serve-token --name 林夏 --role owner
wisp_8f9c861c81aadfb5e906a892f6de6e3cea590c885ffdae24
(给 林夏 的令牌,角色 owner。只显示这一次:服务器只记着它的散列,丢了就用 --revoke 收回再发一个。)
$ wisp serve-token --name 周远 --role writer
wisp_dc6d9c20ab2c3cdec18bc04c7141f25e2707b949516daaa1
(给 周远 的令牌,角色 writer。只显示这一次:服务器只记着它的散列,丢了就用 --revoke 收回再发一个。)
$ wisp serve-token --name 张老师 --role reader
wisp_cc52da45dd4e4cace288b365aa80c87497bbc2e6a6b5fb03
(给 张老师 的令牌,角色 reader。只显示这一次:服务器只记着它的散列,丢了就用 --revoke 收回再发一个。)
$ wisp serve --library 植物单细胞转录组 --bind 127.0.0.1:4877
「植物单细胞转录组」的服务器在 http://127.0.0.1:4877 上(同步协议第 1 版),3 个令牌。用 wisp serve-token 给成员发令牌;Ctrl+C 停止。

The command line speaks Chinese. After each token it says that this is the token for that person and role, that it is shown only this once because the server keeps only its hash, and that a lost one is revoked and made again; the server's last line says where it listens, its sync protocol version and how many tokens it has. Send each person their token privately. There are three roles: owner (writes, and is the one who makes tokens), writer, and reader (only receives). A token stands for one person, and one computer's changes count for one member only. When someone leaves the group, wisp serve-token --revoke 周远 takes his token back.

In her library, Lin Xia clicks “Export” › “Connect to the group's server…”, enters the address and her token, and clicks “Connect”:

The dialog for connecting to the group's server: a note that the server's owner runs wisp serve and gives you a token with wisp serve-token; the address field holds http://127.0.0.1:4877, the token field a string beginning with wisp_; buttons cancel and connect.
Figure 9 “Connect to the group's server”. The token in the picture was made for this run and has been revoked since.
Notice

Connected: you are 林夏 (owner).

Her library already had 29 papers and a manuscript; connecting sent all of it to the server, and the empty library there now holds it. Zhou Yuan does not use her library: he makes a new empty library, “组里的文献库” (the group's library), chooses “Connect to the group's server…” in the same way and enters his own token. Once connected:

Zhou Yuan's group library: a notice that he is connected as 周远 (can write) and that 65 changes from 林夏 were synced; 29 papers in the list, those with PDFs marked as saved, every one pending in screening.
Figure 10 One sentence says first who Zhou Yuan is on the server and with what role, then that his empty library received Lin Xia's 65 changes: the 29 papers, their PDFs and the manuscript. The role stays written to the right of the server's line in the “Export” menu.

While both are on the Writing page, each tells the server which section they are writing. Zhou Yuan is writing the methods; in the outline there is a small blue dot by “Introduction”, and with the pointer on it:

Zhou Yuan's Writing page on Methods; in the outline on the left a small blue dot at the right of the Introduction row, with the pointer on it and the tooltip that 林夏 is writing this section.
Figure 11 “林夏 is writing this section”. It names only the section: no cursor, nothing of what she is typing.

On Lin Xia's side there is likewise an amber dot of Zhou Yuan's by “Methods”. Once the other person leaves the Writing page or closes the library, the dot stays for a minute and a half at most.

  • Prof. Zhang (张老师), connected with the reader token, receives everyone's changes; what he changes in his own copy stays on his computer and is not sent. The window tells him so: on connecting, “Connected: you are 张老师 (read only). What you change here stays on this computer and is not sent to the group. Synced 65 changes from 林夏.”; after he changed a paragraph and synced by hand, “You can only read on this server: 1 change made here stayed on this computer; nothing is sent to the group.”; and the server's line in the “Export” menu carries “read only: changes are not sent”. wisp sync-server says it too: its answer has role reader, kept (the changes left on this computer) and a one-sentence note.
  • A library uses one of the two ways only: one already shared through a folder answers a connection with “这个文献库已经和一个共享文件夹同步;先停止那个共享,再连服务器。” (this library is already kept in step with a shared folder; stop that share first).
  • When the two sides speak different versions of the sync protocol, both say plainly to update to the same version rather than half sync. A group is best on one version of Wisp Study.
  • The command line connects too: wisp connect --url <address> --token <token>, wisp sync-server.

6Which to choose, and what stays on each computer

Table 1 The shared folder and the group's server.
Shared folderGroup's server
What it takesA cloud drive or NAS folder everyone syncsAn always-on computer everyone can reach, and the terminal
Who can joinWhoever can open the folderWhoever has a token; tokens can be revoked
RolesNone: everyone writesOwner, writer, reader
How fastEvery 30 seconds, plus the drive's own syncingEvery 30 seconds
Who is writing whereNot shownA dot in the outline
SuitsTwo or three people already on one cloud driveA lab group, with people coming and going

Both share the same things: the papers' bibliographic records, tags and notes, the trash, PDFs and other attachments, the picture library, the glossary, manuscripts and comments, and who made each change and when. What stays on each person's computer:

  • screening decisions, reading states, stars, reading positions, highlights and notes on PDFs;
  • conversations with the assistant;
  • all settings, including API keys and the token you connect with (the token goes only to that server, with each request);
  • the library's database itself: it never goes into the shared folder or to the server.

Once connected to a server, the section you are writing on the Writing page (not the cursor, not the text) is also told to the server and kept for 90 seconds. To send one manuscript to one person without sharing a library, use a manuscript package.

Recap

  • In the library's “Export”, “Share through a folder (with others)…” picks an empty folder a cloud drive syncs; others choose the same one with “Join a shared folder” on their home page.
  • Papers, tags, PDFs, manuscripts and comments sync both ways; a paper someone else adds waits in your “Screening”, and screening is each person's own.
  • When both change one paragraph, each keeps their own and gets the other's as a proposal; one merge brings both sides together.
  • wisp serve and wisp serve-token make a computer of the group the server; members connect with “Connect to the group's server…”, as owner, writer or reader, and the outline shows who is writing which section.
  • Conversations, settings, screening and reading traces always stay on your own computer.