Bodu.Text.Configuration
1.0.0
dotnet add package Bodu.Text.Configuration --version 1.0.0
NuGet\Install-Package Bodu.Text.Configuration -Version 1.0.0
<PackageReference Include="Bodu.Text.Configuration" Version="1.0.0" />
<PackageVersion Include="Bodu.Text.Configuration" Version="1.0.0" />
<PackageReference Include="Bodu.Text.Configuration" />
paket add Bodu.Text.Configuration --version 1.0.0
#r "nuget: Bodu.Text.Configuration, 1.0.0"
#:package Bodu.Text.Configuration@1.0.0
#addin nuget:?package=Bodu.Text.Configuration&version=1.0.0
#tool nuget:?package=Bodu.Text.Configuration&version=1.0.0
Bodu.Text.Configuration
API stability — Stable. The public API surface is committed; breaking changes are reserved for a major-version bump per SemVer.
An EditorConfig-inspired, INI-backed configuration document model with parse, resolve, and write phases that consumers can compose independently.
The library separates three concerns:
source text ──► ConfigurationDocument.Parse ──► IniDocument
IniDocument ──► .Resolve(targetPath) ──► ConfigurationView
ConfigurationView ──► .GetXxx(key) ──► typed value
Profiles select a coherent set of parse, resolve, and write defaults: Bodu (permissive default),
EditorConfigCompatible (strict EditorConfig 0.17.2 alignment), Strict (deterministic parsing for
generated files), and Relaxed (collect-diagnostics for user-authored files).
Quick start
using Bodu.Text.Configuration;
ConfigurationDocument document = ConfigurationDocument.Parse("""
root = true
[*]
indent_size = 4
start_day = Monday
[src/**.cs]
indent_size = 8
""");
// Sections whose glob matches the target path apply, later sections winning.
ConfigurationView view = document.Resolve("src/App/Program.cs");
var indent = view.GetInt32("indent_size"); // 8
var start = view.GetEnum<DayOfWeek>("start_day"); // Monday
var missing = view.TryGetValue("theme", out string? theme); // false - no throw
// Presets switch the whole pipeline's dialect in one place:
ConfigurationView compat = document.Resolve(
"src/App/Program.cs", ConfigurationResolveOptions.EditorConfigCompatible);
ParseWithDiagnostics returns the document plus collected ConfigurationDiagnostic rows instead
of throwing; ConfigurationDocument.Save(document, path, writeOptions) round-trips the document
(comments preserved by default).
Where to start
- Documentation index — high-level pipeline overview.
- Concepts — vocabulary used throughout the API: documents, views, profiles, target paths, preamble, unset values, diagnostics.
- Getting started — worked samples for parsing, resolving, typed value access, and round-tripping.
Runnable samples
The repository ships offline, dotnet run-able sample projects for this package and its
bridge — the resolve cascade, diagnostics, unset dialect handling, save round trips, and
the Microsoft.Extensions.Configuration integration — under
samples/Text.Configuration/.
When to reach for the bridge package
If you want a .boduconfig file to flow into Microsoft.Extensions.Configuration (the standard
IConfiguration / IOptions<T> pipeline) rather than calling the document/resolver model directly, use
Bodu.Extensions.Configuration.Text. It bridges the same
document model into the IConfigurationBuilder API surface.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Bodu.Text.Configuration:
| Package | Downloads |
|---|---|
|
Bodu.Extensions.Configuration.Text
The EditorConfig-compatible Microsoft.Extensions.Configuration provider. Bridges Bodu.Text.Configuration into the standard IConfiguration / IOptions<T> pipeline so a .boduconfig or bodu.config file registers with the same AddTextConfiguration(...) shape used for the JSON, INI, and XML providers — with file, stream, and programmatic-document overloads, reload-on-change, and colon-delimited section binding. Also ships the read-only TOML (AddTomlFile / AddTomlStream) and Bencode (AddBencodeFile / AddBencodeStream) sources. |
GitHub repositories
This package is not used by any popular GitHub repositories.