Git Product home page Git Product logo

obsidian-text-expander's People

Contributors

joethei avatar konodyuk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

obsidian-text-expander's Issues

Trigger replacement text doesn't substitute variables.

Hi,

I've added trigger:

{
"regex": "^jira:",
"replacement": "[<text>](https://notmyrealsite.atlassian.net/browse/<text>)"
}

however when triggering with {{jira:PROJ-1234}} the resultant output is:

[<text>](https://notmyrealsite.atlassian.net/browse/<text>)

rather than the expected:

[PROJ-1234](https://notmyrealsite.atlassian.net/browse/PROJ-1234)

Are there any pointers on how to get this to function?

Usage On Windows (first steps)

I installed the plugin on my window 10 machine and found the setting for the executable not to work, obviously.

As a developer and Linux fan I use Windows Linux Subsystem (wsl) and tried that out.

Using the Shell executable with
C:\Windows\System32\wsl.exe

The first tests worked as excpected:

  • now
  • trigger
  • eval
  • py (for python)

Could you - maybe add a note inside the documentation - or could we use a feature inside the plugin to default to this?

Shortcuts don't save in plugin config pane

I tried adding a new shortcut:

	{
		"regex": "^brev$",
		"replacement": "**\[Redacted for brevity\]**"
	},

There is no save button. How can you miss something as obvious on a config UI as that? So I assume the plugin autosaves when I close the config. Now what if I don't want to save changes?

That is immaterial because the autosave doesn't work. It saves the Shell executable setting, and it saves half my new shortcut, the regex, but not the replacement.

I will look at a PR to help you, but really, do you test you work at all? Have you even tried using the plugin outside of your IDE?

Is it possible to make this work on mobile?

I use Obsidian a lot on my phone and my iPad. Text Expander is really useful on PC but when I tried to install it on mobile I can't enable it after installing. Is it possible to get this working on mobile, and if so, are you able to use it without having a keyboard attached to hit the Tab key? It would be really awesome if this could use some other prompt on mobile devices since there's not a Tab key on the on-screen keyboard.

how to add commands/edit the settings?

Using this plugin on windows, with powershell set as the shell — I cannot discover how to add new triggers to the text expander. If I edit the window in the settings, my changes can't be saved and the new triggers disappear (though triggers I delete seem to stay deleted). I found a "data.json" file in the plugin's subdirectory, but this doesn't seem to get read. I have tried disabling and re-enabling the plugin. Doesn't help. Do I have to restart Obsidian or reload the vault for my changes to that file to be picked up?

It would improve the docs if you were to state clearly where and how people can add their own simple shell commands to the list of triggers.

Use different syntax for replacements

It would be nice to have a different syntax for calling replacements.
I propose @trigger or ::trigger for this case, but if possible it should be configurable.

This would allow reusing trigger-words for different context. And this would give a mental context when something is a fast replacment or a potential slow call to an external process. For example, I use {{@py}} and {{@sh}} to insert code-fences for python- and shell-code, but typing this so often can be a pain.

Tab-Press not execution plugin

Hi,

on widnows 10 the plugin didn't work as expected. It seems that the hotkey for "tab" was not set correctly.
On Linux & macOS it works as expected.

obsidian version: 0.13.33

best regards

Sympy-tool.py is not found

When using the default {{sympy:}} syntax, I get a python error stating that <path-to-vault>/.obsidian/scripts/sympy-tool.py is not found. I checked and indeed there's no /scripts folder at all. Looking at the readme, it says the examples folder contains two scripts, but the current commit's example folder only has one, main.py, that seems to do quite a bit more than just sympy.

What's the correct way to set up {{sympy:}}?

[Noob] Question on syntax

Hi,

I try (on Windows) to save this into the setting (the syntax) but I cannot seem to save it. Want to know if there's something wrong with the syntax.

Context: I am trying to have an expander for a format of table that I use frequently.

        {
		"regex": "^22$",
		"replacement": 
        "
        |     |     |     |
        | --- | --- | --- |
        |     |     |     |
        |     |     |     |
         "
	}

[question] double quote issue on command

I want to get text like ## 2021.04.07 (Wed) using this command:

today_str=`date +"%Y.%m.%d (%a)"` && echo "## $today_str"

But, I'm not sure how should I put this command in the configuration.
Specifically, how can I use double quotation mark in double quote?

{
    "regex": "^standup$",
    "command": "today_str=`date +"%Y.%m.%d (%a)"` && echo "## $today_str""
}

Thanks

Documentation for writing custom tools in Python

Thanks for this plugin! It looks to be exactly what I need. Unfortunately I'm having trouble following the examples. It seems the API for custom tools changed recently and I'm unsure what should be specified in the plugin's settings and what should be in the <scripts_path> folder.

For example, the default settings for the tool: and sympy: triggers still reference separate non-existent files (<scripts_path>/tool.py and <scripts_path>/sympy_tool.py respectively). They also use the cut command to manually trim the trigger from the rest of the input text.

The new example script is called main.py and seems to not only implement the sympy example but to re-implement the now command from the default settings too. The cut_prefix argument suggests to me that it is no longer required to trim triggers from the command specified in the settings but I can't be sure. I'm also unsure if I can just add new triggers by adding new handlers decorated with @handler.command or if I also need to modify the Processor or Handler classes.

Also, the gif moves far too quickly for me to see what's really happening. I'd really appreciate some clear text documentation in the README on the best way to add my own commands, and what the relationship between the settings and any script files is 🙏🏻

Plugin freezes Obsidian

After enabling plugin Obsidian doesn't respond. After killing app the plugin remains disabled. Obsidian v. 0.10,7

Doesn't work with the new Obsidian editor

I'm using Obsidian v0.13.8.
Text expander stopped working, the Tab command just indent the {{trigger}} without actual substitution.
When I switched to the Legacy Editor at the Editor section, everything starts working again.

gpt-4-1106-preview

Getting an error when running, looks like it's thinking this is a completions endpoint instead.

Python modules not found on Ubuntu

I am trying to get the text expander to run a simple no-arguments python script with the following config:

	{"regex": "^foo$",
	"command": "python3 <scripts_path>/bar.py"
	}

The bar.py file has the following shebang line: #!/usr/bin/python3

python3 <scripts_path>/bar.py runs fine if executed in the terminal (Ubuntu 20.04), where which python3 points to the same /usr/bin/python3. But the text expander execution fails, because python cannot find the required modules (which have been pip3-installed system-wide).

I thought that maybe it somehow calls some different python binary, but the expander command {{shell: which python3}} also outputs /usr/bin/python3, as expected.

Obsidian was installed via flathub.

information about missing windows support is hidden

Your plugin looks really interesting, but I am on windows, so I cant use it right now. But it would be really helpful if you wouldn't place that information at the very bottom of the README. I was already thinking of some use cases, until I found that comment. It would not suprise me, if some windows users create an issue, because the plugin is not working, if the information is so well hidden.

After hitting tab a new line is created

Hello!
This is my Text Expander Shortcut:

[
	{
		"regex": "^rpc:",
		"command": "echo <text> | cut -c 5- | python3 <scripts_path>/rpc.py"
	}
]

And this is rpc.py:
print("[[" + input().replace(" ", "_") + "]]");

But when I hit tab, the cursor doesn't stay on the same line (as demo shows), it goes to a new line:

screencast-00006

I want it to stay on the same line, as it's most convenient to me.
Can you help me?

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.