Created
March 20, 2018 21:53
-
-
Save pat-s/7aa990030e0fd25a4eb727592da492d1 to your computer and use it in GitHub Desktop.
Convert NEWS.md to ASCII NEWS for R packages
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
# 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.md > NEWS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment