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
craftedcode 11 hours ago [-]
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.
baliex 22 hours ago [-]
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?
stack_framer 22 hours ago [-]
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?
baliex 3 hours ago [-]
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.
stack_framer 3 hours ago [-]
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):
This looks really cool and right up my alley. Congratulations on showing it to people. Will check it out!
tquinn35 23 hours ago [-]
I’m a little confused what this does. Is it like espanso?
stack_framer 23 hours ago [-]
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.
Alifatisk 12 hours ago [-]
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?
stack_framer 6 hours ago [-]
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.
vifly_net 21 hours ago [-]
expend to ime could be a way
metalliqaz 23 hours ago [-]
shares a name with the markup language[1] and even though it's in a different category, it's a little close for comfort
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...
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
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?
(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?
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've created a new issue for this (it's similar to an idea I already had):
https://github.com/rob-johansen/textile/issues/75
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.
[1] https://en.wikipedia.org/wiki/Textile_(markup_language)