Skip to content

Instantly share code, notes, and snippets.

Created March 20, 2018 21:53
What would you like to do?
Convert to ASCII NEWS for R packages
# 1.'-e' part: Replaces all level 2 headers and appends a ":" at the end of the line
# 2.'-e' part: Indents all bullet points with a whitespace
# 3.'-e' part: Removes all level 2 headers
# 4.'-e' part: For all level 1 headers, add linebreak and 80 hyphens (not strictly required but clean)
# 5.'-e' part: Remove all level 1 headers
sed -e '/^##/ s/$/:/' -e 's/^*/ */' -e 's/^## *//' -e "/^#/a\\--------------------------------------------------------------------------------" -e 's/^# *//' < > NEWS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment