Git Product home page Git Product logo

obsidian-text-expand's Introduction

Text expand

Hey, if you like this plugin, you can support me using Patreon, Paypal or Buy me a cofee. Or you can just share how plugin improves your note-taking experience. Or just send me a message :)

This plugin will search files using Obsidian search functionality and then paste result. The output can be customized using template feature.

Install

  • Just use built-in plugin manager and find Text expand plugin

Manually

  • You need Obsidian v0.9.18+ for latest version of plugin
  • Get Latest release
  • Extract files and place them to your vault's plugins folder: <vault>/.obsidian/plugins/
  • Reload Obsidian
  • If prompted about Safe Mode, you can disable safe mode and enable the plugin. Otherwise head to Settings, third-party plugins, make sure safe mode is off and enable the plugin from there.

How to use

  • You should wrap your search request like that
    ```expander
    SEARCH_QUERY
    ```
  • Open command palette (Ctrl + P)
  • Find and run Text expand: expand command
  • It should search and put results below the wrapped request

Template feature

Using template feature you can customize an output.

  • Put template below the SEARCH_QUERY line
  • Put a cursor inside code block with a templete
  • Open command palette (Ctrl+P) and find Text expand: expand command

To create a list:

```expander
SEARCH_QUERY
- [[$filename]]
```

or to create a table:

```expander
SEARCH_QUERY
^|Filename|Content|
^|---|---|
|$filename|$lines:1|
```

Syntax looks like that:

```expander
SEARCH_QUERY
^This is a header
This line will be repeated for each file
Also, [[$filename]] <- this will be a link
>This is a footer
```
  • Line prepended with ^ is a header. It will be added at the top of the list
  • Line prepended with > is a footer. It will be added at the bottom of the list
  • Line with no special symbol at start will be repeated for each file. Also, all special sequences will be replaced.

Special sequences

  • $filename - return a basename of a file
  • $lines - return the full content of the file
  • $lines:10 - return 10 lines from the file. 10 could be replaced on any number
  • $ext - return extension of the file
  • $created
  • $size
  • $parent - return parent folder
  • $path - return path to file
  • $frontmatter:NAME - return frontmatter value from field NAME
  • $header:## - extract content of all ## headers in a file
  • $header:### HEADER - extract content of the HEADER, ex. $header:##Ideas or $header:"## Plugins for Obsidian"
  • $blocks - extract all blocks paths from the note

Settings

  • Delay (default: 2000ms) - the plugin don't wait until search completed. It waits for a delay and paste result after that.
  • Line ending (default: <--->) - how will looks like the line below the expanded content
  • Default template (default: - [[$filename]]) - how will look the expanded content when no template provided

obsidian-text-expand's People

Contributors

mrjackphil avatar lishid avatar jcangas avatar zgagnon avatar bkyle avatar giulianofiorotto avatar

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.