From 000f2b0c65822ea467a121ca8142b90631a6dd16 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 18:35:13 -0400 Subject: [PATCH 01/23] Move installation section, copyedit --- README.md | 54 +++++++++++++++++++++++++++--------------------------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/README.md b/README.md index cfe7803..ec0f0c7 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,32 @@ Tree query is a tool that searches across indented lines. It is a replacement for Roam's query system. It supports everything Roam does, except for block references. +## Quickstart + +**Query in current directory:** +``` +tree-query '{and: [[Page 1]] [[Page 2]]}' . +``` +[*Learn to navigate to a working directory with `cd`*](https://linuxize.com/post/linux-cd-command/) + +**Query in a folder:** +``` +tree-query '{and: [[Page 1]] [[Page 2]]}' /Users/steve/myfoldername/ +``` +*Learn to get the location of a folder on [macOS](https://osxdaily.com/2009/11/23/copy-a-files-path-to-the-terminal-by-dragging-and-dropping/), [Windows](https://www.top-password.com/blog/copy-full-path-of-a-folder-file-in-windows/), or [GNU+Linux](https://unix.stackexchange.com/questions/102551/mouse-shortcut-to-copy-the-path-to-a-file-in-the-gnome-file-manager).* + +Or query in multiple folders and files: + +``` +tree-query '{and: [[Page 1]] [[Page 2]]}' /Users/steve/myfoldername/ file1 +``` + +**Query stdin with pipes:** +``` +cat myfile | tree-query '{and: [[Page 1]] [[Page 2]]}' +``` +[*Learn to build powerful no-code applications using pipes*](https://youtu.be/tc4ROCJYbm0?t=360) + ## Installation ### Build from source @@ -16,7 +42,7 @@ On FreeBSD, GNU+Linux, and macOS, open Terminal and go: curl https://dlang.org/install.sh | bash -s ``` -On Windows, download and install [Git Bash](https://gitforwindows.org/): +On Windows, download and install [Git Bash](https://gitforwindows.org/), then run: ``` mkdir %USERPROFILE%\dlang powershell.exe -Command "wget https://dlang.org/install.sh -OutFile %USERPROFILE%\dlang\install.sh" @@ -39,32 +65,6 @@ chmod 700 ~/Downloads/tree-query sudo mv ~/Downloads/tree-query /usr/local/bin ``` -## Quickstart - -**Query in current directory:** -``` -tree-query '{and: [[Page 1]] [[Page 2]]}' . -``` -[*Learn to navigate to a working directory with `cd`*](https://linuxize.com/post/linux-cd-command/) - -**Query in a folder:** -``` -tree-query '{and: [[Page 1]] [[Page 2]]}' /Users/steve/myfoldername/ -``` -*Learn to get the location of a folder on [macOS](https://osxdaily.com/2009/11/23/copy-a-files-path-to-the-terminal-by-dragging-and-dropping/), [Windows](https://www.top-password.com/blog/copy-full-path-of-a-folder-file-in-windows/), or [GNU+Linux](https://unix.stackexchange.com/questions/102551/mouse-shortcut-to-copy-the-path-to-a-file-in-the-gnome-file-manager).* - -Or query in multiple folders and files: - -``` -tree-query '{and: [[Page 1]] [[Page 2]]}' /Users/steve/myfoldername/ file1 -``` - -**Query stdin with pipes:** -``` -cat myfile | tree-query '{and: [[Page 1]] [[Page 2]]}' -``` -[*Learn to build powerful no-code applications using pipes*](https://youtu.be/tc4ROCJYbm0?t=360) - ## Features This section is a work-in-progress. From 854acfed6599b4a589fd6608fa4bbc06696ebf8a Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 18:37:41 -0400 Subject: [PATCH 02/23] Clarify mixing tabs issue --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index ec0f0c7..5e23db6 100644 --- a/README.md +++ b/README.md @@ -103,4 +103,4 @@ A string in D is a reference to a region of immutable memory. It is a length and A struct is like a Java record or class. ## Known bugs - - Mixing tabs and spaces is not supported, unless an explicit spaces per indent specified + - Mixing tabs and spaces is not supported in the same file, unless an explicit spaces per indent specified From e7f1f2d3ce19ea0095c0fe6104f7af9582f9a21a Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 18:43:08 -0400 Subject: [PATCH 03/23] Add GNU Kind Communication Guidelines as CoC --- CODE_OF_CONDUCT.md | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 CODE_OF_CONDUCT.md diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md new file mode 100644 index 0000000..a20bea7 --- /dev/null +++ b/CODE_OF_CONDUCT.md @@ -0,0 +1,31 @@ +# GNU Kind Communications Guidelines + +by Richard Stallman +## Purpose + +The GNU Project encourages contributions from anyone who wishes to advance the development of the GNU system, regardless of gender, race, ethnic group, physical appearance, religion, cultural background, and any other demographic characteristics, as well as personal political views. + +People are sometimes discouraged from participating in GNU development because of certain patterns of communication that strike them as unfriendly, unwelcoming, rejecting, or harsh. This discouragement particularly affects members of disprivileged demographics, but it is not limited to them. Therefore, we ask all contributors to make a conscious effort, in GNU Project discussions, to communicate in ways that avoid that outcome—to avoid practices that will predictably and unnecessarily risk putting some contributors off. + +These guidelines suggest specific ways to accomplish that goal. + +## Guidelines + +- Please assume other participants are posting in good faith, even if you disagree with what they say. When people present code or text as their own work, please accept it as their work. Please do not criticize people for wrongs that you only speculate they may have done; stick to what they actually say and actually do. +- Please think about how to treat other participants with respect, especially when you disagree with them. For instance, call them by the names they use, and honor their preferences about their gender identity[1]. +- Please do not take a harsh tone towards other participants, and especially don't make personal attacks against them. Go out of your way to show that you are criticizing a statement, not a person. +- Please recognize that criticism of your statements is not a personal attack on you. If you feel that someone has attacked you, or offended your personal dignity, please don't “hit back” with another personal attack. That tends to start a vicious circle of escalating verbal aggression. A private response, politely stating your feelings as feelings, and asking for peace, may calm things down. Write it, set it aside for hours or a day, revise it to remove the anger, and only then send it. +- Please avoid statements about the presumed typical desires, capabilities or actions of some demographic group. They can offend people in that group, and they are always off-topic in GNU Project discussions. +- Please be especially kind to other contributors when saying they made a mistake. Programming means making lots of mistakes, and we all do so—this is why regression tests are useful. Conscientious programmers make mistakes, and then fix them. It is helpful to show contributors that being imperfect is normal, so we don't hold it against them, and that we appreciate their imperfect contributions though we hope they follow through by fixing any problems in them. +- Likewise, be kind when pointing out to other contributors that they should stop using certain nonfree software. For their own sake, they ought to free themselves, but we welcome their contributions to our software packages even if they don't do that. So these reminders should be gentle and not too frequent—don't nag. +- By contrast, to suggest that others run a nonfree program opposes the basic principles of GNU, so it is not allowed in GNU Project discussions. +- Please respond to what people actually said, not to exaggerations of their views. Your criticism will not be constructive if it is aimed at a target other than their real views. +- If in a discussion someone brings up a tangent to the topic at hand, please keep the discussion on track by focusing on the current topic rather than the tangent. This is not to say that the tangent is bad, or not interesting to discuss—only that it shouldn't interfere with discussion of the issue at hand. In most cases, it is also off-topic, so those interested ought to discuss it somewhere else. +- If you think the tangent is an important and pertinent issue, please bring it up as a separate discussion, with a Subject field to fit, and consider waiting for the end of the current discussion. +- Rather than trying to have the last word, look for the times when there is no need to reply, perhaps because you already made the relevant point clear enough. If you know something about the game of Go, this analogy might clarify that: when the other player's move is not strong enough to require a direct response, it is advantageous to give it none and instead move elsewhere. +- Please don't argue unceasingly for your preferred course of action when a decision for some other course has already been made. That tends to block the activity's progress. +- If others have irritated you, perhaps by disregarding these guidelines, please don't excoriate them, and especially please don't hold a grudge against them. The constructive approach is to encourage and help other people to do better. When they are trying to learn to do better, please give them plenty of chances. +- If other participants complain about the way you express your ideas, please make an effort to cater to them. You can find ways to express the same points while making others more comfortable. You are more likely to persuade others if you don't arouse ire about secondary things. +- Please don't raise unrelated political issues in GNU Project discussions, because they are off-topic. The only political positions that the GNU Project endorses are (1) that users should have control of their own computing (for instance, through free software) and (2) supporting basic human rights in computing. We don't require you as a contributor to agree with these two points, but you do need to accept that our decisions will be based on them. + +By making an effort to follow these guidelines, we will encourage more contribution to our projects, and our discussions will be friendlier and reach conclusions more easily. From e705d685f814b319a3c84b54cdac29e4f9f37590 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 19:06:16 -0400 Subject: [PATCH 04/23] Add basic build (windows, macos todo) --- .github/workflows/make.yml | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 .github/workflows/make.yml diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml new file mode 100644 index 0000000..67ebc6a --- /dev/null +++ b/.github/workflows/make.yml @@ -0,0 +1,22 @@ +name: Makefile CI + +on: + push: + branches: [ main ] + pull_request: + branches: [ main ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - uses: dlang-community/setup-dlang@4c99aa991ce7d19dd3064de0a4f2f6b2f152e2d7 + - name: make tree-query + run: make + - name: make tree-query-build + run: make tree-query-build + - name: make distcheck + run: make distcheck From 65147fc771a73343c03ba1b5b3874cb405a042c5 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 19:10:46 -0400 Subject: [PATCH 05/23] Compile with ldc2 --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 130d0ef..67efc18 100644 --- a/Makefile +++ b/Makefile @@ -9,5 +9,5 @@ md2sexpr-build: # Compile with LLVM tree-query-build: - ~/dlang/ldc-1.23.0/bin/ldc2 --link-defaultlib-shared=false -O2 -release tree-query.d interp.d query.d parser.d + ldc2 --link-defaultlib-shared=false -O2 -release tree-query.d interp.d query.d parser.d strip tree-query From e098b8e75e5a009207296b48cd290ca0d73d4011 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 19:13:49 -0400 Subject: [PATCH 06/23] Fix Makefile CI --- .github/workflows/make.yml | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 67ebc6a..8865293 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -8,12 +8,20 @@ on: jobs: build: + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macOS-latest] + dc: [dmd-latest, ldc-latest, dmd-2.085.0, ldc-1.17.0] + exclude: + - { os: macOS-latest, dc: dmd-2.085.0 } - runs-on: ubuntu-latest - + runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v2 - - uses: dlang-community/setup-dlang@4c99aa991ce7d19dd3064de0a4f2f6b2f152e2d7 + - name: Install D compiler + uses: dlang-community/setup-dlang@v1 + with: + compiler: ${{ matrix.dc }} - name: make tree-query run: make - name: make tree-query-build From e4ff88d745e5916d40d194b170fee0ea8809a8de Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 19:18:46 -0400 Subject: [PATCH 07/23] Update make.yml --- .github/workflows/make.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 8865293..df54ea9 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -23,8 +23,8 @@ jobs: with: compiler: ${{ matrix.dc }} - name: make tree-query - run: make + run: (dmd && make) || true - name: make tree-query-build - run: make tree-query-build + run: (ldc && make tree-query-build) || true - name: make distcheck run: make distcheck From 1cb46bc9dc46e52fc6177a19f4581723a04ff391 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 19:19:31 -0400 Subject: [PATCH 08/23] Update make.yml --- .github/workflows/make.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index df54ea9..71f68c6 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -26,5 +26,5 @@ jobs: run: (dmd && make) || true - name: make tree-query-build run: (ldc && make tree-query-build) || true - - name: make distcheck - run: make distcheck + #- name: make distcheck + # run: make distcheck From 0f095e002b099e8afb54761e297a130b594aa3c2 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 19:20:52 -0400 Subject: [PATCH 09/23] Update make.yml --- .github/workflows/make.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 71f68c6..913b323 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -23,8 +23,8 @@ jobs: with: compiler: ${{ matrix.dc }} - name: make tree-query - run: (dmd && make) || true + run: (dmd && make && echo "Built successfully with DMD Reference Compiler!") || true - name: make tree-query-build - run: (ldc && make tree-query-build) || true + run: (ldc2 && make tree-query-build && echo "Built successfully with LLVM D Compiler!") || true #- name: make distcheck # run: make distcheck From ca9783f7ace2185924390197de8053fd318085b5 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 19:23:49 -0400 Subject: [PATCH 10/23] Update make.yml --- .github/workflows/make.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml index 913b323..1db18c4 100644 --- a/.github/workflows/make.yml +++ b/.github/workflows/make.yml @@ -10,7 +10,7 @@ jobs: build: strategy: matrix: - os: [ubuntu-latest, windows-latest, macOS-latest] + os: [ubuntu-latest, macOS-latest] dc: [dmd-latest, ldc-latest, dmd-2.085.0, ldc-1.17.0] exclude: - { os: macOS-latest, dc: dmd-2.085.0 } @@ -23,8 +23,8 @@ jobs: with: compiler: ${{ matrix.dc }} - name: make tree-query - run: (dmd && make && echo "Built successfully with DMD Reference Compiler!") || true + run: (which dmd && make && echo "Built successfully with DMD Reference Compiler!") || true - name: make tree-query-build - run: (ldc2 && make tree-query-build && echo "Built successfully with LLVM D Compiler!") || true + run: (which ldc2 && make tree-query-build && echo "Built successfully with LLVM D Compiler!") || true #- name: make distcheck # run: make distcheck From 9aac9418e56153717cb12e588b48fb6fbe426e37 Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 21:14:05 -0400 Subject: [PATCH 11/23] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 5e23db6..505dc6f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,8 @@ Tree query is a tool that searches across indented lines. It is a replacement for Roam's query system. It supports everything Roam does, except for block references. +[Join us on Discord](https://discord.gg/7B9ywS5x) + ## Quickstart **Query in current directory:** From d20eeeeac4ad5abccfde3858a61ce4ccb029e0bf Mon Sep 17 00:00:00 2001 From: James Date: Thu, 17 Jun 2021 21:16:19 -0400 Subject: [PATCH 12/23] Delete make.yml --- .github/workflows/make.yml | 30 ------------------------------ 1 file changed, 30 deletions(-) delete mode 100644 .github/workflows/make.yml diff --git a/.github/workflows/make.yml b/.github/workflows/make.yml deleted file mode 100644 index 1db18c4..0000000 --- a/.github/workflows/make.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Makefile CI - -on: - push: - branches: [ main ] - pull_request: - branches: [ main ] - -jobs: - build: - strategy: - matrix: - os: [ubuntu-latest, macOS-latest] - dc: [dmd-latest, ldc-latest, dmd-2.085.0, ldc-1.17.0] - exclude: - - { os: macOS-latest, dc: dmd-2.085.0 } - - runs-on: ${{ matrix.os }} - steps: - - uses: actions/checkout@v2 - - name: Install D compiler - uses: dlang-community/setup-dlang@v1 - with: - compiler: ${{ matrix.dc }} - - name: make tree-query - run: (which dmd && make && echo "Built successfully with DMD Reference Compiler!") || true - - name: make tree-query-build - run: (which ldc2 && make tree-query-build && echo "Built successfully with LLVM D Compiler!") || true - #- name: make distcheck - # run: make distcheck From 77bf65d1318d39d16f79f5ea4e7abbe079fe6513 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 13 Jul 2021 13:50:42 -0400 Subject: [PATCH 13/23] Fix minor doc error for Unixes --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 505dc6f..3b5ba74 100644 --- a/README.md +++ b/README.md @@ -63,8 +63,8 @@ make tree-query-build Install to make available eveywhere: ``` -chmod 700 ~/Downloads/tree-query -sudo mv ~/Downloads/tree-query /usr/local/bin +chmod 700 tree-query +sudo mv tree-query /usr/local/bin ``` ## Features From f2f75ecd2e66ad6325fb17e4855fac710b8dc2ba Mon Sep 17 00:00:00 2001 From: James Date: Fri, 23 Jul 2021 13:23:34 -0400 Subject: [PATCH 14/23] Improve Windows build instrunctions --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 3b5ba74..684aa57 100644 --- a/README.md +++ b/README.md @@ -53,6 +53,8 @@ powershell.exe -Command "wget https://dlang.org/install.sh -OutFile %USERPROFILE Then: ``` +set PATH=%PATH%;C:\Program Files\7-Zip +set BASH="\Program Files\Git\usr\bin\bash.exe ~/dlang/install.sh install ldc-1.23.0,dub ``` From 0bd5f595aa3781bd35d4d7822658b37964002ac8 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 23 Jul 2021 13:59:03 -0400 Subject: [PATCH 15/23] Fix Windows build instrunctions --- README.md | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 684aa57..1bb21e7 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ > This README is TODO. If you'd like to use this software in a project, **don't hestiate to reach out to me.** -Tree query is a tool that searches across indented lines. +`tree-query` is a tool that lets you execute queries on ordinary directories of files like text and Markdown, inspired by Roam Research's query syntax. It is a replacement for Roam's query system. It supports everything Roam does, except for block references. @@ -44,26 +44,26 @@ On FreeBSD, GNU+Linux, and macOS, open Terminal and go: curl https://dlang.org/install.sh | bash -s ``` -On Windows, download and install [Git Bash](https://gitforwindows.org/), then run: +On Windows, download and install [Git Bash](https://gitforwindows.org/) and [7-Zip to C:\Program Files](https://www.7-zip.org/), then run: ``` mkdir %USERPROFILE%\dlang -powershell.exe -Command "wget https://dlang.org/install.sh -OutFile %USERPROFILE%\dlang\install.sh" +set PATH="%PATH%;C:\Program Files\7-Zip" +set BASH="\Program Files\Git\usr\bin\bash.exe" +mkdir dlang +powershell.exe -Command "wget https://dlang.org/install.sh -OutFile dlang\install.sh" ``` Then: - ``` -set PATH=%PATH%;C:\Program Files\7-Zip -set BASH="\Program Files\Git\usr\bin\bash.exe -~/dlang/install.sh install ldc-1.23.0,dub +~/dlang/install.sh install ldc-1.23.0 ``` -Then `cd` into the directory where you cloned this directory and type: +Then `cd` into the directory where you cloned this directory (`git clone https://github.com/CrazyPython/tree-query.git && cd tree-query`) and type: ``` -make tree-query-build +~/dlang/ldc-1.23.0/bin/ldc2 --link-defaultlib-shared=false -O2 -release tree-query.d interp.d query.d parser.d ``` -Install to make available eveywhere: +(Non-Windows) Install to make available eveywhere: ``` chmod 700 tree-query sudo mv tree-query /usr/local/bin From 7ea6266e596045f3bbb09fd5418f790e1d7e340a Mon Sep 17 00:00:00 2001 From: James Date: Fri, 23 Jul 2021 14:04:16 -0400 Subject: [PATCH 16/23] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index d5bcd63..3f07b60 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,10 +1,11 @@ # Release notes -## Since 0.0.1 +## 0.0.2 - Added hyperlinked documentation on usage instructions for people new to the CLI - Added missing source files, now it's possible to compile - Support for starting queries with `{query:` was enabled - Shows message when executed without a query + - Fixed build instructions for Windows and added a binary release for Windows and Mac ## 0.0.1 - Supports `{and:`, `{or:`, `{not:`, nested arbitrarily, querying using page references From 57f088bc9ca6f5884995a7532dc575eece6448f5 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 23 Jul 2021 14:08:30 -0400 Subject: [PATCH 17/23] Update RELEASE_NOTES.md --- RELEASE_NOTES.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 3f07b60..d6b48e2 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,13 +1,13 @@ # Release notes -## 0.0.2 +## 0.1.1 - Added hyperlinked documentation on usage instructions for people new to the CLI - Added missing source files, now it's possible to compile - Support for starting queries with `{query:` was enabled - Shows message when executed without a query - Fixed build instructions for Windows and added a binary release for Windows and Mac -## 0.0.1 +## 0.1.0 - Supports `{and:`, `{or:`, `{not:`, nested arbitrarily, querying using page references - Works on any kind of indentation, including tabs, spaces. - Caveat: Mixing tabs and spaces in one file may lead to undesired results, because a tab is interpreted as one space From e2bc80e72ff26372ae98d0a8a29075499b6cc81d Mon Sep 17 00:00:00 2001 From: James Date: Fri, 23 Jul 2021 14:10:03 -0400 Subject: [PATCH 18/23] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1bb21e7..bace193 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,10 @@ cat myfile | tree-query '{and: [[Page 1]] [[Page 2]]}' [*Learn to build powerful no-code applications using pipes*](https://youtu.be/tc4ROCJYbm0?t=360) ## Installation +### [Download a copy](https://github.com/CrazyPython/tree-query/releases/tag/v0.1.1) +The more convenient method. Click above for instructions. ### Build from source -Currently the only supported method. DYI style. On FreeBSD, GNU+Linux, and macOS, open Terminal and go: ``` From 30e2beafb61c7d2f0200ceec7f9e3f134b286af8 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 17 Jun 2021 18:55:36 -0400 Subject: [PATCH 19/23] Add "Your Rights" section --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bace193..e665016 100644 --- a/README.md +++ b/README.md @@ -108,4 +108,21 @@ A string in D is a reference to a region of immutable memory. It is a length and A struct is like a Java record or class. ## Known bugs - - Mixing tabs and spaces is not supported in the same file, unless an explicit spaces per indent specified + - Mixing tabs and spaces in the same file is not supported, unless an explicit spaces per indent specified + +## Your rights + +This is open-source software. + +We use copyleft to gurantee these rights: + +0. Free for commercial use and any other purpose +1. Freedom to remix to fit your needs: You (and if you can't code, by proxy a programmer you hire) have freedom to add new query keywords, completely change the query system, add support for new formats like org-mode, or anything else +2. Freedom to help friends by sharing +3. Freedom to share remixes, commercially and noncommercially + +I believe knowledge management is a deeply, and everyone should have freedom over their "digital brain." A digital brain is a deeply intimate and personal thing. This means you are the sovereign of your digital brain. + +Compatible with permissive licenses like Apache License, MIT License, and Mozilla Public License. + +(C) 2021. Affero General Public License v3.0 or any later version From b6ff559fb432108db5b37b255ee8b05fda89e1a2 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 23 Jul 2021 16:16:10 -0400 Subject: [PATCH 20/23] Add org-mode support --- parser.d | 1 + 1 file changed, 1 insertion(+) diff --git a/parser.d b/parser.d index 68a5c2b..ae1389b 100644 --- a/parser.d +++ b/parser.d @@ -14,6 +14,7 @@ int count_indents(ref int i, string input, int spaces_per_indent=4) { for (; i < input.length; ++i) { switch (input[i]) { case ' ': nspaces++; break; + case '*': nspaces++; break; case '\t': nspaces += spaces_per_indent; break; // Commented out makes it only accept "-" //case '-': return nspaces / spaces_per_indent; From 2798c61cbd19b26d26b614ce64f6b5feb9cc2d35 Mon Sep 17 00:00:00 2001 From: James Date: Sat, 24 Jul 2021 21:18:03 -0400 Subject: [PATCH 21/23] Update README.md --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index e665016..9cbc4c4 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,8 @@ tree-query '{and: [[Page 1]] [[Page 2]]}' . | xclip ## Contributing +`tree-query` has doc comments on internals and example code demonstrating how internal APIs work. (Ctrl-F for "unittest") + Tree-query is written in [Dlang](https://dlang.org) but don't let that put you off- if you know C, C++, or Java, you'll pick it up very quickly. If you have any questions on D, feel free to go to #d on freenode or D Forums. People are very nice. From a2b791dd30798a8708889d526d205da789a05069 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 30 Jul 2021 09:20:41 -0400 Subject: [PATCH 22/23] Add file overview --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 9cbc4c4..850c1fc 100644 --- a/README.md +++ b/README.md @@ -91,6 +91,14 @@ tree-query '{and: [[Page 1]] [[Page 2]]}' . | xclip ## Contributing +**query.d**: The logic for executing Roam queries + +**parser.d**: The Markdown parser + +**tree-query.d**: The command-line tool/wrapper. Parses the string `{and: [[Page 1]] [[Page 2]]}` into a tree of boolean expressions + +**interp.d**: Evaluates boolean expressions on behalf of query.d + `tree-query` has doc comments on internals and example code demonstrating how internal APIs work. (Ctrl-F for "unittest") Tree-query is written in [Dlang](https://dlang.org) but don't let that put you off- if you know C, C++, or Java, you'll pick it up very quickly. From a0833c524bb414378f30480af84147894ebbeeba Mon Sep 17 00:00:00 2001 From: James Date: Fri, 30 Jul 2021 09:22:46 -0400 Subject: [PATCH 23/23] Update README.md --- README.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 850c1fc..4debf04 100644 --- a/README.md +++ b/README.md @@ -93,11 +93,11 @@ tree-query '{and: [[Page 1]] [[Page 2]]}' . | xclip **query.d**: The logic for executing Roam queries -**parser.d**: The Markdown parser +**parser.d**: The Markdown/org-mode parser, which detects the indentation level of each line and uses it to emit a stream of events for a handler like `query.d` to consume. -**tree-query.d**: The command-line tool/wrapper. Parses the string `{and: [[Page 1]] [[Page 2]]}` into a tree of boolean expressions +**tree-query.d**: The command-line tool/wrapper. Recursively parses the string `{and: [[Page 1]] [[Page 2]]}` into a tree of expressions -**interp.d**: Evaluates boolean expressions on behalf of query.d +**interp.d**: Recursively evaluates boolean expressions on behalf of query.d `tree-query` has doc comments on internals and example code demonstrating how internal APIs work. (Ctrl-F for "unittest")