Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow template-variables in a header-path in a capture-template #386

Closed
jyssh opened this issue Jul 8, 2020 · 5 comments · Fixed by #387
Closed

Allow template-variables in a header-path in a capture-template #386

jyssh opened this issue Jul 8, 2020 · 5 comments · Fixed by #387

Comments

@jyssh
Copy link
Contributor

jyssh commented Jul 8, 2020

Is your feature request related to a problem? Please describe.

I file my thoughts/observations/todos/notes of a day under a main headline titled as the timestamp of that day. For eg:

* [2020-07-08 Wed]
** After breathing for a couple of hours in a mask, I understand why Superman chose a pair of glasses and a curly lock of hair to hide his identity. :thoughts:
** A Time to Kill :watch:
** being bald: you immediately know when a fly has landed on your hair :thoughts:

* [2020-07-07 Tue]
** TODO Set up quick screenshotting in Zoom and Windows 7 :wife:
** Corona FAQ: :thoughts:
Q: Should I wear a mask while driving?
A: If you usually speed through red lights, then don't bother.

So the headline under which I want to use capture-templates are dynamic.

Describe the solution you'd like
Allow the use of template-variables in the header-path in a capture-template. So I could simply use %u as my header-path.

Describe alternatives you've considered
Another way could be to allow adding a subheadline under (instead of below) a zoomed-in/narrowed-in headline.

@munen
Copy link
Collaborator

munen commented Jul 8, 2020

Hi @jayesh-bhoot

Thank you for checking out organice! Would you be interested to building this feature?

@munen munen added the question Further information is requested label Jul 8, 2020
@jyssh
Copy link
Contributor Author

jyssh commented Jul 8, 2020

So I gave this a shot. I think I have figured it out. video demonstration on imgur

I have kept the changes to a minimum -

  1. Parse the template-variables in a header with substituteTemplateVariables() in headerWithPath(), so that the template-variables are processed wherever headerPath is touched (I think so atleast).
  2. Parse the template variables in a header with substituteTemplateVariables() to display the header-path correctly in the capture-modal.

While all the existing tests pass, I think I should add a few tests to cover this change as well.

@munen
Copy link
Collaborator

munen commented Jul 8, 2020

From the video, it looks great! 🎉

Adding tests for the specific new feature is much appreciated!

@jyssh
Copy link
Contributor Author

jyssh commented Jul 8, 2020

@munen See if the PR #387 satisfies this issue.

@munen
Copy link
Collaborator

munen commented Jul 8, 2020

@jayesh-bhoot Perfect implementation!

I've added a tiny bit of documentation and the contribution attribution.

Happy to merge it in! Welcome to the organice contributor list 🙏 🙇

@munen munen closed this as completed in #387 Jul 8, 2020
@munen munen removed the question Further information is requested label Jul 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants