PHPackages                             dsnr/obsidian-commonmark-extension - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Parsing &amp; Serialization](/categories/parsing)
4. /
5. dsnr/obsidian-commonmark-extension

ActiveLibrary[Parsing &amp; Serialization](/categories/parsing)

dsnr/obsidian-commonmark-extension
==================================

A league/commonmark extension to parse obsidian markdown to html

v0.0.3(3y ago)062MITPHPPHP ^8.0

Since Apr 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/DSNR/obsidian-commonmark-laravel-extension)[ Packagist](https://packagist.org/packages/dsnr/obsidian-commonmark-extension)[ RSS](/packages/dsnr-obsidian-commonmark-extension/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

obsidian-commonmark-extension
=============================

[](#obsidian-commonmark-extension)

obsidian-commonmark-extension is a custom extension for the CommonMark markdown parser that adds a new inline element and renderer for displaying images with a configurable base URL. A new inline element and parser for obsidian style links and anchors

---

Installation
------------

[](#installation)

You can install the extension using Composer:

```
composer require dsnr/obsidian-commonmark-extension
```

Usage
-----

[](#usage)

To use the extension, create a new `League\CommonMark\Environment\Environment` instance, register the extension with the `addExtension()` method, and pass the environment to a new `League\CommonMark\CommonMarkConverter` instance:

The extension expects the image file names to be kebab cased eg. `example-image.ong`

```
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment\Environment;
use Dsnr\ObsidianCommonmarkExtension\ObsidianConverterExtension;

$environment = new Environment();
  $environment->addExtension(new ObsidianConverterExtension());

$converter = new CommonMarkConverter([], $environment);

echo $converter->convertToHtml('![[Example Image.png]]);
```

---

Configuration
-------------

[](#configuration)

obsidian-commonmark-extension includes a configuration schema that defines the `obsidian.image_base_url` option as a string type with an empty default value. You can modify this option by passing an array of configuration options.

By default, the extension's image base URL is an empty string, so the image URL will be displayed exactly as written. To set a custom image base URL, set the `obsidian.image_base_url ` :

```
use League\CommonMark\CommonMarkConverter;
use League\CommonMark\Environment\Environment;
use Dsnr\ObsidianCommonmarkExtension\ObsidianConverterExtension;

$config = [
  'obsidian' => [
    'base_image_path' => asset('/images/')
  ]
];

$environment = new Environment($config);
$environment->addExtension(new ObsidianConverterExtension());

$converter = new CommonMarkConverter([], $environment);

echo $converter->convertToHtml('![[Example Image.png]]);
```

---

License
-------

[](#license)

obsidian-commonmark-extension is licensed under the MIT license.

Please let me know if you need any further modifications or clarifications in the readme file.

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~1 days

Total

3

Last Release

1125d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/a05f425a7cf6e969d5d1676874e700e4e930e55ceeb6dbf86b9ba36f9a128dcd?d=identicon)[dsnr](/maintainers/dsnr)

---

Top Contributors

[![scotthellings](https://avatars.githubusercontent.com/u/12866345?v=4)](https://github.com/scotthellings "scotthellings (3 commits)")

---

Tags

commonmark-extensionmarkdownphpobsidiancommonmark-mark-extension

### Embed Badge

![Health badge](/badges/dsnr-obsidian-commonmark-extension/health.svg)

```
[![Health](https://phpackages.com/badges/dsnr-obsidian-commonmark-extension/health.svg)](https://phpackages.com/packages/dsnr-obsidian-commonmark-extension)
```

###  Alternatives

[spatie/laravel-markdown

A highly configurable markdown renderer and Blade component for Laravel

4053.4M35](/packages/spatie-laravel-markdown)[mnapoli/front-yaml

2895.6M45](/packages/mnapoli-front-yaml)[daux/daux.io

Documentation generator that uses a simple folder structure and Markdown files to create custom documentation on the fly

825191.0k1](/packages/daux-dauxio)[spatie/sheets

Store &amp; retrieve your static content in plain text files

30187.7k4](/packages/spatie-sheets)[prezet/prezet

Prezet: Markdown Blogging for Laravel

2969.8k2](/packages/prezet-prezet)[sinnbeck/markdom

Converts markdown to html with classes

69122.6k2](/packages/sinnbeck-markdom)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
