name: md-viewer
base: core22
version: '0.1.11'
summary: Fast, lightweight markdown viewer for Linux
description: |
  A fast, lightweight markdown viewer built with Rust and egui.

  Features:
  - GitHub Flavored Markdown with syntax highlighting (200+ languages)
  - Tab system for multiple documents
  - File explorer sidebar
  - Outline/table of contents sidebar
  - Dark and light themes
  - Live reload on file changes
  - Session persistence
  - Native X11 and Wayland support

grade: stable
confinement: strict

architectures:
  - build-on: amd64

apps:
  md-viewer:
    command: bin/md-viewer
    plugs:
      - home
      - removable-media
      - desktop
      - desktop-legacy
      - wayland
      - x11
      - opengl
      - gsettings
    environment:
      XDG_DATA_DIRS: $SNAP/usr/share:$XDG_DATA_DIRS

parts:
  md-viewer:
    plugin: rust
    source: .
    rust-channel: stable
    build-packages:
      - clang
      - pkg-config
      - libxcb1-dev
      - libxcb-render0-dev
      - libxcb-shape0-dev
      - libxcb-xfixes0-dev
      - libxkbcommon-dev
      - libssl-dev
      - libgtk-3-dev
      - libfontconfig1-dev
      - libdbus-1-dev
    stage-packages:
      - libxcb1
      - libxkbcommon0
      - libfontconfig1
      - libgtk-3-0
      - libglib2.0-0
      - libgl1
      - libwayland-client0
      - libwayland-egl1
    override-build: |
      # Remove optional MCP dependency (not needed in production, path doesn't exist in snap build)
      sed -i '/egui-mcp-bridge/d' Cargo.toml
      sed -i 's/mcp = \["dep:egui-mcp-bridge"\]/mcp = []/' Cargo.toml
      craftctl default
