Add Pronunciation Guide page with word cards and TTS
Build and Push Docker Image / build-and-push (push) Successful in 3m37s
Build and Push Docker Image / build-and-push (push) Successful in 3m37s
Replace the copy-to-clipboard button with a dedicated page that shows all collected Greek/Hebrew words as cards grouped by language. Each card displays the original script large, transliteration, Strong's number, English gloss, definition, part of speech, and a Speak button. Includes a search/filter and a "Copy all" fallback for the old behavior. Move buildPronunciationGuide to bibleUtils.jsx to avoid circular imports. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
1 parent
7b2920b9e6
commit
85fc566ade
3 files changed
+212
-20
No files matched your search
+5
-20
@@ -9,6 +9,7 @@ import ReaderPage from './pages/ReaderPage.jsx';
|
||||
import SettingsPage from './pages/SettingsPage.jsx';
|
||||
import SetupPage from './pages/SetupPage.jsx';
|
||||
import StudyPage from './pages/StudyPage.jsx';
|
||||
import PronunciationPage from './pages/PronunciationPage.jsx';
|
||||
import {
|
||||
AlignmentType,
|
||||
BorderStyle,
|
||||
@@ -48,6 +49,7 @@ import {
|
||||
BookmarkIcon,
|
||||
CopyIcon,
|
||||
CrossRefChip,
|
||||
buildPronunciationGuide,
|
||||
} from './utils/bibleUtils.jsx';
|
||||
|
||||
import {
|
||||
@@ -410,24 +412,6 @@ PASSAGE: ${chapterLabel}
|
||||
return header + buildChunkBodies(project);
|
||||
}
|
||||
|
||||
export function buildPronunciationGuide(project) {
|
||||
const chapters = Array.isArray(project.chapters) ? project.chapters : [];
|
||||
const lines = [];
|
||||
chapters.forEach((ch) => {
|
||||
ch.chunks.forEach((chunk) => {
|
||||
(chunk.greekWords ?? []).forEach((word) => {
|
||||
const gloss = word.shortDefinition || word.englishGloss || '';
|
||||
const lexeme = word.lexeme || '';
|
||||
const translit = word.transliteration || '';
|
||||
if (!lexeme && !translit) return;
|
||||
const label = gloss ? `${gloss} — ` : '';
|
||||
lines.push(`${label}${lexeme}${translit ? ` (${translit})` : ''}`);
|
||||
});
|
||||
});
|
||||
});
|
||||
if (lines.length === 0) return 'No Greek/Hebrew words collected yet.';
|
||||
return lines.join('\n');
|
||||
}
|
||||
|
||||
export function buildPodcastPrompt(project, podcastName) {
|
||||
const chapters = Array.isArray(project.chapters) ? project.chapters : [];
|
||||
@@ -3243,9 +3227,9 @@ const deleteProject = (id) => {
|
||||
</button>
|
||||
<button
|
||||
type="button"
|
||||
onClick={copyPronunciationGuide}
|
||||
onClick={() => setCurrentPage('pronunciation')}
|
||||
disabled={allChunks.length === 0}
|
||||
title="Copy a quick word + transliteration list to keep open while recording"
|
||||
title="Open the pronunciation guide — all Greek & Hebrew words with transliterations"
|
||||
className="rounded-md bg-amber-500 px-4 py-2 text-sm font-medium text-white shadow-sm transition hover:bg-amber-400 disabled:cursor-not-allowed disabled:bg-slate-500"
|
||||
>
|
||||
🗣<span className="hidden sm:inline"> Pronunciation Guide</span>
|
||||
@@ -3639,6 +3623,7 @@ function AppRouter() {
|
||||
if (currentPage === 'import') return <ImportPage />;
|
||||
if (currentPage === 'study') return <StudyPage />;
|
||||
if (currentPage === 'setup') return <SetupPage />;
|
||||
if (currentPage === 'pronunciation') return <PronunciationPage />;
|
||||
return <HomePage />;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user