You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Obsidian 1.8.0 has introduced a new core plugin named Web viewer, which allows users to browse the web in a tab without leaving Obsidian.
For the Shell commands plugin, this could allow some new use-cases, for example:
Executing a custom web scraping script/program that would save the currently visited web page to disk. Obsidian does offer a save to markdown feature for web pages already, but this could allow more control over the conversion process, e.g. keep original HTML without converting to markdown.
Storing web page URLs and titles in a custom "bookmark system", e.g. a file containing a list of web pages related to a certain topic.
Web viewer variable ideas
Below is a preliminary list of variables that came to my mind. Please note that these are currently just very quick ideas, and I haven't made any decisions yet if I will actually implement them. I also have not done any technical research on Obsidian API to see if it provides a way to retrieve the information required by these variables.
{{web_url}}
The variable would return the address of the currently open and focused page in Web viewer.
The name is a bit similar to {{file_uri}}, but there are some key differences:
This new variable would use the word url, not uri.
While {{file_uri}} (starting with obsidian://) is about an URI that opens a file in Obsidian, {{web_url}} (starting with e.g. https://) would be (usually) openable in a dedicated web browser. Also, if Obsidian URI would support opening a web page via a URI starting with obsidian:// some day, perhaps SC could have another variable for that purpose, i.e. {{web_uri}}. But this is just theoretical and I don't know if Obsidian devs are planning to implement any Web viewer related features to Obsidian URI or not.
{{web_name}} (or {{web_file_name}}?)
This would return e.g. index.html from url https://mydomain.com/index.html.
Need to consider what to return if the url does not end with anything that looks like a file name, i.e. there's no dots after the last slash /. E.g. if the url is https://mydomain.com/ or https://mydomain.com/my-page/.
{{web_title}}
Page title of the currently focused Web viewer tab. The variable's name is similar to {{title}}, which returns a currently open note file's name without a file extension.
Example:
<html><head><title>My page title</title></head><body>
My page content.
</body></html>
In this case, {{web_title}} would return My page title.
{{web_content}}
Returns the HTML content of the currently open web page.
Should this have the possibility to skip <head> and only get the content of <body>? Bit similar to how {{note_content}} excludes YAML frontmatter that is present in {{file_content}}.
Should there be another variable for getting the Markdown version of page content converted by Obsidian?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Obsidian 1.8.0 has introduced a new core plugin named Web viewer, which allows users to browse the web in a tab without leaving Obsidian.
For the Shell commands plugin, this could allow some new use-cases, for example:
Web viewer variable ideas
Below is a preliminary list of variables that came to my mind. Please note that these are currently just very quick ideas, and I haven't made any decisions yet if I will actually implement them. I also have not done any technical research on Obsidian API to see if it provides a way to retrieve the information required by these variables.
{{web_url}}
The variable would return the address of the currently open and focused page in Web viewer.
The name is a bit similar to {{file_uri}}, but there are some key differences:
{{file_uri}}
(starting withobsidian://
) is about an URI that opens a file in Obsidian,{{web_url}}
(starting with e.g.https://
) would be (usually) openable in a dedicated web browser. Also, if Obsidian URI would support opening a web page via a URI starting withobsidian://
some day, perhaps SC could have another variable for that purpose, i.e.{{web_uri}}
. But this is just theoretical and I don't know if Obsidian devs are planning to implement any Web viewer related features to Obsidian URI or not.{{web_name}}
(or{{web_file_name}}
?)index.html
from urlhttps://mydomain.com/index.html
./
. E.g. if the url ishttps://mydomain.com/
orhttps://mydomain.com/my-page/
.{{web_title}}
Page title of the currently focused Web viewer tab. The variable's name is similar to {{title}}, which returns a currently open note file's name without a file extension.
Example:
In this case,
{{web_title}}
would returnMy page title
.{{web_content}}
Returns the HTML content of the currently open web page.
<head>
and only get the content of<body>
? Bit similar to how {{note_content}} excludes YAML frontmatter that is present in {{file_content}}.Other variables?
Please write a comment if you hvae any ideas! 🙂👍
Beta Was this translation helpful? Give feedback.
All reactions