Repository navigation
Conversation
Create a markdown file with gander new, and open an existing one with gander edit. While a local file is watched, share saves are written back through watch/sync and watch/ack. Co-authored-by: Scott Miller <scott.miller.utah@gmail.com>
POST /watch/sync and /watch/ack now match gandermd #181: file_hash, version, optional content, and op ok|write with need_content and force. Co-authored-by: Scott Miller <scott.miller.utah@gmail.com>
gander edit and gander new open {shareURL}/edit. gander share and
gander watch still open the reader, and --silent still skips the browser.
Co-authored-by: Scott Miller <scott.miller.utah@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #148
Summary
Adds the three entry points from #148 and writes share saves back to a watched local file.
gander new filename.mdcreates that markdown file, shares it, watches it, and opens the web editor.gander newprompts for a file name on a terminal, then does the same.gander edit filename.mdshares an existing file (if needed), watches it, and opens the web editor.gander newandgander editopen{shareURL}/edit(trailing slashes stripped, and/editis not appended twice).gander shareandgander watchstill open the reader URL.--silentstill skips the browser. The stored share URL stays the reader path.Disk → share is unchanged:
gander watch/gander share --watchstillPUT /api/shares/{uuid}withcontentonly. A returnedversionis sent on the next sync.Share → disk follows gandermd #181 (
cursor/watch-writeback-chips-093a):POST /api/shares/{uuid}/watch/syncwith JSON{"file_hash","version","content?"}.file_hashis the SHA-256 hex of the local file bytes.versionis the acked share version.contentis included only after the previous response setneed_content: true.{"op":"ok"|"write","version","content?","force?","need_content?"}.op: "write", the client writescontentto the local file (a local edit made during the poll is kept unlessforceis true) and thenPOST /api/shares/{uuid}/watch/ackwith{"file_hash","version"}(204).need_content: true, the client posts sync again with the local filecontent.Help, the man page, shell completions, and the README list the commands.
Testing
go test ./...go vet ./...CGO_ENABLED=0 go build -o /tmp/gander .mandoc -Tlint man/man1/gander.1