### Run Obsidian CLI Help Command Source: https://help.obsidian.md/cli This command executes the help function within the Obsidian CLI, providing information about available commands and their usage. It's a fundamental step for understanding the CLI's capabilities. ```shell # Run the help command obsidian help ``` -------------------------------- ### Obsidian CLI - Everyday Use Examples Source: https://help.obsidian.md/cli A collection of practical examples demonstrating how to use the Obsidian CLI for common tasks like managing daily notes, tasks, and files. ```APIDOC ## Obsidian CLI - Everyday Use Examples ### Description This section provides examples of how to use the Obsidian CLI for everyday tasks within your vault. ### Examples ```bash # Open today's daily note obsidian daily # Add a task to your daily note obsidian daily:append content="- [ ] Buy groceries" # Search your vault for notes containing "meeting notes" obsidian search query="meeting notes" # Read the content of the currently active file obsidian read # List all tasks from your daily note obsidian tasks daily # Create a new note named "Trip to Paris" using the "Travel" template obsidian create name="Trip to Paris" template=Travel # List all tags in your vault along with their counts obsidian tags counts # Compare two versions of a file (e.g., README) obsidian diff file=README from=1 to=3 ``` ``` -------------------------------- ### Obsidian CLI - Parameters and Flags Source: https://help.obsidian.md/cli Explanation of how to use parameters and flags with Obsidian CLI commands, including required parameters and boolean flags. ```APIDOC ## Obsidian CLI - Using Parameters and Flags ### Description This section explains how to use parameters and flags to customize the behavior of Obsidian CLI commands. ### Parameters and Flags Commands can accept **parameters**, which take a value (e.g., `parameter=value`), and **flags**, which are boolean switches (e.g., `silent`). - **Parameters**: Written as `parameter=value`. If the value contains spaces, enclose it in quotes. ```bash # Create a new note named "Note" with content "Hello world" obsidian create name=Note content="Hello world" ``` - **Flags**: Boolean switches that are included to enable a feature. They do not take a value. ```bash # Create the note silently and overwrite if it already exists obsidian create name=Note content="Hello" silent overwrite ``` - **Multiline Content**: Use `\n` for newlines and `\t` for tabs within parameter values. ```bash obsidian create name=Note content="# Title\n\nBody text" ``` ``` -------------------------------- ### Obsidian CLI Everyday Use Examples Source: https://help.obsidian.md/cli A collection of common Obsidian CLI commands for daily tasks. These include opening daily notes, appending content, searching the vault, reading files, listing tasks, creating notes from templates, listing tags, and comparing file versions. ```shell # Open today's daily note obsidian daily # Add a task to your daily note obsidian daily:append content="- [ ] Buy groceries" # Search your vault obsidian search query="meeting notes" # Read the active file obsidian read # List all tasks from your daily note obsidian tasks daily # Create a new note from a template obsidian create name="Trip to Paris" template=Travel # List all tags in your vault with counts obsidian tags counts # Compare two versions of a file obsidian diff file=README from=1 to=3 ``` -------------------------------- ### Obsidian CLI Developer Examples Source: https://help.obsidian.md/cli Examples of Obsidian CLI commands tailored for developers, useful for plugin and theme development. These include opening developer tools, reloading plugins, taking screenshots, and executing JavaScript code within the app console. ```shell # Open developer tools obsidian dev:open # Reload a community plugin you're developing obsidian plugin:reload id=my-plugin # Take a screenshot of the app obsidian dev:screenshot path=screenshot.png # Run JavaScript in the app console obsidian dev:eval code="app.vault.getFiles().length" ``` -------------------------------- ### Obsidian CLI Target Specific Vault Source: https://help.obsidian.md/cli This shows how to specify which vault the Obsidian CLI should operate on. If the current directory is not a vault, or if you need to target a different vault, you can use the 'vault=' parameter. In the TUI, 'vault:open ' switches vaults. ```shell obsidian vault=Notes daily obsidian vault="My Vault" search query="test" ``` -------------------------------- ### Obsidian CLI - Targeting Vaults and Files Source: https://help.obsidian.md/cli Instructions on how to specify which vault or file a command should operate on, including default behavior and specific targeting methods. ```APIDOC ## Obsidian CLI - Targeting Vaults and Files ### Description This section details how to direct Obsidian CLI commands to operate on specific vaults or files. ### Targeting a Vault - **Default Behavior**: If the terminal's current working directory is a vault folder, that vault is used. Otherwise, the currently active vault is used. - **Specific Vault**: Use the `vault=` parameter to target a specific vault. ```bash # Run the daily command on the 'Notes' vault obsidian vault=Notes daily # Search in the vault named "My Vault" obsidian vault="My Vault" search query="test" ``` - **TUI Vault Switching**: Within the TUI, use `vault:open ` to switch to a different vault. ### Targeting a File Many commands accept `file` or `path` parameters to specify a target file. If neither is provided, the command defaults to the active file. - **`file=`**: Resolves the file using Obsidian's wikilink resolution, matching by file name without requiring the full path or extension. - **`path=`**: Requires the exact path from the vault root (e.g., `folder/note.md`). ```bash # Example using file parameter (assuming 'README.md' exists) obsidian read file=README # Example using path parameter obsidian read path=folder/subfolder/note.md ``` ``` -------------------------------- ### Obsidian CLI - Developer Examples Source: https://help.obsidian.md/cli Examples showcasing the Obsidian CLI's capabilities for developers, including opening developer tools, managing plugins, and taking screenshots. ```APIDOC ## Obsidian CLI - Developer Examples ### Description This section provides examples of how to use the Obsidian CLI for development purposes, such as debugging, plugin management, and automation. ### Examples ```bash # Open Obsidian's developer tools obsidian dev:open # Reload a community plugin you are developing (replace 'my-plugin' with your plugin ID) obsidian plugin:reload id=my-plugin # Take a screenshot of the Obsidian app and save it to 'screenshot.png' obsidian dev:screenshot path=screenshot.png # Execute JavaScript code within the Obsidian app console obsidian dev:eval code="app.vault.getFiles().length" ``` ``` -------------------------------- ### Obsidian CLI - General Usage Source: https://help.obsidian.md/cli This section covers the basic installation and usage of the Obsidian CLI, including running single commands and using the interactive terminal interface (TUI). ```APIDOC ## Obsidian CLI ### Description Obsidian CLI is a command-line interface that allows you to control Obsidian from your terminal. It's useful for scripting, automation, and integrating Obsidian with other tools. You can perform actions like opening notes, appending content, searching your vault, and even developer-specific tasks. ### Installation 1. Ensure you have the latest Obsidian installer version (1.11.7) and the latest early access version (1.12.x). 2. Enable Obsidian CLI in Obsidian: Go to **Settings** → **General** and enable **Command line interface**. Follow the prompt to register. 3. On Windows, you may need to run the `.com` file available to Catalyst members. ### Getting Started **Note:** The Obsidian app must be running for most CLI commands. The first command will launch Obsidian if it's not already open. #### Running a Single Command Execute individual commands directly from your terminal: ```bash # Run the help command obsidian help ``` #### Using the Terminal Interface (TUI) Launch the interactive TUI by simply typing `obsidian`. Once inside the TUI, you can enter commands directly without prefixing them with `obsidian`. The TUI offers features like autocomplete, command history, and reverse search (`Ctrl+R`). ```bash # Open the TUI, then run help obsidian help ``` ``` -------------------------------- ### Interact with Obsidian CLI Terminal User Interface (TUI) Source: https://help.obsidian.md/cli This demonstrates how to launch the Obsidian CLI's interactive terminal user interface (TUI). Once inside the TUI, you can enter commands directly without prefixing them with 'obsidian'. The TUI offers features like autocomplete and command history. ```shell # Open the TUI, then run help obsidian help ``` -------------------------------- ### Obsidian CLI Create Note with Parameters Source: https://help.obsidian.md/cli Demonstrates creating a new note using the Obsidian CLI. It shows how to use parameters like 'name' and 'content', including how to handle values with spaces and multiline content using newline ('\n') and tab ('\t') characters. ```shell # Create a new note using the default "Untitled" name obsidian create # Create a new note called "Note" with content "Hello world" obsidian create name=Note content="Hello world" # Create the note in the background and overwrite any existing content obsidian create name=Note content="Hello" silent overwrite # For multiline content use \n for newline. Use \t for tab. obsidian create name=Note content="# Title\n\nBody text" ``` -------------------------------- ### Run a Model with Ollama Source: https://help.obsidian.md/web-clipper/interpreter This command is used to run a specific language model that has been downloaded and configured within Ollama. Replace 'llama3.2' with the actual model ID you wish to use. ```bash ollama run llama3.2 ``` -------------------------------- ### Compare Links and Files in Obsidian Markdown Source: https://help.obsidian.md/bases/syntax Illustrates how to compare links with other links, files, or the current file (`this`) using equality operators. It also shows checking if a list contains a specific link. ```Obsidian Markdown link1 == link2 link == file link == this authors.contains(this) ``` -------------------------------- ### Start Ollama Server for Browser Extension Access Source: https://help.obsidian.md/web-clipper/interpreter This command starts the Ollama server, allowing it to accept requests from browser extensions. It explicitly sets the allowed origins to include common browser extension protocols. Ensure you adjust the protocol if you are not using Chrome, Firefox, or Safari. ```bash OLLAMA_ORIGINS=moz-extension://*,chrome-extension://*,safari-web-extension://* ollama serve ``` -------------------------------- ### Obsidian Flavored Markdown: Callout Frontmatter Example Source: https://help.obsidian.md/callouts Provides an example of frontmatter (YAML metadata) for a callout in Obsidian. This includes aliases, a description, mobile compatibility, permalink, and publish status. ```yaml aliases: - How to/Use callouts description: This page details how to use callouts to include additional content without breaking the flow of your notes. mobile: true permalink: callouts publish: true ``` -------------------------------- ### Create Lists and Access Elements in Obsidian Markdown Source: https://help.obsidian.md/bases/syntax Explains how to convert a single element into a list using the `list()` function and how to access elements within lists and objects using zero-based indexing and property names. ```Obsidian Markdown list(element) property[0] property.subprop property["subprop"] ``` -------------------------------- ### Filter Markdown Files by Extension Source: https://help.obsidian.md/bases/syntax This example demonstrates how to filter files based on their extension. It uses the `file.ext` property to check if a file is a Markdown file. ```Obsidian Formula file.ext == "md" ``` -------------------------------- ### Open Vault Manager Source: https://help.obsidian.md/uri Opens the vault manager interface, allowing users to switch between vaults. ```APIDOC ## GET /choose-vault ### Description Opens the vault manager interface, allowing users to switch between vaults. ### Method GET ### Endpoint `obsidian://choose-vault` ### Response #### Success Response (200) Opens the Obsidian vault manager. ``` -------------------------------- ### Create Note Action Source: https://help.obsidian.md/uri The `new` action allows you to create a new note within a specified vault, optionally providing content and a file name or path. You can also specify how the note should be opened and whether to append or overwrite existing files. ```APIDOC ## `new` Action The `new` action creates a new note in the vault, optionally with some content. ### Endpoint ``` obsidian://new ``` ### Parameters * **`vault`** (string) - Required - The name or ID of the vault where the note will be created. * **`name`** (string) - Optional - The name of the file to be created. If specified, the file location is based on your "Default location for new notes" preferences. * **`file`** (string) - Optional - A vault absolute path, including the name. Overrides `name` if specified. * **`path`** (string) - Optional - A globally absolute path. Works similarly to the `path` option in the `open` action, overriding `vault` and `file`. * **`paneType`** (string) - Optional - Determines where the note will be opened in the UI. Options: `tab`, `split`, `window` (Desktop only). Defaults to replacing the last active tab. * **`content`** (string) - Optional - The contents of the note. * **`clipboard`** (boolean) - Optional - Use the contents of the clipboard instead of specifying `content`. * **`silent`** (boolean) - Optional - If included, the new note will not be opened. * **`append`** (boolean) - Optional - Appends to an existing file if one exists. * **`overwrite`** (boolean) - Optional - Overwrites an existing file if one exists, but only if `append` is not set. * **`x-success`** (string) - Optional - See Use x-callback-url parameters. ### Examples * Create a new note with a specific name: ``` obsidian://new?vault=my%20vault&name=my%20note ``` * Create a new note at a specific path: ``` obsidian://new?vault=my%20vault&file=path%2Fto%2Fmy%20note ``` * Create a new note with content and append it: ``` obsidian://new?vault=my%20vault&name=my%20note&content=This%20is%20the%20content.&append=true ``` ``` -------------------------------- ### Extract Date Components and Compare Dates in Obsidian Markdown Source: https://help.obsidian.md/bases/syntax Demonstrates how to extract specific parts of a date object, like the hour, and how to compare dates using operators. It also shows calculating the difference between two dates in milliseconds. ```Obsidian Markdown now().hour (now() + "1d") - now() ``` -------------------------------- ### Obsidian Base Filters Syntax Source: https://help.obsidian.md/bases/syntax Demonstrates the syntax for defining filters in an Obsidian Base file. It shows how to use logical operators like 'or', 'and', and 'not' to create complex filtering conditions for notes. ```yaml filters: or: - file.hasTag("tag") - and: - file.hasTag("book") - file.hasLink("Textbook") - not: - file.hasTag("book") - file.inFolder("Required Reading") ``` -------------------------------- ### Construct and Use Links in Obsidian Markdown Source: https://help.obsidian.md/bases/syntax Provides examples of creating links using the `link` function, including creating links from strings and setting custom display text or icons. It also shows how to convert file objects to links. ```Obsidian Markdown link("filename") link("https://obsidian.md") link(file.ctime.date().toString()) link("filename", "display") link("filename", icon("plus")) file.asLink() ``` -------------------------------- ### Open Note Action Source: https://help.obsidian.md/uri The `open` action allows you to open a specific note within an Obsidian vault, or to open the vault itself. You can specify the vault by name or ID, and the file by name, path, or absolute file system path. ```APIDOC ## `open` Action The `open` action opens an Obsidian vault, or opens a file within that vault. ### Endpoint ``` obsidian://open ``` ### Parameters * **`vault`** (string) - Required - The name or ID of the vault to open. * **`file`** (string) - Optional - The name or path from the vault root to the file to open. The `.md` extension can be omitted. * **`path`** (string) - Optional - An absolute file system path to a file. This parameter overrides `vault` and `file`. * **`prepend`** (boolean) - Optional - Prepends content to the top of the file and attempts to merge properties. * **`append`** (boolean) - Optional - Appends content to the end of the file and attempts to merge properties. * **`paneType`** (string) - Optional - Determines where the note will be opened in the UI. Options: `tab`, `split`, `window` (Desktop only). Defaults to replacing the last active tab. ### Examples * Open a vault by name: ``` obsidian://open?vault=my%20vault ``` * Open a vault by ID: ``` obsidian://open?vault=ef6ca3e3b524d22f ``` * Open a specific file in a vault: ``` obsidian://open?vault=my%20vault&file=my%20note ``` * Open a file using its absolute path: ``` obsidian://open?path=%2Fhome%2Fuser%2Fmy%20vault%2Fpath%2Fto%2Fmy%20note ``` * Open a heading or block within a note: ``` obsidian://open?vault=my%20vault&file=Note%23Heading obsidian://open?vault=my%20vault&file=Note%23%5EBlock ``` ``` -------------------------------- ### Integrate with Hook Source: https://help.obsidian.md/uri Provides an Obsidian URI action intended for integration with the Hook application. ```APIDOC ## GET /hook-get-address ### Description Provides an Obsidian URI action intended for integration with the Hook application. It can return a Markdown link of the current note or use x-callback-url parameters. ### Method GET ### Endpoint `obsidian://hook-get-address` ### Parameters #### Query Parameters - **vault** (string) - Optional - The name or ID of the vault. If not provided, the current or last focused vault will be used. - **x-success** (string) - Optional - A URL to redirect to upon successful execution, including data about the note. - **x-error** (string) - Optional - A URL to redirect to if an error occurs. ### Response #### Success Response (200) - **name** (string) - The name of the file, without the file extension. - **url** (string) - The `obsidian://` URI for this file. - **file** (string) - (Desktop only) The `file://` URL for this file. ### Request Example ``` obsidian://hook-get-address?vault=my%20vault&x-success=myapp://x-callback-url ``` ### Response Example ```json { "name": "My Note", "url": "obsidian://open?vault=my%20vault&file=My%20Note", "file": "file:///path/to/my%20note.md" } ``` ``` -------------------------------- ### Construct and Modify Dates in Obsidian Markdown Source: https://help.obsidian.md/bases/syntax Learn to create date objects using the `date` function and modify them by adding or subtracting durations. Examples show creating a specific date and adding hours or days. ```Obsidian Markdown date("2025-01-01 12:00:00") now() + "1 hour" today() + "7d" ``` -------------------------------- ### Obsidian Flavored Markdown Frontmatter Example Source: https://help.obsidian.md/obsidian-flavored-markdown This snippet demonstrates the frontmatter configuration for an Obsidian Markdown file, including aliases, description, mobile support, permalink, and publish status. ```yaml aliases: - Obsidian Markdown description: Learn about Obsidian Flavored Markdown, including supported extensions and how Markdown interacts with HTML elements. mobile: true permalink: obsidian-flavored-markdown publish: true ``` -------------------------------- ### Using Prompt Variables in Obsidian Web Clipper Source: https://help.obsidian.md/web-clipper/interpreter Demonstrates how to use natural language prompts within Obsidian Web Clipper templates. Prompts are enclosed in double curly braces and can include specific instructions for data extraction and manipulation. The output can be further refined using filters. ```markdown Examples of prompts Prompts use the variable syntax `{{"your prompt"}}`. You can use this syntax with any natural language query, e.g. * `{{"a summary of the page"}}` to extract a summary of the page. * `{{"a three bullet point summary, translated to French"}}` to extract bullet points about the page, and translate them to French. * `{{"un resumé de la page en trois points"}}` to extract three bullet points using a prompt in French. The output of your prompts can be further manipulated using Filters. Filters are processed after the prompt response is received from the model. For example: `{{"a summary of the page"|blockquote}}` will turn the response into a blockquote. ``` -------------------------------- ### Obsidian Flavored Markdown: Basic Callout Syntax Source: https://help.obsidian.md/callouts Demonstrates the basic syntax for creating an 'info' type callout in Obsidian. It shows how to use blockquotes with a type identifier and includes examples of supported Markdown, internal links, and embeds within the callout. ```markdown > [!info] Here's a callout title > Here's a callout block. > It supports **Markdown**, [[Internal link|Wikilinks]], and [[Embed files|embeds]]! > ![[Engelbart.jpg]] ``` -------------------------------- ### Open Note (Absolute Path) Source: https://help.obsidian.md/uri Opens a note using its absolute file path on the system. ```APIDOC ## GET /[absolute_path_to_note] ### Description Opens a note using its absolute file path on the system. This is equivalent to `obsidian://open?path=[absolute_path]`. ### Method GET ### Endpoint `obsidian:///[absolute_path_to_note]` ### Parameters #### Path Parameters - **absolute_path_to_note** (string) - Required - The absolute file path to the note. ### Response #### Success Response (200) Opens the specified note using its absolute file path. ``` -------------------------------- ### YAML Property Formatting in Obsidian Source: https://help.obsidian.md/properties Demonstrates the basic YAML structure for defining properties in Obsidian Markdown files. Properties are key-value pairs separated by a colon and space, enclosed within '---' delimiters. Each property name must be unique within a note. ```markdown --- name: value --- ``` -------------------------------- ### Open Note (Shorthand) Source: https://help.obsidian.md/uri Opens a specific note within a vault using a shorthand URI format. ```APIDOC ## GET /vault/[vault_name]/[note_name] ### Description Opens a specific note within a vault using a shorthand URI format. This is equivalent to `obsidian://open?vault=[vault_name]&file=[note_name]`. ### Method GET ### Endpoint `obsidian://vault/[vault_name]/[note_name]` ### Parameters #### Path Parameters - **vault_name** (string) - Required - The name of the vault. - **note_name** (string) - Required - The name of the note file. ### Response #### Success Response (200) Opens the specified note within the specified Obsidian vault. ``` -------------------------------- ### Obsidian Blockquote Formatting Source: https://help.obsidian.md/syntax Demonstrates how to create blockquotes in Obsidian using the '>' symbol. Also shows how to convert a standard quote into a callout using `[!info]`. -------------------------------- ### Obsidian URI Actions Source: https://help.obsidian.md/uri The Obsidian URI protocol allows you to perform various actions within Obsidian using a custom URI format. Available actions include opening notes, creating new notes, performing searches, and managing vaults. ```APIDOC ## Obsidian URI Protocol Obsidian URIs use the following format: ``` obsidian://action?param1=value¶m2=value ``` ### Available Actions * **`open`**: Opens a note or a vault. * **`new`**: Creates a new note or adds content to an existing note. * **`daily`**: Creates or opens your daily note. * **`search`**: Opens the search interface. * **`choose-vault`**: Opens the vault manager. ### Encoding Ensure that your values are properly URI encoded. For example, forward slash characters `/` must be encoded as `%2F` and space characters must be encoded as `%20`. ``` -------------------------------- ### Example: Cards View Permalink Source: https://help.obsidian.md/bases/views/cards This snippet shows the permalink configuration for the Cards view within Obsidian Bases. It's a simple key-value pair defining the URL path for accessing this view. ```yaml permalink: bases/views/cards ``` -------------------------------- ### Obsidian External Image Embedding Source: https://help.obsidian.md/syntax Illustrates how to embed external images in Obsidian notes using Markdown syntax. Covers basic embedding, resizing by dimensions, and resizing by width while maintaining aspect ratio. -------------------------------- ### Obsidian Base File Structure Example Source: https://help.obsidian.md/bases/syntax An example of a complete Obsidian Base file, demonstrating the structure for filters, formulas, properties, summaries, and views. This serves as a template for creating custom bases. ```yaml filters: or: - file.hasTag("tag") - and: - file.hasTag("book") - file.hasLink("Textbook") - not: - file.hasTag("book") - file.inFolder("Required Reading") formulas: formatted_price: 'if(price, price.toFixed(2) + " dollars")' ppu: "(price / age).toFixed(2)" properties: status: displayName: Status formula.formatted_price: displayName: "Price" file.ext: displayName: Extension summaries: customAverage: 'values.mean().round(3)' views: - type: table name: "My table" limit: 10 groupBy: property: note.age direction: DESC filters: and: - 'status != "done"' - or: - "formula.ppu > 5" - "price > 2.1" order: - file.name - file.ext - note.age - formula.ppu - formula.formatted_price summaries: formula.ppu: Average ``` -------------------------------- ### Obsidian List Formatting Source: https://help.obsidian.md/syntax Explains how to create unordered lists using '-', '*', or '+', ordered lists using numbers followed by '.' or ')', and task lists with checkboxes. Includes line breaks within list items. -------------------------------- ### Obsidian Internal and External Links Source: https://help.obsidian.md/syntax Shows how to create internal links between notes using Wikilinks or Markdown syntax, and external links to websites or Obsidian URIs. Includes methods for escaping spaces in URLs. -------------------------------- ### Create or Open Daily Note Source: https://help.obsidian.md/uri Creates or opens the daily note for the current day. Requires the Daily notes plugin to be enabled. ```APIDOC ## POST /daily ### Description Creates or opens the daily note for the current day. The Daily notes plugin must be enabled. ### Method GET ### Endpoint `obsidian://daily` ### Parameters #### Query Parameters - **vault** (string) - Required - The name or ID of the vault to open the daily note in. - **day** (string) - Optional - The specific date for the daily note in `YYYY-MM-DD` format. ### Request Example ``` obsidian://daily?vault=my%20vault obsidian://daily?vault=my%20vault&day=2023-10-27 ``` ### Response #### Success Response (200) Opens the specified daily note within the Obsidian vault. ``` -------------------------------- ### Configure Caddy Server for Obsidian Publish Source: https://help.obsidian.md/publish/domains This Caddyfile configuration sets up reverse proxying and rewriting for a custom domain to serve content from Obsidian Publish. It includes enabling compression and defining the proxy target and rewrite rules. ```caddyfile mysite.com { encode zstd gzip handle /my-notes* { reverse_proxy https://publish.obsidian.md { header_up Host {upstream_hostport} } rewrite * /serve?url=mysite.com{path} } } ``` -------------------------------- ### Nesting Lists in Markdown Source: https://help.obsidian.md/syntax Demonstrates how to create nested lists (ordered, unordered, task lists) by indenting list items. Supports mixing list types within a nested structure. ```markdown 1. First list item 1. Ordered nested list item 2. Second list item - Unordered nested list item - [ ] Task item 1 - [ ] Subtask 1 - [ ] Task item 2 - [ ] Subtask 1 ``` -------------------------------- ### Nesting Code Blocks in Markdown Source: https://help.obsidian.md/syntax Demonstrates how to nest code blocks by using more fence characters (backticks or tildes) for the outer block than the inner block, or by using different fence types. ```markdown ````md Here's how to create a code block: ```js console.log("Hello world") ``` ```` ````md ```dataviewjs dv.paragraph(` ~~~mermaid graph TD A --> B ~~~ `) ``` ```` ``` -------------------------------- ### Configure Netlify Redirects for Obsidian Publish Source: https://help.obsidian.md/publish/domains This snippet shows how to configure redirects in Netlify's `netlify.toml` file to point a custom domain path to Obsidian Publish. It specifies the source path and the destination URL, including status code and force options. ```toml [[redirects]] from = "https://mysite.com/my-notes/*" to = "https://publish.obsidian.md/serve?url=mysite.com/my-notes/:splat" status = 200 force = true ``` -------------------------------- ### Comparison Operations Source: https://help.obsidian.md/bases/syntax Provides examples of comparison operators used to compare numbers, dates, or other values. These are essential for creating conditional logic in filters. ```Obsidian Formula value1 == value2 value1 != value2 value1 > value2 value1 < value2 value1 >= value2 value1 <= value2 ``` -------------------------------- ### Configure Table View with Filters and Summaries in Obsidian Bases Source: https://help.obsidian.md/bases/syntax The `views` section defines how data is rendered. This example shows a table view with specific sorting, filtering logic (using AND and OR conditions), ordering, and summary assignments for properties. ```yaml views: - type: table name: "My table" limit: 10 groupBy: property: note.age direction: DESC filters: and: - 'status != "done"' - or: - "formula.ppu > 5" - "price > 2.1" order: - file.name - file.ext - note.age - formula.ppu - formula.formatted_price summaries: formula.ppu: Average ``` -------------------------------- ### Accessing File Properties with `this` Source: https://help.obsidian.md/bases/syntax Illustrates how to access file properties using the `this` object, which refers to the current file or the embedding file depending on the context. This is useful for creating dynamic queries. ```Obsidian Formula this.file.folder this.file.name file.hasLink(this.file) ``` -------------------------------- ### Defining Targeted Context with Selector Variables in Obsidian Web Clipper Source: https://help.obsidian.md/web-clipper/interpreter Shows how to specify a targeted context for the Interpreter feature in Obsidian Web Clipper using selector variables. This allows processing only a specific part of a web page, improving efficiency. HTML processing filters can further refine the context. ```markdown To define a more targeted context use selector variables (or other variable types) to interpret a section of the page. For example, you could use the following selector variable in your template's Interpreter context: ``` {{selectorHtml:#main}} ``` This would only run Interpreter on the `#main` element of a web page, if it exists. HTML processing filters like `remove_html`, `strip_tags` and `strip_attr` can be useful to further reduce the context length and speed up processing. ``` -------------------------------- ### Organizing Platform-Specific Content in Markdown Source: https://help.obsidian.md/style-guide Demonstrates how to use Markdown headings to separate content specific to different platforms (Desktop and Mobile) within a single document. This helps users quickly find relevant instructions. ```markdown ## Customizing the ribbon ### Desktop On the desktop version, you can customize the ribbon as follows: - Rearrange the order of ribbon actions by dragging and dropping the icons. - To hide specific actions, right-click on an empty space and uncheck the actions you want to hide. ### Mobile In the mobile version, you can customize the ribbon through settings: 1. Open **[[Settings]]**. 2. Navigate to **Appearance**. 3. Click **Manage** under **Ribbon menu**. ``` -------------------------------- ### Obsidian Base Formulas Syntax Source: https://help.obsidian.md/bases/syntax Illustrates the syntax for defining custom formulas within an Obsidian Base file. These formulas can perform calculations and transformations on note properties, making them available across views. ```yaml formulas: formatted_price: 'if(price, price.toFixed(2) + " dollars")' ppu: "(price / age).toFixed(2)" ``` -------------------------------- ### Open Search Source: https://help.obsidian.md/uri Opens the Search view in the specified vault and optionally performs a search query. ```APIDOC ## GET /search ### Description Opens the Search view in the specified vault and optionally performs a search query. ### Method GET ### Endpoint `obsidian://search` ### Parameters #### Query Parameters - **vault** (string) - Required - The name or ID of the vault to open. - **query** (string) - Optional - The search term to perform. ### Request Example ``` obsidian://search?vault=my%20vault obsidian://search?vault=my%20vault&query=Obsidian ``` ### Response #### Success Response (200) Opens the Search view in the specified Obsidian vault with the search query applied if provided. ``` -------------------------------- ### Strip Markdown from Text in Obsidian Web Clipper Source: https://help.obsidian.md/web-clipper/filters Illustrates removing Markdown formatting from text variables using the `strip_md` filter in Obsidian Web Clipper templates. This converts Markdown to plain text. ```template {{markdown_text|strip_md}} ``` -------------------------------- ### Transforming Page Content with Prompt Variables and Filters Source: https://help.obsidian.md/web-clipper/variables Prompt variables use natural language processing to extract and modify data, requiring the Interpreter to be enabled. They are flexible for inconsistent data formats and can be combined with filters for complex transformations, such as mapping and templating JSON data. ```javascript {{"return a JSON object for each tweet, that includes the author, tweet_text, date in YYYY-MM-DD format, and images array (if there are any)"|map:tweet => ({text: tweet.tweet_text, author: tweet.author, date: tweet.date})|template:"${text}\n— [[@${author}]], [[${date}]]\n"}} ``` -------------------------------- ### Boolean Logic Operations Source: https://help.obsidian.md/bases/syntax Illustrates the use of boolean operators to combine or negate logical conditions. These operators are used to build complex filter expressions. ```Obsidian Formula !condition condition1 && condition2 condition1 || condition2 ``` -------------------------------- ### Obsidian Publish Frontmatter Configuration Source: https://help.obsidian.md/publish This snippet demonstrates the frontmatter configuration for an Obsidian Publish site. It includes aliases, CSS classes for styling, and a permalink setting for the site. ```yaml aliases: - Obsidian Publish cssclasses: - list-cards - list-cards-mobile-full permalink: publish ``` -------------------------------- ### Format a date object (Date) Source: https://help.obsidian.md/bases/functions The `format()` function formats a date object into a string according to a specified format string, compatible with Moment.js format syntax. This allows for customizable date output. ```javascript date("2025-05-27").format("YYYY-MM-DD") // Returns: "2025-05-27" date("2025-05-27").format("dddd, MMMM Do YYYY") // Returns: "Tuesday, May 27th 2025" ``` -------------------------------- ### Format Text as Callout in Obsidian Web Clipper Source: https://help.obsidian.md/web-clipper/filters Demonstrates formatting text as an Obsidian callout using the `callout` filter. This allows for structured notes with icons and titles. ```template {{variable|callout:"Note","💡"}} ``` -------------------------------- ### Split String into Array in Obsidian Web Clipper Source: https://help.obsidian.md/web-clipper/filters Shows how to split a string variable into an array of substrings based on a delimiter using the `split` filter in Obsidian Web Clipper templates. This is useful for parsing text. ```template {{string|split:","}} ``` -------------------------------- ### Date Arithmetic and Manipulation Source: https://help.obsidian.md/bases/syntax Demonstrates how to perform arithmetic operations on dates, including adding or subtracting durations and obtaining current date/time. It also shows how to format dates and calculate differences. ```Obsidian Formula date + "1M" date - "2h" today() now() now() + "1 day" file.mtime > now() - "1 week" date("2024-12-01") + "1M" + "4h" + "3m" now() - file.ctime datetime.date() datetime.format("YYYY-MM-DD") ``` -------------------------------- ### Check if a string is empty (String) Source: https://help.obsidian.md/bases/functions The `isEmpty()` function checks if a string has zero characters or is not present. It returns `true` for empty or null strings, and `false` otherwise. ```javascript "Hello world".isEmpty() // Returns: false "".isEmpty() // Returns: true ``` -------------------------------- ### Creating Horizontal Rules in Markdown Source: https://help.obsidian.md/syntax Shows how to create horizontal rules using three or more asterisks, hyphens, or underscores on their own line. Symbols can be separated by spaces. ```markdown *** **** * * * --- ---- - - - ___ ____ _ _ _ ``` -------------------------------- ### Convert any value to a string (Any) Source: https://help.obsidian.md/bases/functions The `toString()` function returns the string representation of any value. This is useful for displaying values or concatenating them into strings. ```javascript 123.toString() // Returns: "123" [1, 2, 3].toString() // Returns: "1,2,3" true.toString() // Returns: "true" ```