[FEATURE] Add :file header argument to org-ql dynamic blocks
Dynamic blocks are great, could we add :file (or :from if you want to stay consistent with your documentation) as a header argument to specify what files org-ql searches?
Example:
#+BEGIN: org-ql :query "todo: priority:A,B" :columns (todo (priority "P") deadline heading) :sort (deadline priority) :take 7 :ts-format "%Y-%m-%d %H:%M :file org-agenda-files"
| Todo | P | Deadline | Heading |
|------+---+------------------+---------------------------------------|
| TODO | A | 2017-07-07 00:00 | Take over the world |
| TODO | B | 2017-07-10 00:00 | Renew membership in supervillain club |
| TODO | A | 2017-07-15 00:00 | Take over the universe |
| TODO | B | 2017-07-21 00:00 | Internet |
| TODO | A | 2017-08-01 00:00 | Spaceship lease |
| TODO | A | | Skype with president of Antarctica |
| TODO | B | | Take over Mars |
#+END:
Thanks, good idea.
One good example how this feature can be used is automatic backlinks. It becomes trivial to list all the headings containing links to current heading.
@yantar92 I post something like that here : https://github.com/org-roam/org-roam/issues/1336
I would love to see this! My personal need is just to be able to select the options of either using the org-agenda-files or current-buffer. These two options are enough for me. Specifying the file could give more freedom but this is not necessary to me. My entire purpose is to put the dynamic blocks to create a daily, weekly, or monthly review template by querying my org-agenda-files.
This should probably depend on the fixes discussed in #228.
Retargeting this for 0.7. 0.6 has been delayed for too long.
I'm looking forward to this feature coming. I also noticed that clocktable dynamic blocks has scope parameter. You may or may not want to follow its interface.
Any news about this feature? Would be awesome in combination with org roam and todo lists.
Actually, yes. I pushed a WIP branch with some improvements, including adding a :from argument to the blocks that can accept a list of filename strings:
- https://github.com/alphapapa/org-ql/compare/wip/dynamic-block-improvements
- https://github.com/alphapapa/org-ql/commit/65a5ff7c9afa2d4188f82cc6d7e124dff522e002
It also includes some other small improvements, like using relative timestamps for and adding a planning column.
Feel free to try it out and let me know what you think. It could probably go into a v0.8-pre commit soon.
See also this branch, which I think will be very useful: https://github.com/alphapapa/org-ql/commit/70cfee6d570875bd19cc1e2b711d2b51e9432c20
See also this branch, which I think will be very useful: 70cfee6
Looks awesome, i will give it a try.
Actually, yes. I pushed a WIP branch with some improvements, including adding a
:fromargument to the blocks that can accept a list of filename strings:
- https://github.com/alphapapa/org-ql/compare/wip/dynamic-block-improvements
- 65a5ff7
It also includes some other small improvements, like using relative timestamps for and adding a
planningcolumn.Feel free to try it out and let me know what you think. It could probably go into a v0.8-pre commit soon.
Ah, great I have been wanting dynamic blocks that source from other files. I added ((pred functionp) (funcall from)) so that :from could be a function (https://github.com/alphapapa/org-ql/commit/65a5ff7c9afa2d4188f82cc6d7e124dff522e002#diff-4b3992feea362ab38c27e90987e7151d2d9d7f3f41e1ec4ee7973ca0ef00b969R309). It doesn't seem to want to use id links for the headlines. Swapping out (format-element element) for link does make it use the id link, but it sticks it in the first column only (https://github.com/alphapapa/org-ql/commit/65a5ff7c9afa2d4188f82cc6d7e124dff522e002#diff-4b3992feea362ab38c27e90987e7151d2d9d7f3f41e1ec4ee7973ca0ef00b969R387).