Giter Club home page Giter Club logo

obsidian-copy-block-link's People

Contributors

mgmeyers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

obsidian-copy-block-link's Issues

[Bug ]Not Adding To The End Of The Line

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.

[Bug] the generated embed link from the separate window does not go into the clipboard, for Obsidian 0.15.3

Obsidian 0.15.x supports displaying notes in separated windows.
to reproduce the bug:

  1. open 2 notes, note a and note b
  2. drag note a outside the obsidian, so note a will be in a separate window.
  3. select text from note a and chose "copy block embed" from the context menu
    3.1. notice that the label ^xxxx is generated correctly.
  4. check the clipboard, nothing is in the clipboard
  5. try select text from note b and chose "copy block embed" from the context menu
  6. notice that the label ^yyyy is generated correctly and the block embed link is in the clipboard

on icon hover show note_name of source

Please 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.

Support for List Blocks

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)
  • test 4

Desired behavior

  • test1
  • test
  • test 3
  • test 4

Workaround

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.

Support for nested list

Hi, I'm wondering if nested list like the following:
image
I've tried but seems the plugin does not support copy link embedded in this circumstances?

Position (and retrieve) blockids correctly

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:

  1. Find the end of the block
  2. Add a new line + the blockid

This same complexity is needed when retrieving existing blockids attached to a block.

So, we need something like:

  1. Determine what type of block we're in:
const tokens = editor.getTokenTypeAt(cursor);
  1. Seek towards the end of the block. This changes depending on the type of block. In several cases we'll have to iterate and check the lines following the cursor. This is a quick sketch of one possibility:
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....
}
  1. Grab or create a block id.

[Feature Request] Hotkey for Menu Context (mouse right click)

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)

Why I'm requesting this ?

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!

copy link to heading but show the file name

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!

[BUG] Links are not relative to pasted location

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#...).

Support only copying note link

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. 😅

Copy from backlinks in document

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

Can not copy code block link

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.

CleanShot.2021-08-15.at.11.59.59.mp4

Should use `app.fileManager.generateMarkdownLink()` to create link

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.

[FR] Support for Callout Block

Could this Plugin support for Callout Block?

For now, only Callout in Editting got context menu:
image

I see that Obsidian 1.5.0 could show context menu for rendered callout block:
image

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 .

FR: pls support advanced obsidian URI plugin, so we can link to specific block from EXTERNAL, thx

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

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.