An obsidian plugin that give additional features to code blocks.

Overview

Obsidian Advanced Codeblock

Add additioinal features to code blocks.

Demo

demo

Feature

  1. Add line numbers to code block
  2. Add line highlight to code block

Usage

All features won't apply universally, if you need any feature, you need to correctly specify params to specific code block. Params should be split by ' '.

Feature param description
show line numbers nums
highlight line {a, b-c} brackets matters

Notice

  • Code block won't update if you only change params of blocks.

    Obsidian cache every section of artical, but it directly ignore anything follows the first space after ```language. Which means if you only change params of a code block, obsidian will think nothing has been changed, so it won't call any post processor in preview view render process.

Manually installing the plugin

  • Copy over main.js, styles.css, manifest.json to your vault VaultFolder/.obsidian/plugins/obsidian-advanced-codeblock/.

Donating

Buy Me A Coffee

Comments
  • Line numbers and line highlights only work in live preview

    Line numbers and line highlights only work in live preview

    Like the title suggests, displaying line numbers and line highlights is exclusively working in live preview, but does not work in "read" mode. From looking at past documentation it sounds like it originally worked in read mode, then you added support for live preview, but now it's only working in the latter.

    bug 
    opened by J-Howard 3
  • feature suggestion

    feature suggestion

    Hi,

    ich really like your plugin! But as I used it, i came across an idea how to improve it:

    • you could make the linenums toggleable, with a button that fades (like some code websides do) next ro the copy button
    • obsidian gives the ability to collapse functions/blocks etc. but with the line nums enables, the first collapseable arrow is on the left side of the linenumbers, whilst the code is on the right
    • a global option to always show linenumbers would be great!

    Thanks again for the useful plugin :)

    bug 
    opened by julianmueller 3
  • Lines that wrap gets more than one line number

    Lines that wrap gets more than one line number

    As seen in this screenshot, line 8 wraps because it is too long to display on one line causing the wrapped line to get line number 9, instead of the real line number 9.

    All the following lines are pushed down except for the last one which is missing a line number.

    CleanShot 2022-06-04 at 14 56 41@2x

    In edit mode, Obsidian handles it correctly and adds a gap in the line numbers as seen here:

    CleanShot 2022-06-04 at 14 59 41@2x

    bug 
    opened by davidolrik 3
  • Plugin not rendering changes for codeblocks nested inside blockquotes

    Plugin not rendering changes for codeblocks nested inside blockquotes

    Hey, I have a few codeblocks nested inside blockquotes and callouts. The plugin however, don't seem to render the code block changes inside the blockquotes :

    image

    image

    opened by mhdatzh 1
  • A bit confused

    A bit confused

    Sorry if I am being a bit thick, but do I need to add

    nums {1, 4-6, 8}

    After the language? If so, what do the number represent. I copied your code and it worked fine, but not in Live Preview. Is that right?

    This is a great plugin.

    help wanted 
    opened by sophosukps 1
  • Export to PDF does not show formatting

    Export to PDF does not show formatting

    The extra formatting does not appear when one does an Export to PDF.

    /**
     * Test
     */
    
    package net.gwizlabs.test;
    
    public class Test {
      private int x;
    }
    

    Looks like this in reading mode:

    Screen Shot 2022-06-04 at 4 44 21 PM

    Doing CMD+P Export to PDF while in reading mode shows

    Screen Shot 2022-06-04 at 4 45 44 PM bug 
    opened by dgreen 1
Releases(1.1.3)
Owner
lijyze
JavaScript
lijyze
A plugin for Obsidian (https://obsidian.md) that adds a button to its search view for copying the Obsidian search URL.

Copy Search URL This plugin adds a button to Obsidian's search view. Clicking it will copy the Obsidian URL for the current search to the clipboard. T

Carlo Zottmann 6 Dec 26, 2022
A set of utilities and additional features for my creative coding class aiming to help students while introducing the algorithmic thinking.

p5.utils A set of utilities and additional features for my creative coding class aiming to help students while introducing the algorithmic thinking. T

alp tuğan 15 Dec 25, 2022
Use better-sqlite3 to give obsidian the ability to manipulate sqlite3 databases

OBSIDIAN-SQLITE3 Use better-sqlite3 to give obisidian the ability to manipulate sqlite3 databases. Intention Currently the linkage between obsidian an

cloud 12 Nov 28, 2022
Debut plugin that provides additional candles of specified tickers to strategy.

debut-plugin-candles A plugin for Debut platform that provides additional candles of specified tickers to strategy. Install @debut/community-core shou

Denis Mainhardt 2 Dec 15, 2022
An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor.

Obsidian Excel to Markdown Table An Obsidian plugin to paste Excel tables as Markdown tables in Obsidian editor. Demo You can paste the copied Excel d

Ganessh Kumar 108 Jan 4, 2023
This is a plugin for Obsidian (https://obsidian.md). Can open document with `.html` and `.htm` file extensions.

Obsidian HTML reader Plugin This is a plugin for Obsidian (https://obsidian.md). Can open document with .html and .htm file extensions. Obsidian HTML

null 37 Dec 27, 2022
An Obsidian plugin that lets you browse the web within Obsidian.

Obsidian Web Browser An Obsidian plugin that allows you to browse the web within Obsidian using v1.0 tabs. The core functionality of the plugin, rende

Dion Tryban 102 Dec 28, 2022
Get the latest Flashbots blocks and Flashbots transactions using TypeScript in two lines of code !

mev-blocks-js This package can let you query the Flashbots blocks API easily from any JavaScript or TypeScript project. You can access the Flashbots b

Luca G.F. 6 May 14, 2022
A platform designed specifically as an additional layer on top of Google Classroom for students to gain the best out of online evaluations

Peer-Learning-Platform A platform designed specifically as an additional layer on top of Google Classroom for students to gain the best out of online

Rahul Dhakar 3 Jun 12, 2022
Additional themes for Lovelace Mushroom Cards 🍄

?? Mushroom Themes Mushroom themes allow you to customize your Mushroom dashboard using Home Assistant themes. ⚠️ It's only a theme! You need to insta

Paul Bottein 127 Dec 24, 2022
A NodeJs service which allows you to create a movie based on it's title (additional movie details will be fetched) and fetch all created movies.

movies-api A NodeJs service which allows you to create a movie based on it's title (additional movie details will be fetched) and fetch all created mo

Ugochukwu Ejiogu 2 Mar 27, 2022
Used for creating a out-of-the-box template without additional configuration.

ou Used for creating a out-of-the-box template without additional configuration. Templates Vue3 Lite Template Used for some simple web app Vue3 + Vite

Dewey Ou 6 Jul 17, 2022
Snowfall effect written in pure JavaScript. No additional libraries, no dependencies. Works in every modern browser.

pureSnow.js Snow falling slowly on a winter night. Probably the most calming and peaceful snowfall effect written in pure JS/CSS. (No SCSS). Inspired

null 20 Dec 29, 2022
Kirby Conditional Blocks plugin

Kirby 3 plugin: disables blocks in layout fields when the column width does not match the block requirements

Roman Steiner 13 Dec 21, 2022
jQuery plugin for showing a calendar yearview with blocks (github contributions style)

calendar-yearview-blocks jQuery plugin for showing a calendar yearview with blocks (github contributions style) Code adopted from https://github.com/b

Opbod 2 Feb 28, 2021
A docsify.js plugin for rendering LaTeX math blocks from markdown

docsify-latex A docsify.js plugin for typesetting LaTeX with display engines from markdown. Docsify + LaTeX = ❤️ Installation Add JavaScript LaTeX dis

Scruel Tao 8 Dec 25, 2022
This plugin can be embedded in PHP application to give the web application specific routes/href

Routes Plugin PHP This plugin can be embedded in PHP application to give the web application specific routes/href location and for entering specific/l

Ifechukwudeni Oweh 7 Jul 17, 2022
A jquery plugin that makes images truly responsive, without sacrificing anyone's face. Give it more stars!

Responsify.js A jquery plugin that makes images truly responsive, without sacrificing anyone's face :D When images are used in a responsive container

Wenting Zhang 1.3k Dec 14, 2022
Statistics plugin for RemNote that will give you some helpful numbers, charts and heatmap for your knowledge base.

RemNote statistics plugin Features This plugin will give you the following statistics: Retention rate Number of cards due in future Type of buttons yo

Henrik 3 Sep 9, 2022