Code Monkey home page Code Monkey logo

Comments (6)

svsool avatar svsool commented on June 18, 2024 6

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?

from memo.

mlao-pdx avatar mlao-pdx commented on June 18, 2024 1

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!

from memo.

mlao-pdx avatar mlao-pdx commented on June 18, 2024

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? ;)

from memo.

svsool avatar svsool commented on June 18, 2024

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

from memo.

svsool avatar svsool commented on June 18, 2024

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! 💙

from memo.

mlao-pdx avatar mlao-pdx commented on June 18, 2024

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.

from memo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.