π Table of Contents
- rc-docs-fix β
Documentation Stub
- π Overview
- π Usage
- π Details
- π£οΈ Navigation
- π οΈ Troubleshooting
- π¨ Sora Prompts # rc-docs-fix β Documentation Stub
A concise overview of what rc-docs-fix.sh does in the
Rotkeeper toolkit, providing automated insertion of standard sections
into Markdown docs.
π Overview
Requirements: Bash 4+, GNU or BSD sed, standard Unix utilities (grep, find, mkdir, cp).
The rc-docs-fix.sh utility audits and patches Markdown
files by inserting stub sections for Purpose, Usage, Examples,
Troubleshooting, and Future Plans if they are missing.
Inputs: Target directory path (default:
home/content/docs/). Outputs: Updated
Markdown files with inserted section stubs and corresponding
backups.
π Usage
rc-docs-fix.sh [OPTIONS] [DIR]Options:
-h,--helpβ Display help message.DIRβ Directory to scan (default:docs/docs).--dry-runβ Show what changes would be made without modifying files.
Examples
Generating stubs in the default docs folder:
./bones/scripts/rc-docs-fix.shTargeting a specific directory:
./bones/scripts/rc-docs-fix.sh bones/archiveDisplay help:
rc-docs-fix --helpπ Details
Upon invocation, the utility: 1. Parses flags, resolves the target
directory, and confirms write access. - e.g.,
rc-docs-fix bones/archive 2. Detects the appropriate
sed in-place flag for the host environment. 3. Creates a
timestamped backup directory under the target. - Creates
bones/archive/.rc-docs-backups-20250515123045/filename.md
4. Iterates over each .md file, backing it up and
inserting missing stub sections. 5. Reports the files modified and
backups created. - Summary printed to stdout, listing each file
processed and backup location.
π£οΈ Navigation
π οΈ Troubleshooting
- Missing frontmatter errors? Ensure each file
begins with
---on its own line. - Permission denied? Verify you have write permissions for both the target directory and backup location.
- Unsupported sed version? Install GNU sed or adjust the scriptβs sed-detection logic.
- No changes made? Use
--dry-runto inspect what would be added, or verify the files are missing known stub headings.
π¨ Sora Prompts
"An ancient archivist ghost, crafting stub sections in glowing Markdown crypts under flickering candlelight"
"A nameless scribeβs quill moving across digital parchment, leaving behind structured stubs of purpose and usage"