obsidian-auto-typography/README.md

27 lines
1.7 KiB
Markdown
Raw Permalink Normal View History

2023-05-20 08:47:27 +00:00
# Auto-Typography for Obsidian
2023-05-20 07:21:16 +00:00
2023-05-21 14:01:18 +00:00
This is a simple plugin for [Obsidian](https://obsidian.md) that converts ASCII typography to the correct Unicode symbols for English writing, similar to the original [SmartyPants plugin](https://daringfireball.net/projects/smartypants/) by John Gruber.
2023-05-20 07:21:16 +00:00
2023-05-20 08:47:27 +00:00
Text is replaced in **reading mode only**. This plugin does not interfere during editing or in live-preview mode, and Markdown files are never modified.
2023-05-20 07:21:16 +00:00
2023-05-20 08:47:27 +00:00
## Rules
2023-05-20 07:21:16 +00:00
2023-05-20 08:47:27 +00:00
- Convert double hyphens `--` to en-dash ``
- Convert triple hyphens `---` to em-dash `—`
- Convert triple periods `...` to horizonal ellipsis `…`
- Convert single apostrophe `'` in the middle of a word to a right single quotation mark ``
- Convert single ASCII quotes `'` around words to left and right single quotation marks `` and ``
- Convert double ASCII quotes `"` around words to left and right double quotation marks `“` and `”`
2023-05-20 07:21:16 +00:00
2023-05-20 08:47:27 +00:00
## Notes
2023-05-20 07:21:16 +00:00
2023-05-21 14:01:18 +00:00
This is my first Obsidian plugin; I made it for practice and for my personal use and it's intentionally simple. There is currently no configuration, and no support for other languages or different kinds of quotation marks. More features might be added in the future.
2023-05-20 07:21:16 +00:00
2023-05-21 14:01:18 +00:00
The plugin registers a `MarkdownPostProcessor` and affects text nodes in the rendered DOM tree only; this should prevent it from interfering with other plugins by replacing CSS classes or HTML attributes by accident.
## Development
[NodeJS 18.16.0 LTS](https://nodejs.org) is required for development.
After checkout, run `npm install` to fetch dependencies. `npm run build` to compile, then copy `manifest.json` and `main.js` to `VAULT/.obsidian/plugins/obsidian-auto-typography/` to install and enable the plugin under *Settings - Community Plugins*.