Clean up readme, and default config

This commit is contained in:
Alexander R.
2026-07-21 22:51:28 +00:00
parent edfcc872d9
commit 0b7259a011
8 changed files with 43 additions and 35 deletions
+1 -1
View File
@@ -144,7 +144,7 @@ class HandbookExampleRequest(BaseModel):
@app.get("/handbook/catalog/{language}")
def get_handbook_catalog_endpoint(language: str):
"""Returns W3Schools-style syntax handbook catalog (functions & subjects) for specified language."""
"""Returns syntax handbook catalog (functions & subjects) for specified language."""
catalog = handbook_service.get_catalog(language)
return {"language": language, "catalog": catalog}
+5 -5
View File
@@ -1,4 +1,4 @@
"""W3Schools-Style Language Reference Handbook service for built-in functions, methods, primitive types, and topics."""
"""Language Reference Handbook service for built-in functions, methods, primitive types, and topics."""
import httpx
from typing import Dict, List, Any
from src.core.config import config
@@ -197,7 +197,7 @@ HANDBOOK_CATALOG: Dict[str, Dict[str, List[Dict[str, str]]]] = {
class HandbookService:
"""W3Schools-Style Language Reference Handbook service."""
"""Language Reference Handbook service."""
def get_catalog(self, language: str) -> Dict[str, List[Dict[str, str]]]:
canonical = registry.canonical_name(language)
@@ -210,7 +210,7 @@ class HandbookService:
lang_name = config_info.get("name", language) if config_info else language
prompt = (
f"Generate a W3Schools-Style Reference Card for '{topic_title}' in {lang_name}.\n"
f"Generate a Reference Card for '{topic_title}' in {lang_name}.\n"
f"Structure your response strictly into these four Markdown sections:\n"
f"1. **Syntax / Signature:** Clear representation of how to invoke or write it.\n"
f"2. **Description & Parameters:** Brief summary of parameter types and return value.\n"
@@ -219,7 +219,7 @@ class HandbookService:
)
sys_prompt = (
"You are an expert W3Schools-Style Documentation Assistant for TactiTerm.\n"
"You are an expert Documentation Assistant for TactiTerm.\n"
"Provide clean, educational reference cards. Ensure the code example is realistic, complete, and copy-pasteable."
)
@@ -259,7 +259,7 @@ class HandbookService:
except Exception as e:
return {
"status": "error",
"message": f"Failed to generate W3Schools reference card via LLM: {e}",
"message": f"Failed to generate reference card via LLM: {e}",
}
+6 -6
View File
@@ -1,4 +1,4 @@
"""TactiTerm TUI — Coding Tutor Terminal User Interface with W3Schools-style Handbook & Expandable Output Terminal."""
"""TactiTerm TUI — Coding Tutor Terminal User Interface with Handbook & Expandable Output Terminal."""
import argparse
import logging
from typing import List, Dict, Any
@@ -336,14 +336,14 @@ class TactiTermTUI(App):
yield MentorInputTextArea(id="mentor-question-input")
yield Button("💡 Ask Mentor (Enter)", id="btn-send-mentor", variant="warning")
# Right column 2: W3Schools-Style Handbook Sidebar
# Right column 2: Handbook Sidebar
with Container(id="handbook-sidebar"):
yield Static("📖 W3Schools Handbook", id="handbook-header")
yield Static("📖 Handbook", id="handbook-header")
yield Input(placeholder="🔍 Search built-ins or topics...", id="handbook-search-input")
yield Button("Filter: All Items (Click to Switch)", id="btn-handbook-mode", variant="default")
yield OptionList(id="handbook_topic_list")
with VerticalScroll(id="handbook-example-scroll"):
yield Markdown("Select a function or topic above to view W3Schools reference card...", id="handbook-example-display")
yield Markdown("Select a function or topic above to view reference card...", id="handbook-example-display")
yield Static("Ready", id="status-bar")
yield Footer()
@@ -524,7 +524,7 @@ class TactiTermTUI(App):
self.load_handbook_catalog(lang)
self.query_one("#handbook_topic_list", OptionList).focus()
self.query_one("#status-bar", Static).update(f"W3Schools Handbook open for {lang}.")
self.query_one("#status-bar", Static).update(f"Handbook open for {lang}.")
def on_mentor_input_text_area_submit_question(
self, event: MentorInputTextArea.SubmitQuestion
@@ -699,7 +699,7 @@ class TactiTermTUI(App):
lang = challenge.language if challenge else "Python"
self.query_one("#handbook-example-display", Markdown).update(
f"⏳ **Generating W3Schools reference card for '{item['title']}' in {lang}...**"
f"⏳ **Generating reference card for '{item['title']}' in {lang}...**"
)
self.run_worker(self._handbook_worker(lang, item["id"], item["title"]))