MCPcopy Index your code
hub / github.com/FSoft-AI4Code/CodeWiki / get_file_title

Function get_file_title

codewiki/src/fe/visualise_docs.py:93–104  ·  view source on GitHub ↗

Extract title from markdown file, fallback to filename.

(file_path: Path)

Source from the content-addressed store, hash-verified

91
92
93def get_file_title(file_path: Path) -> str:
94 """Extract title from markdown file, fallback to filename."""
95 try:
96 content = file_manager.load_text(file_path)
97 first_line = content.split('\n')[0].strip()
98 if first_line.startswith('# '):
99 return first_line[2:].strip()
100 except Exception:
101 pass
102
103 # Fallback to filename without extension
104 return file_path.stem.replace('_', ' ').title()
105
106
107@app.get("/", response_class=HTMLResponse)

Callers 3

indexFunction · 0.85
serve_docFunction · 0.85
serve_generated_docsMethod · 0.85

Calls 1

load_textMethod · 0.80

Tested by

no test coverage detected