All Projects → mrjackphil → obsidian-text-expand

mrjackphil / obsidian-text-expand

Licence: other
A simple text expand plugin for Obsidian.md

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to obsidian-text-expand

obsidian-metatemplates
Take advantage of YAML front-matter in generating notes from templates (for obsidian.md)
Stars: ✭ 68 (-44.26%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-jump-to-link
Quick jump between links using hotkeys
Stars: ✭ 57 (-53.28%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian42-text-transporter
Text Transporter - advanced text management for Obsidian. Part of the Obisidan42 family of Obsidian plugins.
Stars: ✭ 100 (-18.03%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-core-search-assistant-plugin
An Obsidian plugin to enhance built-in search: keyboard interface, card preview, bigger preview
Stars: ✭ 59 (-51.64%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-pangu
为 Obsidian 笔记加上「盘古之白」,排版强迫症者的福音。 | A small plugin aims to add space between Chinese Characters and English Alphabet, and it is a boon for typographically compulsive people.
Stars: ✭ 40 (-67.21%)
Mutual labels:  obsidian-plugin, obsidian-md
nldates-obsidian
Work with dates in natural language in Obsidian
Stars: ✭ 263 (+115.57%)
Mutual labels:  obsidian-plugin, obsidian-md
note-folder-autorename
Obsidian plugin to support folder-overview notes by keeping their folder in sync
Stars: ✭ 36 (-70.49%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-convert-url-to-iframe
Plugin for Obsidian.md to convert a selected URL to an iframe.
Stars: ✭ 132 (+8.2%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-journey-plugin
Discover the story between your notes in Obsidian
Stars: ✭ 93 (-23.77%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-url-into-selection
Paste URLs into selected text "notion style"
Stars: ✭ 129 (+5.74%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-task-collector
Plugin for https://obsidian.md/ that assists with managing tasks within a document.
Stars: ✭ 77 (-36.89%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-search-on-internet
Add context menu items in Obsidian to search the internet.
Stars: ✭ 79 (-35.25%)
Mutual labels:  obsidian-plugin, obsidian-md
oz-image-in-editor-obsidian
This Obsidian plugin to view Images, Transclusions, iFrames and PDF Files within the Editor without a necessity to switch to Preview.
Stars: ✭ 243 (+99.18%)
Mutual labels:  obsidian-plugin, obsidian-md
ObsidianBookmark
Chrome extension and nodejs server to allow web clipping to Obsidian.
Stars: ✭ 122 (+0%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-link-archive
Link Archive plugin for Obsidian
Stars: ✭ 94 (-22.95%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-spaced-repetition
Fight the forgetting curve by reviewing flashcards & entire notes on Obsidian.md
Stars: ✭ 667 (+446.72%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-plugin-template
Template for Obsidian.md Plugins
Stars: ✭ 32 (-73.77%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-better-pdf-plugin
Goal of this Plugin in to implement a native PDF handling workflow in Obsidian
Stars: ✭ 120 (-1.64%)
Mutual labels:  obsidian-plugin, obsidian-md
Highlightr-Plugin
A minimal and aesthetically pleasing highlighting menu that makes color-coded highlighting much easier 🎨.
Stars: ✭ 321 (+163.11%)
Mutual labels:  obsidian-plugin, obsidian-md
obsidian-embedded-note-titles
No description or website provided.
Stars: ✭ 50 (-59.02%)
Mutual labels:  obsidian-plugin, obsidian-md

Text expand

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

Table of Contents

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

Search functionality

First line in expander code block is always a search request. You can leave it empty to use results from search panel as is.

Once searching, plugin waits some time (configurable) and extract results from search panel to template engine.

Template engines

eta template engine

You can use eta template engine for managing results.

## <%= it.current.frontmatter.title %>

<% it.files.forEach(file => { %>
   - <%= file.link %> 
<% }) %>

Use it object to access search results and fields for current file.

Path Type Description
it.current FileParameters Info about current file
it.files Array Info about files in search panel

FileParameters type has those fields.

Name Type Description Example
basename string Name of the file Obsidian
name string Full name of the file with extension Obsidian.md
content string Content of the file Obsidian\nContent of the file.
extension string Extension of the file .md
link string Wiki or MD link (depends on Obsidian's settings) [[Obsidian]]
path string Relative to vault root path to the file resources/Obsidian.md
frontmatter Object Returns all values from frontmatter { title: "Obsidian", author: MrJackphil }
stat Object File stats returned by Obsidian { ctime: 1654089929073, mtime: 1654871855121, size: 1712 }
links Array Array with links in the file
headings Array Array with headings in the file
sections Array Array with section of the file
listItems Array Array with list items of the file

sequence template engine (LEGACY)

Using template feature you can customize an output.

  • Put template below the SEARCH_QUERY line
  • Put a cursor inside code block with a template
  • 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

Regexp Description Usage example
$filename a basename of a file $filename
$link wikilink $link
$searchresult the context displayed in the Obsidian search, depending on the amount of context that is selected in the search window $searchresult
$matchline the line which contains the search query $matchline
$matchline:NUMBER the line which contains the search query and NUMBER lines after and before matched line $matchline:10
$matchline:+NUMBER the line which contains the search query and NUMBER lines after matched line $matchline:+10
$matchline:COUNT:LIMIT the line which contains the search query and NUMBER lines around and limit line by LIMIT characters $matchline:0:10
$lines the full content of the file $lines
$lines:NUMBER NUMBER lines from the file $lines:10
$ext extension of the file
$created
$size
$parent parent folder
$path path to file
$frontmatter:NAME frontmatter value from field NAME
$header:## all headers as links
$header:###HEADER headers as links $header:##Ideas
$header:"## Plugins for Obsidian"
$blocks all blocks paths from the note as links

Settings

  • Delay (default: 100ms) - 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
  • Prefixes - which prefix to use to recognize header/footer in template section

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 the 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.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].