deepal / boostnote-github-sync Goto Github PK
View Code? Open in Web Editor NEW✨ Sync BoostNote notes into Github Private Repo in Markdown format
✨ Sync BoostNote notes into Github Private Repo in Markdown format
When a note is created, Note title and the content is initially empty. Syncing the empty notes should not be done as it unnecessary adds useless commits to the repository
Write unit tests for Watcher module
Sync only the latest version of a file, if multiple versions are in the sync queue in order to prevent unnecessary commits on the repository.
The current implementation parses markdown content from Boostnote .cson
files and syncs to GitHub. This loses the metadata (tags, storage locations etc.) on notes, hence notes cannot be synced from GitHub back to the local storage. To provide back-and-forth sync, raw files also should be synced to a separate directory in the repository.
Implement a custom error scheme
Command line of the boostnote github sync should look like the following:
$ boostnote-github-sync configure
Your github repository name: my-boostnotes
Destination branch: [master] master
Boostnote Directories to Sync: /Users/johndoe/boostnotes,/Users/johndoe/work/boostnotes
GitHub Personal Access Token: xxxxxxxxxxxxxxxxxxx
[*] Boostnote GitHub Sync configuration saved at /Users/.boostnote-github-sync/config.json
# boostnote-github-sync start
# boostnote-github-sync stop
# boostnote-github-sync restart
# boostnote-github-sync status
Automatically create the GitHub sync repository according to the configuration if the repository is not manually created by the user.
Since the notes are saved in GitHub with a unique filename (GUID), it is not possible to find the notes without opening each one. To ease the search, make the README.md
a table of contents file which will list the titles of all the notes in the repository with links to each.
Deleting note is not possible currently. This is a must-have feature.
Use chokidar (https://github.com/paulmillr/chokidar) instead of native node.js fs.watch
for watching directories as fs.watch
is inconsistent across platforms according to the official documentation (https://nodejs.org/docs/latest/api/fs.html#fs_caveats)
If the enumerateOnStartup
is set to true
and process is restarted due to some issue, the entire enumeration process happens again (even for the already synced notes).
The best way to do this is:
Write unit tests for Preprocessor module
When a note is being edited by the user, every keystroke can trigger a file update event on the watcher. In the worse-case, this results in the creation of individual sync events per each keystroke, which is unnecessary and could event lead to Github API quota exhaustion. To prevent this, implement delayed sync in the following manner.
Configuration .env file
GITHUB_TOKEN="personal access token---个人访问令牌" GITHUB_REPO="github repository---boostnote的github库地址" LOCAL_BOOSTNOTE_DIR="local boostnotes directory---boostnote的本地储存目录"
Configuration .env file
There is no clear description of which configuration is required
Did you consider synchronizing all metadata from boostnote notes and snippets with markdown files? Metadata could be added to YAML front matter.
This section is invisible for most markdown renderer. Also works with BN. An example could look like:
---
createdAt: "2018-09-25T09:05:00.937Z"
updatedAt: "2019-05-23T14:05:01.657Z"
type: "MARKDOWN_NOTE"
folder: "2826e081a3ec6d795f77"
filename: blabla.cson""
title: "some title"
tags: "a, b, c"
---
Though it is being displayed on github and bitbucket (others untested). Maybe a comment section could be used, instead:
<!--
createdAt: "2018-09-25T09:05:00.937Z"
updatedAt: "2019-05-23T14:05:01.657Z"
type: "MARKDOWN_NOTE"
folder: "2826e081a3ec6d795f77"
filename: blabla.cson""
title: "some title"
tags: "a, b, c"
-->
Implement syncing Boostnote SNIPPET notes in markdown format.
Write unit tests for Sync module
Write unit tests for github module
In the current implementation, boostnote-github-sync dequeues an item from the sync queue and then attempts to sync it. If the sync fails, it is never retried because the item is already dequeued from the sync queue.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.