CODITECT.AI Documentation Server - Navigation Guide
🌐 Server Features
The custom Markdown server supports full subdirectory navigation with beautiful rendering!
✅ What You Can Do
- Browse Directories - Navigate through folder structures
- View Markdown Files - Rendered as beautiful HTML pages
- View HTML Files - Served directly
- Clickable Breadcrumbs - Easy navigation back to parent folders
- File Icons - Visual indicators for file types
- Security - Directory traversal protection built-in
🗂️ Directory Navigation
How to Navigate
In Browser:
-
Start at Root:
http://localhost:8000/- You'll see a beautiful directory listing with file icons
-
Click on Folders (📁):
- Opens the directory listing for that folder
- Shows all files and subdirectories inside
-
Click on Files:
- 📄 Markdown (.md) - Rendered as beautiful HTML
- 🌐 HTML (.html) - Served directly
- ⚙️ YAML (.yaml/.yml) - Downloaded
- 🐍 Python (.py) - Downloaded
-
Use Breadcrumbs:
- Top of page shows:
Home / folder1 / folder2 - Click any part to jump back to that level
- Top of page shows:
-
Parent Directory Button:
- ⬆️ Parent Directory button at top
- Quick way to go back one level
📁 Example Directory Structure
CODITECT-ARCHITECTURE/
├── index.html (🌐 HTML - served directly)
├── README.md (📄 Markdown - rendered as HTML)
├── coditect-platform-overview.md
├── coditect-gcp-gke-architecture.html
│
├── test-docs/ (📁 Subdirectory)
│ ├── README.md
│ ├── guides/ (📁 Nested subdirectory)
│ │ └── getting-started.md
│ └── api/
│ └── overview.md
│
├── kubernetes-config.yaml (⚙️ YAML file)
└── socketio-chat-app.py (🐍 Python file)
🎯 Navigation Examples
Example 1: Reading a Nested Markdown File
URL: http://localhost:8000/test-docs/guides/getting-started.md
What Happens:
- Server receives request for
test-docs/guides/getting-started.md - Checks it's a
.mdfile ✅ - Reads the markdown content
- Converts to HTML with:
- Syntax highlighting for code blocks
- Styled tables
- Beautiful typography
- Wraps in template with breadcrumb
- Sends to browser
You See:
- Beautiful rendered markdown
- Breadcrumb:
Home / test-docs / guides / getting-started.md - "Back to Index" button
- Properly highlighted code blocks
Example 2: Browsing a Subdirectory
URL: http://localhost:8000/test-docs/
What Happens:
- Server detects
test-docs/is a directory - Lists all files and folders inside
- Creates beautiful listing with icons
- Shows file sizes
You See:
- 📄 README.md (2.1 KB)
- 📁 guides/
- 📁 api/
- Each item is clickable
- Breadcrumb:
Home / test-docs
Example 3: Navigating Deep Paths
Starting at: http://localhost:8000/test-docs/guides/getting-started.md
Navigation Options:
- Click "Back to Index" → Goes to
http://localhost:8000/ - Click breadcrumb "guides" → Goes to
http://localhost:8000/test-docs/guides/ - Click breadcrumb "test-docs" → Goes to
http://localhost:8000/test-docs/ - Click breadcrumb "Home" → Goes to
http://localhost:8000/ - Click "⬆️ Parent Directory" → Goes to
http://localhost:8000/test-docs/guides/
🔒 Security Features
Directory Traversal Protection
The server prevents directory traversal attacks:
# This is BLOCKED:
http://localhost:8000/../../../etc/passwd
# Server checks that resolved path is within current directory
# Returns: 403 Forbidden - Access denied
Hidden File Protection
Files starting with . are not listed in directory browsing:
.venv/ ← Hidden (not shown)
.git/ ← Hidden (not shown)
.gitignore ← Hidden (not shown)
README.md ← Visible ✅
📋 URL Patterns
Valid URL Patterns
| URL Pattern | Result | Description |
|---|---|---|
/ | Directory listing | Root directory |
/folder/ | Directory listing | Browse folder |
/file.md | Rendered HTML | Markdown file |
/file.html | Served directly | HTML file |
/folder/subfolder/file.md | Rendered HTML | Nested markdown |
/folder/subfolder/ | Directory listing | Nested directory |
URL Normalization
The server handles various URL formats:
# These all work the same:
http://localhost:8000/test-docs
http://localhost:8000/test-docs/
http://localhost:8000/test-docs/index
# These are equivalent:
http://localhost:8000/README.md
http://localhost:8000/./README.md
🎨 Visual Features
File Type Icons
- 📁 Directories - Light blue/green background
- 📄 Markdown (.md) - Light red/pink background
- 🌐 HTML (.html) - Light orange/yellow background
- ⚙️ YAML (.yaml/.yml) - Light green background
- 🐍 Python (.py) - Light blue background
- 📎 Other files - No background color
Breadcrumb Navigation
Home / test-docs / guides / getting-started.md
↑ ↑ ↑ ↑
| | | └─ Current file (bold)
| | └─ Clickable link
| └─ Clickable link
└─ Clickable link to root
Hover Effects
- Directory items - Slide right 5px on hover
- Links - Color changes to purple gradient
- Border - Changes from gray to purple
💻 Command Line Testing
Test Directory Listing
# Get root directory listing
curl http://localhost:8000/
# Get subdirectory listing
curl http://localhost:8000/test-docs/
# Get nested directory
curl http://localhost:8000/test-docs/guides/
Test Markdown Rendering
# Render root markdown
curl http://localhost:8000/README.md | less
# Render nested markdown
curl http://localhost:8000/test-docs/guides/getting-started.md | less
Test Status Codes
# Should return 200 OK
curl -I http://localhost:8000/README.md
# Should return 404 Not Found
curl -I http://localhost:8000/nonexistent.md
# Should return 403 Forbidden (if trying directory traversal)
curl -I http://localhost:8000/../../../etc/passwd
🚀 Advanced Usage
Linking Between Markdown Files
In your markdown, you can link to other files:
<!-- Relative link to file in same directory -->
See [Overview](overview.md)
<!-- Relative link to file in parent directory -->
See [Main README](../README.md)
<!-- Relative link to file in subdirectory -->
See [API Docs](api/overview.md)
<!-- Absolute link (from root) -->
See [README](/README.md)
Organizing Documentation
Best practices:
docs/
├── README.md # Overview of documentation
├── getting-started/ # Beginner guides
│ ├── README.md # Index of getting started guides
│ ├── installation.md
│ └── quickstart.md
├── guides/ # User guides
│ ├── README.md
│ ├── authentication.md
│ └── deployment.md
├── api/ # API documentation
│ ├── README.md
│ ├── rest-api.md
│ └── websocket-api.md
└── reference/ # Reference documentation
├── README.md
├── configuration.md
└── troubleshooting.md
Each README.md in subdirectories:
- Provides overview of that section
- Links to files in that directory
- Acts as index page
🔍 Troubleshooting
Issue: Directory Not Loading
Problem: Clicking folder doesn't show contents
Check:
# 1. Verify folder exists
ls -la test-docs/
# 2. Test URL directly
curl http://localhost:8000/test-docs/
# 3. Check permissions
ls -ld test-docs/
Solution: Ensure folder has read permissions
Issue: Markdown Not Rendering
Problem: Markdown shows as plain text or downloads
Check:
# 1. Verify it's a .md file
ls -la test-docs/README.md
# 2. Check server logs
tail -50 /tmp/markdown-server.log
# 3. Test file extension
file test-docs/README.md
Solution: Ensure file has .md extension (lowercase)
Issue: 404 Not Found
Problem: File exists but shows 404
Possible causes:
- Case sensitivity -
README.md≠readme.md - Spaces in path - URL encode:
my file.md→my%20file.md - Wrong path - Check breadcrumb for correct path
Test:
# List actual files
find . -name "*.md" -type f
# URL encode spaces
curl "http://localhost:8000/test-docs/my%20file.md"
📊 Server Logs
View Access Logs
# Watch logs in real-time
tail -f /tmp/markdown-server.log
# Search for specific path
grep "test-docs" /tmp/markdown-server.log
# See errors only
grep "Error" /tmp/markdown-server.log
Log Format
[2025-10-20 10:30:45] GET /test-docs/README.md HTTP/1.1 200
[2025-10-20 10:30:46] GET /test-docs/guides/ HTTP/1.1 200
[2025-10-20 10:30:47] GET /nonexistent.md HTTP/1.1 404
🎓 Examples in Action
Example Documentation Site
Visit: http://localhost:8000/test-docs/
Structure:
test-docs/
├── README.md # Landing page
├── guides/ # User guides section
│ └── getting-started.md # First guide
└── api/ # API docs section
└── overview.md # API overview
Navigation Flow:
- Open
http://localhost:8000/test-docs/- See directory listing - Click
README.md- See overview with links - Click link to guides - Navigate to guides directory
- Click
getting-started.md- Read getting started guide - Use breadcrumb to go back - Click "test-docs" in breadcrumb
- Navigate to API docs - Click
api/folder - Read API docs - Click
overview.md
🌟 Pro Tips
- Create README.md in every directory - Acts as index page
- Use relative links - More portable than absolute paths
- Organize by topic - Create subdirectories for different topics
- Include navigation - Add "Next" and "Previous" links in docs
- Use consistent naming - Lowercase, hyphens instead of spaces
- Test links - Use relative links and test navigation
- Add images - Put in
images/subfolder, link relatively
📝 Summary
The CODITECT.AI Documentation Server provides:
✅ Full directory navigation - Browse any folder depth ✅ Beautiful markdown rendering - Syntax highlighting, tables, styles ✅ Clickable breadcrumbs - Easy navigation back up the tree ✅ File type icons - Visual file type indicators ✅ Security - Directory traversal protection ✅ Responsive design - Works on all screen sizes ✅ One server - HTML and Markdown both supported
Start exploring: http://localhost:8000/
Last updated: October 20, 2025