Giter Club home page Giter Club logo

uri-commands-obsidian's People

Contributors

kzhovn avatar pjeby 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

Watchers

 avatar  avatar

uri-commands-obsidian's Issues

Suggestion: display notice of URL being opened

Before I realized #3 was an issue, I kept hitting a hotkey over and over and nothing was happening and couldn't tell whether it was Obsidian or Calibre. I ended up adding a new Notice(Opening ${URIString}); line before each window.open() so that I could see exactly what URL was being launched, which was helpful both for finding a problem with my configuration, and for getting active feedback that the command was being invoked at all.

I suspect other people might find this useful as well.

(Though perhaps a more robust version that cuts off the URL after it gets to a certain length would be best, since fileText insertions could make for some huge notices!)

Hotkey assignments lost if a command is edited

The code in URIModal sets a new ID for a command each time it's edited, instead of only assigning an ID once, when the command is first created. This causes hotkey assignments to be lost, because Obsidian stores them by command ID. So every time you edit a command, you have to go back and re-assign a hotkey to it, and the old hotkey assignments will accumulate in Obsidian's hotkeys.json.

The fix would be to move the ID assignment into the if branch for creating a new command, so that once it is created, a command will always have the same ID.

[Feature Request] New Placeholder: {{clipboard}}

Hello @kzhovn !!!!!

This FR is simple to explain: would be amazing to be able to built custom URI using the content of the clipboard.

My Workflow

I use the obsidian URI to search content from my active note using this URI attached to a hotkey.

obsidian://search?vault=vault_name&query=content:""

I realize that most of the time the content that I am searching is already in the clipboard.

This way, I need a {{clipboard}} placeholder to automatically search from the clipboard.

obsidian://search?vault=vault_name&query=content:"{{clipboard}}"

Thanks for reading this :)

I wish you a fantastic day!

{{fileText}} cause uri-commands-obsidian to fail silently

Using {{fileText}} within URIs prevents the command from running.

All of the following work as expected:

obsidian://open?vault={{vaultName}}&file=Untitled
https://en.wikipedia.org/wiki/{{fileName}}
mailto:[email protected]?subject={{fileName}}

whereas the following all fail silently

obsidian://open?vault={{vaultName}}&file={{fileText}}
https://en.wikipedia.org/wiki/{{fileText}}
mailto:[email protected]?subject={{fileName}}&body={{fileText}}

Dis-proven hypotheses:

  1. {{fileText}} is not being replaced correctly
    console.log() shows replacement is correct
  2. URI is not being generated correctly
    if I send the generated URI to console.log() and then copy this into firefox, it opens up an email with the correct content.
  3. It is a problem with URIs being too long.
    I have tried on a blank note and URIs with {{fileText}} still fail
  4. It is a problem with multiple {{x}} replacements in the one URI
    I have tried mailto:[email protected]?subject=test&body={{fileText}} and this still fails.

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.