Last active
June 8, 2017 14:20
-
-
Save fanaugen/c96693ec9dea17ea9b08 to your computer and use it in GitHub Desktop.
rake tasks to wiki
This file contains 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