Directives and Advanced Configuration
ZiraDocs supports advanced directives and configuration options that provide granular control over presentation behavior, layout, and content inclusion beyond the global FrontMatter configuration.
Overview
Section titled “Overview”Directives are special markers within the document body that control specific aspects of rendering, behavior, or content processing for individual slides or sections. They complement global FrontMatter settings with slide-level precision.
Inline Directives
Section titled “Inline Directives”Slide-Specific Layout Override
Section titled “Slide-Specific Layout Override”Override layout for individual slides while maintaining global theme consistency.
Flex Mode:
---layout: two_columns_image_right---
# Special Layout Slide
**Left Column:**- Main content point- Supporting details
**Right Column:**Strict Mode:
SLIDE content layout_override: "two_columns_image_right" title: "Special Layout Slide"
COLUMN_LEFT POINTS - Main content point - Supporting details
COLUMN_RIGHT IMAGE "assets/feature.png"Style and CSS Control
Section titled “Style and CSS Control”Apply specific styling or CSS classes to content blocks.
Flex Mode:
::: style class="highlight-box warning" css="border: 2px solid red; padding: 1em;" :::**Warning:** This message requires immediate attention.:::
::: style class="branded-callout" :::Key insight that aligns with brand guidelines.:::Strict Mode:
SLIDE content title: "Important Information"
TEXT style_class="highlight-box warning" custom_css="border: 2px solid red; padding: 1em;" Warning: This message requires immediate attention.
TEXT style_class="branded-callout" Key insight that aligns with brand guidelines.Content Inclusion Directives
Section titled “Content Inclusion Directives”External File Inclusion
Section titled “External File Inclusion”Include content from external files for modular presentation development.
Syntax (Both Modes):
# Main Presentation Content
<!-- Include detailed analysis from external file -->::: include path="./sections/market-analysis.md" :::
## Code Examples
<!-- Include specific lines from code file -->::: include_code path="./examples/api-demo.py" language="python" lines="15-35" :::
<!-- Include entire file with syntax highlighting -->::: include_code path="./config/database-setup.yaml" language="yaml" :::Conditional Content
Section titled “Conditional Content”Include content based on output format or conditions.
::: include_if format="html" :::Interactive elements appear here in web version.:::
::: include_if format="pdf" :::Static alternative content for PDF export.:::
::: include_unless format="print" :::This content is excluded from printed versions.:::Block Processing Control
Section titled “Block Processing Control”Raw Content Blocks
Section titled “Raw Content Blocks”Prevent ZiraDocs parsing for literal content preservation.
::: raw :::This content bypasses ZiraDocs processing entirely.Even --- slide separators and # headers are ignored.SLIDE fake_element TEXT "This won't be processed as ZiraDocs syntax"::: end_raw :::Comment Blocks
Section titled “Comment Blocks”Add development notes that won’t appear in output.
::: comment :::TODO: Update this section with Q4 dataDesigner feedback: Consider different color schemeReview with legal team before final presentation::: end_comment :::Section-Level Configuration
Section titled “Section-Level Configuration”Apply temporary configuration changes to specific sections.
Theme Override
Section titled “Theme Override”::: config theme="dark_presentation" transition="fade" :::
# Dark Theme SectionContent using dark theme styling...
---
# Another Dark SlideContinues with dark theme...
::: end_config :::
---
# Back to DefaultReturns to global theme configuration.Animation and Transition Control
Section titled “Animation and Transition Control”::: config transition="zoom" animation_speed="slow" :::
# Slow Zoom TransitionsThis section uses slower, zoom-based transitions.
::: end_config :::Advanced Presenter Features
Section titled “Advanced Presenter Features”Enhanced Presenter Notes
Section titled “Enhanced Presenter Notes”While basic presenter notes use the @notes: directive, advanced configuration allows structured presenter information.
SLIDE content title: "Financial Summary"
@notes: Key talking points: - Emphasize 25% growth over last quarter - Address concerns about market volatility - Estimated speaking time: 3 minutes
@notes_timing: 180 # seconds @notes_priority: high
TEXT Our revenue has increased significantly this quarter.Slide Metadata
Section titled “Slide Metadata”SLIDE content title: "Market Analysis" slide_id: "market_overview_2024" tags: ["analysis", "market", "strategy"] review_status: "approved" last_updated: "2024-01-15"
TEXT Market conditions show positive trends...Project Configuration Files
Section titled “Project Configuration Files”For organization-wide or project-level settings, ZiraDocs supports configuration files.
slidelang.config.yaml
Section titled “slidelang.config.yaml”# Project-wide ZiraDocs configuration
# Default settings for all presentationsdefaults: mode: flex theme: "corporate_standard" slide_aspect_ratio: "16:9"
# Asset managementassets: base_paths: - "./shared/images" - "./brand/logos" - "./templates"
# Optimization settings image_optimization: max_width: 1920 quality: 85 format_preference: ["webp", "png", "jpg"]
# Plugin configurationplugins: enabled: - "slidelang-charts" - "slidelang-analytics"
config: slidelang_charts: default_library: "chartjs" color_scheme: "corporate"
slidelang_analytics: tracking_id: "GA-XXXX-YYYY" anonymize_ip: true
# Build and processingbuild: # Pre-processing hooks pre_process: - "./scripts/validate_content.js" - "./scripts/fetch_data.py"
# Post-processing hooks post_process: - "./scripts/optimize_assets.js" - "./scripts/generate_index.html"
# Output optimization optimization: minify_css: true compress_images: true bundle_assets: true
# Development settingsdevelopment: auto_reload: true log_level: "debug" serve_port: 3000
# Security policiessecurity: allow_external_scripts: false sanitize_html: true validate_urls: trueEnvironment-Specific Configuration
Section titled “Environment-Specific Configuration”# ziradocs.com.yaml - Development overridesdefaults: theme: "debug_theme"
development: log_level: "verbose" show_build_time: true enable_source_maps: true# slidelang.prod.yaml - Production settingsbuild: optimization: minify_css: true compress_images: true
security: strict_mode: true validate_all_links: trueValidation and Linting
Section titled “Validation and Linting”Directives integrate with ZiraDocs’s validation system.
Directive Validation
Section titled “Directive Validation”# Validate directive usageslidelang lint presentation.slidelang
# Check for unsupported directivesslidelang lint --strict presentation.slidelang
# Validate included files existslidelang lint --check-includes presentation.slidelangConfiguration Validation
Section titled “Configuration Validation”# Validate configuration filesslidelang config validate
# Test configuration with dry-runslidelang build --dry-run --config=slidelang.prod.yamlBest Practices
Section titled “Best Practices”Performance Considerations
Section titled “Performance Considerations”- Minimize external includes - Each inclusion adds processing time
- Use conditional content wisely - Excessive conditions can complicate maintenance
- Cache included content - Configure build system to cache frequently included files
Organization
Section titled “Organization”- Group related directives - Keep similar directives together for readability
- Document complex configurations - Use comment blocks to explain advanced setups
- Version configuration files - Track configuration changes alongside content
Security
Section titled “Security”- Validate external content - Ensure included files are safe and authorized
- Limit raw blocks - Use raw directives sparingly to maintain security
- Review custom CSS - Validate inline styles don’t introduce vulnerabilities
Migration from Legacy Configurations
Section titled “Migration from Legacy Configurations”If updating from earlier versions:
- Presenter Notes: Legacy HTML-based notes automatically migrate to metadata
- Layout Specifications: Old layout syntax remains compatible
- Include Directives: File paths may need updating for new asset resolution
Error Handling
Section titled “Error Handling”Common directive issues and solutions:
- File not found: Check include paths and asset configuration
- Invalid CSS: Validate custom styling syntax
- Conflicting configurations: Later directives override earlier ones
- Unsupported directive: Update ZiraDocs or check plugin availability
Related Documentation
Section titled “Related Documentation”- FrontMatter Configuration - Global presentation settings
- Specialized Layouts - Built-in layout options
- Dynamic & Interactive Features - Animation and interaction directives
- Advanced Elements - Complex content elements
- CLI Reference - Command-line tools and options
💡 Pro Tip: Start with simple directives like style classes and external includes. Gradually incorporate advanced configuration as your presentation complexity grows.