/obsidian-code-block-enhancer

Enhance obsidian markdown code block,provides copy button,linenumber,language name tip and so on.

Primary LanguageTypeScriptMIT LicenseMIT

Obsidian Code Block Enhancer

This is a plugin for Obsidian (https://obsidian.md).
Inspired by obsidian-code-block-copy.

Note: The Obsidian API is still in early alpha and is subject to change at any time!

Feature

Enhancer the markdown code block in preview mode.

  • Provide Copy Button.
  • Provide Line Number.
  • Show Language Name.
  • Custom exclusion language.
  • Enhance contextmenu in code block.

Screenshot

Gif

Use with Default theme

Obsidian_Default_Dark_Theme

Gruvbox theme

Obsidian_Gruvbox_Dark_Theme

Nord theme

Obsidian_Nord_Dark_Theme

Plugin setting

plugin_settings

How to use

Obsidian

  • Open Obsidian
  • Settings -> Community plugins -> Turn off Safe Mode
  • Browes community plugins and search Code Block Enhancer
  • Install and enable

Releases

  • Download main.js, styles.css, manifest.json in the latest release
  • Copy over main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/obsidian-code-block-enhancer/.
  • Enable plugin in Obsidian setting.

Source Code

  • Clone this repo.
  • npm i or yarn to install dependencies
  • npm run build to build file in ./dist.
  • Copy over main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/obsidian-code-block-enhancer/.
  • Enable plugin in Obsidian setting.