From 92386c0d6a03230c042571d7265c87319e3e05e0 Mon Sep 17 00:00:00 2001 From: defclass Date: Tue, 10 Nov 2020 09:36:16 +0800 Subject: [PATCH 1/7] chore: add welcome message --- src/main/frontend/core.cljs | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/src/main/frontend/core.cljs b/src/main/frontend/core.cljs index 49c8838b6..f9bb9c4d2 100644 --- a/src/main/frontend/core.cljs +++ b/src/main/frontend/core.cljs @@ -15,10 +15,26 @@ ;; set to false to enable HistoryAPI {:use-fragment false})) -(defn start [] +(defn welcome-message + [] + (js/console.log + "Welcome to Logseq! If you encounter any problem, feel free to file an issue on GitHub (https://github.com/logseq/logseq) or join our Discord server (https://discord.gg/KpN4eHY). + .____ + | | ____ ____ ______ ____ ______ + | | / _ \\ / ___\\/ ___// __ \\/ ____/ + | |__( <_> ) /_/ >___ \\\\ ___< <_| | + |_______ \\____/\\___ /____ >\\___ >__ | + \\/ /_____/ \\/ \\/ |__| + " )) + + + + + (defn start [] (when-let [node (.getElementById js/document "root")] (set-router!) - (rum/mount (page/current-page) node))) + (rum/mount (page/current-page) node) + (welcome-message))) (defn ^:export init [] ;; init is called ONCE when the page loads From 3c910c877add9102bbe1fa94090ec27743d46f33 Mon Sep 17 00:00:00 2001 From: defclass Date: Tue, 10 Nov 2020 09:57:42 +0800 Subject: [PATCH 2/7] style: fix the display style and code style --- src/main/frontend/core.cljs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/frontend/core.cljs b/src/main/frontend/core.cljs index f9bb9c4d2..bebd05952 100644 --- a/src/main/frontend/core.cljs +++ b/src/main/frontend/core.cljs @@ -15,10 +15,13 @@ ;; set to false to enable HistoryAPI {:use-fragment false})) -(defn welcome-message +(defn display-welcome-message [] (js/console.log - "Welcome to Logseq! If you encounter any problem, feel free to file an issue on GitHub (https://github.com/logseq/logseq) or join our Discord server (https://discord.gg/KpN4eHY). + " + Welcome to Logseq! + If you encounter any problem, feel free to file an issue on GitHub (https://github.com/logseq/logseq) + or join our Discord server (https://discord.gg/KpN4eHY). .____ | | ____ ____ ______ ____ ______ | | / _ \\ / ___\\/ ___// __ \\/ ____/ @@ -27,14 +30,11 @@ \\/ /_____/ \\/ \\/ |__| " )) - - - - (defn start [] +(defn start [] (when-let [node (.getElementById js/document "root")] (set-router!) (rum/mount (page/current-page) node) - (welcome-message))) + (display-welcome-message))) (defn ^:export init [] ;; init is called ONCE when the page loads From 2fd6bcf80aa5762a5ed02b780e241f8961cf4e78 Mon Sep 17 00:00:00 2001 From: Yukun Guo Date: Tue, 10 Nov 2020 14:51:29 +0800 Subject: [PATCH 3/7] docs: fix links in readme --- readme.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.org b/readme.org index 325f076be..67e57cc73 100644 --- a/readme.org +++ b/readme.org @@ -55,7 +55,7 @@ If you're on Windows, use the [[#windows-setup][Windows setup]]. #+END_SRC *** 6. Open the browser - Open http://localhost:3000. + Open [[http://localhost:3000]]. ** Windows setup @@ -64,7 +64,7 @@ If you're on Windows, use the [[#windows-setup][Windows setup]]. Install clojure through scoop-clojure: https://github.com/littleli/scoop-clojure. You can also install [[https://nodejs.org/en/][Node.js]], [[https://yarnpkg.com/][Yarn]] and [[https://www.postgresql.org/download/][PostgreSQL]] through scoop if you want to. *** 2. Creating a GitHub app - Follow [[step #2][#2-creating-a-github-app]] above if you want Logseq to connect to GitHub. If not, skip this section. + Follow [[#2-creating-a-github-app][step #2]] above if you want Logseq to connect to GitHub. If not, skip this section. The ~GITHUB_APP_PEM~ variable in the ~run-windows.bat~ needs to be set with the correct directory for your system. *** 3. Setup PostgreSQL From 7b3c6bf0170992dc0b87d5e3ccc901578c775839 Mon Sep 17 00:00:00 2001 From: Yukun Guo Date: Tue, 10 Nov 2020 15:05:43 +0800 Subject: [PATCH 4/7] docs: fix grammar in readme --- readme.org | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/readme.org b/readme.org index 67e57cc73..6541cd5b3 100644 --- a/readme.org +++ b/readme.org @@ -4,8 +4,8 @@ ** Website https://logseq.com -** Setup development environment -If you're on Windows, use the [[#windows-setup][Windows setup]]. +** Set up development environment +If you are on Windows, use the [[#windows-setup][Windows setup]]. *** 1. Requirements @@ -15,7 +15,7 @@ If you're on Windows, use the [[#windows-setup][Windows setup]]. **** [[https://nodejs.org/en/][Node.js]] -*** 2. Creating a GitHub app: +*** 2. Create a GitHub app: Follow this step: https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-a-github-app. The ~User authorization callback URL~ should be: http://localhost:3000/auth/github @@ -36,14 +36,14 @@ If you're on Windows, use the [[#windows-setup][Windows setup]]. export LOG_PATH="/tmp/logseq" #+END_SRC -*** 4. Compile javascript +*** 4. Compile to JavaScript #+BEGIN_SRC sh cd web yarn yarn watch #+END_SRC -*** 5. Start the clojure server +*** 5. Start the Clojure server #+BEGIN_SRC sh cd resources @@ -61,17 +61,17 @@ If you're on Windows, use the [[#windows-setup][Windows setup]]. ** Windows setup *** 1. Required software - Install clojure through scoop-clojure: https://github.com/littleli/scoop-clojure. You can also install [[https://nodejs.org/en/][Node.js]], [[https://yarnpkg.com/][Yarn]] and [[https://www.postgresql.org/download/][PostgreSQL]] through scoop if you want to. + Install Clojure through scoop-clojure: https://github.com/littleli/scoop-clojure. You can also install [[https://nodejs.org/en/][Node.js]], [[https://yarnpkg.com/][Yarn]] and [[https://www.postgresql.org/download/][PostgreSQL]] through scoop if you want to. -*** 2. Creating a GitHub app - Follow [[#2-creating-a-github-app][step #2]] above if you want Logseq to connect to GitHub. If not, skip this section. +*** 2. Create a GitHub app + Follow [[#2-create-a-github-app][step #2]] above if you want Logseq to connect to GitHub. If not, skip this section. The ~GITHUB_APP_PEM~ variable in the ~run-windows.bat~ needs to be set with the correct directory for your system. -*** 3. Setup PostgreSQL +*** 3. Set up PostgreSQL Make sure you have PostgreSQL running. You can check if it's running with ~pg_ctl status~ and use ~pg_ctl start~ to start it up. - You'll also need to make a logseq DB in PostgreSQL. Do that with ~createdb logseq~. + You'll also need to make a Logseq DB in PostgreSQL. Do that with ~createdb logseq~. -*** 4. Download the clojure server +*** 4. Download the Clojure server Go to https://github.com/logseq/logseq-internal/releases, download the logseq.jar and move into the root directory of repo. *** 5. Start Logseq From 566dd27082820c2bded576b3321ffb5b3ec5226f Mon Sep 17 00:00:00 2001 From: Yukun Guo Date: Tue, 10 Nov 2020 15:22:40 +0800 Subject: [PATCH 5/7] docs: fix format in readme --- readme.org | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/readme.org b/readme.org index 6541cd5b3..2cd8447dc 100644 --- a/readme.org +++ b/readme.org @@ -9,16 +9,16 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. *** 1. Requirements -**** [[https://clojure.org/guides/getting_started][Java && Clojure]] +- [[https://clojure.org/guides/getting_started][Java && Clojure]] -**** [[https://www.postgresql.org/download/][PostgreSQL]] +- [[https://www.postgresql.org/download/][PostgreSQL]] -**** [[https://nodejs.org/en/][Node.js]] +- [[https://nodejs.org/en/][Node.js]] *** 2. Create a GitHub app: - Follow this step: https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-a-github-app. - The ~User authorization callback URL~ should be: - http://localhost:3000/auth/github + Follow the guide at https://docs.github.com/en/free-pro-team@latest/developers/apps/creating-a-github-app, + where the user authorization "Callback URL" should be + =http://localhost:3000/auth/github=. Remember to download the ~private-key.pem~ which will be used for the next step. @@ -31,7 +31,7 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. export GITHUB_APP2_ID="78728" export GITHUB_APP2_KEY="xxxxxxxxxxxxxxxxxxxx" export GITHUB_APP2_SECRET="xxxxxxxxxxxxxxxxxxxx" - # Replace your-code-directory with yours + # Replace your-code-directory and your-app.private-key.pem with yours export GITHUB_APP_PEM="/your-code-directory/your-app.private-key.pem" export LOG_PATH="/tmp/logseq" #+END_SRC @@ -44,15 +44,16 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. #+END_SRC *** 5. Start the Clojure server - #+BEGIN_SRC sh - cd resources + 1. Download jar - # 1. Download jar - Go to https://github.com/logseq/logseq-internal/releases, download the logseq.jar and move it to the "resources" directory. + Go to https://github.com/logseq/logseq-internal/releases, download the =logseq.jar= and move it to the =resources= directory. - # 2. run jar - java -Duser.timezone=UTC -jar logseq.jar - #+END_SRC + 2. Run jar + + #+BEGIN_SRC sh + cd resources + java -Duser.timezone=UTC -jar logseq.jar + #+END_SRC *** 6. Open the browser Open [[http://localhost:3000]]. @@ -64,7 +65,7 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. Install Clojure through scoop-clojure: https://github.com/littleli/scoop-clojure. You can also install [[https://nodejs.org/en/][Node.js]], [[https://yarnpkg.com/][Yarn]] and [[https://www.postgresql.org/download/][PostgreSQL]] through scoop if you want to. *** 2. Create a GitHub app - Follow [[#2-create-a-github-app][step #2]] above if you want Logseq to connect to GitHub. If not, skip this section. + Follow [[#2-create-a-github-app][Step 2]] above if you want Logseq to connect to GitHub. If not, skip this section. The ~GITHUB_APP_PEM~ variable in the ~run-windows.bat~ needs to be set with the correct directory for your system. *** 3. Set up PostgreSQL @@ -72,7 +73,7 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. You'll also need to make a Logseq DB in PostgreSQL. Do that with ~createdb logseq~. *** 4. Download the Clojure server - Go to https://github.com/logseq/logseq-internal/releases, download the logseq.jar and move into the root directory of repo. + Go to https://github.com/logseq/logseq-internal/releases, download the =logseq.jar= and move into the root directory of repo. *** 5. Start Logseq Run ~start-windows.bat~ which is located in the repo. This will open a second terminal that runs Logseq's backend server. From 370265d4e50e68d47ed2cfe6831da0bc479d358e Mon Sep 17 00:00:00 2001 From: Yukun Guo Date: Tue, 10 Nov 2020 15:34:17 +0800 Subject: [PATCH 6/7] docs: PostgreSQL setup for unix-like systems --- readme.org | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/readme.org b/readme.org index 2cd8447dc..ff4943d3a 100644 --- a/readme.org +++ b/readme.org @@ -22,7 +22,13 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. Remember to download the ~private-key.pem~ which will be used for the next step. -*** 3. Add environment variables +*** 3. Set up PostgreSQL + +Make sure you have PostgreSQL running. You can check if it's running with ~pg_ctl -D /usr/local/var/postgres status~ +and use ~pg_ctl -D /usr/local/var/postgres start~ to start it up. +You'll also need to make a Logseq DB in PostgreSQL. Do that with ~createdb logseq~. + +*** 4. Add environment variables #+BEGIN_SRC sh export ENVIRONMENT="dev" export JWT_SECRET="4fa183cf1d28460498b13330835e80ab" @@ -36,14 +42,14 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. export LOG_PATH="/tmp/logseq" #+END_SRC -*** 4. Compile to JavaScript +*** 5. Compile to JavaScript #+BEGIN_SRC sh cd web yarn yarn watch #+END_SRC -*** 5. Start the Clojure server +*** 6. Start the Clojure server 1. Download jar Go to https://github.com/logseq/logseq-internal/releases, download the =logseq.jar= and move it to the =resources= directory. @@ -55,7 +61,7 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. java -Duser.timezone=UTC -jar logseq.jar #+END_SRC -*** 6. Open the browser +*** 7. Open the browser Open [[http://localhost:3000]]. From cc6072055aadfc958eb18549528bd6fc5ee4b6fe Mon Sep 17 00:00:00 2001 From: Yukun Guo Date: Tue, 10 Nov 2020 15:43:42 +0800 Subject: [PATCH 7/7] docs: remove redundant words --- readme.org | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.org b/readme.org index ff4943d3a..c0d45a693 100644 --- a/readme.org +++ b/readme.org @@ -1,5 +1,5 @@ * Logseq - Logseq is A privacy-first, open-source platform for knowledge sharing and management. + A privacy-first, open-source platform for knowledge sharing and management. ** Website https://logseq.com @@ -9,7 +9,7 @@ If you are on Windows, use the [[#windows-setup][Windows setup]]. *** 1. Requirements -- [[https://clojure.org/guides/getting_started][Java && Clojure]] +- [[https://clojure.org/guides/getting_started][Java & Clojure]] - [[https://www.postgresql.org/download/][PostgreSQL]]