Skip to main content

Update Documentation

Refresh the documentation section in your README.md from nova.config.json.

Summary

The update-documentation recipe rewrites the documentation section of a README.md file so the documentation link stays in sync with nova.config.json. It reuses the exact builder the generate must-haves read-me command uses, so the spliced documentation is byte-identical to a freshly generated region.

The recipe only touches the marked region. Everything before the <!-- nova-region: documentation --> marker and everything after the <!-- nova-region-end: documentation --> marker is left byte-identical, so hand-written prose around the documentation is never disturbed.

Prerequisites

  • An existing README.md — The recipe updates a file in the project root; it does not create one. Use generate must-haves read-me to create the initial file.
  • The documentation region markers — The README.md must contain the <!-- nova-region: documentation --> and <!-- nova-region-end: documentation --> markers. A generate must-haves read-me file has them by default.
  • A documentation URLurls.documentation in nova.config.json so there is a documentation link to render.

Behavior

The recipe follows an in-place splice so it can only ever rewrite the region it owns.

  • Region gate — The documentation region markers must both be present and correctly ordered. If the markers are absent, misordered, or the README.md was not generated by Nova, the recipe warns that the region markers were not found and returns without writing.
  • Region-only splice — Only the content between the markers is replaced. The markers and all content outside them are preserved exactly.
  • Not applicable — When the current nova.config.json yields no documentation, the recipe warns and returns without touching the file.
  • Idempotent — When the regenerated documentation already matches the file on disk, the recipe reports that the documentation is already up to date and makes no write.

Settings

Settings are configured in nova.config.json under the recipes.read-me key. The update-documentation recipe is controlled by a single enabled toggle:

json
{
  "recipes": {
    "read-me": {
      "update-documentation": {
        "enabled": true
      }
    }
  }
}

When the recipe is not enabled, it warns and returns without touching any files.

Usage

Options

FlagDescription
-d, --dry-runRun without writing any files.
-r, --replace-fileReplace the original file without creating a backup.