Giter Site home page Giter Site logo

boostnote-github-sync's Introduction

boostnote-github-sync's People

Contributors

deepal avatar dependabot[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

boostnote-github-sync's Issues

Do not sync empty notes

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

Escape meta characters from file names

Certain files may contain markdown meta characters in the file name. This might lead to the file name not being properly displayed in the table of contents.

screenshot 2019-02-17 at 22 34 56

Sync raw note content to GitHub

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.

Command line utility

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

Display a Table of Contents in README.md

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.

Delayed Sync

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.

  • Start a timer when an edit on a note has been started
  • Add the updated note to the sync queue only when the timer is expired
  • If a file change is detected (another update) on the same file before the timer is expired, reset the timer.

Please update the quick start

Setting up:

  • Clone the repository
  • Configure your github repository, personal access token and the local boostnotes directory in .env file.
  • Configure other application settings in config.js file.
  • Run npm install
  • Run npm start to run the sync process.

Configuration .env file

GITHUB_TOKEN="personal access token---个人访问令牌"
GITHUB_REPO="github repository---boostnote的github库地址"
LOCAL_BOOSTNOTE_DIR="local boostnotes directory---boostnote的本地储存目录"

Snipaste_2019-09-26_17-34-16

Configuration .env file

There is no clear description of which configuration is required

What are the necessary configuration files for config.js file???

Please update the quick start!

include tags and other metadata

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"
-->

Retry notes which were failed to sync

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.