Created
January 14, 2014 18:04
-
-
Save khornberg/8422787 to your computer and use it in GitHub Desktop.
Convert markdown file to WordPress readme format.
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 | |
# Script to convert markdown file to WordPress readme format | |
# @author Kyle Hornberg | |
# @date 2014-01-14 | |
# | |
# Changes | |
# # Header 1 -> === Header 1 === | |
# ## Header 2 -> == Header 2 == | |
# ### Header 3 -> = Header 3 = | |
# #### Header 4 -> **Header 4** | |
# ##### Header 5 -> **Header 5** | |
# | |
# Example | |
# convert-readme.sh SOURCE DEST | |
# ./convert-readme.sh readme.md readme.txt | |
sed -e 's/^#\{1\} \(.*\)/=== \1 ===/g' -e 's/^#\{2\} \(.*\)/== \1 ==/g' -e 's/^#\{3\} \(.*\)/= \1 =/g' -e 's/^#\{4,5\} \(.*\)/**\1**/g' "$1" > "$2" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment