diff --git a/README.md b/README.md index b54b266..ff6a1ba 100644 --- a/README.md +++ b/README.md @@ -229,7 +229,7 @@ You can easily combine both ways: * [Usage](https://github.com/ekalinin/sitemap.js/blob/master/README.md#usage) * [License](https://github.com/ekalinin/sitemap.js/blob/master/README.md#license) -Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc) + ``` Auto insert and update TOC @@ -266,7 +266,7 @@ Table of Contents !! TOC added into a separate file: 'README.test.md.toc.2018-02-04_192655' -Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc) + ``` Now check the same file: diff --git a/gh-md-toc b/gh-md-toc index ac5e183..61d6ea8 100755 --- a/gh-md-toc +++ b/gh-md-toc @@ -164,6 +164,7 @@ gh_toc(){ local dt=`date +'%F_%H%M%S'` local ext=".orig.${dt}" local toc_path="${gh_src}.toc.${dt}" + local toc_createdby="" local toc_footer="" # http://fahdshariff.blogspot.ru/2012/12/sed-mutli-line-replacement-between-two.html # clear old TOC @@ -171,7 +172,7 @@ gh_toc(){ # create toc file echo "${toc}" > "${toc_path}" if [ "${no_footer}" != "yes" ]; then - echo -e "\n${toc_footer}\n" >> "$toc_path" + echo -e "\n${toc_createdby}\n${toc_footer}\n" >> "$toc_path" fi # insert toc file @@ -351,7 +352,7 @@ gh_toc_app() { done echo "" - echo "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)" + echo "" } # diff --git a/tests/tests.bats b/tests/tests.bats index 47bb57e..a1ad2df 100755 --- a/tests/tests.bats +++ b/tests/tests.bats @@ -26,7 +26,7 @@ load test_helper assert_equal "${lines[16]}" "* [Docker](#docker)" assert_equal "${lines[17]}" " * [Local](#local)" assert_equal "${lines[18]}" " * [Public](#public)" - assert_equal "${lines[19]}" "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)" + assert_equal "${lines[19]}" " } @@ -40,7 +40,7 @@ load test_helper assert_equal "${lines[3]}" " * [Installation](#installation)" assert_equal "${lines[4]}" " * [Usage](#usage)" assert_equal "${lines[5]}" " * [License](#license)" - assert_equal "${lines[6]}" "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)" + assert_equal "${lines[6]}" " } @test "TOC for mixed README.md (remote/local)" { @@ -70,7 +70,7 @@ load test_helper assert_equal "${lines[18]}" " * [Installation](https://github.com/ekalinin/sitemap.js/blob/6bc3eb12c898c1037a35a11b2eb24ababdeb3580/README.md#installation)" assert_equal "${lines[19]}" " * [Usage](https://github.com/ekalinin/sitemap.js/blob/6bc3eb12c898c1037a35a11b2eb24ababdeb3580/README.md#usage)" assert_equal "${lines[20]}" " * [License](https://github.com/ekalinin/sitemap.js/blob/6bc3eb12c898c1037a35a11b2eb24ababdeb3580/README.md#license)" - assert_equal "${lines[21]}" "Created by [gh-md-toc](https://github.com/ekalinin/github-markdown-toc)" + assert_equal "${lines[21]}" " } @test "TOC for markdown from stdin" {