Coder Social home page Coder Social logo

Comments (11)

kwrobert avatar kwrobert commented on July 29, 2024 1

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

This plugin is actually quite nice!

Thanks!

I personally don't need any such system of organization. The reason is simply that I generally keep track of everything manually. That said, I'm not against adding such a system. But if we do, then I think it should be well thought through. In the sense that it will add value that is not easily brought from other tools.

As an example: If I want to find notes related to a particular topic, I use one of the following methods:

  • ctrlsf: A very good Vim plugin for searching. I use it with ripgrep as a backend, which makes it very fast. This way I can find almost anything worth finding very quickly.
  • CtrlP: I've added :CtrlPWiki as a command in the plugin, which relies on CltrP (of course). It makes it easy to search and open notes by name.

So, say we added a tag system that allows one to add tags to notes. We would need to do several things:

  • Specify a tag syntax (or more than one); it should be "compatible" to the filetype one wants to use.
  • Decide if the tags should be specific to a particular note (i.e. file), or if it can be local to a section of a note. If the latter, it should be clearly justified.
  • Add functionality that utilizes the tags. Would we need more than the possibility to list all notes that contain a given tag? If so, what?

Before I implement anything, I want to finish this discussion and to clearly specify how it should work. Preferably, I should be able to write the documentation and some tests before I implement. That way I will waste less time redoing things after the initial implementation.

from wiki.vim.

jounathaen avatar jounathaen commented on July 29, 2024

Thanks for your reply. I'll dump my ideas here 😉

As an example: If I want to find notes related to a particular topic, I use one of the following methods

Yes that is possible, but I think the point of having wiki.vim is to add some comfort to this. It would be possible to maintain a wiki completely without this plugin in pure vim, but that is not what I want 😄

My usecase would probably be solved by something like a combination of the behaviour of WikiGraphFindBacklinks function and the WikiPageToc.

Let's say, I add something like [[Tag:ProjA]] to a file (which is apparently not supportet at the moment).
Then in my overview page i could call something like :WikiGraphFindTag ProjA which has behaviour like WikiPageToc i.e. it can create or update a sorted list of the results.

  • Specify a tag syntax (or more than one); it should be "compatible" to the filetype one wants to use.

What about [[Tag:mytag]]? Does this collide with something? I don't have a full overview about the link syntax yet. But this would allow to create a "special meaning text object" with the already existing and very comfortable method of pressing enter.
It could also create a tag page (maybe in a seperate folder) with a backlink to the current wiki page.
But it doesn't have to be solved with a link.

  • Decide if the tags should be specific to a particular note (i.e. file), or if it can be local to a section of a note. If the latter, it should be clearly justified.

I'd say file specific. If I'm thinking about something like Wikipedia, you have links which can point to pages and sections, which is already possible in wiki.vim. But you also have "Categories" for a page which will automatically add the page to the category's page.

  • Name: I'd rather go for Tag instead of "Category" because it is faster to type and more clear that a page can have multiple tags. (Some systems only allow one category for one kind of thing).
  • Automatically update: Might by comfortable, but I don't know if this is "vim spirit". But having a command for manually updating a tag collection would be great.
  • Add functionality that utilizes the tags. Would we need more than the possibility to list all notes that contain a given tag? If so, what?

For my usecase that is enough, but maybe some plugins which generate websites from a vim wiki could utilize it/already have such a feature

Before I implement anything, I want to finish this discussion and to clearly specify how it should work. Preferably, I should be able to write the documentation and some tests before I implement. That way I will waste less time redoing things after the initial implementation.

👍
It would be great to hear other ideas!

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

Yes that is possible, but I think the point of having wiki.vim is to add some comfort to this. It would be possible to maintain a wiki completely without this plugin in pure vim, but that is not what I want smile

Agreed (and good point).

It seems to me that the tag feature of Vimwiki [0, 1] is close to what you want. And due to the already close relationship, it seems sensible to make something similar to this.

For a first implementation, I propose the following:

  • Syntax: :tag-one:tag-two:...:. Tags can not contain spaces. This is the same as the Vimwiki syntax.
  • Tags are file specific. If desired, we may consider to expand on it later. This differs from Vimwiki, where tags may also be section specific. If we could restrict the tags to eiher be at the top and/or the bottom of a wiki page/file, then searching would probably be very fast.
  • :WikiTagSearch - a command that searches for the specified tag. I think it should allow :WikiTagSearch -output=<arg>, where <arg> can be specified to direct the output to e.g.
    • location list (default)
    • below the cursor
    • scratch buffer
    • simple echo
      The function would basically first collect a list of the matching wiki pages, then it would output the list at the desired location.
  • Possibly: If searching for tags turns out to be slow, then we could consider to implement a tag cache.

I'll refine this list with the continued discussion, and when we agree I'll begin implementing.

from wiki.vim.

jounathaen avatar jounathaen commented on July 29, 2024

I agree with all points.
I'd suggest to add an alias function WikiTagInsertListwhich is basically the same as WikiTagSearch -output=cursor.
The latter is a long command and might scare beginners (like me 😄) but I like the Idea of beeing able to search for the Tags. It'd be great if that function would update a current tag list, if exists (like the TOC).

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

I've begun to work on this now. It is not fully functional, but the ideas are progressing.

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

Now it is getting closer to ready, and I'd be happy to get some feedback.

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

@kwrobert I don't mind considering something like that, but I think it is smart to polish the initial version of this feature first. So, please open a new issue with this suggestion, then we can further discuss it there and I can consider to implement it later.

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

I think the current implementation now covers the basics. It would be convenient if further enhancement requests are described in separate issues. Feel free to give general feedback and/or notice of bugs related to the "basic" mechanisms here. In the meantime, I'll take the liberty of closing this issue.

from wiki.vim.

edrex avatar edrex commented on July 29, 2024

I just want to drop a note here that I am plotting a markdown macro-expansion preprocessor that can output link lists matching a query string. Haven't decided on a final syntax but I think the POC will expand

## My List | linksTo:somePage

appending

* [Each](Each.md)
* [Match](Match.md)

The idea being that you could have it run on editor focus/save to update. Inspired by TiddlyWiki macros and https://github.com/tbabej/taskwiki.

POC # 2 might be to automatically append a backlinks list to each file if there are backlinks.

from wiki.vim.

lervag avatar lervag commented on July 29, 2024

@edrex Thanks. If you want to collaborate, e.g. couple what you are doing with wiki.vim, then feel free to open a new issue for a full discussion.

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.