diff --git a/cmd/mungedocs/toc.go b/cmd/mungedocs/toc.go index dfc705daf12..de68beb5308 100644 --- a/cmd/mungedocs/toc.go +++ b/cmd/mungedocs/toc.go @@ -75,6 +75,9 @@ func buildTOC(markdown []byte) ([]byte, error) { if numSharps > 0 { indent := strings.Repeat(" ", numSharps-1) bookmark := strings.Replace(strings.ToLower(heading), " ", "-", -1) + // remove ' and ? in bookmarks + bookmark = strings.Replace(bookmark, "?", "", -1) + bookmark = strings.Replace(bookmark, "'", "", -1) tocLine := fmt.Sprintf("%s- [%s](#%s)\n", indent, heading, bookmark) buffer.WriteString(tocLine) } diff --git a/cmd/mungedocs/toc_test.go b/cmd/mungedocs/toc_test.go index 966c4a4bd8c..4180a480c33 100644 --- a/cmd/mungedocs/toc_test.go +++ b/cmd/mungedocs/toc_test.go @@ -37,6 +37,10 @@ func Test_buildTOC(t *testing.T) { "# Title\nLorem ipsum \n## Section Heading\ndolor sit amet\n```bash\n#!/bin/sh\n```", "- [Title](#title)\n - [Section Heading](#section-heading)\n", }, + { + "# Title\nLorem ipsum \n## Section Heading\n### Why doesn't this work?\ndolor sit amet\n", + "- [Title](#title)\n - [Section Heading](#section-heading)\n - [Why doesn't this work?](#why-doesnt-this-work)\n", + }, } for _, c := range cases { actual, err := buildTOC([]byte(c.in)) diff --git a/docs/admin/admission-controllers.md b/docs/admin/admission-controllers.md index 34ed7bdcf65..7a28f4ccf07 100644 --- a/docs/admin/admission-controllers.md +++ b/docs/admin/admission-controllers.md @@ -25,10 +25,10 @@ certainly want the docs that go with that version. **Table of Contents** - [Admission Controllers](#admission-controllers) - - [What are they?](#what-are-they?) - - [Why do I need them?](#why-do-i-need-them?) - - [How do I turn on an admission control plug-in?](#how-do-i-turn-on-an-admission-control-plug-in?) - - [What does each plug-in do?](#what-does-each-plug-in-do?) + - [What are they?](#what-are-they) + - [Why do I need them?](#why-do-i-need-them) + - [How do I turn on an admission control plug-in?](#how-do-i-turn-on-an-admission-control-plug-in) + - [What does each plug-in do?](#what-does-each-plug-in-do) - [AlwaysAdmit](#alwaysadmit) - [AlwaysDeny](#alwaysdeny) - [DenyExecOnPrivileged](#denyexeconprivileged) @@ -39,7 +39,7 @@ certainly want the docs that go with that version. - [NamespaceExists](#namespaceexists) - [NamespaceAutoProvision (deprecated)](#namespaceautoprovision-(deprecated)) - [NamespaceLifecycle](#namespacelifecycle) - - [Is there a recommended set of plug-ins to use?](#is-there-a-recommended-set-of-plug-ins-to-use?) + - [Is there a recommended set of plug-ins to use?](#is-there-a-recommended-set-of-plug-ins-to-use) diff --git a/docs/admin/node.md b/docs/admin/node.md index 66fb4bbe78c..fde3f03c8fa 100644 --- a/docs/admin/node.md +++ b/docs/admin/node.md @@ -25,7 +25,7 @@ certainly want the docs that go with that version. **Table of Contents** - [Node](#node) - - [What is a node?](#what-is-a-node?) + - [What is a node?](#what-is-a-node) - [Node Status](#node-status) - [Node Addresses](#node-addresses) - [Node Phase](#node-phase) diff --git a/docs/user-guide/configuring-containers.md b/docs/user-guide/configuring-containers.md index 877b64964dc..a6eb38ff118 100644 --- a/docs/user-guide/configuring-containers.md +++ b/docs/user-guide/configuring-containers.md @@ -32,7 +32,7 @@ certainly want the docs that go with that version. - [Viewing pod status](#viewing-pod-status) - [Viewing pod output](#viewing-pod-output) - [Deleting pods](#deleting-pods) - - [What's next?](#what's-next?) + - [What's next?](#whats-next) diff --git a/docs/user-guide/connecting-applications.md b/docs/user-guide/connecting-applications.md index e81682e1178..20da23c0688 100644 --- a/docs/user-guide/connecting-applications.md +++ b/docs/user-guide/connecting-applications.md @@ -32,7 +32,7 @@ certainly want the docs that go with that version. - [Environment Variables](#environment-variables) - [DNS](#dns) - [Exposing the Service to the internet](#exposing-the-service-to-the-internet) - - [What's next?](#what's-next?) + - [What's next?](#whats-next) diff --git a/docs/user-guide/deploying-applications.md b/docs/user-guide/deploying-applications.md index 586862900ff..a315225f912 100644 --- a/docs/user-guide/deploying-applications.md +++ b/docs/user-guide/deploying-applications.md @@ -29,7 +29,7 @@ certainly want the docs that go with that version. - [Viewing replication controller status](#viewing-replication-controller-status) - [Deleting replication controllers](#deleting-replication-controllers) - [Labels](#labels) - - [What's next?](#what's-next?) + - [What's next?](#whats-next) diff --git a/docs/user-guide/introspection-and-debugging.md b/docs/user-guide/introspection-and-debugging.md index 986bb9b830d..5c7e07f8a0e 100644 --- a/docs/user-guide/introspection-and-debugging.md +++ b/docs/user-guide/introspection-and-debugging.md @@ -32,7 +32,7 @@ your pods. But there are a number of ways to get even more information about you - [Using ```kubectl describe pod``` to fetch details about pods](#using-```kubectl-describe-pod```-to-fetch-details-about-pods) - [Example: debugging Pending Pods](#example:-debugging-pending-pods) - [Example: debugging a down/unreachable node](#example:-debugging-a-down/unreachable-node) - - [What's next?](#what's-next?) + - [What's next?](#whats-next) diff --git a/docs/user-guide/managing-deployments.md b/docs/user-guide/managing-deployments.md index bd215424533..9af539fc50b 100644 --- a/docs/user-guide/managing-deployments.md +++ b/docs/user-guide/managing-deployments.md @@ -36,7 +36,7 @@ You’ve deployed your application and exposed it via a service. Now what? Kuber - [Updating your application without a service outage](#updating-your-application-without-a-service-outage) - [In-place updates of resources](#in-place-updates-of-resources) - [Disruptive updates](#disruptive-updates) - - [What's next?](#what's-next?) + - [What's next?](#whats-next) diff --git a/docs/user-guide/production-pods.md b/docs/user-guide/production-pods.md index b62ab8aa0f3..fb7242dfd5b 100644 --- a/docs/user-guide/production-pods.md +++ b/docs/user-guide/production-pods.md @@ -33,7 +33,7 @@ certainly want the docs that go with that version. - [Liveness and readiness probes (aka health checks)](#liveness-and-readiness-probes-(aka-health-checks)) - [Lifecycle hooks and termination notice](#lifecycle-hooks-and-termination-notice) - [Termination message](#termination-message) - - [What's next?](#what's-next?) + - [What's next?](#whats-next) diff --git a/docs/user-guide/quick-start.md b/docs/user-guide/quick-start.md index 290c1dcc562..f6039236db2 100644 --- a/docs/user-guide/quick-start.md +++ b/docs/user-guide/quick-start.md @@ -28,7 +28,7 @@ certainly want the docs that go with that version. - [Launching a simple application](#launching-a-simple-application) - [Exposing your application to the Internet](#exposing-your-application-to-the-internet) - [Killing the application](#killing-the-application) - - [What's next?](#what's-next?) + - [What's next?](#whats-next) diff --git a/docs/user-guide/replication-controller.md b/docs/user-guide/replication-controller.md index 01063191dcd..f3942888247 100644 --- a/docs/user-guide/replication-controller.md +++ b/docs/user-guide/replication-controller.md @@ -25,8 +25,8 @@ certainly want the docs that go with that version. **Table of Contents** - [Replication Controller](#replication-controller) - - [What is a _replication controller_?](#what-is-a-_replication-controller_?) - - [How does a replication controller work?](#how-does-a-replication-controller-work?) + - [What is a _replication controller_?](#what-is-a-_replication-controller_) + - [How does a replication controller work?](#how-does-a-replication-controller-work) - [Pod template](#pod-template) - [Labels](#labels) - [Responsibilities of the replication controller](#responsibilities-of-the-replication-controller) diff --git a/docs/user-guide/services.md b/docs/user-guide/services.md index bb304c6d37d..d0792821931 100644 --- a/docs/user-guide/services.md +++ b/docs/user-guide/services.md @@ -31,7 +31,7 @@ certainly want the docs that go with that version. - [Virtual IPs and service proxies](#virtual-ips-and-service-proxies) - [Multi-Port Services](#multi-port-services) - [Choosing your own IP address](#choosing-your-own-ip-address) - - [Why not use round-robin DNS?](#why-not-use-round-robin-dns?) + - [Why not use round-robin DNS?](#why-not-use-round-robin-dns) - [Discovering services](#discovering-services) - [Environment variables](#environment-variables) - [DNS](#dns)