Giter Site home page Giter Site logo

Feature Request: Links to headers about memo HOT 22 CLOSED

svsool avatar svsool commented on August 20, 2024 7
Feature Request: Links to headers

from memo.

Comments (22)

svsool avatar svsool commented on August 20, 2024 2

support multi-level embeds. So, note 1 is embedded in note 2, and when note 2 is embedded in note 3, note 1 is also rendered in note 3.

Have you tried? It's already supported. Cyclic embedding detected as well.

make header sections embeddable too, like in Obsidian. Why is it not possible to have automatic links synchronization on header rename? After all, you already have made possible to do it with file names.

It's not impossible, just harder. Filepath = id in filesystem, so there is a good basis to sync links. Text within file content != id, so there should be a whole new system introduced for linking text and syncing links.

from memo.

abuggin avatar abuggin commented on August 20, 2024 1

I extract the whole concept to another file under that concept folder and link directly to it.
Make sense. I personally tend not to use folders (but I'm willing to try it out).
On another side, I find it helpful to have some autocompletion, so having knowing that I've got to pick something from status, I start typing Status# and then pick the relevant one from the selection, without need to remember the right name.

How do you find those that are on hold or in progress? Using backlinks panel or via search?
Search. Backlinks don't work well when you are linking the same file literally in every notes. Which might make pointless to actually have it as link vs having it as a tag.

I'm going to try out having separate files for status: so that will lower my urgency in this feature request.
This system is a WIP anyway so πŸ‘

from memo.

DutchPete avatar DutchPete commented on August 20, 2024 1

I think the opposite. We can agree to disagree. Thank you for the opinion on this topic.

Fair enough. I have uninstalled Memo. Thank you for the discussion.

from memo.

1u0n avatar 1u0n commented on August 20, 2024 1

I wonder if now with "find all references to header" feature arriving to vscode, it'll be easier to keep links updated on header name change - I guess that's the key part of this feature request

from memo.

svsool avatar svsool commented on August 20, 2024

Hi,

I'm aware of this feature and wonder how useful it is for your knowledge base?

As far as I know, Obsidian headers' transclusion implemented only halfway, and links synchronization is not supported yet. Am I right that if the user changes header all other links pointing to it become obsolete until manually fixed?

Maybe you have some other improvements to this feature in mind after using it in your knowledge base?

I think showing in UI how many other files reference to certain header might be useful, so it will be easier to notice that this header is transcluded n times.

Also, I would be happy to collect more ideas on how to make headers transclusion compatible with links auto-sync.

from memo.

abuggin avatar abuggin commented on August 20, 2024

I don't tend to use transclusion much to be honest (as defined by https://en.wikipedia.org/wiki/Wikipedia:Transclusion):
I'm not interested in seeing same content in both notes. I just want to link a concept to its proper page.
In this case, its location is not a standalone page, but it's a paragraph.

When I start a new page on a topic, I tend to create an outline by using headers.
When I develop a note, sometimes it gets pretty big since there are many headers: sometimes I split those big notes into multiple pages/notes and sometimes is not necessary, so having a link to those headers is quite useful.

Having an way to link to headers would be useful, imho.

Happy to clarify if needed.

from memo.

abuggin avatar abuggin commented on August 20, 2024

Another use case:
I have a flag in some notes, where I link to one header in the Status.md page like:

status: [[Status#on-hold]]
status: [[Status#in-progress]]
status: [[Status#urgent]]

It's a hack to fix not being able to enumerate / select one choice from a set of values.
I could have those as separate pages, but it would create more clutter.

from memo.

abuggin avatar abuggin commented on August 20, 2024

@svsool What are your thoughts on what I've said?

from memo.

svsool avatar svsool commented on August 20, 2024

When I start a new page on a topic, I tend to create an outline by using headers.

Regarding outline - I do the same, but I rarely use headers for referencing in other files, I extract the whole concept to another file under that concept folder and link directly to it.

When I develop a note, sometimes it gets pretty big since there are many headers: sometimes I split those big notes into multiple pages/notes and sometimes is not necessary, so having a link to those headers is quite useful.

Given that I start to think that "extract to note" command might be useful.

Also, another command that allows sending selected paragraph to some existing note. Sometimes I refactor my dailies and extracting certain chunks to individual files and that might speed up this process a little bit.

Another use case:
I have a flag in some notes, where I link to one header in the Status.md page like:

status: [[Status#on-hold]]
status: [[Status#in-progress]]
status: [[Status#urgent]]

It's a hack to fix not being able to enumerate / select one choice from a set of values.
I could have those as separate pages, but it would create more clutter.

Do you have something else in Status.md besides headers? Would links uncreated to filesystem work for you, for example: status-on-hold, status-in-progress, status-urgent? Does Obsidian provide backlinks to headers?

How do you find those that are on hold or in progress? Using backlinks panel or via search?

About headers linking and how Obsidian implements it: I don't think that encouraging headers redundancy by referencing them as a whole is a scalable solution. Headers on their own tend to change less often than the rest of the content, but it does not make them a better id. Given that redundancy changing header in the original file wouldn't change it in the referencing files.

I think adding this feature is a good chunk of work because another level of analysis (ideally markdown AST / for headers simple regexes might work) is needed along with the cache. Given time I'd think how to make any markdown text content referable and not only headers because headers are just one level of transclusion.

Considering how citation works we can infer that headers is not the only thing that is cited.

from memo.

DutchPete avatar DutchPete commented on August 20, 2024

I think there is a misunderstanding.

Linking to a header is NOT a transclusion, it is merely a link, which, if clicked on, takes you to the header in the same note or in another note. It is the nearest thing to Roam's block reference, though with less granularity.
You are right when you say links are not updated (yet) when the user changes the header title.

A transclusion is an embedded header with its text block/paragraph below. It is like an embedded image.
The syntax is ![[note-name#header-name]]. Notice the exclamation mark.

I use both links to headers and transclusions extensively in Obsidian. Transclusions allow me to combine different notes or part of notes in order to construct different stories. Very useful for writing.

I know this issue is closed, so this comment can maybe be transferred to a relevant issue.

from memo.

svsool avatar svsool commented on August 20, 2024

Links of this sort (linking any content inside the file) very quickly require transclusion, and I would even imply having it. So what Obsidian implemented with headers is a special case. The problem is how to make them consistent and in sync across the knowledge base given just text files. Currently, I wouldn't like to introduce half working concept with the possibility of out of sync links to headers as in Obsidian. How it works produces more questions than the answers.

from memo.

DutchPete avatar DutchPete commented on August 20, 2024

Obsidian has both linking to headers and transclusions. The link to a header and its block of text/paragraph below can easily be converted to a transclusion by putting an ! in front of the link.

from memo.

svsool avatar svsool commented on August 20, 2024

I understand and yet Obsidian allows to break links as soon as file content changes link it or transclusion to the piece of content (not the filename) which I don't want in Memo at this point.

from memo.

DutchPete avatar DutchPete commented on August 20, 2024

I understand and yet Obsidian allows to break links as soon as file content changes ……

Only if the header name changes is the link broken. Other file content changes do not affect links. Even changing the file name does not affect links as they are automatically updated.

Another thing is that for a transclusion you don't necessarily link to a header only, you can transclude an entire file into another one.

from memo.

DutchPete avatar DutchPete commented on August 20, 2024

I do agree that header changes not being updated in links is a shortcoming.

from memo.

svsool avatar svsool commented on August 20, 2024

Another thing is that for a transclusion you don't necessarily link to a header only, you can transclude an entire file into another one.

You can transclude an entire file in Memo too using ![[file.md]] and files of files and so on, but not a part of the file as Obsidian does via headers due to what I mentioned. Links by header text are fragile and easily become out of sync, also it brings content redundancy. Ideally header should not be duplicated in the link, and referenced via id and editor should hint which header (its content) is referenced (similar to Roam).

from memo.

svsool avatar svsool commented on August 20, 2024

from memo.

DutchPete avatar DutchPete commented on August 20, 2024

Thanks for your help. I deleted the post because I figured out a couple of things.

  • I don't know why VS Code creates those ._filename files, one for each file in the folder I open, but below the last such strange file are the regular .md files.
  • The embedding does work, I tested it, but only for entire .md files, which I understood after reading the comments on the actual extension's page.

I find your extension nice and useful. I would have 2 wishes:

  1. make header sections embeddable too, like in Obsidian. Why is it not possible to have automatic links synchronization on header rename? After all, you already have made possible to do it with file names.
  2. support multi-level embeds. So, note 1 is embedded in note 2, and when note 2 is embedded in note 3, note 1 is also rendered in note 3.

from memo.

DutchPete avatar DutchPete commented on August 20, 2024

Have you tried? It's already supported. Cyclic embedding detected as well.

Sorry, no, I had not tried. In any case, for me multi-level embeds with entire files is not workable. It is workable when headers with their blocks are embeddable.

It's not impossible, just harder.

Does that mean you won't implement it?

from memo.

svsool avatar svsool commented on August 20, 2024

Sorry, no, I had not tried. In any case, for me multi-level embeds with entire files is not workable. It is workable when headers with their blocks are embeddable.

That ☝️ contradicts with the following:

So, note 1 is embedded in note 2, and when note 2 is embedded in note 3, note 1 is also rendered in note 3.

Does that mean you won't implement it?

It won't be implemented in Memo until I or any other contributor to Memo or a similar tool like Obsidian / Foam understand how to do it well (lack of syncing for heading links != well for me). Here is the long thread on that, and headings, as said, are just a special case of full transclusion.

For now, the most feasible solution that I imagine is introducing content-based indexing and adding UUID at the end of the line [abcd] automatically on linking any bullet/heading/paragraph via autocomplete to unambiguously identify content and then it could be used in links and preview for transclusion and linking.

You are welcome to contribute with the ideas if you have something on top of the linked discussion in discourse.

from memo.

DutchPete avatar DutchPete commented on August 20, 2024

That ☝️ contradicts with the following

Yes it does and no it does not.
Yes it does, if we are talking about entire notes.
No, it does not because that was just an example of what I meant by multi-level embeddings. Since I knew Memo can only handle entire notes, there was no need to take header examples from 3 different notes to clarify my point.

On the Obs page you linked to, the discussion is about backlinks and showing more of their context like in an embed (i.e. transclusion). There is no discussion about automatic syncing when the original is changed.

What you and I are discussing is your reluctance at this stage for Memo to support embeds (i.e. transclusions) of a part of a note, i.e. a section/block/paragraph that has a header, because if the name of the header is changed the link is broken and the transclusion is no longer rendered - lack of syncing, as you call it.

You want to wait till there is a solution for that, fair enough, that is a choice you as the dev have to make. I think it is a pity because having no option to transclude a header and its section is still worse than having that option with a risk of a transclusion being broken. And let's face it, a broken link still carries info of where it linked to so it can be fixed. So, having the option with the status as it is, would still be an improvement by 1 notch of Memo.

Having said that, I do not want to persuade you to support header transclusions at this stage. I just give you my personal view. I am not a coder so cannot provide a solution.

from memo.

svsool avatar svsool commented on August 20, 2024

I think it is a pity because having no option to transclude a header and its section is still worse than having that option with a risk of a transclusion being broken.

I think the opposite. We can agree to disagree. Thank you for the opinion on this topic.

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.