From 6e4ec38f51ee9fea139f05c4c9af36b1034e41f2 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Fri, 17 Jul 2015 09:20:19 -0700 Subject: [PATCH] Make TOC munge include blank line before TOC --- cmd/mungedocs/toc.go | 1 + cmd/mungedocs/toc_test.go | 12 ++++++------ docs/admin/admission-controllers.md | 1 + docs/admin/cluster-components.md | 6 +++--- docs/admin/high-availability.md | 1 + docs/admin/networking.md | 1 + docs/admin/node.md | 1 + docs/devel/api-conventions.md | 1 + docs/getting-started-guides/scratch.md | 1 + docs/user-guide/README.md | 1 + docs/user-guide/accessing-the-cluster.md | 1 + docs/user-guide/application-troubleshooting.md | 1 + docs/user-guide/compute-resources.md | 1 + docs/user-guide/configuring-containers.md | 1 + docs/user-guide/connecting-applications.md | 1 + docs/user-guide/container-environment.md | 1 + docs/user-guide/debugging-services.md | 1 + docs/user-guide/deploying-applications.md | 1 + docs/user-guide/docker-cli-to-kubectl.md | 1 + docs/user-guide/images.md | 1 + docs/user-guide/introspection-and-debugging.md | 1 + docs/user-guide/managing-deployments.md | 1 + docs/user-guide/persistent-volumes.md | 1 + docs/user-guide/production-pods.md | 1 + docs/user-guide/quick-start.md | 1 + docs/user-guide/replication-controller.md | 1 + docs/user-guide/secrets.md | 1 + docs/user-guide/services.md | 1 + docs/user-guide/volumes.md | 1 + docs/user-guide/walkthrough/README.md | 1 + docs/user-guide/walkthrough/k8s201.md | 1 + 31 files changed, 38 insertions(+), 9 deletions(-) diff --git a/cmd/mungedocs/toc.go b/cmd/mungedocs/toc.go index 8a4a1a0203d..ecb97001c7d 100644 --- a/cmd/mungedocs/toc.go +++ b/cmd/mungedocs/toc.go @@ -54,6 +54,7 @@ func updateTOC(filePath string, markdown []byte) ([]byte, error) { // builds the ToC. func buildTOC(markdown []byte) ([]byte, error) { var buffer bytes.Buffer + buffer.WriteString("\n") scanner := bufio.NewScanner(bytes.NewReader(markdown)) inBlockQuotes := false for scanner.Scan() { diff --git a/cmd/mungedocs/toc_test.go b/cmd/mungedocs/toc_test.go index ad32319085d..b2f7f4d9925 100644 --- a/cmd/mungedocs/toc_test.go +++ b/cmd/mungedocs/toc_test.go @@ -27,19 +27,19 @@ func Test_buildTOC(t *testing.T) { in string out string }{ - {"", ""}, - {"Lorem ipsum\ndolor sit amet\n", ""}, + {"", "\n"}, + {"Lorem ipsum\ndolor sit amet\n", "\n"}, { "# Title\nLorem ipsum \n## Section Heading\ndolor sit amet\n", - "- [Title](#title)\n - [Section Heading](#section-heading)\n", + "\n- [Title](#title)\n - [Section Heading](#section-heading)\n", }, { "# Title\nLorem ipsum \n## Section Heading\ndolor sit amet\n```bash\n#!/bin/sh\n```", - "- [Title](#title)\n - [Section Heading](#section-heading)\n", + "\n- [Title](#title)\n - [Section Heading](#section-heading)\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", + "\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 { @@ -63,7 +63,7 @@ func Test_updateTOC(t *testing.T) { }, { "# Title\nLorem ipsum \n**table of contents**\n\nold cruft\n\n## Section Heading\ndolor sit amet\n", - "# Title\nLorem ipsum \n**table of contents**\n\n- [Title](#title)\n - [Section Heading](#section-heading)\n\n\n## Section Heading\ndolor sit amet\n", + "# Title\nLorem ipsum \n**table of contents**\n\n\n- [Title](#title)\n - [Section Heading](#section-heading)\n\n\n## Section Heading\ndolor sit amet\n", }, } for _, c := range cases { diff --git a/docs/admin/admission-controllers.md b/docs/admin/admission-controllers.md index b175f025970..bfa4600eef9 100644 --- a/docs/admin/admission-controllers.md +++ b/docs/admin/admission-controllers.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [Admission Controllers](#admission-controllers) - [What are they?](#what-are-they) - [Why do I need them?](#why-do-i-need-them) diff --git a/docs/admin/cluster-components.md b/docs/admin/cluster-components.md index 1de6dbdebe5..766af21c577 100644 --- a/docs/admin/cluster-components.md +++ b/docs/admin/cluster-components.md @@ -103,9 +103,9 @@ Example addons are: * [DNS](../../cluster/addons/dns/) provides cluster local DNS. * [kube-ui](../../cluster/addons/kube-ui/) provides a graphical UI for the cluster. -* [fluentd-elasticsearch](../../cluster/addons/fluentd-elasticsearch) provides - log storage. Also see the [gcp version](../../cluster/addons/fluentd-gcp). -* [cluster-monitoring](../../cluster/addons/cluster-monitoring) provides +* [fluentd-elasticsearch](../../cluster/addons/fluentd-elasticsearch/) provides + log storage. Also see the [gcp version](../../cluster/addons/fluentd-gcp/). +* [cluster-monitoring](../../cluster/addons/cluster-monitoring/) provides monitoring for the cluster. ## Node components diff --git a/docs/admin/high-availability.md b/docs/admin/high-availability.md index 9c31d7144b6..b1d66c8be05 100644 --- a/docs/admin/high-availability.md +++ b/docs/admin/high-availability.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [High Availability Kubernetes Clusters](#high-availability-kubernetes-clusters) - [Introduction](#introduction) - [Overview](#overview) diff --git a/docs/admin/networking.md b/docs/admin/networking.md index 9e24b0098bb..49d90b9eeb6 100644 --- a/docs/admin/networking.md +++ b/docs/admin/networking.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [Networking in Kubernetes](#networking-in-kubernetes) - [Summary](#summary) - [Docker model](#docker-model) diff --git a/docs/admin/node.md b/docs/admin/node.md index cfdf9bcbd1b..83ec479402e 100644 --- a/docs/admin/node.md +++ b/docs/admin/node.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [Node](#node) - [What is a node?](#what-is-a-node) - [Node Status](#node-status) diff --git a/docs/devel/api-conventions.md b/docs/devel/api-conventions.md index 323cde41643..271efed4786 100644 --- a/docs/devel/api-conventions.md +++ b/docs/devel/api-conventions.md @@ -41,6 +41,7 @@ using resources with kubectl can be found in (working_with_resources.md).* **Table of Contents** + - [Types (Kinds)](#types-kinds) - [Resources](#resources) - [Objects](#objects) diff --git a/docs/getting-started-guides/scratch.md b/docs/getting-started-guides/scratch.md index 735aa49de7d..480ad77dad5 100644 --- a/docs/getting-started-guides/scratch.md +++ b/docs/getting-started-guides/scratch.md @@ -48,6 +48,7 @@ steps that existing cluster setup scripts are making. **Table of Contents** + - [Designing and Preparing](#designing-and-preparing) - [Learning](#learning) - [Cloud Provider](#cloud-provider) diff --git a/docs/user-guide/README.md b/docs/user-guide/README.md index 3ec9a1efa7b..7e3ad43d166 100644 --- a/docs/user-guide/README.md +++ b/docs/user-guide/README.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [Kubernetes User Guide: Managing Applications](#kubernetes-user-guide-managing-applications) - [Quick walkthrough](#quick-walkthrough) - [Thorough walkthrough](#thorough-walkthrough) diff --git a/docs/user-guide/accessing-the-cluster.md b/docs/user-guide/accessing-the-cluster.md index 720069c8884..8f2dafcda6f 100644 --- a/docs/user-guide/accessing-the-cluster.md +++ b/docs/user-guide/accessing-the-cluster.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [User Guide to Accessing the Cluster](#user-guide-to-accessing-the-cluster) - [Accessing the cluster API](#accessing-the-cluster-api) - [Accessing for the first time with kubectl](#accessing-for-the-first-time-with-kubectl) diff --git a/docs/user-guide/application-troubleshooting.md b/docs/user-guide/application-troubleshooting.md index 572f75ab7ac..e4317d928c4 100644 --- a/docs/user-guide/application-troubleshooting.md +++ b/docs/user-guide/application-troubleshooting.md @@ -38,6 +38,7 @@ This is *not* a guide for people who want to debug their cluster. For that you **Table of Contents** + - [Application Troubleshooting](#application-troubleshooting) - [FAQ](#faq) - [Diagnosing the problem](#diagnosing-the-problem) diff --git a/docs/user-guide/compute-resources.md b/docs/user-guide/compute-resources.md index 9d381c1676f..2c926fccb2a 100644 --- a/docs/user-guide/compute-resources.md +++ b/docs/user-guide/compute-resources.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at ** Table of Contents** + - [Compute Resources](#compute-resources) - [Container and Pod Resource Limits](#container-and-pod-resource-limits) - [How Pods with Resource Limits are Scheduled](#how-pods-with-resource-limits-are-scheduled) diff --git a/docs/user-guide/configuring-containers.md b/docs/user-guide/configuring-containers.md index a82cce81c68..c0d5d12802a 100644 --- a/docs/user-guide/configuring-containers.md +++ b/docs/user-guide/configuring-containers.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [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) diff --git a/docs/user-guide/connecting-applications.md b/docs/user-guide/connecting-applications.md index e4884339461..d6038bbf574 100644 --- a/docs/user-guide/connecting-applications.md +++ b/docs/user-guide/connecting-applications.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [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) diff --git a/docs/user-guide/container-environment.md b/docs/user-guide/container-environment.md index c4772db6262..58be1cbf933 100644 --- a/docs/user-guide/container-environment.md +++ b/docs/user-guide/container-environment.md @@ -35,6 +35,7 @@ Documentation for other releases can be found at **Table of Contents** + - [Kubernetes Container Environment](#kubernetes-container-environment) - [Overview](#overview) - [Cluster Information](#cluster-information) diff --git a/docs/user-guide/debugging-services.md b/docs/user-guide/debugging-services.md index 06a9ae9f165..ee9c7cc9184 100644 --- a/docs/user-guide/debugging-services.md +++ b/docs/user-guide/debugging-services.md @@ -39,6 +39,7 @@ This document will hopefully help you to figure out what's going wrong. **Table of Contents** + - [My Service is not working - how to debug](#my-service-is-not-working---how-to-debug) - [Conventions](#conventions) - [Running commands in a Pod](#running-commands-in-a-pod) diff --git a/docs/user-guide/deploying-applications.md b/docs/user-guide/deploying-applications.md index afe87743c47..6d435b52bd4 100644 --- a/docs/user-guide/deploying-applications.md +++ b/docs/user-guide/deploying-applications.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [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) diff --git a/docs/user-guide/docker-cli-to-kubectl.md b/docs/user-guide/docker-cli-to-kubectl.md index 4a5cf4fa377..7cc950c5c62 100644 --- a/docs/user-guide/docker-cli-to-kubectl.md +++ b/docs/user-guide/docker-cli-to-kubectl.md @@ -36,6 +36,7 @@ In this doc, we introduce the kubernetes command line to for interacting with th **Table of Contents** + - [kubectl for docker users](#kubectl-for-docker-users) - [docker run](#docker-run) - [docker ps](#docker-ps) diff --git a/docs/user-guide/images.md b/docs/user-guide/images.md index 848de4b818c..3e4ad1d018a 100644 --- a/docs/user-guide/images.md +++ b/docs/user-guide/images.md @@ -40,6 +40,7 @@ The `image` property of a container supports the same syntax as the `docker` com **Table of Contents** + - [Images](#images) - [Updating Images](#updating-images) - [Using a Private Registry](#using-a-private-registry) diff --git a/docs/user-guide/introspection-and-debugging.md b/docs/user-guide/introspection-and-debugging.md index 5385e1045a0..ad24260953d 100644 --- a/docs/user-guide/introspection-and-debugging.md +++ b/docs/user-guide/introspection-and-debugging.md @@ -38,6 +38,7 @@ your pods. But there are a number of ways to get even more information about you **Table of Contents** + - [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) diff --git a/docs/user-guide/managing-deployments.md b/docs/user-guide/managing-deployments.md index 53e250f9523..e5b06df7289 100644 --- a/docs/user-guide/managing-deployments.md +++ b/docs/user-guide/managing-deployments.md @@ -36,6 +36,7 @@ You’ve deployed your application and exposed it via a service. Now what? Kuber **Table of Contents** + - [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) diff --git a/docs/user-guide/persistent-volumes.md b/docs/user-guide/persistent-volumes.md index fcca240fcb3..6287c058362 100644 --- a/docs/user-guide/persistent-volumes.md +++ b/docs/user-guide/persistent-volumes.md @@ -36,6 +36,7 @@ This document describes the current state of `PersistentVolumes` in Kubernetes. **Table of Contents** + - [Persistent Volumes and Claims](#persistent-volumes-and-claims) - [Introduction](#introduction) - [Lifecycle of a volume and claim](#lifecycle-of-a-volume-and-claim) diff --git a/docs/user-guide/production-pods.md b/docs/user-guide/production-pods.md index 26e8c44ba56..f58710f6e16 100644 --- a/docs/user-guide/production-pods.md +++ b/docs/user-guide/production-pods.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [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) diff --git a/docs/user-guide/quick-start.md b/docs/user-guide/quick-start.md index fd6ab608084..e1310a94552 100644 --- a/docs/user-guide/quick-start.md +++ b/docs/user-guide/quick-start.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [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) diff --git a/docs/user-guide/replication-controller.md b/docs/user-guide/replication-controller.md index 8cf3a5b7d83..e85bd156e48 100644 --- a/docs/user-guide/replication-controller.md +++ b/docs/user-guide/replication-controller.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **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) diff --git a/docs/user-guide/secrets.md b/docs/user-guide/secrets.md index 4fc5e4cab6d..7a2df677da8 100644 --- a/docs/user-guide/secrets.md +++ b/docs/user-guide/secrets.md @@ -39,6 +39,7 @@ a docker image. See [Secrets design document](../design/secrets.md) for more inf **Table of Contents** + - [Secrets](#secrets) - [Overview of Secrets](#overview-of-secrets) - [Service Accounts Automatically Create and Use Secrets with API Credentials](#service-accounts-automatically-create-and-use-secrets-with-api-credentials) diff --git a/docs/user-guide/services.md b/docs/user-guide/services.md index 759ab65782c..34a16533c19 100644 --- a/docs/user-guide/services.md +++ b/docs/user-guide/services.md @@ -34,6 +34,7 @@ Documentation for other releases can be found at **Table of Contents** + - [Services in Kubernetes](#services-in-kubernetes) - [Overview](#overview) - [Defining a service](#defining-a-service) diff --git a/docs/user-guide/volumes.md b/docs/user-guide/volumes.md index adc1d0446bf..48143d2293c 100644 --- a/docs/user-guide/volumes.md +++ b/docs/user-guide/volumes.md @@ -43,6 +43,7 @@ Familiarity with [pods](pods.md) is suggested. **Table of Contents** + - [Volumes](#volumes) - [Background](#background) - [Types of Volumes](#types-of-volumes) diff --git a/docs/user-guide/walkthrough/README.md b/docs/user-guide/walkthrough/README.md index 42d2bdff5e2..e89d1cd2d8c 100644 --- a/docs/user-guide/walkthrough/README.md +++ b/docs/user-guide/walkthrough/README.md @@ -38,6 +38,7 @@ In order for the kubectl usage examples to work, make sure you have an examples **Table of Contents** + - [Kubernetes 101 - Kubectl CLI and Pods](#kubernetes-101---kubectl-cli-and-pods) - [Kubectl CLI](#kubectl-cli) - [Pods](#pods) diff --git a/docs/user-guide/walkthrough/k8s201.md b/docs/user-guide/walkthrough/k8s201.md index a66da4e5d03..6ecec4db843 100644 --- a/docs/user-guide/walkthrough/k8s201.md +++ b/docs/user-guide/walkthrough/k8s201.md @@ -40,6 +40,7 @@ In order for the kubectl usage examples to work, make sure you have an examples **Table of Contents** + - [Kubernetes 201 - Labels, Replication Controllers, Services and Health Checking](#kubernetes-201---labels-replication-controllers-services-and-health-checking) - [Labels](#labels) - [Replication Controllers](#replication-controllers)