mix confispex.gen.doc.md (confispex v1.2.0)

Generates a Markdown documentation file listing all configuration variables from your schema in a human-readable table format.

Perfect for:

  • Project README files
  • Deployment documentation
  • Onboarding new team members
  • CI/CD pipeline documentation

The generated document includes tables organized by groups showing:

  • Variable names
  • Required/optional status
  • Default values
  • Descriptions from :doc fields

Options

  • --schema - (required) the module name of your schema (e.g., MyApp.RuntimeConfigSchema)
  • --output - (required) path to output file (e.g., RUNTIME_CONFIG.md)
  • --env - (optional) environment context (e.g., prod, dev, test)
  • --target - (optional) target context (e.g., host, docker)

Examples

# Generate docs for production environment
$ mix confispex.gen.doc.md \
    --schema=MyApp.RuntimeConfigSchema \
    --output=docs/PRODUCTION_CONFIG.md \
    --env=prod \
    --target=host

# Generate docs for development
$ mix confispex.gen.doc.md \
    --schema=MyApp.RuntimeConfigSchema \
    --output=README_CONFIG.md \
    --env=dev

Example Output

# Variables (env=prod target=host)

## GROUP :database

| Name          | Required | Default   | Description            |
| ------------- | -------- | --------- | ---------------------- |
| DATABASE_URL  | required |           | PostgreSQL connection  |
| DATABASE_POOL |          | 10        | Connection pool size   |

## GROUP :cache

| Name       | Required | Default     | Description       |
| ---------- | -------- | ----------- | ----------------- |
| REDIS_URL  | required |             | Redis connection  |

Context-Aware Documentation

The generated documentation respects context filters in your schema. Variables marked with context: [env: [:prod]] will only appear in documentation generated with --env=prod.

Summary

Functions

Callback implementation for Mix.Task.run/1.

Functions

run(args)

Callback implementation for Mix.Task.run/1.