From 57f088bc9ca6f5884995a7532dc575eece6448f5 Mon Sep 17 00:00:00 2001 From: James Date: Fri, 23 Jul 2021 14:08:30 -0400 Subject: [PATCH 1/7] 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 2/7] 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 3/7] 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 4/7] 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 5/7] 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 6/7] 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 7/7] 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")