mix rdmx.update (readmix v0.5.0)

Updates Readmix blocks in a file.

A backup of updated files is automatically done in the system temporary directory.

Readmix will use the default generators and scopes defined in the configuration for the :readmix application, under the :generators and :scopes keys:

# dev.exs

config :readmix,
  generators: [MyGenerator],
  scopes: [MyScope, Readmix.Scopes.Defaults]

Synopsis

mix rdmx.update [options] <path>

Arguments

  • path - The file or directory to update.

    When a directory is given, only .md files are updated.

Options

  • -b, --backup - Perform a backup of the updated files. Defaults to true.

  • -d, --backup-dir <string> - Target directory to backup files before update. Defaults to System.tmp_dir!().

  • --var <string> - Provide variables for generators using the Readmix.Scopes.Defaults scope.

    Variables must be given with a key and value:

    --var "some_key=some_value"
  • --help - Displays this help.

Examples

# Update a single file
mix rdmx.update README.md

# Update with custom variables
mix rdmx.update README.md --var "app_vsn=1.2.3"

# Update without backup
mix rdmx.update README.md --no-backup