https://github.com/bur4kbey/obsidian-prettier
A plugin for Obsidian to format markdown files using Prettier.
https://github.com/bur4kbey/obsidian-prettier
obsidian obsidian-plugin prettier
Last synced: over 1 year ago
JSON representation
A plugin for Obsidian to format markdown files using Prettier.
- Host: GitHub
- URL: https://github.com/bur4kbey/obsidian-prettier
- Owner: BUR4KBEY
- Created: 2023-04-18T22:25:06.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2024-07-14T02:10:30.000Z (almost 2 years ago)
- Last Synced: 2024-07-14T03:23:39.983Z (almost 2 years ago)
- Topics: obsidian, obsidian-plugin, prettier
- Language: TypeScript
- Homepage:
- Size: 22.5 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ✨ Obsidian Prettier
This is a plugin developed for [Obsidian](https://obsidian.md) to format markdown files using the popular code formatter [Prettier](https://prettier.io/).
## 🛠️ Building the project
Firstly, clone the project to your local disk by running the following command:
```
git clone https://github.com/BUR4KBEY/obsidian-prettier.git
```
Then, install the dependencies using [yarn](https://yarnpkg.com):
```
cd obsidian-prettier
yarn
```
Next, build the project by running the following command:
```
yarn build
```
Alternatively, you can run the `yarn dev` command for development purposes.
## 🔌 Installation
To install the plugin, follow these steps:
1. Navigate to your Obsidian vault and find the `.obsidian` folder.
2. Create a new folder called `obsidian-prettier` inside the `.obsidian/plugins` directory.
3. Copy `main.js` and `manifest.json` files into the `obsidian-prettier` folder.
4. Enable the plugin from the Obsidian settings. (Community plugins > Prettier Formatter)
## 🚀 Usage
To use the plugin, you need to create a configuration file.
Create a new folder called `config`, and then create a new file called `prettierrc` inside that folder. (You can use any names you like)
The file content must follow this structure:
````
```json
{
"trailingComma": "none",
"tabWidth": 4,
"semi": true,
"singleQuote": true,
"arrowParens": "avoid"
}
```
````
You can write your Prettier configuration inside the JSON object.
To use this configuration file, specify the path by opening `Prettier Formatter` in the **Community Plugins** section and writing the path. (`config/prettierrc`)
Once you have set up the path, you can press `CTRL + P` to open the command palette and type `format document`, then run it to format the document according to your configuration.
## ☕ Support
If you find this project useful and would like to support [me](https://github.com/BUR4KBEY), you can do so by visiting [my website](https://burakbey.dev).
