diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..d3842c2 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM node:lts + +RUN npm install -g markdown-toc + +ENTRYPOINT ["/usr/local/bin/markdown-toc"] diff --git a/README.md b/README.md index 42fc603..2708904 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,22 @@ Assuming you want to add a TOC to README.md: 2. Edit README.md and insert the following line where you want the TOC inserted:
`` 3. `$ markdown-toc -i README.md` +## Usage with Docker + +First, clone the repository and create the image using the command: + +```sh +docker build -t markdown-toc:latest . +``` + +Then, use the Docker "run" command to launch the container (assuming that the file contains a line with ``): + +```sh +docker run -it --rm -v "$(pwd):/src" -i /src/README.md +``` + +The command above assumes that the `README.md` file is in the current working directory. If not, replace `$(pwd)` with the path to the directory where the markdown file is. + ## CLI ```