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

Feature Request: A configurable root location for creating notes on the fly #38

Closed
mlao-pdx opened this issue Jul 24, 2020 · 6 comments
Closed
Labels
feature New feature or request

Comments

@mlao-pdx
Copy link

mlao-pdx commented Jul 24, 2020

What:

Add a configurable path, relative within a workspace, as the location for notes created on the fly.

It would enable the concept of an inbox, from which we can then decide the notes final location. Or it could be an unstructured repository if we care only to contain our notes in a single bucket.

Why:

Following a link to a non-existing target will create the new MD file in the root of my workspace. While that works well for a dedicated knowledge base, I use Markdown Memo to document my research for a writing project with its own set of documents and folder structure. All these Zettelkasten Markdown documents clutter up my workspace root.

I end up prefixing the link to something like [[kb/thought]], create the note, then come back to the link and remove the kb/ so that backlinks work. This is workable if I have only one reference, but becomes cumbersome when I have links to [[thought]] in multiple locations. In that scenario I leave out the "kb/" prefix and let the note be created in the workspace root and then later manually move it to kb/.

Either way works, but both are more cumbersome and I have to consider in advance whether I will be creating multiple links before creating the content. If we can remove that extra [[thought]] process to get focus back on the content and relations themselves, that would be a big boon.

Kudos:

Love Markdown Memo, quite liberating. And while I'm asking for a configuration setting, I love that Markdown Memo is opinionated. Less is more.

@svsool
Copy link
Owner

svsool commented Jul 28, 2020

Hi,

Thanks for your suggestion! I think the use case is clear to me.

I want to notice that suggested logic looks relevant only for short links [[link]] - by clicking such link file can be created to a folder of your choice within a workspace.

For long links[[folder 1/folder 2/link]], I think logic should stay the same, and file should be created under folder 1/folder 2 always relative to a workspace root. Another thing to notice is that kb/ can't be removed in case of long links when filename clash happens across different folders within a workspace, but possible for short links as you mentioned.

Memo creates files on the fly for any known format (not only .md), so I wonder if the same logic should be applied for short links with formats other than '.md`.

In my case, I have a similar need for redirecting daily notes yyyy-mm-dd to Daily folder and I had an idea of introducing mapping rules:

[{
  rule: "/([12]\d{3}-(0[1-9]|1[0-2])-(0[1-9]|[12]\d|3[01]))\.md$/",
  comment: "Daily notes yyyy-mm-dd",
  folder: "/Daily"
},
{ 
  rule: "\.md$",
  comment: "All other notes",
  folder: "/Notes"
]}

Rules applied in the order they appear, given rules above [[2020-07-07]] will be created under <workspace-root>/Daily folder, and all other notes under <workspace-root>/Notes.

With mapping rules, Memo gives user flexibility to configure where and what should be created.

What do you think about having mapping rules? Would it be useful for your use case?

@svsool svsool added the feature New feature or request label Jul 28, 2020
@mlao-pdx
Copy link
Author

mlao-pdx commented Jul 30, 2020

I agree. Short links only. Long links functionality as-is feels very natural to me.

I did not know about the other formats supported. Very cool!

Mapping rules would work perfectly and offer far more flexibility. I would be delighted with such a solution.

Also looking at the regex in the code, maybe add "webp" image files? ;)

@svsool
Copy link
Owner

svsool commented Jul 31, 2020

Mapping rules would work perfectly and offer far more flexibility. I would be delighted with such a solution.

I can take a look at some point. Feel free to contribute 🙂 .

Also looking at the regex in the code, maybe add "webp" image files? ;)

webp added and will be released in the next version

image

@mlao-pdx
Copy link
Author

mlao-pdx commented Jul 31, 2020

Mapping rules would work perfectly and offer far more flexibility. I would be delighted with such a solution.

I can take a look at some point. Feel free to contribute 🙂 .

My background is SQL and Python, so no TypeScript experience, let alone VS-code API. Let me see what I need to do to set up on my system and get my skills up to contribute safely.

webp added and will be released in the next version

Thanks!

@svsool
Copy link
Owner

svsool commented Jun 19, 2021

Link rules feature for short links was implemented in v0.3.9. Please update the Memo extension. A bit more information on how to use it can be found here. Also thanks @caiych, for the contribution! 💙

@svsool svsool closed this as completed Jun 19, 2021
@mlao-pdx
Copy link
Author

Link rules feature for short links was implemented in v0.3.9. Please update the Memo extension. A bit more information on how to use it can be found here. Also thanks @caiych, for the contribution! 💙

Thank you, @caiych and @svsool, for making my feature request real. It works like a charm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants