Text Tools
This is a Toolkit for work with text. You can analyse selected text, get statistics, find and replace text, and modify it in various ways.
🧰 text-tools /
Lorem Ipsum Text Generator 🔧
Generate Lorem Ipsum text. You can choose between ... (Read more)
- 💻 Setup
- Easy
- 🏷️ Tags
- create text, lorem ipsum
🧰 text-tools /
Text Case Converter 🔧
Transform the selected text to a different case. Y... (Read more)
- 💻 Setup
- Easy
- 🏷️ Tags
- text, case, convert, transform
// Author: Eduard Uffelmann
// Linkedin: https://www.linkedin.com/in/euffelmann/
// Twitter: @schmedu_
// Website: https://schmedu.com
import "@johnlindquist/kit";
let input = await getSelectedText();
let buildPreview = ([search, replacement]) => {
if (!search) return md(input);
if (!replacement)
return md(
`${input
.replaceAll("\n", "<br>")
.replaceAll(search, `<ins>${search}</ins>`)}`
);
return md(
`${input}
${replacement
.split(",")
.map((item) => {
return input
.replaceAll("\n", "<br>")
.replaceAll(search, `<ins>${item}</ins>`);
})
.join("<br>")}`
);
};
let [search, replacement] = await fields({
fields: ["Search", "Replacement"],
preview: buildPreview(["", ""]),
onChange: async (input, state) => {
let preview = buildPreview(state?.value);
setPreview(preview);
},
});
let result = `${input}
${replacement
.split(",")
.map((item) => {
return input.replaceAll(search, `${item}`);
})
.join("\n")}`;
// Output
await setSelectedText(result);
- 💻 Setup
- Easy
- 🏷️ Tags
- text, replace text
- 💻 Setup
- Easy
- 🏷️ Tags
- text, word count
🧰 text-tools /
Get Reading Time of Text 🔧
How much time does the text take to read? Just sel... (Read more)
- 💻 Setup
- Easy
- 🏷️ Tags
- Reading Time, Text
- 💻 Setup
- Easy
- 🏷️ Tags
- text, replace text
- 💻 Setup
- Easy
- 🏷️ Tags
- text, word count
- 💻 Setup
- Easy
- 🏷️ Tags
- title case, text