Coder Social home page Coder Social logo

Comments (5)

lervag avatar lervag commented on September 4, 2024

Here is my wiki.vim settings:

Did you forget the g:wiki_root setting? I assume it is also defined?

Here is my example index.md ... work.md.

Do I understand correctly that the files you are referring to are placed like this?

.
├── index.md
└── work.md
├── work
│   ├── project1.md
│   └── project2.md

That is, you are not describing issues with using two separate wiki's, but rather with how links work within a single wiki with multiple folder levels. I that right?

How can I specify relative path to current note when creating new files?

Links are generally relative to the path of the current file. So, from project1.md, a link like [project2](project2) should work as expected. But from work.md, links to files inside the work folder needs the work/ prefix.

Is there any way to make wiki.vim respect the folder of current wiki when creating new files? Otherwise I have to make sure to include the parent folder each time when I create a new link.

I think this is how it is supposed to work already, and it seems to work like that for me.

By the way, could you share some insights what is the better way to arrange notes for different projects? Do you put all of them inside the wiki root folder or create a folder to store notes for each projects?

Good question. I keep a rather flat structure, but I do agree that it makes sense to keep project specific notes within a project folder. The main drawback is that information may be related to more than a single project or topic. That is, you might end up writing redundant/duplicate notes. But if you are good at organizing this well, I think you could avoid issues like this.

from wiki.vim.

hongyuanjia avatar hongyuanjia commented on September 4, 2024

Thanks for your explanation!

Did you forget the g:wiki_root setting? I assume it is also defined?

Sorry I forgot to put the g:wiki_root setting here. Yes, it is defined correctly.

Do I understand correctly that the files you are referring to are placed like this?

.
├── index.md
└── work.md
├── work
│   ├── project1.md
│   └── project2.md

That is, you are not describing issues with using two separate wiki's, but rather with how links work within a single wiki with multiple folder levels. I that right?

Exactly. This structure is what I want to achieve.

I think this is how it is supposed to work already, and it seems to work like that for me.
Links are generally relative to the path of the current file. So, from project1.md, a link like project2 should work as expected. But from work.md, links to files inside the work folder needs the work/ prefix.

That's right. So if I understand it right, all new notes will be created inside the same folder of current note. Previously I was also trying to find a way to create new notes inside the folder with the same name as its parent folder, e.g.:

.
├───index.md
│
└───work
    ├───work.md
    │
    ├───project1
    │   ├───project1.md
    │   │
    │   ├───materials
    │   └───meetings
    └───project2
        ├───project2.md
        │
        ├───materials
        └───meetings

Probably this has to be achieved by adding folder prefix. This may also be out of scope of a wiki plugin.

Good question. I keep a rather flat structure, but I do agree that it makes sense to keep project specific notes within a project folder. The main drawback is that information may be related to more than a single project or topic. That is, you might end up writing redundant/duplicate notes. But if you are good at organizing this well, I think you could avoid issues like this.

I agree that a project-centric structure does need taking more care on organizing things, but that may pay off in the long run.

Thanks for this awesome plugin!

from wiki.vim.

lervag avatar lervag commented on September 4, 2024

Exactly. This structure is what I want to achieve.

Good, then I understand correctly.

Ok, so: Links are by default relative to the current file. However, you can root them to the wiki root by prepending /. I think this works as expected, at least it does for me. If you should find that it does not work like this, then I think we have a bug.

In this updated example:

.
├───index.md
│
└───work
    ├───work.md
    │
    ├───project1
    │   ├───project1.md
    │   │
    │   ├───materials
    │   └───meetings
    │
    └───project2
        ├───project2.md
        │
        ├───materials
        └───meetings

Here you would use a link like [](work/work) inside your index.md. Inside work.md, you would use a link like [](project1/project1) or [](project2/project2). From project1.md, you could link back to work.md with [](../work.md) or [](/work/work.md).

However, note that the link syntax [](work/) will expand to [](work/index).

Probably this has to be achieved by adding folder prefix. This may also be out of scope of a wiki plugin.

I am not quite sure what you mean here. Are you saying that the links are somehow not working as I am explaining? If so, then I think it may be a bug and I'll be happy to try and fix it.

Thanks for this awesome plugin!

You're welcome, I'm happy you like it! I find it very useful for my own workflow, and it makes me happy to hear that it is useful to others as well.

from wiki.vim.

hongyuanjia avatar hongyuanjia commented on September 4, 2024

Here you would use a link like [](work/work) inside your index.md. Inside work.md, you would use a link like [](project1/project1) or [](project2/project2). From project1.md, you could link back to work.md with [](../work.md) or [](/work/work.md).

Thank you for this hint! Right now it works 100% as I want.

Since this issue seems more like questions on usage instead of actual bugs, I will close it now.

Thanks for you help.

from wiki.vim.

lervag avatar lervag commented on September 4, 2024

Thank you for this hint! Right now it works 100% as I want.

Great, happy to hear it! :)

from wiki.vim.

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.