Skip to content

Commit

Permalink
MUNGE generated table of contents should strip comma
Browse files Browse the repository at this point in the history
  • Loading branch information
janetkuo committed Jul 17, 2015
1 parent 55e9356 commit 2498f93
Show file tree
Hide file tree
Showing 19 changed files with 33 additions and 33 deletions.
6 changes: 3 additions & 3 deletions cmd/mungedocs/toc.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +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)
// remove symbols (except for -) in bookmarks
r := regexp.MustCompile("[^A-Za-z0-9-]")
bookmark = r.ReplaceAllString(bookmark, "")
tocLine := fmt.Sprintf("%s- [%s](#%s)\n", indent, heading, bookmark)
buffer.WriteString(tocLine)
}
Expand Down
4 changes: 2 additions & 2 deletions cmd/mungedocs/toc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ func Test_buildTOC(t *testing.T) {
"- [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",
"# Title\nLorem ipsum \n## Section Heading\n### Ok, why doesn't this work? ...add 4 *more* `symbols`!\ndolor sit amet\n",
"- [Title](#title)\n - [Section Heading](#section-heading)\n - [Ok, why doesn't this work? ...add 4 *more* `symbols`!](#ok-why-doesnt-this-work-add-4-more-symbols)\n",
},
}
for _, c := range cases {
Expand Down
2 changes: 1 addition & 1 deletion docs/admin/admission-controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ certainly want the docs that go with that version.</h1>
- [ResourceQuota](#resourcequota)
- [LimitRanger](#limitranger)
- [NamespaceExists](#namespaceexists)
- [NamespaceAutoProvision (deprecated)](#namespaceautoprovision-(deprecated))
- [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)

Expand Down
2 changes: 1 addition & 1 deletion docs/admin/networking.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ certainly want the docs that go with that version.</h1>
- [Docker model](#docker-model)
- [Kubernetes model](#kubernetes-model)
- [How to achieve this](#how-to-achieve-this)
- [Google Compute Engine (GCE)](#google-compute-engine-(gce))
- [Google Compute Engine (GCE)](#google-compute-engine-gce)
- [L2 networks and linux bridging](#l2-networks-and-linux-bridging)
- [Flannel](#flannel)
- [OpenVSwitch](#openvswitch)
Expand Down
2 changes: 1 addition & 1 deletion docs/devel/api-conventions.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ using resources with kubectl can be found in (working_with_resources.md).*

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Types (Kinds)](#types-(kinds))
- [Types (Kinds)](#types-kinds)
- [Resources](#resources)
- [Objects](#objects)
- [Metadata](#metadata)
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ certainly want the docs that go with that version.</h1>

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes User Guide: Managing Applications](#kubernetes-user-guide:-managing-applications)
- [Kubernetes User Guide: Managing Applications](#kubernetes-user-guide-managing-applications)
- [Quick walkthrough](#quick-walkthrough)
- [Thorough walkthrough](#thorough-walkthrough)
- [Concept guide](#concept-guide)
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/configuring-containers.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ certainly want the docs that go with that version.</h1>

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes User Guide: Managing Applications: Configuring and launching containers](#kubernetes-user-guide:-managing-applications:-configuring-and-launching-containers)
- [Kubernetes User Guide: Managing Applications: Configuring and launching containers](#kubernetes-user-guide-managing-applications-configuring-and-launching-containers)
- [Configuration in Kubernetes](#configuration-in-kubernetes)
- [Launching a container using a configuration file](#launching-a-container-using-a-configuration-file)
- [Validating configuration](#validating-configuration)
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/connecting-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ certainly want the docs that go with that version.</h1>

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes User Guide: Managing Applications: Connecting applications](#kubernetes-user-guide:-managing-applications:-connecting-applications)
- [Kubernetes User Guide: Managing Applications: Connecting applications](#kubernetes-user-guide-managing-applications-connecting-applications)
- [The Kubernetes model for connecting containers](#the-kubernetes-model-for-connecting-containers)
- [Exposing pods to the cluster](#exposing-pods-to-the-cluster)
- [Creating a Service](#creating-a-service)
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/deploying-applications.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ certainly want the docs that go with that version.</h1>

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes User Guide: Managing Applications: Deploying continuously running applications](#kubernetes-user-guide:-managing-applications:-deploying-continuously-running-applications)
- [Kubernetes User Guide: Managing Applications: Deploying continuously running applications](#kubernetes-user-guide-managing-applications-deploying-continuously-running-applications)
- [Launching a set of replicas using a configuration file](#launching-a-set-of-replicas-using-a-configuration-file)
- [Viewing replication controller status](#viewing-replication-controller-status)
- [Deleting replication controllers](#deleting-replication-controllers)
Expand Down
8 changes: 4 additions & 4 deletions docs/user-guide/introspection-and-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ your pods. But there are a number of ways to get even more information about you

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes User Guide: Managing Applications: Application Introspection and Debugging](#kubernetes-user-guide:-managing-applications:-application-introspection-and-debugging)
- [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)
- [Kubernetes User Guide: Managing Applications: Application Introspection and Debugging](#kubernetes-user-guide-managing-applications-application-introspection-and-debugging)
- [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-downunreachable-node)
- [What's next?](#whats-next)

<!-- END MUNGE: GENERATED_TOC -->
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/managing-deployments.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ You’ve deployed your application and exposed it via a service. Now what? Kuber

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes User Guide: Managing Applications: Managing deployments](#kubernetes-user-guide:-managing-applications:-managing-deployments)
- [Kubernetes User Guide: Managing Applications: Managing deployments](#kubernetes-user-guide-managing-applications-managing-deployments)
- [Organizing resource configurations](#organizing-resource-configurations)
- [Bulk operations in kubectl](#bulk-operations-in-kubectl)
- [Using labels effectively](#using-labels-effectively)
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/namespaces/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ Use the file [`namespace-dev.json`](namespace-dev.json) which describes a develo
Create the development namespace using kubectl.

```shell
$ kubectl create -f docs/user-guide/kubernetes-namespaces/namespace-dev.json
$ kubectl create -f docs/user-guide/namespaces/namespace-dev.json
```

And then lets create the production namespace using kubectl.

```shell
$ kubectl create -f docs/user-guide/kubernetes-namespaces/namespace-prod.json
$ kubectl create -f docs/user-guide/namespaces/namespace-prod.json
```

To be sure things are right, let's list all of the namespaces in our cluster.
Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/persistent-volumes.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ This document describes the current state of `PersistentVolumes` in Kubernetes.
- [PersistentVolumeClaims](#persistentvolumeclaims)
- [Access Modes](#access-modes)
- [Resources](#resources)
- [<a name="claims-as-volumes"></a> Claims As Volumes](#<a-name="claims-as-volumes"></a>-claims-as-volumes)
- [Claims As Volumes](#claims-as-volumes)

<!-- END MUNGE: GENERATED_TOC -->

Expand Down Expand Up @@ -194,7 +194,7 @@ Claims use the same conventions as volumes when requesting storage with specific

Claims, like pods, can request specific quantities of a resource. In this case, the request is for storage. The same [resource model](../design/resources.md) applies to both volumes and claims.

## <a name="claims-as-volumes"></a> Claims As Volumes
## Claims As Volumes

Pods access storage by using the claim as a volume. Claims must exist in the same namespace as the pod using the claim. The cluster finds the claim in the pod's namespace and uses it to get the `PersistentVolume` backing the claim. The volume is then mounted to the host and into the pod.

Expand Down
4 changes: 2 additions & 2 deletions docs/user-guide/production-pods.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ certainly want the docs that go with that version.</h1>

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes User Guide: Managing Applications: Working with pods and containers in production](#kubernetes-user-guide:-managing-applications:-working-with-pods-and-containers-in-production)
- [Kubernetes User Guide: Managing Applications: Working with pods and containers in production](#kubernetes-user-guide-managing-applications-working-with-pods-and-containers-in-production)
- [Persistent storage](#persistent-storage)
- [Distributing credentials](#distributing-credentials)
- [Authenticating with a private image registry](#authenticating-with-a-private-image-registry)
- [Helper containers](#helper-containers)
- [Resource management](#resource-management)
- [Liveness and readiness probes (aka health checks)](#liveness-and-readiness-probes-(aka-health-checks))
- [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?](#whats-next)
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ certainly want the docs that go with that version.</h1>

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes User Guide: Managing Applications: Quick start](#kubernetes-user-guide:-managing-applications:-quick-start)
- [Kubernetes User Guide: Managing Applications: Quick start](#kubernetes-user-guide-managing-applications-quick-start)
- [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)
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/replication-controller.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ certainly want the docs that go with that version.</h1>
**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Replication Controller](#replication-controller)
- [What is a _replication controller_?](#what-is-a-_replication-controller_)
- [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)
Expand Down
6 changes: 3 additions & 3 deletions docs/user-guide/secrets.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ a docker image.
- [Consuming Secret Values](#consuming-secret-values)
- [Secret and Pod Lifetime interaction](#secret-and-pod-lifetime-interaction)
- [Use cases](#use-cases)
- [Use-Case: Pod with ssh keys](#use-case:-pod-with-ssh-keys)
- [Use-Case: Pods with prod / test credentials](#use-case:-pods-with-prod-/-test-credentials)
- [Use-case: Secret visible to one container in a pod](#use-case:-secret-visible-to-one-container-in-a-pod)
- [Use-Case: Pod with ssh keys](#use-case-pod-with-ssh-keys)
- [Use-Case: Pods with prod / test credentials](#use-case-pods-with-prod--test-credentials)
- [Use-case: Secret visible to one container in a pod](#use-case-secret-visible-to-one-container-in-a-pod)
- [Security Properties](#security-properties)
- [Protections](#protections)
- [Risks](#risks)
Expand Down
8 changes: 4 additions & 4 deletions docs/user-guide/services.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ certainly want the docs that go with that version.</h1>
- [Environment variables](#environment-variables)
- [DNS](#dns)
- [Headless services](#headless-services)
- [<a name="external"></a>External services](#<a-name="external"></a>external-services)
- [Type = NodePort](#type-=-nodeport)
- [Type = LoadBalancer](#type-=-loadbalancer)
- [External services](#external-services)
- [Type = NodePort](#type--nodeport)
- [Type = LoadBalancer](#type--loadbalancer)
- [Shortcomings](#shortcomings)
- [Future work](#future-work)
- [The gory details of virtual IPs](#the-gory-details-of-virtual-ips)
Expand Down Expand Up @@ -342,7 +342,7 @@ they desire, but leaves them freedom to do discovery in their own way.
Applications can still use a self-registration pattern and adapters for other
discovery systems could easily be built upon this API.

##<a name="external"></a>External services
## External services

For some parts of your application (e.g. frontends) you may want to expose a
Service onto an external (outside of your cluster, maybe public internet) IP
Expand Down
2 changes: 1 addition & 1 deletion docs/user-guide/walkthrough/k8s201.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ In order for the kubectl usage examples to work, make sure you have an examples

**Table of Contents**
<!-- BEGIN MUNGE: GENERATED_TOC -->
- [Kubernetes 201 - Labels, Replication Controllers, Services and Health Checking](#kubernetes-201---labels,-replication-controllers,-services-and-health-checking)
- [Kubernetes 201 - Labels, Replication Controllers, Services and Health Checking](#kubernetes-201---labels-replication-controllers-services-and-health-checking)
- [Labels](#labels)
- [Replication Controllers](#replication-controllers)
- [Replication Controller Management](#replication-controller-management)
Expand Down

0 comments on commit 2498f93

Please sign in to comment.