Simple Code Formatter

by SY
5
4
3
2
1
Score: 53/100

Description

Category: Coding & Technical Tools

The Simple Code Formatter plugin for Obsidian offers a straightforward way to format your code blocks with just a few clicks. It allows you to apply formatting to code in various languages such as JavaScript, CSS, HTML, Java, SQL, and more, using popular formatting tools like Prettier and js-beautify. To use it, simply place your cursor in the code block you wish to format, open the Command Palette, and select "Simple Code Formatter." The plugin ensures your code is neatly organized and readable, enhancing the development experience within Obsidian. Additionally, it supports syntax checking and gives users the option to bypass errors when necessary, making it flexible and reliable for various coding needs. This plugin is especially useful for anyone who frequently works with code snippets in their notes and wants a quick way to improve code presentation.

Reviews

No reviews yet.

Stats

19
stars
3,442
downloads
4
forks
547
days
289
days
513
days
0
total PRs
0
open PRs
0
closed PRs
0
merged PRs
10
total issues
0
open issues
10
closed issues
44
commits

Latest Version

a year ago

Changelog

Optimize: Change the indentation of java code to 4 Spaces

README file from

Github

Simple Code Formatter

Format the block of code where the cursor is located

Direction for use

  • Place the cursor in the block of code you want to format.
  • Search "Simple Code Formatter" in Command Palette. alt text
  • Execute it.

Example

alt text

Supported Languges

Language Formatter(JS Module)
C(C++) js-beautify
csharp js-beautify
java prettier
xml xml-formatter
sql sqlformatter
html prettier
vue prettier
css prettier
javascript prettier
typescript prettier
json5 prettier
scss prettier
less prettier
graphql prettier
markdown prettier
yaml prettier

Questions

1. Markdown syntax of the code block

Make sure the Markdown syntax of the code block you want to format is correct.

2. Code syntax in a code block

The plugin will check your code syntax which use prettier of Formatter(JS Module).

Example of Code syntax

alt text

3. If your code doesn't conform to syntax, but you still want to beautify it?

You should bypass the syntax check. You can use a language powered by js-beautify instead of the current language.

After formatting, change it back.

Similar Plugins

info
• Similar plugins are suggested based on the common tags between the plugins.
Execute Code
4 years ago by twibiral
Obsidian Plugin to execute code in a note.
VSCode Editor
3 years ago by Sun Xvming
Edit Code Files like VSCode in Obsidian.
Shiki Highlighter
2 years ago by Moritz Jung
An Obsidian plugin that offers better code highlighting via shiki and Expressive Code.
Prettier Format
5 years ago by Andrew Lisowski
Format obsidian.md notes using prettier
Code Files
3 years ago by Lukas Bach
Plugin for ObsidianMD to show and edit code files along other notes.
Code Block
4 years ago by Patrik Lindefors
Code block from selection
5 years ago by Dmitry Savosh
Obsidian plugin. Adds code block for the selected text.
Format code blocks of various languages
4 years ago by iVariable
Embed Code File
4 years ago by Abdullah Almariah
Format with Prettier
2 years ago by Alex Gavrusev
Format files in your Obsidian vault using Prettier
Code Block Labels
4 years ago by Sean Bowers
Provides labels for codeblocks in Obsidian
Stenography
5 years ago by bramses
Prettier
2 years ago by GoodbyeNJN
Code::Stats
3 years ago by MiskaMyasa
The Code::Stats plugin allows you to track your coding progress and earn XP for writing markdown in the Obsidian editor.
Alt-Click to Copy
2 years ago by Veer Sheth
Code Language Completer
2 years ago by Stanley Wang
minimal Obisdian plugin, fine-tuned to speed up developer note-taking
Svelte Syntax Highlighter
2 years ago by Typhoon-Kim
This plugin adds Svelte syntax highlighting to Obsidian.
Snippetsaurus
a year ago by Christian Humbert
Format Automatically with Prettier
a year ago by Dylan Armstrong
Format with Prettier using built-in settings for Obsidian
Inline Code Copy
a year ago by Hongchen Lin
ruby.wasm
2 years ago by geeknees
Obsidian RubyWasm Plugin