Update README to reflect Unicode Text Formatter plugin

Replace the boilerplate Obsidian sample plugin README with accurate
documentation covering features, usage, installation, project structure,
and Unicode code point ranges used by the plugin.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-19 19:26:36 +01:00
parent fd74c0987e
commit 6a3cb48f60
+58 -72
View File
@@ -1,90 +1,76 @@
# Obsidian Sample Plugin # Unicode Text Formatter
This is a sample plugin for Obsidian (https://obsidian.md). An [Obsidian](https://obsidian.md) plugin that transforms selected text into Unicode Mathematical Alphanumeric Symbols — Sans-Serif Bold, Italic, and Bold-Italic — for use in LinkedIn and Facebook posts.
This project uses TypeScript to provide type checking and documentation. ## Features
The repo depends on the latest plugin API (obsidian.d.ts) in TypeScript Definition format, which contains TSDoc comments describing what it does.
This sample plugin demonstrates some of the basic functionality the plugin API can do. - **Unicode Bold** — converts letters and digits to sans-serif bold (𝗔𝗕𝗖 / 𝗮𝗯𝗰 / 𝟬𝟭𝟮)
- Adds a ribbon icon, which shows a Notice when clicked. - **Unicode Italic** — converts letters to sans-serif italic (𝘈𝘉𝘊 / 𝘢𝘣𝘤)
- Adds a command "Open modal (simple)" which opens a Modal. - **Unicode Bold Italic** — converts letters to sans-serif bold italic (𝘼𝘽𝘾 / 𝙖𝙗𝙘)
- Adds a plugin setting tab to the settings page. - Non-mapped characters (punctuation, spaces, emoji, etc.) are passed through unchanged
- Registers a global click event and output 'click' to the console.
- Registers a global interval which logs 'setInterval' to the console.
## First time developing plugins? ## Usage
Quick starting guide for new plugin devs: 1. Select text in the editor
2. Open the Command Palette (`Ctrl/Cmd + P`)
3. Run one of:
- **Format as Unicode Bold**
- **Format as Unicode Italic**
- **Format as Unicode Bold Italic**
- Check if [someone already developed a plugin for what you want](https://obsidian.md/plugins)! There might be an existing plugin similar enough that you can partner up with. The selected text is replaced in place with its Unicode equivalent.
- Make a copy of this repo as a template with the "Use this template" button (login to GitHub if you don't see it).
- Clone your repo to a local development folder. For convenience, you can place this folder in your `.obsidian/plugins/your-plugin-name` folder.
- Install NodeJS, then run `npm i` in the command line under your repo folder.
- Run `npm run dev` to compile your plugin from `main.ts` to `main.js`.
- Make changes to `main.ts` (or create new `.ts` files). Those changes should be automatically compiled into `main.js`.
- Reload Obsidian to load the new version of your plugin.
- Enable plugin in settings window.
- For updates to the Obsidian API run `npm update` in the command line under your repo folder.
## Releasing new releases ## Installation
- Update your `manifest.json` with your new version number, such as `1.0.1`, and the minimum Obsidian version required for your latest release. ### Manual
- Update your `versions.json` file with `"new-plugin-version": "minimum-obsidian-version"` so older versions of Obsidian can download an older version of your plugin that's compatible.
- Create new GitHub release using your new version number as the "Tag version". Use the exact version number, don't include a prefix `v`. See here for an example: https://github.com/obsidianmd/obsidian-sample-plugin/releases
- Upload the files `manifest.json`, `main.js`, `styles.css` as binary attachments. Note: The manifest.json file must be in two places, first the root path of your repository and also in the release.
- Publish the release.
> You can simplify the version bump process by running `npm version patch`, `npm version minor` or `npm version major` after updating `minAppVersion` manually in `manifest.json`. 1. Build the plugin (see [Development](#development)) or download a release
> The command will bump version in `manifest.json` and `package.json`, and add the entry for the new version to `versions.json` 2. Copy `main.js` and `manifest.json` to your vault at:
```
<VaultFolder>/.obsidian/plugins/unicode-text-formatter/
```
3. In Obsidian: **Settings → Community Plugins → Installed Plugins** — enable **Unicode Text Formatter**
## Adding your plugin to the community plugin list ## Development
- Check the [plugin guidelines](https://docs.obsidian.md/Plugins/Releasing/Plugin+guidelines). Requirements: Node.js ≥ 16
- Publish an initial version.
- Make sure you have a `README.md` file in the root of your repo.
- Make a pull request at https://github.com/obsidianmd/obsidian-releases to add your plugin.
## How to use ```bash
npm install
- Clone this repo. npm run dev # watch mode — recompiles on save
- Make sure your NodeJS is at least v16 (`node --version`). npm run build # one-time production build
- `npm i` or `yarn` to install dependencies. npm run lint # ESLint check
- `npm run dev` to start compilation in watch mode.
## Manually installing the plugin
- Copy over `main.js`, `styles.css`, `manifest.json` to your vault `VaultFolder/.obsidian/plugins/your-plugin-id/`.
## Improve code quality with eslint
- [ESLint](https://eslint.org/) is a tool that analyzes your code to quickly find problems. You can run ESLint against your plugin to find common bugs and ways to improve your code.
- This project already has eslint preconfigured, you can invoke a check by running`npm run lint`
- Together with a custom eslint [plugin](https://github.com/obsidianmd/eslint-plugin) for Obsidan specific code guidelines.
- A GitHub action is preconfigured to automatically lint every commit on all branches.
## Funding URL
You can include funding URLs where people who use your plugin can financially support it.
The simple way is to set the `fundingUrl` field to your link in your `manifest.json` file:
```json
{
"fundingUrl": "https://buymeacoffee.com"
}
``` ```
If you have multiple URLs, you can also do: ### Project structure
```json | File | Purpose |
{ |------|---------|
"fundingUrl": { | `src/unicode-maps.ts` | Builds character lookup maps from Unicode code point ranges |
"Buy Me a Coffee": "https://buymeacoffee.com", | `src/formatter.ts` | `transformText(text, style)` — maps each character through the selected style map |
"GitHub Sponsor": "https://github.com/sponsors", | `src/commands.ts` | Registers the three editor commands with the Obsidian plugin API |
"Patreon": "https://www.patreon.com/" | `src/main.ts` | Plugin entry point — calls `registerCommands` on load |
}
} ### Unicode blocks used
```
| Style | Uppercase | Lowercase | Digits |
|-------|-----------|-----------|--------|
| Sans-Serif Bold | U+1D5D4U+1D5ED | U+1D5EEU+1D607 | U+1D7ECU+1D7F5 |
| Sans-Serif Italic | U+1D608U+1D621 | U+1D622U+1D63B | — |
| Sans-Serif Bold-Italic | U+1D63CU+1D655 | U+1D656U+1D66F | — |
## Releasing
1. Update `manifest.json` with the new version and minimum Obsidian version
2. Update `versions.json`: `"new-version": "min-obsidian-version"`
3. Create a GitHub release tagged with the exact version number
4. Attach `manifest.json` and `main.js` as release assets
> You can bump the version automatically:
> ```bash
> npm version patch # or minor / major
> ```
## API Documentation ## API Documentation
See https://docs.obsidian.md See <https://docs.obsidian.md>