Nodsoft.MoltenObsidian 1.0.17

There is a newer version of this package available.
See the version list below for details.
dotnet add package Nodsoft.MoltenObsidian --version 1.0.17                
NuGet\Install-Package Nodsoft.MoltenObsidian -Version 1.0.17                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Nodsoft.MoltenObsidian" Version="1.0.17" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Nodsoft.MoltenObsidian --version 1.0.17                
#r "nuget: Nodsoft.MoltenObsidian, 1.0.17"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install Nodsoft.MoltenObsidian as a Cake Addin
#addin nuget:?package=Nodsoft.MoltenObsidian&version=1.0.17

// Install Nodsoft.MoltenObsidian as a Cake Tool
#tool nuget:?package=Nodsoft.MoltenObsidian&version=1.0.17                

<p align="center"><img src="icon.png" alt="logo" width="256"/></p> <h1 align="center">MoltenObsidian</h1> <h3 align="center">.NET 6+ Library for <a href="https://obsidian.md">Obsidian</a>-flavoured Markdown parsing, with support for vault mapping and Blazor.</h3>

<div align="center"> <hr /> <img alt="GitHub Actions Workflow Status" src="https://img.shields.io/github/actions/workflow/status/Nodsoft/MoltenObsidian/build.yml?style=flat&logo=github&label=test%2Fbuild"> <img alt="NuGet Core Version" src="https://img.shields.io/nuget/v/Nodsoft.MoltenObsidian?style=flat&logo=nuget&label=core"> <img alt="NuGet Core Preversion" src="https://img.shields.io/nuget/vpre/Nodsoft.MoltenObsidian?style=flat&logo=nuget&label=core%20(pre)"> <img alt="NuGet Downloads" src="https://img.shields.io/nuget/dt/Nodsoft.MoltenObsidian?style=flat&logo=nuget"> <hr /> </div> <div>​</div>

Premise

Molten Obsidian is a high-performance library designed as an easily integrated and lightweight FOSS alternative to Obsidian Publish. With extensibility and integration-oriented conception, this library makes it perfect for integrating Obsidian-flavoured markdown notes on your Blazor App, but also importing entire vaults as a navigation-ready area, with full routing support.

Furthermore, Molten Obisidian extends past the original Obsidian specifications, aiming to supercharge your documentation/wiki applications and websites needs, using a customizable data source interface, and supercharged YAML frontmatter capabilities.

Example

Converting an Obsidian-flavoured Markdown note to HTML is as simple as this :

using Nodsoft.MoltenObsidian;

// Create a new ObsidianText instance with the content to convert
ObsidianText obsidianMarkdown = new(@"
# Hello, world!   

This is a sample Markdown document.    
And a paragraph with **bold** and *italic* text.
");

// This is the HTML string you can then call in Blazor components as `@htmlText`.
MarkupString htmlText = obsidianMarkdown.ToHtml();

But that's just the basics. Under the hood, Markdig is what makes it happen. Easy!

**Now let's open an Obsidian vault on the Filesystem, and wire it to a routable Blazor component 😗*

Startup.cs

using Nodsoft.MoltenObsidian.Blazor;
using Nodsoft.MoltenObsidian.Vault;
using Nodsoft.MoltenObsidian.Vaults.FileSystem;

// First deal with the DI, by adding a Filesystem vault and the Blazor integration:
public void ConfigureServices(IServiceCollection services)
{
	services.AddMoltenObsidianFileSystemVault(new DirectoryInfo("/path/to/vault"));
	services.AddMoltenObsidianBlazorIntegration();
}

_Imports.razor

@using Nodsoft.MoltenObsidian.Blazor
@using Nodsoft.MoltenObsidian.Blazor.Helpers;
@using Nodsoft.MoltenObsidian.Vault;

VaultPage.razor

@page "/vault/{*VaultPath}"  
@inject IVault Vault   
  
<ObsidianVaultDisplay BasePath="@this.GetCallingBaseVaultPath()" CurrentPath="@VaultPath" />  
  
@code {  
   [Parameter]  
   public string VaultPath { get; set; }
}

In a matter of minutes, you've just created a web app integration for your own Obsidian Vault, for all to see. Congratulations!

Now, let's take it further.

Customizations

Vault sources (see: Vaults)

Molten Obsidian is designed with extensibility at its core, and allows you to implement your own Vault source. Should the existing reference Vault providers not be suitable for your Vault storage needs, you can provide your own implementation.

A few examples of additional stores you can implement:

  • Database store (xSQL, MongoDB, etc...)
  • Over-the-wire/Network-based (NFS, etc...)
  • VCS-based (Git repo)

If you're finding yourself implementing any of these, feel free to PR! We'll be more than happy to support new vault providers.

Layouts

Molten Obsidian is meant to tailor itself to your app. As such, you can provide within the Blazor Component a series of RenderFragment delegates responsible for organizing the Vault display.

You can provide them in cascade, as such :

<ObsidianVaultDisplay BasePath="@this.GetCallingBaseVaultPath()" CurrentPath="@VaultPath">  
   <FoundFile Context="file">  
      <h1>Vault note: @file.NoteName</h1>  
      <a class="lead text-muted" href="@file.Parent?.Path">Return to @(file.Parent?.Name ?? "Root")</a>  
  
      <hr />  
  
      @(new MarkupString(file.ReadDocument().ToHtml()))  
   </FoundFile>  
  
   <NotFound>  
      <h3 class="text-warning">Sorry, there is nothing here.</h3>  
   </NotFound>  
</ObsidianVaultDisplay>

Alternatively, you can provide delegates, like so :

<ObsidianVaultDisplay BasePath="@this.GetCallingBaseVaultPath()" CurrentPath="@VaultPath"  
   FoundFile="OnFoundFile"  
   NotFound="OnNotFound"  
/>  

@code {  
   public static RenderFragment OnFoundFile(IVaultNote file) => __builder =>  
   {  
      <h1>Vault note: @file.NoteName</h1>  
      <a class="lead text-muted" href="@file.Parent?.Path">Return to @(file.Parent?.Name ?? "Root")</a>  

      <hr />  

      @(new MarkupString(file.ReadDocument().ToHtml()))  
   };  
     
   public static RenderFragment OnNotFound(string _) => static __builder =>  
   {  
      <h3 class="text-warning">Sorry, there's nothing here.</h3>  
   }; 
}

CLI Tool

Our CLI tool aims at cutting down the menial tasks associated with implementing more advanced features of Molten Obsidian, allowing you to better focus on what matters, but also automating any of those integration tasks within you workflow.

See: Nodsoft.MoltenObsidian.Tool

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Nodsoft.MoltenObsidian:

Package Downloads
Nodsoft.MoltenObsidian.Blazor

Blazor integration for Molten Obsidian

Nodsoft.MoltenObsidian.Manifest

Implementation for Molten Obsidian vault Manifest, used for vault implementations where structure scanning is not possible.

Nodsoft.MoltenObsidian.Vaults.FileSystem

Local Filesystem Vault provider for Molten Obsidian

Nodsoft.MoltenObsidian.Vaults.Http

Remote HTTP Vault provider for Molten Obsidian

Nodsoft.MoltenObsidian.Vaults.Ftp

Remote FTP Vault provider for Molten Obsidian

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.1.1 241 8/25/2024
1.0.19 226 6/22/2024
1.0.18 122 6/22/2024
1.0.17 140 5/12/2024
1.0.15 109 5/11/2024
1.0.14 112 5/11/2024
1.0.13 171 5/11/2024
1.0.4-beta 206 4/12/2024
0.6.10 225 3/25/2024
0.6.3 212 3/23/2024
0.5.73 252 2/17/2024
0.5.67 250 2/16/2024
0.5.18 512 8/11/2023
0.5.13 445 6/17/2023
0.5.12 430 6/17/2023
0.5.3 465 6/14/2023
0.4.23 441 6/1/2023
0.4.22 440 5/26/2023
0.4.21 456 5/14/2023
0.4.19 512 4/30/2023
0.4.18 495 4/30/2023
0.4.16 485 4/30/2023
0.4.3 519 4/29/2023
0.4.1 527 4/22/2023
0.3.16 687 2/25/2023
0.3.14 667 2/10/2023
0.3.12 759 12/31/2022
0.3.9 743 12/30/2022
0.3.8 567 12/30/2022
0.3.6 581 12/27/2022
0.3.5 669 12/19/2022
0.2.4 698 12/11/2022
0.2.3 580 12/11/2022
0.1.9 712 12/4/2022
0.1.6 736 12/4/2022
0.1.5 720 12/3/2022
0.1.4 682 12/3/2022