Skip to content

Commit 827abe6

Browse files
authored
fix build and build errors (#452)
* typo in nav menu * missing app connect use-case * fix spell check * fix build script. cpell and link checker Signed-off-by: Brian Innes <binnes@uk.ibm.com> * fix cspell errors Signed-off-by: Brian Innes <binnes@uk.ibm.com> * fix broken links Signed-off-by: Brian Innes <binnes@uk.ibm.com> * added to documentation - code block info Signed-off-by: Brian Innes <binnes@uk.ibm.com>
1 parent 252543b commit 827abe6

File tree

8 files changed

+198
-55
lines changed

8 files changed

+198
-55
lines changed

build.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
#!/usr/bin/env sh
22

3-
cspell docs/**/**/*.md
3+
set -e
4+
5+
cspell "docs/**/*.md"
46
mkdocs build
7+
linkchecker -f linkcheckerrc public

docs/adopting/use-cases/gitops/gitops-ace.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,29 @@
11
# Install App Connect on an existing cluster using GitOps
22

3+
<!--- cSpell:ignore gitid kubeseal cntk -->
4+
35
_This is a work in progress, come back for updates._
46

57
Steps to install App Connect in an existing cluster using ArgoCD.
68

79
## Pre-requisites
10+
811
The following is required before proceeding to the next section.
912

1013
- Provision an OpenShift cluster.
1114
- IBM Cloud Pak Entitlement Key
1215

13-
1416
## Installation
17+
1518
1. Fork the [multi-tenancy-gitops](https://github.com/cloud-native-toolkit/multi-tenancy-gitops) repository and clone your fork.
16-
```bash
19+
20+
```shell
1721
git clone git@github.com:{gitid}/multi-tenancy-gitops.git
1822
```
1923

2024
1. Install the Red Hat OpenShift GitOps operator.
21-
```bash
25+
26+
```shell
2227
cd multi-tenancy-gitops
2328
2429
oc apply -f 2-services/operators/openshift-gitops/
@@ -27,14 +32,16 @@ The following is required before proceeding to the next section.
2732
1. Update your repository to reference your forked repository. Search and replace `cloud-native-toolkit` GithUb Org references with your {gitid}.
2833

2934
1. Create the bootstrap ArgoCD application.
30-
```bash
35+
36+
```shell
3137
oc apply -f bootstrap.yaml -n openshift-gitops
3238
```
3339

3440
1. Generate an encrypted Secret containing the IBM Entitlement Key using Sealed Secret Operator.
3541
- Install [kubeseal](https://github.com/bitnami-labs/sealed-secrets/blob/main/README.md) CLI.
3642
- Encrypt IBM Entitlement Key Secret.
37-
```bash
43+
44+
```shell
3845
NAMESPACE=tools
3946
IBM_ENTITLEMENT_KEY=<Entitlement Key>
4047
@@ -51,12 +58,14 @@ The following is required before proceeding to the next section.
5158
```
5259

5360
1. Apply the yaml manually or add to your gitops git repo to be deploy via ArgoCD.
54-
```bash
61+
62+
```shell
5563
oc apply -f enc-ibm-entitled-key-secret.yaml
5664
```
5765

5866
1. Verify the infrastructure and cluster wide resources under the `3-infra` folder are created successfully.
59-
```bash
67+
68+
```text
6069
3-infra/
6170
├── argocd-apps
6271
│   ├── consolelink.yaml
@@ -94,10 +103,12 @@ The following is required before proceeding to the next section.
94103
├── namespace.yaml
95104
└── operatorgroup.yaml
96105
```
106+
97107
![ArgoCD deployments of 3-infra](images/argocd-cntk-3-infra.png){.center}
98108

99109
1. Verify the operators and instances of custom resource definitions under the `2-services` folder are created successfully.
100-
```bash
110+
111+
```text
101112
2-services/
102113
├── active
103114
│   ├── instances
@@ -181,4 +192,5 @@ The following is required before proceeding to the next section.
181192
├── Chart.yaml
182193
└── values.yaml
183194
```
195+
184196
![ArgoCD deployments of 2-services](images/argocd-ace-2-services.png)
Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,43 @@
11
# Install the Cloud Native Toolkit on an existing cluster using GitOps
22

3+
<!--- cSpell:ignore gitorg YAMLs -->
4+
35
_This is a work in progress, come back for updates._
46

57
Steps to install the Cloud Native Toolkit in an existing OpenShift cluster using a declarative approach with ArgoCD.
68

7-
8-
99
## Pre-requisites
10+
1011
The following is required before proceeding to the next section.
1112

1213
- Provision an OpenShift cluster.
1314
- Install the `oc` and `git` cli.
14-
- Install the [Cloud Native Toolkit CLI](http://localhost:8000/learning/dev-setup.html#install-the-cloud-native-toolkit-command-line-interface-cli).
15-
15+
- Install the [Cloud Native Toolkit CLI](../../../learning/dev-setup.md#install-the-cloud-native-toolkit-command-line-interface-cli).
1616

1717
## Installation
18+
1819
1. Fork the [multi-tenancy-gitops](https://github.com/cloud-native-toolkit/multi-tenancy-gitops) repository and clone your fork.
19-
```bash
20+
21+
```shell
2022
git clone git@github.com:{gitorg}/multi-tenancy-gitops.git
2123

2224
cd multi-tenancy-gitops
2325
```
2426

25-
1. Update the cloned repository with your GitHub Organization.
27+
2. Update the cloned repository with your GitHub Organization.
2628
- Search and replace all instances of `github.com/cloud-native-toolkit/multi-tenancy-gitops.git` with `github.com/{gitorg}/multi-tenancy-gitops.git`.
2729
- Commit and push your changes to your fork.
28-
```bash
30+
31+
```shell
2932
git commit -m "Update github organization"
3033
git push origin master
3134
```
3235

3336
3. The gitops repository is structured into different layers (ie. `1-apps`, `2-services`, `3-infra`). Each layer is structured in a similar pattern consisting of the following:
3437
- The `argocd` folder contains a set of ArgoCD Application YAMLs.
3538
- The set of folder(s) in each layer contains the resource YAMLs which will be deployed.
36-
```bash
39+
40+
```shell
3741
tree . -L 2
3842
.
3943
├── 0-bootstrap
@@ -56,51 +60,60 @@ The following is required before proceeding to the next section.
5660
├── README.md
5761
└── bootstrap.yaml
5862
```
59-
- Each `argocd` folder contains an `active` and `inactive` sub-folder. For each layer, select the ArgoCD Appliation YAMLs to deploy and move them into the `active` folder.
60-
```bash
61-
1-apps/argocd/
62-
├── active
63-
└── inactive
64-
65-
2-services/argocd/
66-
├── active
67-
└── inactive
68-
69-
3-infra/argocd/
70-
├── active
71-
└── inactive
72-
```
63+
64+
- Each `argocd` folder contains an `active` and `inactive` sub-folder. For each layer, select the ArgoCD Application YAMLs to deploy and move them into the `active` folder.
65+
66+
```text
67+
1-apps/argocd/
68+
├── active
69+
└── inactive
70+
71+
2-services/argocd/
72+
├── active
73+
└── inactive
74+
75+
3-infra/argocd/
76+
├── active
77+
└── inactive
78+
```
79+
7380
- Commit and push your changes to your fork.
74-
```bash
75-
git commit -m "Update github organization"
76-
git push origin master
77-
```
7881

79-
1. Install the Red Hat OpenShift GitOps operator using the commands below or directly from the OpenShift Web Console. An instance of ArgoCD will automatically be created in the `openshift-gitops` namespace.
80-
```bash
82+
```shell
83+
git commit -m "Update github organization"
84+
git push origin master
85+
```
86+
87+
4. Install the Red Hat OpenShift GitOps operator using the commands below or directly from the OpenShift Web Console. An instance of ArgoCD will automatically be created in the `openshift-gitops` namespace.
88+
89+
```shell
8190
oc apply -f 2-services/operators/openshift-gitops/ -n openshift-operators
8291
```
92+
8393
- Verify you can log on to the ArgoCD Web Console.
84-
```
94+
95+
```shell
8596
# ArgoCD Web Console URL
8697
echo https://$(oc get route argocd-cluster-server -o jsonpath='{ .spec.host }' -n openshift-gitops)
8798
8899
# Admin password
89100
oc extract secret/argocd-cluster-cluster --to=- -n openshift-gitops
90101
```
91102

92-
1. Review and apply the custom ClusterRole permissions to the ArgoCD Application Controller service account. This is required for ArgoCD to create the required Kubernetes resources in target namespaces.
93-
```bash
103+
5. Review and apply the custom ClusterRole permissions to the ArgoCD Application Controller service account. This is required for ArgoCD to create the required Kubernetes resources in target namespaces.
104+
105+
```shell
94106
oc apply -f 3-infra/clusterrole/
95107
```
96108

97-
1. Create the bootstrap ArgoCD application.
109+
6. Create the bootstrap ArgoCD application.
98110
The bootstrap application will create the parent ArgoCD Application for each layer (YAMLs are located in `0-bootstrap` folder).
99111
The parent ArgoCD Applications will subsequently create the ArgoCD Applications in the `/argocd/active` directory.
100112

101113
Depending on what resources have been selected, it will take some time for the ArgoCD to deploy the resources.
102-
```bash
114+
115+
```shell
103116
oc apply -f bootstrap.yaml -n openshift-gitops
104117
```
105118

106-
1. From the OpenShift Web Console, verify the resources (ie, operators, namespaces, etc) have been successfully created and/or deployed.
119+
7. From the OpenShift Web Console, verify the resources (ie, operators, namespaces, etc) have been successfully created and/or deployed.

docs/contribute/documentation.md

Lines changed: 103 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# Updating the Developer Guide
22

3-
<!--- cSpell:ignore linkchecker linkcheckerrc mkdocs mkdoc -->
4-
3+
<!--- cSpell:ignore linkchecker linkcheckerrc mkdocs mkdoc linenums -->
54

65
## Setting up a documentation environment
76

@@ -42,8 +41,6 @@ To work on documentation and be able to view the rendered web site you need to c
4241
- To check links in the built site (`mkdocs build` must be run first), use the linkchecker, with command `npm run dev:links`. This command should be run in the root folder of the project, containing the **linkcheckerrc** file.
4342
- To check spelling `npm run dev:spell` should be run in the root folder of the project, containing the **cspell.json** file.
4443

45-
46-
4744
The developer guide is created using [MkDocs](http://mkdocs.org){: target="_blank" .external } with the [Materials theme](https://squidfunk.github.io/mkdocs-material/){: target="_blank" .external } theme.
4845

4946
MkDocs takes Markdown documents and turns them into a static website, that can be accessed from a filesystem or served from a web server.
@@ -273,13 +270,113 @@ The Admonitions supported by the Material theme are :
273270
!!! quote
274271
This is a quote
275272

273+
### Code blocks
274+
275+
Code blocks allow you to insert code or blocks of text in line or as a block.
276+
277+
To use inline you simply enclose the text using a single back quote **\`** character. So a command can be included using **\`oc get pods\`** and will create `oc get pods`
278+
279+
When you want to include a block of code you use a *fence*, which is 3 back quote character at the start and end of the block. After the opening quotes you should also specify the content type contained in the block.
280+
281+
**\`\`\` shell**
282+
**oc get pods**
283+
**\`\`\`**
284+
285+
which will produce:
286+
287+
``` shell
288+
oc get pods
289+
```
290+
291+
Notice that the block automatically gets the *copy to clipboard* link to allow easy copy and paste.
292+
293+
Every code block needs to identify the content. Where there is no content type, then **text** should be used to identify the content as plain text. Some of the common content types are shown in the table below. However, a full link of supported content types can be found [here](https://pygments.org/docs/lexers/){: target="_blank"}, where the short name in the documentation should be used.
294+
295+
| type | Content
296+
|------|--------
297+
| **shell** | Shell script content
298+
| **powershell** | Windows Power Shell content
299+
| **bat** | Windows batch file (.bat or .cmd files)
300+
| **json** | JSON content
301+
| **yaml** | YAML content
302+
| **markdown** or **md** | Markdown content
303+
| **java** | Java programming language
304+
| **javascript** or **js** | JavaScript programming language
305+
| **typescript** or **ts** | TypeScript programming language
306+
| **text** | Plain text content
307+
308+
#### Advanced highlighting of code blocks
309+
310+
There are some additional features available due to the highlight plugin installed in MkDocs. Full details can be found in the [MkDocs Materials documentation](https://squidfunk.github.io/mkdocs-material/reference/code-blocks/){: target=_blank}.
311+
312+
#### Line numbers
313+
314+
You can add line numbers to a code block with the **linenums** directive. You must specify the starting line number, 1 in the example below:
315+
316+
```` md
317+
``` javascript linenums="1"
318+
<script>
319+
document.getElementById("demo").innerHTML = "My First JavaScript";
320+
</script>
321+
```
322+
````
323+
324+
creates
325+
326+
``` javascript linenums="1"
327+
<script>
328+
document.getElementById("demo").innerHTML = "My First JavaScript";
329+
</script>
330+
```
331+
332+
!!!Info
333+
The line numbers do not get included when the copy to clipboard link is selected
334+
335+
#### Code highlighting
336+
337+
You can highlight specific lines of code using the **hl_lines** directive. The line numbers starts at 1 for the first line of code. If you want multiple lines highlighted, then provide the line numbers separated with a space. Below lines 1 and 3 are highlighted:
338+
339+
```` md
340+
``` javascript hl_lines="1 3"
341+
<script>
342+
document.getElementById("demo").innerHTML = "My First JavaScript";
343+
</script>
344+
```
345+
````
346+
347+
creates
348+
349+
``` javascript hl_lines="1 3"
350+
<script>
351+
document.getElementById("demo").innerHTML = "My First JavaScript";
352+
</script>
353+
```
354+
355+
It is possible to combine line number and highlighting. Below I start the line numbers at 10 and highlight the second line of code:
356+
357+
```` md
358+
``` javascript linenums="10" hl_lines="2"
359+
<script>
360+
document.getElementById("demo").innerHTML = "My First JavaScript";
361+
</script>
362+
```
363+
````
364+
365+
creates
366+
367+
``` javascript linenums="10" hl_lines="2"
368+
<script>
369+
document.getElementById("demo").innerHTML = "My First JavaScript";
370+
</script>
371+
```
372+
276373
### Redirects
277374

278-
To help external sites wanting to link to the documentation there are a number of vanity links maintained using the [redirect plugin](){: target=_blank}. The links are defined in the **mkdocs.yml** file and documented on the [Additional Resources](../resources/resources.md#linking-to-this-site){: target=_blank} page.
375+
To help external sites wanting to link to the documentation there are a number of vanity links maintained using the [redirect plugin](https://pypi.org/project/mkdocs-redirects/){: target=_blank}. The links are defined in the **mkdocs.yml** file and documented on the [Additional Resources](../resources/resources.md#linking-to-this-site){: target=_blank} page.
279376

280377
To ensure the auto-generated link page does not get reported by the link checker, an entry needs to be added to the **nofollow** section of the link checker config file, **linkcheckerrc** in the root directory of the project.
281378

282-
E.g. if a link /help was created then an entry in the nofollow section should be ```public/help.html$```.
379+
E.g. if a link **/help** was created then an entry in the nofollow section should be ```public/help.html$```.
283380

284381
## Spell checking
285382

@@ -304,4 +401,3 @@ here the words *linkchecker*, *linkcheckerrc*, *mkdocs* and *mkdoc* are specifie
304401
### Adding global words
305402

306403
The cSpell configuration file **cspell.json** contains a list of words that should always be considered valid when spell checking. The list of words applies to all files being checked.
307-

docs/reference/cli.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
## Invoking the CLI
66

7-
When the [CLI is installed](../learning/dev-setup.html#install-the-cloud-native-toolkit-command-line-interface-cli), it adds an executable named `igc` to the PATH. Running `igc --help` will list
7+
When the [CLI is installed](../learning/dev-setup.md#install-the-cloud-native-toolkit-command-line-interface-cli), it adds an executable named `igc` to the PATH. Running `igc --help` will list
88
the available commands. The output text will be similar to the following:
99

1010
```text

docs/resources/workshop/ai.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,4 @@
120120
- Select toolkit/gitops git repository
121121
![gitops](images/gitops.jpg){.center}
122122

123-
1. Congratulations you finished this lab, continue with lab [Promote an Application using CD with GitOps and ArgoCD](./cd)
123+
1. Congratulations you finished this lab, continue with lab [Promote an Application using CD with GitOps and ArgoCD](cd.md)

0 commit comments

Comments
 (0)