-
Notifications
You must be signed in to change notification settings - Fork 1
Description
When RE was created as solely file system based it was decided that the Parser would handle conversion to and from frontmatter/markdown. The Parser would prepare the content and metadata as a string and return that to the CLI tool to put into the filesystem.
With the addition of the ContentManager it makes sense that that ContentManager would handle the actual storage. The flow would be:
- CLI tool for
new_entryis called. - CLI tool processes metadata (dates, validation, etc.)
- CLI tool calls
collection.add_entrywith all the relevant parameters (metadata, content, whether or not to open the editor, filename, etc.) ContentManagerhandles the business logic of creating the entry, opening the editor, etc. May or may not use theParserto handle metadata formatting for frontmatter.
This flow will allow for custom ContentManager implementations to handle the creation and storage of entries in the appropriate manner. So a DB based ContentManager could collect all the data (including letting the user edit the content and metadata in the editor) and then insert the row into the DB while a file based ContentManager would create the file and, if necessary, open the editor.