Crate basalt_core

Source
Expand description

This crate provides the core functionality for Basalt, a TUI application for Obsidian. It lets you read and manipulate Obsidian’s configuration, vaults, and notes.

§Example

use basalt_core::obsidian::{ObsidianConfig, Error};

let config = ObsidianConfig::load();

This crate also provides a markdown parser that produces a custom AST using the pulldown_cmark::Parser. The “AST” acts as an intermediate layer. This enables segregation of the parsing logic into a module under basalt-core lib.

§Example

use basalt_core::markdown::{from_str, Node, HeadingLevel, Text};

let markdown = "# My Heading\n\nSome text.";
let nodes = from_str(markdown);

assert_eq!(nodes, vec![
  Node::Heading {
    level: HeadingLevel::H1,
    text: Text::from("My Heading"),
  },
  Node::Paragraph {
    text: Text::from("Some text."),
  },
])

Modules§

markdown
Provides Markdown parser that supports Obsidian flavor. Obsidian flavor is a combination of different flavors and a few differences.
obsidian
Provides Obsidian interoperability operations This module provides functionality operating with Obsidian. It lets you read and manipulate Obsidian’s configuration, vaults, and notes.