Orgzly-android: Org-Capture Implementation

Created on 15 May 2017  Â·  11Comments  Â·  Source: orgzly/orgzly-android

Howdy,

I'd love to have org-capture within orgzly, and I've been looking into implementing it. I've poked around and worked on it a bit, and I think it's time to check in and ask a few questions..

I plan on building it such that it works with voice commands.

"Ok Google, capture [idea]"
This would prompt the user to begin speaking and would fill in the idea template.

The template would be a set of default templates or user-edited ones. Currently I plan on using a subset of the template syntax/features that are used in the emacs version of org-capture. Certain template options are either not applicable to implement or would be too complex for my contribution's scope.

Questions:
@nevenz is this something that you'd be interested in pulling into your repo if it was done?
Have you already pursued this in a long-forgotten branch? What do you think? Any problems you foresee?

feature

Most helpful comment

There have been requests for implementing templates, so yeah, actually implementing templates sounds great. 😄

BTW, you can already quickly create a note:

  • Using voice: Saying "create note" and using Orgzly as an app (probably can be set as default)
  • Enabling ongoing notification, so you can just swipe down notification drawer and click

But you can only change the notebook currently and note will be created as a last top-level note in it. So choosing a template should probably be squeezed somewhere in there.

I don't know what's possible to do using voice. Can we actually define a phrase and map it to activity/action/extras? If not, in the worst case, Orgzly can recognize it in the title. So instead of saving a note using "capture orgzly feedback save current location as a property" as a title, Orgzly can create "Save current location as a property" in "orgzly.org/Feedback/". If we defined "orgzly feedback" as a template. Something along those lines?

Using voice or not, a new dropdown can be added to ShareActivity. Currently there is only one for changing the notebook. Adding one for location was planned (to allow browsing the tree, like when refiling in Org mode). Another one can be for templates which, when item is selected, would set both notebook and location, as well as any other property (state, priority, title, tags, planning times, properties, content). Though location should probably include the notebook ("orgzly.com/Feedback").

Anyway, just random thoughts.

I'd probably start with data structure and location - how and where to store defined templates.

All 11 comments

There have been requests for implementing templates, so yeah, actually implementing templates sounds great. 😄

BTW, you can already quickly create a note:

  • Using voice: Saying "create note" and using Orgzly as an app (probably can be set as default)
  • Enabling ongoing notification, so you can just swipe down notification drawer and click

But you can only change the notebook currently and note will be created as a last top-level note in it. So choosing a template should probably be squeezed somewhere in there.

I don't know what's possible to do using voice. Can we actually define a phrase and map it to activity/action/extras? If not, in the worst case, Orgzly can recognize it in the title. So instead of saving a note using "capture orgzly feedback save current location as a property" as a title, Orgzly can create "Save current location as a property" in "orgzly.org/Feedback/". If we defined "orgzly feedback" as a template. Something along those lines?

Using voice or not, a new dropdown can be added to ShareActivity. Currently there is only one for changing the notebook. Adding one for location was planned (to allow browsing the tree, like when refiling in Org mode). Another one can be for templates which, when item is selected, would set both notebook and location, as well as any other property (state, priority, title, tags, planning times, properties, content). Though location should probably include the notebook ("orgzly.com/Feedback").

Anyway, just random thoughts.

I'd probably start with data structure and location - how and where to store defined templates.

I already have this setup to use voice using IFTTT.

For the "if this" section in the builder, choose the google assistant assistant trigger "say a simple phrase with a text ingredient." Customize the trigger phrase(s) to fit your liking, and enter the response you want.

For the "then that" section choose dropbox, and the "append to textfile " option. You can then choose a text to append to the end of the file, which you can later refile to your desired subheading. I have created multiple of these templates, and it works beautifully :)

Btw, you have to change the org file from *.org to *.org.txt if you want it to work properly.

OK, so I'm setting up templates to be composed of the string template itself and the template target. The template target will be a list of heading names, their indices corresponding to the heading "level". I hope to support the File, File+Headline, and File+Datetree, as defined here: http://orgmode.org/manual/Template-elements.html#Template-elements.

Right now I'm working to get the template placed into the correct location.

Questions

  1. What's the best way(class/function) to create a note that is nested within a specific node in the list? There are enough Node/Note/OrgHead/etc classes that I'm not sure which way to approach it.
  1. Is there currently a way to look for a specific series of headings? Like if there was a datetree capture template, I might be looking for the June 24th subheading of the 2016 top level heading. If not, I'll try to implement.

  2. Should I attempt to support more than one "heading" per template? In my Emacs templates, I can include arbitrary org text, and thus the inserted template can be quite complicated(including several headings, lists, etc). However, since Orgzly must parse the text prior to insertion(as I understand it), this could be tricky. It might include several transactions with several Notes into the DB, and a little madness with the updates to the nested set model. Additionally, if we decided to allow more than one "heading" per template, the voice transaction activity for captured templates would have to be different. The ShareActivity page only handles a single Note, whereas for the capture template I would probably just ask for a keyword and text to capture.

What's the best way(class/function) to create a note that is nested within a specific node in the list?

You can take a look at Shelf's createNote. NotePlace being the object which defines where to create the note.

Is there currently a way to look for a specific series of headings?

No, that would be useful for refiling too for example. It can probably be a generic way to convert array of titles to NotePlace.

Should I attempt to support more than one "heading" per template?

I don't think it worth it, but it might not be that hard. Cutting and paste for example already work on subtrees, so there'd be code reuse there.

I'd love this feature as well, particulary in combination with #339. I think it's pretty important to be able to quickly capture notes under a specific heading in a file.

Could org-capture be implemented via a widget? Press the widget on your home screen to open a new item to be synced in a preferred notebook (this would be inbox.org for me).

I don't know how it's implemented technically, but Microsoft OneNote App has "OneNote Badge", which is a small icon that floats free on the screen, mostly almost hidden at the edge, no matter what App you are currently using

Tipping the badge allows you to take a quick OneNote note anytime in any situation on your phone, so it's basically the same idea like org capture.

Just in case you haven't seen it, and it wasn't mentioned before.

hi @Atrus7 . Wondering if you had any progress with that? I'd be interested in that feature too and can contribute so wanna make sure we don't do same work twice :)

Go for it. I took the easy IFTTT route in the end. It would be great to
have in orgzly.

On Sun, Feb 10, 2019, 2:15 AM Dmitrii Gerasimov notifications@github.com
wrote:

hi @Atrus7 https://github.com/Atrus7 . Wondering if you had any
progress with that? I'd be interested in that feature too and can
contribute so wanna make sure we don't do same work twice :)

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/orgzly/orgzly-android/issues/80#issuecomment-462119871,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEeW6I2Rp10epOViiixy-tKkZmG6dRYpks5vL_FcgaJpZM4NasFi
.

@nevenz

Using voice: Saying "create note" and using Orgzly as an app (probably can be set as default)

This is a great improvement for my workflow!

Is there any way to not have to bypass the orgzly details page? It would be good to just say "create quick note pickup groceries at 19:00" and that get saved to your default (mine is inbox.org).

Additionally, I'm wondering what would be needed to support "at 19:00" being turned into scheduling that task. I need to look into what activity "create note" sends to I suppose and what you can do to pre-process the string to parse out stuff before submitting starting the activity.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

apfranzen picture apfranzen  Â·  3Comments

memeplex picture memeplex  Â·  5Comments

bbigras picture bbigras  Â·  5Comments

mtz picture mtz  Â·  3Comments

sudomain picture sudomain  Â·  3Comments