| command | init |
|---|---|
| summary | Generate a default `.mdsmith.yml` config in the current directory, or convert an existing markdownlint config with `--from-markdownlint`. |
Writes .mdsmith.yml in the current directory. Without
flags, the file lists every rule with its built-in default
settings, so individual rules can be flipped off or
overridden with a clear diff.
mdsmith init [--from-markdownlint[=path]]
Refuses to overwrite an existing .mdsmith.yml. Takes no
positional arguments.
| Flag | Effect |
|---|---|
--from-markdownlint |
Convert a markdownlint config found in the current directory |
--from-markdownlint=$path |
Convert the markdownlint config at $path |
With --from-markdownlint and no =path, the command
probes the same file names markdownlint-cli does, in
order:
.markdownlint.jsonc.markdownlint.json.markdownlint.yaml.markdownlint.yml.markdownlintrc
Each file may hold JSON, JSONC (comments and trailing commas), or YAML.
The converted file contains only the rules whose behavior
differs from mdsmith's defaults; every unlisted rule keeps
its default. The
markdownlint rule mapping
supplies the rule correspondence. Options with no mdsmith
setting, unknown keys, tag toggles, and extends: are
reported as notes — on stderr and as a # Not converted:
comment block in the generated file. Notes do not fail the
command.
Default config:
mdsmith init
$EDITOR .mdsmith.ymlConvert a markdownlint config:
mdsmith init --from-markdownlint
$EDITOR .mdsmith.ymlSee Migrate from markdownlint for a worked conversion, including the emitted notes.
| Code | Meaning |
|---|---|
| 0 | Config written (conversion notes may still be present) |
| 2 | .mdsmith.yml exists, no markdownlint config found, or parse error |