Skip to content

Conversation

butschster
Copy link
Collaborator

@butschster butschster commented Apr 5, 2025

This PR adds support for defining custom variables directly in configuration files that can be referenced throughout the context definitions.

Read more about variables here

Changes

  • Added ConfigVariableProvider to store and manage custom variables
  • Created VariablesParserPlugin to extract variables from configuration files
  • Added VariablesBootloader to register the plugin with proper dependencies and integrate the custom variables provider

Example

variables:
  version: 1.0.0
  environment: development
  project_name: Context Generator

documents:
  - description: 'Project documentation'
    outputPath: docs/{{environment}}/{{project_name}}-{{version}}.md
    sources:
      - type: text
        content: |
          # {{project_name}} v{{version}}
          Environment: {{environment}}

Schema update

Updated the JSON schema to include the new variables section.

Closes #143

@butschster butschster added config:parser 1d76db for JSON, PHP, YAML config formats lib:variable Variable substitution for configs labels Apr 5, 2025
@butschster butschster added this to the 1.x milestone Apr 5, 2025
@butschster butschster self-assigned this Apr 5, 2025
@butschster butschster merged commit c5b903c into main Apr 5, 2025
7 checks passed
@butschster butschster deleted the issue/143 branch April 6, 2025 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config:parser 1d76db for JSON, PHP, YAML config formats lib:variable Variable substitution for configs
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Custom variables in configuration files
1 participant