Updating installation instructions should be a small change. In an automated workflow, however, selecting the right part of a README can be surprisingly awkward.
Line numbers move as the document grows. A simple heading regex can mistake an example inside a code block for a real section. Asking an AI agent to reproduce the complete file gives it more unrelated content to preserve.
I built Texio to make this task explicit: find a Markdown section, preview its replacement, and apply the change.
cargo install texio-cli --locked
texio headings README.md --json
texio section README.md Installation
texio replace README.md --section Installation --from installation.md --dry-run
Here, installation.md contains the new section body. The last command shows a diff without changing the file. After checking it, run the same command with --write:
texio replace README.md --section Installation --from installation.md --write
Texio replaces the selected section body and preserves content outside it. Nested headings belong to the section until the next heading of the same or a higher level. Missing or duplicate matching headings produce an error, giving automation a clear failure to handle.
This is useful for scripts that refresh generated documentation and agents that update one part of a longer document. The practical payoff is a smaller edit and a diff that is easier to review.
Texio is an early preview. It supports section discovery, extraction, and replacement; it does not render or format Markdown, and MDX is outside its scope.
Try it on a README section you regularly update, inspect the preview, and see whether it simplifies your workflow. What Markdown editing task would you want to automate?
Top comments (0)