Last active
August 29, 2015 14:06
-
-
Save bachya/9b48ce3151ebf06e7955 to your computer and use it in GitHub Desktop.
aText snippet that takes a gist ID or URL from the clipboard and creates a Wordpress shortcode/link pair
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
| GIST_ID=$(echo "【clipboard】" | sed -Ee 's/https?:\/\/gist\.github\.com\/[^\/]+\///') | |
| echo "[gist ${GIST_ID} /]" \ | |
| "<div class=\"no_js\">" \ | |
| "<a name=\"${GIST_ID}\"></a>" \ | |
| "<a href=\"#${GIST_ID}\">Click here to see the Gist.</a>" \ | |
| "</div>" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment