Skip to content

Commit 92164bb

Browse files
authored
Merge pull request #858 from CecileRobertMichon/netlify-book
πŸ“– Add Netlify book configuration
2 parents d1d3090 + ec590aa commit 92164bb

25 files changed

+900
-2
lines changed

β€Ždocs/book/Makefileβ€Ž

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Copyright 2020 The Kubernetes Authors.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
# Directories.
16+
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
17+
TOOLS_DIR := ../../hack/tools
18+
TOOLS_BIN_DIR := $(TOOLS_DIR)/bin
19+
BIN_DIR := bin
20+
21+
# Binaries.
22+
TABULATE := $(TOOLS_BIN_DIR)/mdbook-tabulate
23+
$(TABULATE): $(TOOLS_DIR)/go.mod
24+
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-tabulate ./mdbook/tabulate
25+
26+
EMBED := $(TOOLS_BIN_DIR)/mdbook-embed
27+
$(EMBED): $(TOOLS_DIR)/go.mod
28+
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-embed ./mdbook/embed
29+
30+
RELEASELINK := $(TOOLS_BIN_DIR)/mdbook-releaselink
31+
$(RELEASELINK): $(TOOLS_DIR)/go.mod
32+
cd $(TOOLS_DIR); go build -tags=tools -o $(BIN_DIR)/mdbook-releaselink ./mdbook/releaselink
33+
34+
.PHONY: serve
35+
serve:
36+
mdbook serve

β€Ždocs/book/OWNERSβ€Ž

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# See the OWNERS docs at https://go.k8s.io/owners
2+
3+
reviewers:
4+
- cluster-api-azure-maintainers
5+
- cluster-api-azure-reviewers

β€Ždocs/book/book.tomlβ€Ž

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
[book]
2+
authors = ["The Cluster API Provider Azure Maintainers"]
3+
language = "en"
4+
multilingual = false
5+
src = "src"
6+
title = "The Cluster API Provider Azure Book"
7+
8+
[output.html]
9+
curly-quotes = true
10+
git-repository-url = "https://sigs.k8s.io/cluster-api-provider-azure"
11+
12+
[preprocessor.tabulate]
13+
command = "./util-tabulate.sh"
14+
15+
[preprocessor.embed]
16+
command = "./util-embed.sh"
17+
18+
[preprocessor.releaselink]
19+
command = "./util-releaselink.sh"
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#!/bin/bash
2+
3+
# Copyright 2020 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
set -o errexit
18+
set -o nounset
19+
set -o pipefail
20+
21+
KUBE_ROOT=$(dirname "${BASH_SOURCE[0]}")/../..
22+
cd "${KUBE_ROOT}" || exit 1
23+
24+
os=$(go env GOOS)
25+
arch=$(go env GOARCH)
26+
27+
# translate arch to rust's conventions (if we can)
28+
if [[ ${arch} == "amd64" ]]; then
29+
arch="x86_64"
30+
elif [[ ${arch} == "x86" ]]; then
31+
arch="i686"
32+
fi
33+
34+
# translate os to rust's conventions (if we can)
35+
ext="tar.gz"
36+
cmd="tar -C /tmp -xzvf"
37+
case ${os} in
38+
windows)
39+
target="pc-windows-msvc"
40+
ext="zip"
41+
cmd="unzip -d /tmp"
42+
;;
43+
darwin)
44+
target="apple-darwin"
45+
;;
46+
linux)
47+
# works for linux, too
48+
target="unknown-${os}-gnu"
49+
;;
50+
*)
51+
target="unknown-${os}"
52+
;;
53+
esac
54+
55+
# grab mdbook
56+
# we hardcode linux/amd64 since rust uses a different naming scheme
57+
echo "downloading mdBook-v0.3.1-${arch}-${target}.${ext}"
58+
set -x
59+
curl -sL -o /tmp/mdbook.${ext} "https://github.com/rust-lang-nursery/mdBook/releases/download/v0.3.1/mdBook-v0.3.1-${arch}-${target}.${ext}"
60+
${cmd} /tmp/mdbook.${ext}
61+
chmod +x /tmp/mdbook
62+
63+
# Finally build the book.
64+
(cd docs/book && /tmp/mdbook build)

β€Ždocs/book/src/SUMMARY.mdβ€Ž

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Summary
2+
3+
[Introduction](./introduction.md)
4+
- [Topics](./topics/topics.md)
5+
- [Cloud Provider Config](./topics/cloud-provider-config.md)
6+
- [Custom Images](./topics/custom-images.md)
7+
- [Data Disks](./topics/data-disks.md)
8+
- [Ephemeral OS](./topics/ephemeral-os.md)
9+
- [External Cloud Provider](./topics/external-cloud-provider.md)
10+
- [Failure Domains](./topics/failure-domains.md)
11+
- [Identity](./topics/identity.md)
12+
- [Machine Pools (VMSS)](./topics/machinepools.md)
13+
- [Managed Clusters (AKS)](./topics/managedcluster.md)
14+
- [Spot Virtual Machines](./topics/spot-vms.md)
15+
- [Virtual Networks](./topics/custom-vnet.md)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{{#include ../../../README.md}}
File renamed without changes.
File renamed without changes.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Custom Vnets
1+
# Custom Virtual Networks
22

33
## Pre-existing vnet and subnets
44

File renamed without changes.

0 commit comments

Comments
Β (0)