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

Suggestion: Allow user to specify section to add to in Daily Note #5

Open
heliostatic opened this issue Jan 11, 2021 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@heliostatic
Copy link

Currently, tasks are appended to the daily note as #{var:task_tag} [[{var:tasks_file}#^{var:ref}|{var:task.stripnonalphanumeric}]]---

However, it would be nice to add the task to a section, as is done in the Tasks file itself, and would presumably look something like:

find = re.compile(r'^(## ' + re.escape(heading) + r'\n.*?)\n+#', flags = re.MULTILINE|re.DOTALL)
replace = '\\1\n- ' + entry + '\n\n#'

if re.findall(find, original_content) == []:
	new_content = original_content + '## ' + heading + '\n- ' + entry + '\n\n#'
else:
	new_content = re.sub(find, replace, original_content)
@macedotavares macedotavares added the enhancement New feature or request label Jan 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants