mgmeyers / obsidian-copy-block-link Goto Github PK
View Code? Open in Web Editor NEWGet links to blocks and headings from Obsidian's right click menu.
License: GNU General Public License v3.0
Get links to blocks and headings from Obsidian's right click menu.
License: GNU General Public License v3.0
I am using this plugin in macros with other commands and sometimes (a lot of times) it adds the id somewhere in middle of the block near the end. I was thought it is a issue with macro but I am adding good amount of wait/sleep in the middle and still getting this issue. Maybe it is because of how the code works in this plugin and if it is so can you adjust it for using in macros.
And thank you very much for this plugin, it is very important in my workflow. I don't know why it is not already part of the core obsidian as it is a must have feature.
If this feature can be support, one can easily link note blocks to other apps.
Obsidian 0.15.x supports displaying notes in separated windows.
to reproduce the bug:
^xxxx
is generated correctly.^yyyy
is generated correctly and the block embed link is in the clipboardPlease add option to show on icon hover note title of embeded block source when in destination (hover on icon of pasted block). Also would be great if in source instead of nothing could be icon showing on hover list of destinations note names. It would be awesome if these were actual links so that user could jump back and forth from destination block to source block (perhaps to read some context) and again to destination block.
I am trying to embed a whole list but only the last item is getting referenced. I would like to be able to ref the whole block.
Current Behavior:
- test1
- test
- test 3
- test 4 ^g3t0m4
![2023-01-06](2023-01-06.md#^g3t0m4)
Desired behavior
I did find that using <br>
tags after each item will allow the desired results, but this will require formatting each list to be referenced.
- test1 <br>- test<br> - test 3<br> - test 4<br>
will render as desired but will require reformatting source notes.
example:
#github
##google
when I copy heading link of google and paste, I get GitHub name but its move me to google head.
Is it possible to add an option for copying links in the form of [[#^blockid]]
for linking from within a note?
Another fun thing I was thinking about (wrote above) was:
This would be a quick way to aggregate a bunch of block refs quickly when reviewing notes, and send them somewhere in one click.
Will the plug-in be amended for LP support?
I made a test file to demonstrate all of the rules / edge cases I could think of: https://github.com/mgmeyers/obsidian-copy-block-link/blob/main/block-id-tests.md
Positioning block IDs correctly adds some complexity, because in certain cases, we have to:
This same complexity is needed when retrieving existing blockids attached to a block.
So, we need something like:
const tokens = editor.getTokenTypeAt(cursor);
const line = editor.getLine(cursor.line);
let nextLine: string;
let isSeeking = true;
let iteration = 0;
while (isSeeking) {
iteration++;
nextLine = editor.getLine(cursor.line + iteration);
....check if we're at the end of the block or the file....
}
Hello @mgmeyers !!!
First of all, thank you very much for this plug-in! My FR is related to the core feature of this plug-in :)
My FR is very simple: A hotkey to the mouse right click (Open Context Menu)
Unfortunately, MacOS don't have dedicated keyboard key to do mouse right click. If you search on Google it is not very simple to do in MacOS :(
This way, I really need a hotkey to access the Context Menu in Obsidian :)
Thanks for reading this!
Have a great day!
When I choose a head
and click copy link to heading
, it will use the file name as the shown text. Do you think it should have some differences between head
and simple text
? For example,
<!-- The file name is SomeFile -->
# head1
hello world ^index
The two referenced blocks should appear as below
[head1](SomeFile#head1)
[SomeFile](SomeFile#^index)
But the real is both SomeFile
as the shown text.
[SomeFile](SomeFile#head1)
[SomeFile](SomeFile#^index)
I think maybe you should just use the title as the display text?
Looking forward to your reply. Thank you!
Here is a quick video of the behavior. This plugin should trim all brackets [[]]
before generating the heading link.
When the Obsidian setting New link format
is set to Relative path to file
, the pasted link is relative the the vault root, not the file into which it is being pasted.
For example, in a vault containing:
folder_1/
- a.md
folder_2/
- b.md
If a heading in b.md
is pasted into a.md
, the link shows up as [b](folder_2/b.md#...)
instead of the desired [b](../folder_2/b.md#...)
.
The content of the link in the blockquote cannot be highlighted if the properties of the page is exist, after the obsidian version is V1.4+
Is it possible to copy the note link, instead of the block or header link? One use some hotkey or the context menu for such a purpose.
Without being able to conveniently insert the link of the note opened in the left pane to the right pane can be frustrating. 😅
Hello, Thanks for creating the plugin.
Would there be a way to use the command Copy Block Link when having the "backlinks in document" option checked? I'd love to right click the quote from the backlink and copy it into the document vs. having to click the backlink, going to the original page and copying the block link from there.
Thanks
When I use the traditional way, I can use block references. But If I use the plugin with the same ^mark location, it doesn't work.
I love that the code hides in preview mode. But it doesn't seem to hide when the paragraph loses focus the way markdown does in live edit mode. Is there any way to make that happen?
Currently, the link generation will not respect user settings for link type, relative/absolute, etc. It always generates plain links and assumes that only one note has the given basename. Using app.fileManager.generateMarkdownLink(view.file, "", headingOrBlockID)
would generate a link that (mostly) matches the user's preferences.
Could this Plugin support for Callout Block?
For now, only Callout in Editting got context menu:
I see that Obsidian 1.5.0 could show context menu for rendered callout block:
Would it be easier for adding new option "Copy block link" with calllout block?
Btw, Would it possible to support for Callout in Reading Mode, too?
For now it seems that Reading Mode still doesn't have right-click menu for callout block .
Re #2: If we start adding more options to the context menu, it'll be nice to give users the option to disable the ones they don't need / use.
hi, the official obsidian URL could only link to a file, but not to a specific text block.
i just found a plugin called advanced obsidian URI, which support in that way, however, just several minor changes make it painful to use.
the link obtained /w your plugin, which is official usage of obsidian URI:
obsidian://open?vault=markdown&file=j-r%2Fmike%2Fmedical%2F0-i%2Fj-r%2Fmike%2Fmitral-stenosis-s-folder%2Fmitral-stenosis
the link of that advanced plugin:
obsidian://advanced-uri?vault=markdown&filepath=j-r%2Fmike%2Fmedical%2F0-i%2Fj-r%2Fmike%2Fmitral-stenosis-s-folder%2Fmitral-stenosis&block=qnuqby
that qnuqby is the official text block's code, usually 6 places.
it's painful to edit manually.
official URI hyperlink to a file is not enough for me, i want hyperlink to text blocks,
from outside like onenote, mindmanager etc.
thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.