Expand description
Style sheets — per-book/series/global rendering hints injected into the translation prompt.
A style sheet captures the per-book stylistic decisions that
--prompt-extra was a thin proxy for: narrative register, dialogue
formality, loanword policy, and free-form custom instructions. Several
sheets at different scopes can be active simultaneously; they merge
book > series > global with the same precedence as glossary terms
(see merge_style_sheets).
The merged sheet renders as a single prompt block; the prompt
template references it via {{style_guide_block}}. When no sheet is
active, the block renders to an empty string.
Structs§
- DoNot
Fields - Register
Fields - Narrative register: maps to source-language → target-language voice
conventions. Values are strings so the user can pick conventions
outside this enum (
passato_remotoetc.) without us pre-enumerating every target-language idiom. - Style
Sheet - Voice
Fields
Functions§
- merge_
style_ sheets - Merge multiple style sheets following
book > series > globalprecedence (mirrorscrate::glossary::merge_scope_terms). For scalar Optional fields, the highest-priority non-Nonewins. Fordo_not.translate_termsanddo_not.preserve_punctuation, vectors concatenate with deduplication.free_text_instructionsconcatenates global-first → book-last so book-level instructions appear most prominently to the model. ReturnsNoneif no input sheets carry any content. - render_
style_ block - Render the merged style sheet as a prompt block. Empty input returns an empty string so the placeholder substitutes to nothing in templates that don’t reference style guides.
- style_
fingerprint - Stable fingerprint of the merged style sheet for cache namespacing
and snapshot integrity. When
mergedisNone, returns the fingerprint of the empty payload — stable across runs and across upgrades, so users without--stylesee no cache invalidation.