Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FR] Add a command to copy uri for current block. #89

Closed
XMB-7 opened this issue Nov 8, 2022 · 9 comments
Closed

[FR] Add a command to copy uri for current block. #89

XMB-7 opened this issue Nov 8, 2022 · 9 comments

Comments

@XMB-7
Copy link

XMB-7 commented Nov 8, 2022

Automatically generate a random block reference id for the active block, then copy the uri consisting of it to the clipboard. I think that would be awesome, making navigation to a specific location of a file handier.
Also thanks for developing this plugin, it really enhances my workflow.

@Vinzent03
Copy link
Owner

That should already be the case by using the copy URI for current file or copy URI for file with options commands.

@XMB-7
Copy link
Author

XMB-7 commented Nov 8, 2022

According to the documentation, navigation to a block in certain file is feasible. For example, obsidian://advanced-uri?filename=kssrc&block=aaa. But it seems no corresponding command there.
image

Furthermore, currently we have first to assign a block with a reference id, then write a URI link to it, I'd hope with a provided command automating the two steps, similar to what "copy URI for current file" does. Thanks.

@Vinzent03
Copy link
Owner

You have to place your cursor in the block and call one of the previous listed commands.

@XMB-7
Copy link
Author

XMB-7 commented Nov 9, 2022

That only works when a block is assigned a reference id already.
image

And what I expect is the following.
image

Currently, we could first use other plugins like Copy Block Link or Carry-Forward to generate random block references, then execute the command available in Advanced-URI. I think it would be awesome if such block reference automating features can be absorbed, but it is definitely not a priority.

@Vinzent03
Copy link
Owner

I've added a new command, which generates the block reference for you.

@XMB-7
Copy link
Author

XMB-7 commented Nov 25, 2022

Thank you so much. But the block reference seems to be assigned always to the last block instead of the expected one where the cursor locates.
image

@Vinzent03
Copy link
Owner

Thanks. Will fix that.

@XMB-7
Copy link
Author

XMB-7 commented Nov 25, 2022

Also appreciate that if the current block already has a reference, just take it instead of creating a new one.
image

Vinzent03 added a commit that referenced this issue Nov 26, 2022
@Vinzent03
Copy link
Owner

Should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants