Skip to content

Commit

Permalink
add more options
Browse files Browse the repository at this point in the history
  • Loading branch information
alxgomz committed Dec 4, 2024
1 parent 2a78346 commit b9354cc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 9 additions & 1 deletion .github/actions/md-toc/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ inputs:
description: Bullets to use for Table of Contents ("*", "-" or "+")
required: false
default: '*'
no_toc_in_toc:
description: >-
Do not include Table of Contents heading in Table of Contents
(Assuming it's the first h1/##)
required: false
default: 'true'
node_version:
description: Node.js version to install (false means do not install)
required: false
Expand All @@ -43,8 +49,10 @@ runs:
- name: Generate Table of Contents
env:
MDTOC_IARG: ${{ inputs.dry_run == 'false' && '-i' || '' }}
MDTOC_HARG: ${{ inputs.no_toc_in_toc == 'true' && '--no-firsth1' || '' }}
MDTOC_ARGS: ${{ env.MDTOC_IARG }} ${{ env.MDTOC_HARG }}
run: |
markdown-toc "$MDTOC_IARG" \
markdown-toc "$MDTOC_ARGS" \
--maxdepth "${{ inputs.depth }}" \
--bullets "${{ inputs.bullets }}" \
--append "${{ inputs.append }}" \
Expand Down
4 changes: 4 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -1681,9 +1681,13 @@ Generates a Markdown table of contents for a file.
For ToC to be inserted in your file, it needs to contain the HTML comment below:

```markdown
## Table of Contents
<!-- toc -->
```

> If you do not add an H1 tag as show above before the ToC comment, use `no_toc_in_toc: false` with this action
> otherwise it will skip the first paragraph of the file.

### update-deployment-runtime-versions

For more information, see [update-deployment-runtime-versions](../.github/actions/update-deployment-runtime-versions/action.yml).
Expand Down

0 comments on commit b9354cc

Please sign in to comment.