Coder Social home page Coder Social logo

nnkn / obsidian-prettify Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cristianvasquez/obsidian-prettify

0.0 0.0 0.0 414 KB

A markdown prettifier for obsidian

License: GNU General Public License v3.0

TypeScript 20.79% JavaScript 79.18% CSS 0.03%

obsidian-prettify's Introduction

Markdown prettifier for Obsidian

Tries to fix and reformat ugly Markdown and adds things like 'modified date' etc.

The default hotkey is Ctrl+Alt+L.

Examples

Hashtags janitor

Say you have:

A #new and #exciting paragraph!

After 'Update fields':

---
tags:
    - '#new'
    - '#exciting'

---

A #new and #exciting paragraph!

Update values in the frontmatter

Before:

I wrote this, but I don't remember when!

After:

---
date updated: '2020-11-23T16:47:37+01:00'
---

I wrote this, but I don't remember when!

Autolink literals

Example

Before:

www.example.com, https://example.com, and [email protected].

After:

[www.example.com](http://www.example.com), <https://example.com>, and <[email protected]>.

Ordered lists

Normalizes ordered lists.

Example

Before:

1. foo
    1. aaa
    1. bbb
    4. ccc
1. bar
1. baz

After:

1.  foo
    1.  aaa
    2.  bbb
    3.  ccc
2.  bar
3.  baz

Tables

Normalizes table formatting.

Example

Before:

**A**|**B**|**C**
|---:|:---|---|
a |b |c
x |y |z

After:

| **A** | **B** | **C** |
| ----: | :---- | ----- |
|     a | b     | c     |
|     x | y     | z     |

This plugin uses the following amazing libraries

How to compile the plugin

First, install the dependencies with

npm i

Then, you can compile the plugin with:

npm run build

This will create a main.js file in the project root. That is the entry point of your plugin.

Manual installation

Download zip archive from GitHub releases page. Extract the archive into <vault>/.obsidian/plugins.

Alternatively, using bash:

OBSIDIAN_VAULT_DIR=/path/to/your/obsidian/vault
mkdir -p $OBSIDIAN_VAULT_DIR/.obsidian/plugins
unzip ~/Downloads/obsidian-prettify-0.1.zip -d $OBSIDIAN_VAULT_DIR/.obsidian/plugins

Version History

v.0.0.7

  • New Refactor tags functionality (ctrl+shift+o)
  • Can add emoticons as tags

v.0.0.6

Fixed frontmatter bug

v.0.0.5

Added indent for lists Sets settings as recommended

v.0.0.4

Fixed a bug that escaped \ Added some feedback to the user

v0.0.3

Enabled frontmatter and settings!

Included: remark-frontmatter

v0.0.2

Added tests!

Included: remark-gfm and remark-images

v0.0.1

Initial Release, just playing around for the first time with Obsidian and the plugins. No settings, Just the minimum possible


Pull requests are both welcome and appreciated. :)

if you want, you can also send me a coffee https://www.buymeacoffee.com/pelado

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.