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

feat!(journal): periodic & multiple journals #1474

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

benlubas
Copy link
Contributor

@benlubas benlubas commented Jun 22, 2024

implements #1471

Features

  • Support for multiple journals, and periodic journals
    • Each journal gets a name, start date, time period, and file format string/stategy
    • you can specify period as either days or months + years.
  • Ships with a daily, weekly, and monthly journal by default
  • users can create their own journals
  • all the journal commands now optionally take a journal name. When the name is left out, uses the default journal (configurable, defaults to daily).
  • new commands, :Neorg journal previous|current|next <journal_name>
  • each journal gets it's own template

Of Note

  • looking for feedback on:
    • functionality--does this cover all the cases we want? Does this ship the defaults that we want?
    • user experience/configuration--anything else that should be configurable? Should each journal be able to have its own folder? or should they continue to be in the same overarching folder, with configurable subfolders/the option to not be in a subfolder?
  • TOC code is untouched and untested, I think forcing each journal into its own subfolder would make the TOC implementation easier, other suggestions on how to handle it would be welcome
  • The breaking change is pretty minimal right now. Templates are now configured differently, and templates files will have a new name. Instead of configuring with template_name = template.norg it's now base_template_name = "template" and templates files will be created on a per-journal basis like: template-daily.norg

@benlubas
Copy link
Contributor Author

@maxkuzn if you have feedback on the features here that would be great

@vhyrro
Copy link
Member

vhyrro commented Jul 8, 2024

With core.tempus now being the defacto (since 0.10 is required) I can start reviewing this sooner than later. I took a general glance at it and the execution looks solid.

@benlubas
Copy link
Contributor Author

benlubas commented Jul 8, 2024

Had a look at this again. I think the best solution for the journal toc commands will be to make them pattern match for file names so that you get a toc specific to each journal.

I'm fairly sure it's possible to transform the path_format_strategy into a lua pattern iff the path_format_strategy is a string. When that value is a function (which is allowed) we would have to also ask the user to provide some type of filter function that takes a path and tells us if it's a part of the journal.

I think this is a fairly reasonable approach. Let me know if you have thoughts @vhyrro

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 this pull request may close these issues.

2 participants