diff --git a/CliClient/build-translation.sh b/CliClient/build-translation.sh deleted file mode 100755 index 11a722a3b3..0000000000 --- a/CliClient/build-translation.sh +++ /dev/null @@ -1,3 +0,0 @@ -#/bin/bash -CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -NODE_PATH="$CLIENT_DIR/build" node "$CLIENT_DIR/build/build-translation.js" --silent \ No newline at end of file diff --git a/CliClient/build-website.sh b/CliClient/build-website.sh deleted file mode 100755 index 7d3c5dcfbd..0000000000 --- a/CliClient/build-website.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -set -e -ROOT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -"$ROOT_DIR/build.sh" && NODE_PATH="$ROOT_DIR/build" node "$ROOT_DIR/build/build-website.js" \ No newline at end of file diff --git a/CliClient/build.sh b/CliClient/build.sh index 31c510535b..bf2394366b 100755 --- a/CliClient/build.sh +++ b/CliClient/build.sh @@ -6,7 +6,4 @@ BUILD_DIR="$ROOT_DIR/build" rsync -a --exclude "node_modules/" "$ROOT_DIR/app/" "$BUILD_DIR/" rsync -a "$ROOT_DIR/../ReactNativeClient/lib/" "$BUILD_DIR/lib/" cp "$ROOT_DIR/package.json" "$BUILD_DIR" -chmod 755 "$BUILD_DIR/main.js" - -# cd "$BUILD_DIR" -# node build-translation.js --silent \ No newline at end of file +chmod 755 "$BUILD_DIR/main.js" \ No newline at end of file diff --git a/CliClient/install.sh b/CliClient/install.sh deleted file mode 100755 index 7efe03e825..0000000000 --- a/CliClient/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -CLIENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - -"$CLIENT_DIR/publish.sh" -npm install -g joplin \ No newline at end of file diff --git a/CliClient/package-lock.json b/CliClient/package-lock.json index 790f37877a..00cd5d87c3 100644 --- a/CliClient/package-lock.json +++ b/CliClient/package-lock.json @@ -460,16 +460,6 @@ "assert-plus": "1.0.0" } }, - "gettext-parser": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.3.0.tgz", - "integrity": "sha512-iloxjcw+uTPnQ8DrGICWtqkHNgk3mAiDI77pLmXQCnhM+BxFQXstzTA4zj3EpIYMysRQnnNzHyHzBUEazz80Sw==", - "dev": true, - "requires": { - "encoding": "0.1.12", - "safe-buffer": "5.1.1" - } - }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", @@ -797,12 +787,6 @@ "highlight.js": "9.12.0" } }, - "marked": { - "version": "0.3.6", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.6.tgz", - "integrity": "sha1-ssbGGPzOzk74bE/Gy4p8v1rtqNc=", - "dev": true - }, "md5": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/md5/-/md5-2.2.1.tgz", @@ -884,12 +868,6 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, - "mustache": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.0.tgz", - "integrity": "sha1-QCj3d4sXcIpImTCm5SrDvKDaQdA=", - "dev": true - }, "nan": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/nan/-/nan-2.7.0.tgz", diff --git a/CliClient/package.json b/CliClient/package.json index 9be188bad1..cd1fd2b247 100644 --- a/CliClient/package.json +++ b/CliClient/package.json @@ -60,10 +60,7 @@ "yargs-parser": "^7.0.0" }, "devDependencies": { - "gettext-parser": "^1.2.2", - "jasmine": "^2.6.0", - "marked": "^0.3.6", - "mustache": "^2.3.0" + "jasmine": "^2.6.0" }, "scripts": { "test": "jasmine" diff --git a/README.md b/README.md index 88277030fb..709d5d9daf 100644 --- a/README.md +++ b/README.md @@ -31,13 +31,13 @@ iOS | = 0; -const { basename, dirname, filename, fileExtension } = require('lib/path-utils.js'); +const { basename, dirname, filename, fileExtension } = require(rootDir + '/ReactNativeClient/lib/path-utils.js'); const fs = require('fs-extra'); const gettextParser = require('gettext-parser'); -const rootDir = dirname(dirname(__dirname)); const cliDir = rootDir + '/CliClient'; const cliLocalesDir = cliDir + '/locales'; const rnDir = rootDir + '/ReactNativeClient'; diff --git a/CliClient/app/build-website.js b/Tools/build-website.js similarity index 91% rename from CliClient/app/build-website.js rename to Tools/build-website.js index a214e08b74..a80159e8a3 100644 --- a/CliClient/app/build-website.js +++ b/Tools/build-website.js @@ -1,6 +1,5 @@ const fs = require('fs-extra'); -const { fileExtension, basename, dirname } = require('lib/path-utils.js'); -const { _, setLocale, languageCode } = require('lib/locale.js'); +const dirname = require('path').dirname; const marked = require('marked'); const Mustache = require('mustache'); @@ -199,7 +198,7 @@ const headerHtml = ` @@ -270,11 +269,7 @@ const scriptHtml = ` `; -// -// -// - -const rootDir = dirname(dirname(__dirname)); +const rootDir = dirname(__dirname); function markdownToHtml(md) { const renderer = new marked.Renderer(); diff --git a/Tools/git-hooks/pre-commit-sh b/Tools/git-hooks/pre-commit-sh new file mode 100644 index 0000000000..c63796f6b4 --- /dev/null +++ b/Tools/git-hooks/pre-commit-sh @@ -0,0 +1,14 @@ +#!/bin/sh + +# In pre-commit, PWD is set to the root of the repo +# https://longair.net/blog/2011/04/09/missing-git-hooks-documentation/ +ROOT_DIR="$PWD" + +# If any README file has been changed, update the website +'README\|build-website' +git status -s | grep ' README\| build-website.js' > /dev/null +readmeStatus=$? +if [ $readmeStatus -eq 0 ]; then + node "$ROOT_DIR/Tools/build-website.js" + git add docs +fi \ No newline at end of file diff --git a/Tools/package-lock.json b/Tools/package-lock.json index b3de2bd3f9..b478b4309a 100644 --- a/Tools/package-lock.json +++ b/Tools/package-lock.json @@ -4,6 +4,14 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "encoding": { + "version": "0.1.12", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz", + "integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=", + "requires": { + "iconv-lite": "0.4.19" + } + }, "fs-extra": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-4.0.2.tgz", @@ -14,11 +22,25 @@ "universalify": "0.1.1" } }, + "gettext-parser": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/gettext-parser/-/gettext-parser-1.3.0.tgz", + "integrity": "sha512-iloxjcw+uTPnQ8DrGICWtqkHNgk3mAiDI77pLmXQCnhM+BxFQXstzTA4zj3EpIYMysRQnnNzHyHzBUEazz80Sw==", + "requires": { + "encoding": "0.1.12", + "safe-buffer": "5.1.1" + } + }, "graceful-fs": { "version": "4.1.11", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.11.tgz", "integrity": "sha1-Dovf5NHduIVNZOBOp8AOKgJuVlg=" }, + "iconv-lite": { + "version": "0.4.19", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.19.tgz", + "integrity": "sha512-oTZqweIP51xaGPI4uPa56/Pri/480R+mo7SeU+YETByQNhDG55ycFyNLIgta9vXhILrxXDmF7ZGhqZIcuN0gJQ==" + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -27,6 +49,21 @@ "graceful-fs": "4.1.11" } }, + "marked": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.7.tgz", + "integrity": "sha512-zBEP4qO1YQp5aXHt8S5wTiOv9i2X74V/LQL0zhUNvVaklt6Ywa6lChxIvS+ibYlCGgADwKwZFhjC3+XfpsvQvQ==" + }, + "mustache": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/mustache/-/mustache-2.3.0.tgz", + "integrity": "sha1-QCj3d4sXcIpImTCm5SrDvKDaQdA=" + }, + "safe-buffer": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.1.tgz", + "integrity": "sha512-kKvNJn6Mm93gAczWVJg7wH+wGYWNrDHdWvpUmHyEsgCtIwwo3bqPtV4tR5tuPaUhTOo/kvhVwd8XwwOllGYkbg==" + }, "universalify": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.1.tgz", diff --git a/Tools/package.json b/Tools/package.json index 235a614f07..73ba24530f 100644 --- a/Tools/package.json +++ b/Tools/package.json @@ -9,6 +9,9 @@ "author": "", "license": "ISC", "dependencies": { - "fs-extra": "^4.0.2" + "fs-extra": "^4.0.2", + "gettext-parser": "^1.3.0", + "marked": "^0.3.7", + "mustache": "^2.3.0" } } diff --git a/docs/desktop/index.html b/docs/desktop/index.html index 3a9cecb033..1357b34b42 100644 --- a/docs/desktop/index.html +++ b/docs/desktop/index.html @@ -193,7 +193,7 @@ diff --git a/docs/index.html b/docs/index.html index 6ddcaaf3ab..92e0a1bdae 100644 --- a/docs/index.html +++ b/docs/index.html @@ -193,7 +193,7 @@ @@ -250,10 +250,10 @@

Terminal application

-

IMPORTANT: Node v8+ is required

On macOS:

-
brew install joplin
-

On Linux or Windows (via WSL), type:

+
brew install node joplin
+

On Linux or Windows (via WSL):

+

Important: First, install Node 8+. Node 8 is LTS but not yet available everywhere so you might need to manually install it.

NPM_CONFIG_PREFIX=~/.joplin-bin npm install -g joplin
 sudo ln -s ~/.joplin-bin/bin/joplin /usr/bin/joplin
 

By default, the application binary will be installed under ~/.joplin-bin. You may change this directory if needed. Alternatively, if your npm permissions are setup as described here (Option 2) then simply running npm -g install joplin would work.

diff --git a/docs/terminal/index.html b/docs/terminal/index.html index 6712b99826..f11e3a6c63 100644 --- a/docs/terminal/index.html +++ b/docs/terminal/index.html @@ -193,7 +193,7 @@ @@ -204,10 +204,10 @@

The notes can be synchronised with various targets including the file system (for example with a network directory) or with Microsoft OneDrive. When synchronising the notes, notebooks, tags and other metadata are saved to plain text files which can be easily inspected, backed up and moved around.

Installation

-

IMPORTANT: Node v8+ is required

On macOS:

-
brew install joplin
-

On Linux or Windows (via WSL), type:

+
brew install node joplin
+

On Linux or Windows (via WSL):

+

Important: First, install Node 8+. Node 8 is LTS but not yet available everywhere so you might need to manually install it.

NPM_CONFIG_PREFIX=~/.joplin-bin npm install -g joplin
 sudo ln -s ~/.joplin-bin/bin/joplin /usr/bin/joplin
 

By default, the application binary will be installed under ~/.joplin-bin. You may change this directory if needed. Alternatively, if your npm permissions are setup as described here (Option 2) then simply running npm -g install joplin would work.