Skip to content

Commit 2cf2ac5

Browse files
committed
docs: Format README tables and remove duplicate content
- Align markdown tables for better readability - Add blank lines before code blocks for proper rendering - Remove duplicate Examples section - Update License section to reflect current MIT-only license
1 parent 7d5ce81 commit 2cf2ac5

1 file changed

Lines changed: 14 additions & 37 deletions

File tree

README.md

Lines changed: 14 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -156,20 +156,20 @@ struct Config {
156156

157157
### Struct-level Attributes
158158

159-
| Attribute | Description | Example |
160-
|-----------|-------------|---------|
159+
| Attribute | Description | Example |
160+
| ----------------------- | ------------------------------- | ------------------------------- |
161161
| `env_prefix = "PREFIX"` | Set environment variable prefix | `#[Gonfig(env_prefix = "APP")]` |
162-
| `allow_cli` | Enable CLI argument support | `#[Gonfig(allow_cli)]` |
163-
| `allow_config` | Enable config file support | `#[Gonfig(allow_config)]` |
162+
| `allow_cli` | Enable CLI argument support | `#[Gonfig(allow_cli)]` |
163+
| `allow_config` | Enable config file support | `#[Gonfig(allow_config)]` |
164164

165165
### Field-level Attributes
166166

167-
| Attribute | Description | Example |
168-
|-----------|-------------|---------|
169-
| `env_name = "NAME"` | Override environment variable name | `#[gonfig(env_name = "DB_URL")]` |
170-
| `cli_name = "name"` | Override CLI argument name | `#[gonfig(cli_name = "database-url")]` |
171-
| `#[skip]` | Skip field from all sources | `#[skip]` |
172-
| `#[skip_gonfig]` | Alternative skip syntax | `#[skip_gonfig]` |
167+
| Attribute | Description | Example |
168+
| ------------------- | ---------------------------------- | -------------------------------------- |
169+
| `env_name = "NAME"` | Override environment variable name | `#[gonfig(env_name = "DB_URL")]` |
170+
| `cli_name = "name"` | Override CLI argument name | `#[gonfig(cli_name = "database-url")]` |
171+
| `#[skip]` | Skip field from all sources | `#[skip]` |
172+
| `#[skip_gonfig]` | Alternative skip syntax | `#[skip_gonfig]` |
173173

174174
## Skip Attributes
175175

@@ -258,6 +258,7 @@ ConfigBuilder::new()
258258
Gonfig supports multiple config file formats:
259259

260260
### TOML
261+
261262
```toml
262263
# config.toml
263264
database_url = "postgres://localhost/prod"
@@ -269,6 +270,7 @@ password = "secret"
269270
```
270271

271272
### YAML
273+
272274
```yaml
273275
# config.yaml
274276
database_url: postgres://localhost/prod
@@ -279,6 +281,7 @@ mongo:
279281
```
280282
281283
### JSON
284+
282285
```json
283286
{
284287
"database_url": "postgres://localhost/prod",
@@ -328,27 +331,6 @@ fn main() -> gonfig::Result<()> {
328331

329332
This gives you fine-grained control over logging output without cluttering your application logs.
330333

331-
## Examples
332-
333-
See the [examples/](examples/) directory for more comprehensive examples:
334-
335-
- [`your_usecase.rs`](examples/your_usecase.rs) - Your exact use case implementation
336-
- [`skip_attributes.rs`](examples/skip_attributes.rs) - Comprehensive skip examples
337-
- [`madara_usecase.rs`](examples/madara_usecase.rs) - Complex hierarchical configuration
338-
- [`simple.rs`](examples/simple.rs) - Basic usage example
339-
340-
Run examples:
341-
```bash
342-
# Run with default logging (INFO level)
343-
cargo run --example your_usecase
344-
345-
# Run with debug logging
346-
RUST_LOG=debug cargo run --example skip_attributes
347-
348-
# Run silently (errors only)
349-
RUST_LOG=error cargo run --example simple
350-
```
351-
352334
## Error Handling
353335

354336
Gonfig provides detailed error types:
@@ -372,9 +354,4 @@ Contributions are welcome! Please feel free to submit a Pull Request.
372354

373355
## License
374356

375-
This project is licensed under either of
376-
377-
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
378-
* MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
379-
380-
at your option.# gonfig
357+
- MIT license ([LICENSE](LICENSE) or https://opensource.org/licenses/MIT)

0 commit comments

Comments
 (0)