Add study templates, exports, breadcrumb, whole-Bible search, bookmarks UX, and share links
- Study templates: richer multi-line guiding questions in the OIA placeholders - PDF/print export: reuses buildExportHtml in a new tab + window.print() - Markdown export: new buildMarkdownExport() with matching tests - Breadcrumb: current chunk's passage reference shown in the Study page header - Reader bookmarks: SVG icons instead of ambiguous emoji, always visible (not hover-only, so it works on touch devices), plus a Bookmarks panel that lists all saved verses across every book and jumps + scrolls to them - Whole-Bible search: no server-side search endpoint exists, so this fetches the full translation once (~7MB) and searches an in-memory flat verse index client-side, with results linking back into the reader - Read-only share links: per-project share token, a public unauthenticated /api/share/:token endpoint, and a ?share=TOKEN view that bypasses the auth gate entirely and renders the export HTML in a script-sandboxed iframe Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,6 +7,7 @@ import {
|
||||
parseBibleChapter,
|
||||
wordTableHtml,
|
||||
buildExportHtml,
|
||||
buildMarkdownExport,
|
||||
buildClaudePrompt,
|
||||
createParagraphsFromText,
|
||||
migrateChunk,
|
||||
@@ -469,6 +470,46 @@ describe('buildExportHtml', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// buildMarkdownExport
|
||||
// ---------------------------------------------------------------------------
|
||||
describe('buildMarkdownExport', () => {
|
||||
test('includes the project title and translation as Markdown headers', () => {
|
||||
const md = buildMarkdownExport(baseProject);
|
||||
expect(md).toContain('# Titus 1 Study');
|
||||
expect(md).toContain('*BSB*');
|
||||
});
|
||||
|
||||
test('includes a chapter heading and chunk reference', () => {
|
||||
const md = buildMarkdownExport(baseProject);
|
||||
expect(md).toContain('## Titus 1');
|
||||
expect(md).toContain('### Titus 1:1-2');
|
||||
});
|
||||
|
||||
test('includes verse text and OIA notes', () => {
|
||||
const md = buildMarkdownExport(baseProject);
|
||||
expect(md).toContain('Paul, a servant of God.');
|
||||
expect(md).toContain('Key observations.');
|
||||
expect(md).toContain('Theological meaning.');
|
||||
expect(md).toContain('Live it out.');
|
||||
});
|
||||
|
||||
test('includes cross-references and Greek word data', () => {
|
||||
const md = buildMarkdownExport(baseProject);
|
||||
expect(md).toContain('John 1:1');
|
||||
expect(md).toContain('G1401');
|
||||
expect(md).toContain('δοῦλος');
|
||||
});
|
||||
|
||||
test('shows placeholder text when observation is empty', () => {
|
||||
const project = {
|
||||
...baseProject,
|
||||
chapters: [{ ...baseProject.chapters[0], chunks: [{ ...baseChunk, observation: '', interpretation: '', application: '' }] }],
|
||||
};
|
||||
expect(buildMarkdownExport(project)).toContain('_No observation._');
|
||||
});
|
||||
});
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// createParagraphsFromText
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user