Files
semantica/test-docs.py
T
KaifAhmad1 727285171a docs: Modern documentation redesign with enhanced navigation
- Reorganize navigation structure (left sidebar: Home, Quickstart, Installation, Cookbook Recipes, Learning More, Deep Dive, API References)
- Add TOC sections on homepage (Features, How to Read this Documentation, Resources)
- Create new pages: learning-more.md, deep-dive.md, community-projects.md, citation.md, license.md
- Add Mermaid diagrams for architecture, workflows, and concepts
- Enhance all documentation pages with better code examples and explanations
- Add custom CSS for modern aesthetic (docs/css/custom.css)
- Update mkdocs.yml with Material theme, Mermaid support, and enhanced features
- Improve user-friendly navigation and clear visual hierarchy
- Add diagrams and charts throughout documentation
2025-11-21 21:57:10 +05:30

64 lines
2.5 KiB
Python

#!/usr/bin/env python3
"""
Simple HTTP server to test documentation locally
Run: python test-docs.py
Then visit: http://localhost:8000/preview.html
"""
import http.server
import socketserver
import os
import webbrowser
from pathlib import Path
PORT = 8000
class DocsHTTPRequestHandler(http.server.SimpleHTTPRequestHandler):
def end_headers(self):
# Add CORS headers for local testing
self.send_header('Access-Control-Allow-Origin', '*')
self.send_header('Access-Control-Allow-Methods', 'GET')
super().end_headers()
def main():
# Change to project root directory
os.chdir(Path(__file__).parent)
Handler = DocsHTTPRequestHandler
with socketserver.TCPServer(("", PORT), Handler) as httpd:
print(f"""
╔═══════════════════════════════════════════════════════╗
║ Semantica Documentation Test Server ║
╠═══════════════════════════════════════════════════════╣
║ ║
║ Server running at: ║
║ http://localhost:{PORT}
║ ║
║ Available pages: ║
║ • http://localhost:{PORT}/preview.html ║
║ • http://localhost:{PORT}/docs/index.md ║
║ • http://localhost:{PORT}/docs/installation.md ║
║ • http://localhost:{PORT}/docs/quickstart.md ║
║ • http://localhost:{PORT}/docs/api.md ║
║ • http://localhost:{PORT}/docs/examples.md ║
║ ║
║ Press Ctrl+C to stop the server ║
╚═══════════════════════════════════════════════════════╝
""")
# Open browser automatically
try:
webbrowser.open(f'http://localhost:{PORT}/docs/preview.html')
except:
pass
try:
httpd.serve_forever()
except KeyboardInterrupt:
print("\n\nServer stopped. Goodbye!")
if __name__ == "__main__":
main()