Add markdown wiki with 473 pages and zk browser
Generate interlinked wiki from master inventory: 397 tool pages, 15 workflow pages, 27 recipe pages, 33 category pages, plus index. All pages use [[wiki-links]] for cross-navigation between tools, workflows, recipes, and categories (1782 links total). Install zk for interactive browsing with fzf search, tag filtering, and backlink discovery. Add 'fhelp wiki' command and Makefile target. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
+67
-4
@@ -13,10 +13,11 @@ MAGENTA='\033[0;35m'
|
||||
NC='\033[0m'
|
||||
|
||||
# Help system paths
|
||||
TOOLS_DB="/opt/remnux-docs/tools.db"
|
||||
CHEAT_DIR="/opt/cheatsheets"
|
||||
WORKFLOW_DIR="/opt/remnux-docs/workflows"
|
||||
TLDR_CACHE="/home/remnux/.local/share/tldr"
|
||||
TOOLS_DB="${TOOLS_DB:-/opt/remnux-docs/tools.db}"
|
||||
CHEAT_DIR="${CHEAT_DIR:-/opt/cheatsheets}"
|
||||
WORKFLOW_DIR="${WORKFLOW_DIR:-/opt/remnux-docs/workflows}"
|
||||
TLDR_CACHE="${TLDR_CACHE:-/home/remnux/.local/share/tldr}"
|
||||
WIKI_DIR="${WIKI_DIR:-/opt/wiki}"
|
||||
|
||||
# Resolve cheat file names from a user-provided tool name
|
||||
# Tries several variants: exact, without .py, with .py, hyphen/underscore alternatives
|
||||
@@ -72,6 +73,10 @@ show_main_help() {
|
||||
echo " fhelp workflow - List all 8 analysis workflows"
|
||||
echo " fhelp workflow <name> - Show step-by-step workflow"
|
||||
echo ""
|
||||
echo -e "${GREEN}Wiki:${NC}"
|
||||
echo " fhelp wiki - Browse the analysis wiki (zk)"
|
||||
echo " fhelp wiki <tool> - Open a specific wiki page"
|
||||
echo ""
|
||||
echo -e "${GREEN}Other:${NC}"
|
||||
echo " fhelp coverage - Help coverage statistics"
|
||||
echo " fhelp examples - Browse all cheat sheets"
|
||||
@@ -440,6 +445,60 @@ show_offline_status() {
|
||||
echo -e "${GREEN}Offline help system ready!${NC}"
|
||||
}
|
||||
|
||||
show_wiki() {
|
||||
local query="$1"
|
||||
|
||||
if [[ ! -d "$WIKI_DIR" ]]; then
|
||||
echo -e "${RED}Wiki not installed at $WIKI_DIR${NC}"
|
||||
return 1
|
||||
fi
|
||||
|
||||
if [[ -z "$query" ]]; then
|
||||
# Interactive browse
|
||||
if command -v zk >/dev/null 2>&1; then
|
||||
cd "$WIKI_DIR" && zk list --interactive
|
||||
elif command -v fzf >/dev/null 2>&1; then
|
||||
local selected
|
||||
selected=$(find "$WIKI_DIR" -name '*.md' -not -path '*/.zk/*' | sort | fzf --preview "cat {}")
|
||||
if [[ -n "$selected" ]]; then
|
||||
cat "$selected"
|
||||
fi
|
||||
else
|
||||
echo -e "${CYAN}Wiki pages:${NC}"
|
||||
find "$WIKI_DIR" -name '*.md' -not -path '*/.zk/*' | sort | sed "s|$WIKI_DIR/||" | sed 's/^/ /'
|
||||
fi
|
||||
else
|
||||
# Search for specific page
|
||||
local found=""
|
||||
local search_slug=$(echo "$query" | tr '[:upper:]' '[:lower:]' | sed 's/\.py$//' | sed 's/[^a-z0-9]/-/g' | sed 's/-$//')
|
||||
|
||||
# Try exact matches
|
||||
for dir in tools workflows recipes categories; do
|
||||
if [[ -f "$WIKI_DIR/$dir/$search_slug.md" ]]; then
|
||||
found="$WIKI_DIR/$dir/$search_slug.md"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Try fuzzy match
|
||||
if [[ -z "$found" ]]; then
|
||||
found=$(find "$WIKI_DIR" -name "*${search_slug}*" -name '*.md' -not -path '*/.zk/*' | head -1)
|
||||
fi
|
||||
|
||||
if [[ -n "$found" && -f "$found" ]]; then
|
||||
echo -e "${CYAN}Wiki: ${YELLOW}$(basename "$found" .md)${NC}"
|
||||
echo "$(printf '=%.0s' $(seq 1 60))"
|
||||
echo ""
|
||||
cat "$found"
|
||||
else
|
||||
echo -e "${YELLOW}No wiki page found for '$query'${NC}"
|
||||
if command -v zk >/dev/null 2>&1; then
|
||||
echo "Try: fhelp wiki (interactive browse)"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
show_all() {
|
||||
echo -e "${CYAN}Complete Help System Overview${NC}"
|
||||
echo "================================="
|
||||
@@ -485,6 +544,10 @@ case "${1:-}" in
|
||||
"forensics")
|
||||
show_workflow "behavioral-analysis"
|
||||
;;
|
||||
"wiki")
|
||||
shift
|
||||
show_wiki "$@"
|
||||
;;
|
||||
"coverage")
|
||||
show_coverage
|
||||
;;
|
||||
|
||||
Reference in New Issue
Block a user