obsidian-copy-as-html icon indicating copy to clipboard operation
obsidian-copy-as-html copied to clipboard

Convert [[internal links]] to <a> tag

Open LuiZzz-Menezes opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe. I would like to request the functionality of being able to copy an internal link as an external link, as is done in the Obsdian_to_Anki plugin.

Describe the solution you'd like When we copy a selection that contains an internal link like [[test]], the plugin will convert that selection into an a tag with href. <a href="obsidian://open?vault=vaultName&amp;file=Test">Test</a>

Describe alternatives you've considered Didnt find another alternatives than that

Additional context As not everyone may want it, it would be interesting to just leave an option for those who want it. Full example if it helps: <a href="obsidian://open?vault=My%20Vault&amp;file=Test%20A">Test A</a>

Furthermore, thank you very much for the plugin, it was an alternative to my workflow that needed to copy some summaries from Obsidian to HTML.

LuiZzz-Menezes avatar Nov 18 '23 14:11 LuiZzz-Menezes

Hi @Luiz-nyan, I'll look into it, should probably be an easy feature to implement.

mvdkwast avatar Nov 21 '23 11:11 mvdkwast

I'm afraid this will take a little more time than what I have at the moment. Still seems like a good feature and welcoming pull requests :)

mvdkwast avatar Apr 26 '24 22:04 mvdkwast

Don't worry about it! I'm still using the plugin for my workflow, but looks like this feature isn't something that other users are looking for since there's no comments or reactions in the post. Also, it's not something I urgently need, but as soon as you implement it, I'll be using it!

LuiZzz-Menezes avatar Apr 27 '24 21:04 LuiZzz-Menezes

I think this feature is really nice, particularly useful for communicating with people via email when you know they have the same vault.

In my opinion it should definitely be a setting that is able to be disabled though. For instance if I'm emailing someone I don't expect to have the Obsidian note, I wouldn't want them to get a "broken" link that won't work for them.

Potentially adding a setting that allows users to configure their internal link handling between some options like:

  • Replace with obsidian URI (what you're mentioning here)
  • Remove link & keep text
  • Remove link & remove text
    • I can't see why this would be too useful myself, but mentioning here anyway

fetwar avatar May 30 '24 01:05 fetwar

For obsidian URI links we should to handle the following :

  • links to documents, including in explicit directories
  • links to sections in other documents
  • links to sections in the same document (should generate a relative link, not an obsidian uri)
  • links to tags

Besides the points @fetwar mentionned, I'd like to add :

  • local links to documents with .html extension (if we're going to do this anyway ;), solves #62)

mvdkwast avatar Jun 28 '24 10:06 mvdkwast

Remove link & remove text I can't see why this would be too useful myself, but mentioning here anyway

This option was in fact related to embedded (transcluded) documents. But, it seems that it doesn't do anything in the code currently.

mvdkwast avatar Jun 28 '24 11:06 mvdkwast