By featuring the issue #4, one can install Parsedown-ToC via composer.
It might be handy if we provide a Phar file in bin directory of the package too. A Phar file which includes the latest extension and the working latest stable package of Parsedown.php tested.
If the bin directory is added to the env path($PATH) then the user can use it as a command.
In bash for example:
$ which parsedown-toc
~/.composer/vendor/bin/parsedown-toc
$
$ cat SAMPLE.md
# Title
## One
Sample data1
## Two
Sample data2
$ cat SAMPLE.md | parsedown-toc --toc
<ul>
<li><a href="#Title">Title</a>
<ul>
<li><a href="#One">One</a></li>
<li><a href="#Two">Two</a></li>
</ul></li>
</ul>
$ cat SAMPLE.md | parsedown-toc --body
<h1 id="Title" name="Title">Title</h1>
<h2 id="One" name="One">One</h2>
<p>Sample data1</p>
<h2 id="Two" name="Two">Two</h2>
<p>Sample data2</p>
$ cat SAMPLE.md | parsedown-toc --no-separator
<ul>
<li><a href="#Title">Title</a>
<ul>
<li><a href="#One">One</a></li>
<li><a href="#Two">Two</a></li>
</ul></li>
</ul>
<h1 id="Title" name="Title">Title</h1>
<h2 id="One" name="One">One</h2>
<p>Sample data1</p>
<h2 id="Two" name="Two">Two</h2>
<p>Sample data2</p>