Skip to content

Commit

Permalink
Automate TOC generation (#184)
Browse files Browse the repository at this point in the history
Signed-off-by: Lucas Caparelli <[email protected]>
  • Loading branch information
LCaparelli authored Oct 30, 2020
1 parent 41b9b04 commit 2c472eb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ fmt:
vet:
go vet ./...
./hack/go-lint.sh
./hack/generate-toc.sh

# Generate code
generate: controller-gen
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
Table of Contents
=================

<!--ts-->
* [Table of Contents](#table-of-contents)
* [Nexus Operator](#nexus-operator)
* [Pre Requisites](#pre-requisites)
* [Quick Install](#quick-install)
Expand All @@ -19,7 +21,7 @@ Table of Contents
* [Use NodePort](#use-nodeport)
* [Network on OpenShift](#network-on-openshift)
* [Network on Kubernetes 1.14 ](#network-on-kubernetes-114)
* [NGINX Ingress troubleshooting](#nginx-ingress-troubleshooting)
* [NGINX Ingress troubleshooting](#nginx-ingress-troubleshooting)
* [TLS/SSL](#tlsssl)
* [Persistence](#persistence)
* [Minikube](#minikube)
Expand All @@ -30,6 +32,10 @@ Table of Contents
* [Repositories Auto Creation](#repositories-auto-creation)
* [Contributing](#contributing)


<!--te-->


# Nexus Operator

A Nexus OSS Kubernetes Operator based on the [Operator SDK](https://github.com/operator-framework/operator-sdk).
Expand Down
20 changes: 20 additions & 0 deletions hack/generate-toc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash
# Copyright 2020 Nexus Operator and/or its authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


command -v bin/gh-md-toc > /dev/null || curl https://raw.githubusercontent.com/ekalinin/github-markdown-toc/master/gh-md-toc -o bin/gh-md-toc && chmod +x bin/gh-md-toc

bin/gh-md-toc --no-backup README.md
sed -i '/^<!-- Added by:/d' README.md

0 comments on commit 2c472eb

Please sign in to comment.