mirror of
https://github.com/rmaake1/httpstatuses.git
synced 2024-09-04 16:49:45 +02:00
In case I need to do this again. I created a file of status code to constant names, then ran this script against it: IFS=$'\n'; for i in $(cat rust-consts.txt); do code="$(echo $i | awk '{print $1}')" const="http::StatusCode::$(echo $i | awk '{print $2}')" fastmod "(references:)(\n)" "\${1}\${2} \"Rust HTTP Status Constant\": \"${const}\"\${2}" "contents/codes/${code}.md" done The hightlight is the grossness for the fastmod invocation, since I couldn't figure out how to get fastmod to add newlines in the replacement text, so I captured and reused the one from the searched patterns. |
||
---|---|---|
.. | ||
codes | ||
error-404.md | ||
error-500.md | ||
favicon.ico | ||
index.md | ||
open-sans-regular.woff | ||
robots.txt | ||
source-code-pro-700.woff | ||
style.scss |