Skip to main content

Crate oxios_markdown

Crate oxios_markdown 

Source
Expand description

§oxios-markdown

Markdown knowledge management library — ported from files.md by Artem Zakirullin. Licensed under MIT — see LICENSE-THIRD-PARTY.

This crate provides core functionality for managing a knowledge base stored as plain .md files:

  • VirtualFs — sandboxed filesystem with path traversal protection
  • BacklinkIndex — bidirectional link tracking between notes
  • Merge — LCS-based conflict resolution
  • Parser — text processing utilities (similarity, links, headings)

§Example

use oxios_markdown::VirtualFs;
use std::path::PathBuf;

let fs = VirtualFs::new(PathBuf::from("/path/to/knowledge")).unwrap();
fs.write("brain", "Rust.md", "# Rust\n\nSee [Ownership](brain/Ownership.md)").unwrap();
let content = fs.read("brain", "Rust.md").unwrap();

Re-exports§

pub use types::FileEntry;
pub use types::FsError;
pub use types::Habits;
pub use types::KnowledgeConfig;
pub use types::SyncError;
pub use types::SyncFile;
pub use types::SyncRequest;
pub use types::SyncResponse;
pub use types::CHAT_FILENAME;
pub use types::DIR_ARCHIVE;
pub use types::DIR_JOURNAL;
pub use types::DIR_MEDIA;
pub use types::DIR_USER_ROOT;
pub use types::DONE_FILENAME;
pub use types::HABIT_COMPLETED;
pub use types::HABIT_COMPLETED_AT_WEEKEND;
pub use types::HABIT_SKIPPED;
pub use types::LATER_FILENAME;
pub use types::MD_EXT;
pub use types::MODE_CHAT;
pub use types::MODE_FULL;
pub use types::MODE_JOURNAL;
pub use types::MODE_NOTES;
pub use types::MODE_TASKS;
pub use types::MOOD_EMOJIS;
pub use types::MOOD_HABIT;
pub use types::READ_FILENAME;
pub use types::SHOP_FILENAME;
pub use types::STATUS_MERGED;
pub use types::STATUS_NOT_MODIFIED;
pub use types::STATUS_OK;
pub use types::STATUS_UPDATED_ON_SERVER;
pub use types::WATCH_FILENAME;
pub use backlinks::BacklinkIndex;
pub use backlinks::LinkEdge;
pub use backlinks::LinkGraph;
pub use backlinks::LinkNode;
pub use chat::append_to_chat_msg;
pub use chat::delete_chat_msg;
pub use chat::find_chat_msg_by_hash;
pub use chat::move_from_chat;
pub use chat::read_chat_msgs;
pub use chat::rename_chat_msg;
pub use chat::today_header as chat_today_header;
pub use checklist::add_checklist_item;
pub use checklist::add_header_and_text;
pub use checklist::checklist_item;
pub use checklist::checklist_items;
pub use checklist::complete_checklist_item;
pub use checklist::incomplete_checklist_items;
pub use checklist::remove_checklist_item;
pub use checklist::remove_completed_checklist_items;
pub use fs::split_posix_path;
pub use fs::VirtualFs;
pub use fslog::FsLog;
pub use habits::emoji_for_status;
pub use habits::habit_emoji;
pub use habits::habits;
pub use habits::last_week_habits;
pub use habits::weekday_emoji;
pub use habits::write_habits;
pub use html::escape_html;
pub use html::markdown_to_html;
pub use html::replace_with_placeholders;
pub use html::restore_from_placeholders;
pub use html::strip_html_tags;
pub use i18n::add_emoji;
pub use i18n::emoji_for;
pub use journal::add_emoji as journal_add_emoji;
pub use journal::add_record as journal_add_record;
pub use journal::today_header as journal_today_header;
pub use journal::today_journal_filename;
pub use knowledge::FileChange;
pub use knowledge::KnowledgeBase;
pub use knowledge::NoteHit;
pub use merge::merge;
pub use parser::emoji_prefix;
pub use parser::extract_headings;
pub use parser::is_multiline;
pub use parser::lcfirst;
pub use parser::levenshtein;
pub use parser::norm_new_lines;
pub use parser::similar;
pub use parser::split_text_into_chunks;
pub use parser::substr;
pub use parser::today_chat_header;
pub use parser::today_journal_path;
pub use parser::ucfirst;
pub use plugins::can_handle as world_clock_can_handle;
pub use plugins::format_report as format_world_clock_report;
pub use plugins::handle as world_clock_handle;
pub use plugins::world_clock_for_names;
pub use plugins::world_clock_now;
pub use plugins::TimezoneEntry;
pub use schedule::ScheduleManager;
pub use stats::done_today;
pub use stats::format_today_report;
pub use stats::today_report;
pub use stats::CompletedItem;
pub use stats::TodayReport;
pub use sync::MediaEntry;
pub use sync::MediaSyncResponse;
pub use sync::SyncEngine;
pub use tgtxt::ExtractResult;
pub use tokens::TokenManager;
pub use worker::move_due_tasks;
pub use worker::next_exclude_today;
pub use worker::remove_completed_checklist;
pub use worker::remove_completed_inbox_entries;
pub use worker::remove_completed_items;
pub use worker::schedule_report;
pub use worker::NightlyReport;

Modules§

backlinks
Bidirectional link tracking between markdown notes.
chat
Chat/Inbox file management.
checklist
Checklist engine for markdown content.
fs
Sandboxed filesystem abstraction for the knowledge base.
fslog
Filesystem change log for sync.
habits
Habit tracking.
html
Markdown → Telegram-supported HTML subset converter.
i18n
i18n: emoji auto-mapping and UI string constants.
journal
Journal entry management.
knowledge
KnowledgeBase — markdown knowledge base application layer.
merge
LCS-based text merge algorithm.
parser
Markdown text processing utilities.
plugins
World clock plugin — generate time reports for multiple timezones.
schedule
Schedule management for tasks.
stats
Stats: today’s completion report.
sync
Sync engine for client-server file synchronization.
tgtxt
tgtxt: Telegram text processing — extract text, images, and links from markdown.
tokens
Authentication token management.
types
Shared types for the oxios-markdown crate.
worker
Nightly worker — daily cleanup of completed items.