diff --git a/gh-md-toc b/gh-md-toc index 0854ac4..e0c3cb1 100755 --- a/gh-md-toc +++ b/gh-md-toc @@ -51,9 +51,14 @@ gh_toc_load() { #
Hello world github/linguist#1 cool, and #1!
'" gh_toc_md2html() { local gh_file_md=$1 + URL=https://api.github.com/markdown/raw + TOKEN="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)/token.txt" + if [ -f "$TOKEN" ]; then + URL="$URL?access_token=$(cat $TOKEN)" + fi curl -s --user-agent "$gh_user_agent" \ --data-binary @"$gh_file_md" -H "Content-Type:text/plain" \ - https://api.github.com/markdown/raw + $URL } # @@ -61,7 +66,7 @@ gh_toc_md2html() { # gh_is_url() { case $1 in - https* | http*) + https* | http*) echo "yes";; *) echo "no";;