content dir #12
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_slides#12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Slide Generator Content + Prompting Spec
Goal
Add a structured content system to the slide generator so a user can:
1. Folder Structure
Each presentation folder must support this layout:
the slides/ not used for now
Rules
content/slides/contains the ordered markdown files representing slide content.content/background/contains reusable context grouped in subdirectories.background/is selectable as a context source during deck creation or slide generation.2. Core Concepts
Slide Content
A markdown file describing:
This is not the final visual instruction output.
Background Context
Reusable markdown grouped by theme, such as:
Slide Instruction Spec
The final generated output used by the slide generator to render the slide.
3. Main User Flows
A. Create Deck
When the user clicks Create Slide as part of a deck:
System behavior
<presentation>/content/exists.<presentation>/content/background/exists.background/Expected result
The deck is created with persistent selected context sources.
B. Create New Slide
When the user creates a new slide:
UI fields
User options
The user can:
System behavior
Implementation Spec for Issue #12: Content Background System
Objective
Add a structured background content system to hero_slides so users can organize reusable contextual material (company info, market data, style guides) in
content/background/subdirectories within each presentation folder, select which background folders to include, and have their markdown content automatically concatenated and injected into AI generation prompts.Requirements
<deck>/content/background/for subdirectories (company/, market/, style/).mdfiles within it{{background_context}}template variablehas_backgroundfield toDeckInfogeomindexampleOut of Scope
content/slides/reading (issue says "not used for now")Implementation Plan (7 Steps)
Step 1: Library types and discovery
Files:
types.rs,discovery.rsBackgroundFolderstruct andhas_backgroundtoDeckInfofind_background_folders()andread_background_content()functionsStep 2: Public deck API
Files:
deck.rs,lib.rsdeck_list_background()anddeck_read_background()public functionsStep 3: Prompt injection
Files:
generator.rs,generator_slide_image.md{{background_context}}placeholder to prompt templatebuild_prompt()andgenerate_slide()to accept background contextStep 4: Server RPC methods
Files:
rpc.rs,openrpc.jsondeck.listBackgroundanddeck.readBackgroundRPC methodsStep 5: Rhai bindings
Files:
deck_module.rsdeck_list_backgroundanddeck_read_backgroundRhai functionsStep 6: Dashboard UI
Files:
dashboard.js,index.htmlStep 7: Seed example content
Files:
examples/geomind/content/background/Acceptance Criteria
deck_list_background()returns empty vec for decks without background contentdeck_list_background()returns correct folder names and file countsread_background_content()concatenates .md files with proper headersDeckInfo.has_backgroundis correctTest Results
All tests pass including 3 new background content tests:
test_find_background_folders_emptytest_find_background_folderstest_read_background_contenttest_build_prompt_with_backgroundImplementation Summary
Files Modified
crates/hero_slides_lib/src/types.rs— AddedBackgroundFolderstruct,has_backgroundfield toDeckInfocrates/hero_slides_lib/src/discovery.rs— Addedfind_background_folders(),read_background_content(), updateddeck_info_from_path(), skipcontent/in recursive scan, added 3 unit testscrates/hero_slides_lib/src/deck.rs— Addeddeck_list_background(),deck_read_background()public APIcrates/hero_slides_lib/src/lib.rs— Re-exported new types and functionscrates/hero_slides_lib/src/generator.rs— Addedbackground_contextparameter tobuild_prompt()andgenerate_slide(), added testcrates/hero_slides_lib/src/prompts/generator_slide_image.md— Added{{background_context}}placeholdercrates/hero_slides_lib/src/hashing.rs— Fixed pre-existing test compilation (missing..Default::default())crates/hero_slides_server/src/rpc.rs— Addeddeck.listBackgroundanddeck.readBackgroundRPC methods,has_backgroundto all deck JSON responsescrates/hero_slides_rhai/src/deck_module.rs— Addeddeck_list_backgroundanddeck_read_backgroundRhai bindings,has_backgroundto deck info mapcrates/hero_slides_ui/static/js/dashboard.js— Background folder selection state,loadBackgroundFolders(),renderBackgroundPanel(),previewBackgroundContent()functionscrates/hero_slides_ui/templates/index.html— Background context panel with checkboxes and preview buttoncrates/hero_slides_ui/static/css/dashboard.css— Background panel stylingFiles Created
examples/geomind/content/background/company/overview.md— Seed company contextexamples/geomind/content/background/style/tone.md— Seed tone/voice guidelinesTest Results
All 57 tests pass (0 failures, 1 ignored).
Implementation committed:
94600bdBrowse:
94600bd