Last active
June 8, 2017 14:20
rake tasks to wiki
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Run `rake -D` and format the task descriptions as a | |
# GitHub-Markdown table (for our Wiki) | |
# Write the output to tasks.md | |
touch tasks.md | |
echo '<dl>' > tasks.md | |
bundle exec rake -D | | |
sed -E '/^rake .*$/{ $! { N; | |
s/^(rake .*)(\n)[[:space:]]+(.*)/<dt> \1\2<dd> \3/; | |
};}; | |
/^$/d;' | | |
sed -nE '1h; 1!H; ${ g; | |
s/\n([^<])/<br>\1/g; | |
s/ +/ /g; | |
p; | |
}' >> tasks.md | |
echo '</dl>' >> tasks.md |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment