Text Format

by Benature
5
4
3
2
1
Score: 75/100

Description

Category: Note Enhancements

The Text Format plugin empowers you to quickly and easily reshape the text in your notes. Instead of painstakingly fixing formatting issues by hand, you can transform cases, trim unwanted spaces, and clean up messy content with a few clicks. This tool helps you standardize headings or turn paragraphs into more readable lists. You can refine your copied text from various sources into a polished form, remove duplicate spaces, or unify punctuation marks. It also assists in adjusting language cases and capitalization styles. Whether you're dealing with short excerpts or lengthy material, it makes reorganizing and refining text a smoother, more streamlined process.

Reviews

No reviews yet.

Stats

262
stars
209,403
downloads
21
forks
1,795
days
657
days
692
days
9
total PRs
0
open PRs
1
closed PRs
8
merged PRs
110
total issues
29
open issues
81
closed issues
100
commits

Latest Version

2 years ago

Changelog

README file from

Github

Text Format

Obsidian Downloads GitHub stars latest download Github release GitHub release (latest by date including pre-releases)

[ 中文 | English ]

When I'm taking notes, sometimes I encounter some issues like

  1. I copied some text from pdf or some other source, but the copied content is out of format. For example, there are more than one space between words or one paragraph brokes into several lines.
  2. Lowercase letters are required while they are all uppercase, etc.
  3. blahblahblah...

This plugin is created to format selected text lowercase/uppercase/capitalize/titlecase or remove redundant spaces/newline characters, and other features listed below.

Click to install this plugin right now

Features

Experimental features:

  • Format on paste: see #86

Commands

Press cmd/ctrl+P to enter the command. 👇

Or you can consider to bind custom hotkeys to those commands according to #29.


⚙️: There is setting of this command.

Basic
Command Description
Lowercase Lowercase all letters in selection or the whole title (when cursor focus inline tile)
Uppercase Uppercase all letters in selection or the whole title (when cursor focus inline tile)
Capitalize all words ⚙️ Capitalize all words in selection or the whole title (when cursor focus inline tile)
Capitalize only first word of sentence ⚙️ Capitalize only first word of sentence(s) in selection or the whole title (when cursor focus inline tile)
Title case ⚙️ Capitalize words but leave certain words in lower case in selection or the whole title (when cursor focus inline tile) #1
Cycle case ⚙️ A custom loop to format the selection or the whole title (when cursor focus inline tile)
Slugify selected text convert any input text into a URL-friendly slug
Snakify selected text Lowercase all letters in selection and replace spaces with underscores
Markdown Grammar
Command Description
Heading upper e.g.: # Heading -> ## Heading (default shortcut: Ctrl+Shift+])
Heading lower e.g.: ## Heading -> # Heading (default shortcut: Ctrl+Shift+[) [discussions]
Callout format #80
List
Command Description
Detect and format bullet list ⚙️ Change into bullet list, i.e. - ; split every bullet point into single line; and remove blank lines. (test cases)
Detect and format ordered list Change *)(star could be any letter) into ordered list (e.g. 1. , 2. ); split every ordered point into single line; and remove blank lines. (#4)
Convert table to bullet list The first volume is 1st list, other volumes are sub-list
Convert table to bullet list with header Sub-list begins with ${header}:
Sort to-do list #37, #46
Command Description
Remove WikiLinks format in selection e.g. Convert [[WikiLinks]] to WikiLinks (#28)
Remove URL links format in selection e.g. Convert [Google](www.google.com) to Google
Convert URL links to WikiLinks in selection e.g. Convert [Google](www.google.com) to [[Google]]
Convert WikiLinks to plain markdown links in selection ⚙️ e.g. Convert [[Google]] to [Google](Google.md) (#40)
Copy / OCR issues
Command Description
Remove redundant spaces in selection Ensure only one space between words
Remove all spaces in selection Remove all spaces
Remove trailing spaces in selection Remove trailing spaces (#61)
Remove blank line(s) replace \n\n with \n
Merge broken paragraph(s) in selection ⚙️ Change selected lines into single-line, except lines are separated by blank line(s). At the same time, blank lines will be merged into one blank line(optional, default enable), and redundant spaces will be removed(optional, default enable).
Split line(s) by blanks Replace with \n for OCR use case.
Convert to Chinese punctuation marks (,;:!?) ⚙️ For OCR use case. (For who require more custom setting, I would recommend https://p.gantrol.com/)
Convert to English punctuation marks Similar to Convert to Chinese punctuation marks (,;:!?)
Remove hyphens Remove hyphens (like when pasting text from pdf) #15
Replace ligature Replace ligature to Non-ligature #24
Academic / Study
Command Description
Convert selection into Anki card format #32
Remove citation index e.g., A research [12] about notes => A research about notes
Get Zotero note from clipboard and paste ⚙️ See below ⬇️
Detect and convert characters to math mode (LaTeX) e.g. convert P into $P$ (latex), apply for all single letter except a.
Convert Mathpix array to markdown table Convert latex array generated by Mathpix to markdown table format
Advanced custom
Command Description
Custom Replace ⚙️ Custom replace <search> to <replace>. See below for more examples ⬇️
Custom Wrapper ⚙️ Add any arbitrary wrapping element in Setting. (https://github.com/Benature/obsidian-underline/issues/5) See below for more examples ⬇️
Custom API Request ⚙️ Replace Selection with the return of custom API request. The selection will be sent to custom API URL with POST method. (No user data is collected!) There is an example of my use case.
Others
Command Description
Decode URL Decode URL for better reading and shorter url.
Add extra double spaces per paragraph for whole file Add double spaces at the end of every paragraph #8
Add extra line break to paragraph replace \n with \n\n
Format space between word and symbol add space between words and (

Support

If you find this plugin useful and would like to support its development, you can sponsor me via Buy Me a Coffee ☕️, WeChat, Alipay or AiFaDian. Any amount is welcome, thank you!

Some Examples

Zotero format

The format template can refer to https://www.zotero.org/support/note_templates

  • default
    • zotero: <p>{{highlight quotes='true'}} {{citation}} {{comment}}</p>
    • plugin config: “(?<text>.*)” \((?<item>.*?)\) \(\[pdf\]\((?<pdf_url>.*?)\)\)
    • result: {text} [🔖]({pdf_url})

Replacements

use cases:

  • Split paragraph into sentences: #78

Wrapper

use cases:

  • Underline: prefix=<u>, suffix=</u>, then selected text will turn into <u>text</u>
  • Font color: #30

Convert citation index to the file name of paper note

With bib-cacher, I can connect to Zotero database by python, building a simple Flask server.

Example of command Custom API Request:

- A survey concludes that obsidian is a good app [12]. Furthermore, The note taking...
+ A survey concludes that obsidian is a good app ([[File Name of the Reference]]). Furthermore, The note taking...

Basic

demo

  • lowercase
    - Hello, I am using Obsidian.
    + hello, i am using obsidian.
    
  • uppercase
    - Hello, I am using Obsidian.
    + HELLO, I AM USING OBSIDIAN.
    
  • capitalize word
    - Hello, I am using Obsidian.
    + Hello, I Am Using Obsidian.
    
  • capitalize sentence
    - hello, I am using Obsidian.
    + Hello, I am using Obsidian.
      ^
    
  • title case
    - Obsidian is a good app.
    + Obsidian Is a Good App.
                  ^
    
  • slugify
    - Obsidian - a good app.
    + obsidian-a-good-app
    
  • snakify
    - Obsidian is a good app
    + obsidian_is_a_good_app
    
  • redundant spaces
    - There  are so   many redundant      blanks
    + There are so many redundant blanks
    
  • merge broken paragraph
    - This paragraph is broken 
    - into several lines. I want 
    - those lines merged!
    - 
    - And this is second paragraph. There is a blank line between 
    - two paragraph, indicating that they should not be merged into 
    - one paragraph!
    
    + This paragraph is broken into several lines. I want those lines merged!
    +
    + And this is second paragraph. There is a blank line between two paragraph, indicating that they should not be merged into one paragraph!
    
  • bullet list
    - • first, blahblah • second, blahblah • third, blahblah
    
    + - first, blahblah 
    + - second, blahblah 
    + - third, blahblah
    
  • ordered list
    - a) first, blahblah b) second, blahblah c) third, blahblah
    - i) first, blahblah ii) second, blahblah iii) third, blahblah
    
    + 1. first, blahblah 
    + 2. second, blahblah 
    + 3. third, blahblah
    

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Arcane Obfuscate
2 years ago by Shusako
Obfuscate text in Obsidian.md with an arcane runic effect.
Colored Tags
3 years ago by Pavel Frankov
Colorizes tags in different colors.
Colored Text
3 years ago by Erinc Ayaz
Colorizelt
2 years ago by Artsem Holub (WiNE-iNEFF)
Easy color and clear selected text
Dynamic Text Concealer
2 years ago by Matt Cole Anderson
Obsidian.md Plugin to conceal or replace user configured text patterns in Live Preview and Read Mode.
Fill in the Blank (FITB)
3 years ago by Shawn McGee
Format with Prettier
2 years ago by Alex Gavrusev
Format files in your Obsidian vault using Prettier
Image Magician
2 years ago by luxmargos
This is a plugin for Obsidian (https://obsidian.md). Supports viewing and exporting various image formats using ImageMagick.
Jelly Snippets
3 years ago by Spencer Gouw
A simple text snippets plugin for Obsidian.md. BACKUP SNIPPETS BEFORE UPDATING.
Linter
5 years ago by Victor Tao
An Obsidian plugin that formats and styles your notes with a focus on configurability and extensibility.
Prettier Format
5 years ago by Andrew Lisowski
Format obsidian.md notes using prettier
Regex Mark
2 years ago by Mara-Li
Remove Newlines
2 years ago by Elias Jaffe
A plugin for Obsidian.md which removes newlines and blank lines from selected or pasted text.
Snippetsaurus
a year ago by Christian Humbert
Text Conversions
3 years ago by Juan D Frias
Text conversions for Obsidian
Text Dataset Aid Plugin
3 years ago by Conner Ohnesorge
This is a obsidian plugin to help with the creation of personal jsonl datasets for text generation models.
Text expand
6 years ago by MrJackphil
A simple text expand plugin for Obsidian.md
Text Extractor
3 years ago by Simon Cambier
A (companion) plugin to facilitate the extraction of text from images (OCR) and PDFs.
Text Finder
a year ago by hafuhafu
Provides a find/replace window in edit mode similar to VSCode (supports regular expressions and case sensitivity).
Text Focus
2 years ago by usysrc
Focus the text area when opening a new note.
Text Generator
4 years ago by Noureddine Haouari
Text Generator is a versatile plugin for Obsidian that allows you to generate text content using various AI providers, including OpenAI, Anthropic, Google and local models.
Text Snippets
5 years ago by Ariana Khitrova
Snippets plugin for obsidian
Text Transform
3 years ago by ipshing
Text Transporter
5 years ago by TfTHacker
Text Transporter - advanced text management for Obsidian.
Textgrams
a year ago by Akop Kesheshyan
Create and store ASCII graphics in your Obsidian
Toggle Case
3 years ago by automattech
Obsidian plugin to toggle between `lowercase` `UPPERCASE` and `Title Case`
Translator
4 years ago by Haifeng Lu
A plugin for Obsidian to translate selected text.
复制图文 (Copy Image Text)
2 years ago by msgk
obsidian插件,复制笔记内容(包括文本和图片)到剪贴板