A minimal email TUI where you read with Markdown and write in Neovim.
neomd.ssp.sh/docs
email
markdown
neovim
tui
1#!/usr/bin/env bash
2# Sync README.md to docs/content/_index.md to avoid duplication
3# Usage: ./scripts/sync-readme-to-docs.sh
4
5set -euo pipefail
6
7REPO_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
8README="$REPO_ROOT/README.md"
9DOCS_OVERVIEW="$REPO_ROOT/docs/content/docs/_index.md"
10
11if [[ ! -f "$README" ]]; then
12 echo "Error: README.md not found at $README"
13 exit 1
14fi
15
16# Extract content from README (skip the first H1 title line)
17README_CONTENT=$(tail -n +3 "$README")
18
19# Create overview.md with Hugo frontmatter
20cat > "$DOCS_OVERVIEW" <<'FRONTMATTER'
21---
22title: Overview & Philosophy
23weight: 0
24---
25
26FRONTMATTER
27
28# Process README content and convert GitHub-style callouts to Hugo callouts
29# Use awk for proper multi-line callout handling
30echo "$README_CONTENT" | awk '
31BEGIN { in_callout = 0; callout_type = ""; callout_content = "" }
32/^> \[!WARNING\]/ { in_callout = 1; callout_type = "warning"; next }
33/^> \[!NOTE\]/ { in_callout = 1; callout_type = "info"; next }
34/^> \[!TIP\]/ { in_callout = 1; callout_type = "info"; next }
35/^> / {
36 if (in_callout) {
37 line = substr($0, 3) # Remove "> " prefix
38 if (callout_content != "") callout_content = callout_content "\n"
39 callout_content = callout_content line
40 next
41 }
42}
43{
44 if (in_callout) {
45 print "{{< callout type=\"" callout_type "\" >}}"
46 print callout_content
47 print "{{< /callout >}}"
48 print ""
49 in_callout = 0
50 callout_type = ""
51 callout_content = ""
52 }
53 print
54}
55END {
56 if (in_callout) {
57 print "{{< callout type=\"" callout_type "\" >}}"
58 print callout_content
59 print "{{< /callout >}}"
60 }
61}
62' | sed \
63 -e 's|docs/gmail\.md|configurations/gmail|g' \
64 -e 's|docs/proton-bridge\.md|configurations/proton-bridge|g' \
65 -e 's|docs/android\.md|configurations/android|g' \
66 -e 's|docs/configuration\.md|configuration|g' \
67 -e 's|docs/keybindings\.md|keybindings|g' \
68 -e 's|docs/screener\.md|screener|g' \
69 -e 's|docs/sending\.md|sending|g' \
70 -e 's|docs/reading\.md|reading|g' \
71 -e 's|docs/static/images/|/images/|g' \
72 >> "$DOCS_OVERVIEW"
73
74echo "✅ Synced README.md → docs/content/docs/_index.md"
75echo " Next: Run 'make docs-build' to regenerate the site"