Here's a few use cases that are in the same territory, which I tried address at various stages with emacs and scripts.
1. Everything I ever paste (which is longer than >N) will be saved into a file. The assumption being is that it's an e-mail or message with high reuse potential
2. I have a single keybind that launches a script-selector and passes the currently selected text to it.
3. Script examples: save selection as markdown in a preset file (for use with LLMs); send selection to a temporary emacs buffer.
4. I have two shortcut that - take the current text area into emacs to edit it; then, send the emacs buffer back to the current selected area (by pasting). Useful for replying to messages
Can it wait/prompt for something new to be put onto the clipboard while it runs a Textile?
For a use-case where I've copied thing 1, then I start my Textile, then I go and copy thing 2 from somewhere, and then Textile continues with the remaining steps with thing 1 and thing 2?
That’s exactly what I was thinking. And I think you’re saying the same thing, but to be sure: the _wait_ wouldn’t be a timer, it’d be watching the clipboard for changes and proceeding as soon as it changed.
If we’re going to do the discovery out in the open.. it would be nice to be able to specify the prompt as part of the Textile (e.g. “Copy the GitHub URL”). And then also showed the clipboard contents it is going to proceed with, before proceeding. A single key press (Enter?) would be ideal to proceed. That protects me from accidentally passing sensitive data through.
I'm not too familiar with Espanso, but Textile is not a text expander. Textile allows you to pre-define a sequence of steps that dynamically generate the text you want, by running commands on your computer, reading your clipboard, or using hard-coded text you provide.
Here's a quick example, and one that I often use with Textile to generate a preview URL based on my current branch:
(1) Start with the output of the command `git branch --show-current` in the `~/code` directory (yielding text like `JIRA-1234/some-feature`).
(2) Replace all `/` characters with `-` (now the text is `JIRA-1234-some-feature`).
(3) Prepend `[preview](https://staging-`, which is the start of a markdown link (now the text is `[preview](https://staging-JIRA-1234-some-feature`).
With those steps saved in Textile, I can now click a button to run them over and over again (or use a keyboard shortcut if I assigned one). So no matter which branch I'm on, I'll always get a proper preview link without having to construct it manually myself.
I'm certain everything Textile does could be handled by bash scripts, or any other script flavors / languages / tools. So, yes, Textile is supposed to be a more convenient way to do it.
`Textile` is a similar language to Markdown, used to weave text across multiple IDEs, programming languages, and CMSs:
https://textile-lang.com/
Textile is one of the core markups supported by GitHub and Pandoc:
https://github.com/github/markup / https://pandoc.org/
And many CMS, most famously TextPattern and MoveableType, but also things like Jekyll:
https://textile-lang.com/article/textile-markup-language-sup...
Here's a few use cases that are in the same territory, which I tried address at various stages with emacs and scripts.
1. Everything I ever paste (which is longer than >N) will be saved into a file. The assumption being is that it's an e-mail or message with high reuse potential
2. I have a single keybind that launches a script-selector and passes the currently selected text to it.
3. Script examples: save selection as markdown in a preset file (for use with LLMs); send selection to a temporary emacs buffer.
4. I have two shortcut that - take the current text area into emacs to edit it; then, send the emacs buffer back to the current selected area (by pasting). Useful for replying to messages
The "local drive as database" tradeoff is interesting. No sync but you own your data completely. For certain use cases that's actually the right call.
Can it wait/prompt for something new to be put onto the clipboard while it runs a Textile?
For a use-case where I've copied thing 1, then I start my Textile, then I go and copy thing 2 from somewhere, and then Textile continues with the remaining steps with thing 1 and thing 2?
No, but this is a great suggestion. I imagine a flow that looks something like this:
(1) When creating the textile, you would add a step to "wait for new clipboard data."
(2) When you run the textile, and it gets to that step, a modal would appear, prompting you to copy the new thing to your clipboard.
(3) Once you've got the new thing on your clipboard, you would go back and click "Continue" on the modal from step 2.
(4) Textile would continue with the new thing on your clipboard.
Is that kind of what you were thinking?
That’s exactly what I was thinking. And I think you’re saying the same thing, but to be sure: the _wait_ wouldn’t be a timer, it’d be watching the clipboard for changes and proceeding as soon as it changed.
If we’re going to do the discovery out in the open.. it would be nice to be able to specify the prompt as part of the Textile (e.g. “Copy the GitHub URL”). And then also showed the clipboard contents it is going to proceed with, before proceeding. A single key press (Enter?) would be ideal to proceed. That protects me from accidentally passing sensitive data through.
I like the idea of being able to specify the prompt, as a reminder of what you wanted to copy to the clipboard at that point.
I've created a new issue for this (it's similar to an idea I already had):
https://github.com/rob-johansen/textile/issues/75
This could be useful for writing report card comments! Source: I'm a teacher. It's report card season. :)
The text on your site is cut off on both left and right on my iPhone 13 mini, and I can't zoom, so it's unreadable.
Same on Android, duck browser
Looks much better now
Thanks! Should be fixed.
Looks a lot like CyberChef which is web based. https://cyberchef.org/
This looks really cool and right up my alley. Congratulations on showing it to people. Will check it out!
I’m a little confused what this does. Is it like espanso?
I'm not too familiar with Espanso, but Textile is not a text expander. Textile allows you to pre-define a sequence of steps that dynamically generate the text you want, by running commands on your computer, reading your clipboard, or using hard-coded text you provide.
Here's a quick example, and one that I often use with Textile to generate a preview URL based on my current branch:
(1) Start with the output of the command `git branch --show-current` in the `~/code` directory (yielding text like `JIRA-1234/some-feature`).
(2) Replace all `/` characters with `-` (now the text is `JIRA-1234-some-feature`).
(3) Prepend `[preview](https://staging-`, which is the start of a markdown link (now the text is `[preview](https://staging-JIRA-1234-some-feature`).
(4) Append `.example.com)`, which is the end of the markdown link (now the text is `[preview](https://staging-JIRA-1234-some-feature.example.com)`).
(5) Copy the result to my clipboard.
With those steps saved in Textile, I can now click a button to run them over and over again (or use a keyboard shortcut if I assigned one). So no matter which branch I'm on, I'll always get a proper preview link without having to construct it manually myself.
Can't this be done with a bash script? Or is this supposed to be a more convenient, ergonomic and declarative way to do it?
I'm certain everything Textile does could be handled by bash scripts, or any other script flavors / languages / tools. So, yes, Textile is supposed to be a more convenient way to do it.
expend to ime could be a way
shares a name with the markup language[1] and even though it's in a different category, it's a little close for comfort
[1] https://en.wikipedia.org/wiki/Textile_(markup_language)
Not to be confused with https://textile-lang.com/