doctree/runexample.sh
2025-04-09 07:54:37 +02:00

39 lines
1.1 KiB
Bash
Executable File

#!/bin/bash
# Change to the directory where the script is located
cd "$(dirname "$0")"
# Exit immediately if a command exits with a non-zero status
set -e
cd doctreecmd
# First, scan the collections
echo "=== Scanning Collections ==="
cargo run -- scan-and-info ../examples supercollection
# Get a document in markdown format
echo -e "\n=== Getting Document (Markdown) ==="
cargo run -- get -c supercollection -p 01_features.md
# Get a document in HTML format
echo -e "\n=== Getting Document (HTML) ==="
cargo run -- get -c supercollection -p 01_features.md -f html
# Get a document without specifying collection
echo -e "\n=== Getting Document (Default Collection) ==="
cargo run -- get -p 01_features.md
# Delete a specific collection
echo -e "\n=== Deleting Collection ==="
cargo run -- delete-collection grid_documentation
# List remaining collections
echo -e "\n=== Listing Remaining Collections ==="
cargo run -- list
# Reset all collections
echo -e "\n=== Resetting All Collections ==="
cargo run -- reset
# Verify all collections are gone
echo -e "\n=== Verifying Reset ==="
cargo run -- list