Rooyca / obsidian-api-request

Obsidian plugin that allows you to make HTTP requests and display responses directly in the document, in codeblocks, or store them in localStorage.
https://rooyca.github.io/obsidian-api-request/
MIT License
100 stars 5 forks source link

[Feature Request] Run Markdown block API on demand #10

Closed sbhal closed 4 months ago

sbhal commented 5 months ago

When working with markdown blocks that contain API requests, is it possible to have an option to explicitly execute the API request instead of having it run automatically, similar to how the obsidian-execute-code plugin allows you to selectively run code blocks?

sbhal commented 5 months ago

Alternatively a disable flag can be added to markdown block to disable API call.

Rooyca commented 5 months ago

I think adding the flag is the most viable option at the moment.

Rooyca commented 5 months ago

Hey @sbhal, Maybe later I will add the button to run the requests on demand, for now the disabled flag will prevent the request from running continuously.

Rooyca commented 4 months ago

Hello @sbhal, I felt that the previous solution to this problem fell a little short and didn't make much sense (at least not to me), although disabling the code block works there are cases where you need the answer. This is why now the responses can be stored in localStorage by means of the req-id flag. Here is an example:

url: https://jsonplaceholder.typicode.com/users/1
show: id
req-id: idUser
disabled

This only will run one time. After that will check the localStorage for a response.