Skip to content

Commit 6091c6a

Browse files
author
Tamas Pallos
committed
Add table of contents to README
1 parent f97a7ad commit 6091c6a

3 files changed

Lines changed: 65 additions & 0 deletions

File tree

.github/workflows/doctoc.yml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: Doctoc
2+
3+
on:
4+
push:
5+
pull_request:
6+
branches: [main]
7+
8+
jobs:
9+
verify-doctoc:
10+
name: Verifies whether table of contents has been updated
11+
runs-on: ubuntu-20.04
12+
13+
steps:
14+
- name: Checkout code
15+
uses: actions/checkout@v2
16+
17+
- name: Run doctoc on README
18+
run: npx doctoc README.md
19+
20+
- name: Verify that doctoc command made no changes, so ToC is up to date
21+
run: '[ -z "$(git status --porcelain)" ]'

README.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22

33
Tools which are commonly used by other JORE4 projects
44

5+
<!-- regenerate with: "./development.sh toc" -->
6+
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
7+
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
8+
9+
- [Tools for Docker](#tools-for-docker)
10+
- [read-secrets.sh](#read-secretssh)
11+
12+
<!-- END doctoc generated TOC please keep comment here to allow auto update -->
13+
514
## Tools for Docker
615

716
### read-secrets.sh

development.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
3+
set -eu
4+
5+
function toc {
6+
echo "Refreshing Table of Contents"
7+
8+
npx doctoc README.md
9+
}
10+
11+
function usage {
12+
echo "
13+
Usage $0 <command>
14+
15+
toc
16+
Refreshes the Table of Contents in the README.
17+
18+
help
19+
Show this usage information
20+
"
21+
}
22+
23+
case $1 in
24+
toc)
25+
toc
26+
;;
27+
28+
help)
29+
usage
30+
;;
31+
32+
*)
33+
usage
34+
;;
35+
esac

0 commit comments

Comments
 (0)