Skip to content

Commit

Permalink
Merge branch 'main' into patch-5
Browse files Browse the repository at this point in the history
  • Loading branch information
mowies authored Jun 12, 2023
2 parents 1348bab + c97b4b9 commit 9b06901
Show file tree
Hide file tree
Showing 7 changed files with 196 additions and 151 deletions.
26 changes: 26 additions & 0 deletions .github/scripts/generate-latest-doc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash

# Keptn Lifecycle Toolkit Documentation generation
#
# This script supports the release of the latest version of the documentation
# The final files are available under the docs/release folder

SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
ROOT_DIR=${SCRIPT_DIR/.github\/scripts/}
DOC_DIR="${ROOT_DIR}docs"
WORK_DIR=${DOC_DIR}/release

## Create the working folder
mkdir -p $WORK_DIR

cd $WORK_DIR

## Download the latest status of the main documentation
git clone https://github.com/keptn/lifecycle-toolkit.git
cd lifecycle-toolkit
git checkout page
git pull

## Rewrite with the current content
cp -r "${DOC_DIR}/content/en/docs" ./docs/content/en

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ manifests/
## Kubebuilder
**/kubebuilder
/docs/tmp/
/docs/release/
/docs/.hugo_build.lock
/docs/resources/_gen
/docs/public
Expand Down
98 changes: 4 additions & 94 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,103 +54,13 @@ and generating manifests.
* [**Helm**](https://helm.sh/): a package manager for Kubernetes that
simplifies the deployment and management of applications on a Kubernetes cluster.

## [Related Technologies](docs/content/en/contribute/general/technologies/_index.md)

## Linters requirements

This project uses a set of linters to ensure good code quality.
In order to make proper use of those linters inside an IDE,
the following configuration is required.

### Golangci-lint

Further information can also be found in
the [`golangci-lint` documentation](https://golangci-lint.run/usage/integrations/).

#### Visual Studio Code

In Visual Studio Code the
[Golang](https://marketplace.visualstudio.com/items?itemName=aldijav.golangwithdidi)
extension is required.

Adding the following lines to the `Golang` extension
configuration file enables all linters used in this project.

```json
"go.lintTool": {
"type": "string",
"default": "golangci-lint",
"description": "GolangGCI Linter",
"scope": "resource",
"enum": [
"golangci-lint",
]
},
"go.lintFlags": {
"type": "array",
"items": {
"type": "string"
},
"default": ["--fast", "--fix"],
"description": "Flags to pass to GCI Linter",
"scope": "resource"
},
```

#### GoLand / IntelliJ requirements

* Install either the **GoLand** or **IntelliJ** Integrated Development Environment
(IDE) for the Go programming language, plus the [Go Linter](https://plugins.jetbrains.com/plugin/12496-go-linter) plugin.

* The plugin can be installed via `Settings` >> `Plugins` >> `Marketplace`,
search for `Go Linter` and install it.
Once installed, make sure that the plugin is using the `.golangci.yml`
file from the root directory.

* The configuration of `Go Linter` can be found in the `Tools` section
of the settings.

If you are on Windows, you need to install **make** for the above process to complete.

> **Note**
When using the make command on Windows, you may receive an `unrecognized command` error for a command that is installed.
This usually indicates that `PATH` for the binary is not set correctly).

### Markdownlint

We are using [markdownlint](https://github.com/DavidAnson/markdownlint) to ensure consistent styling
within our Markdown files.
Specifically we are using [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli).

We are using `GNU MAKE` to ensure the same functionality locally and within our CI builds.
This should allow easier debugging and problem resolution.

#### Markdownlint execution

To verify that your markdown code conforms to the rules, run the following on your local branch:

```shell
make markdownlint
```

To use the auto-fix option, run:

```shell
make markdownlint-fix
```

#### Markdownlint Configuration

We use the default configuration values for `markdownlint`.
## Related Technologies

This means:
Please check [Related Technologies](docs/content/en/contribute/general/technologies/_index.md).

* [.markdownlint.yaml](./.markdownlint.yaml) contains the rule configuration
* [.markdownlintignore](./.markdownlintignore) list files that markdown-lint ignores, using `.gitignore` conventions
## Linter Requirements

We use the default values, so tools like
[markdownlint for VSCode](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
can be used without additional configuration.
Please check [Linter Requirements](docs/content/en/contribute/docs/linter-requirements/_index.md).

## Submit a Pull Request 🚀

Expand Down
58 changes: 2 additions & 56 deletions docs/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -389,63 +389,9 @@ If you've pushed your changes to GitHub already you'll need to force push your b
* <https://code.asam.net/simulation/wiki/-/wikis/docs/project_guidelines/ASAM-DCO?version_id=c510bffb1195dc04deb9db9451112669073f0ba5>
* <https://thesofproject.github.io/latest/contribute/contribute_guidelines.html>

## Source file structure
## Source File Structure

The source files for the [Keptn Lifecycle Toolkit](https://lifecycle.keptn.sh/docs) are stored under
the *docs/content/en/docs* directory in the repository.
The build strategy is to build everything except for files that are explicitly ignored
and files that include the `hidden: true` string in the file's metadata section

The order in which the files are displayed is determined by the value of the `weight` field
in the metadata section of *_index.md* and *index.md* files located throughout the directory tree.

The metadata section of these files contains at least three fields.
As an example, the metadata section for the *Concepts* section of the documentation includes the following fields:

```yaml
title: Concepts
description: Learn about underlying concepts of the keptn lifecycle toolkit.
icon: concepts
layout: quickstart
weight: 50
```
The meaning of these fields is:
* **title** -- title displayed for the section or file
* **description** -- subtext displayed for the section or subsection
* **weight** -- order in which section or subsection is desplayed relative to other sections and
subsections at the same level.
In this case, the weight of 50 means that this section is displayed
after sections that have weights of 49 and lower
and before sections that have weights of 51 and higher.
If two files have the same weight,
their order is determined alphabetically,
but this is a bad practice.
Some other fields are sometimes used in the metadata.
### Top level structure
The current tools do not support versioning.
To work around this limitation, the docs are arranged with some general topics that generally apply to all releases and
then subsections for each release that is currently supported.
The system for assigning weights for the docs landing page is:
* General introductory material uses weight values under 100.
* Sections for individual releases use weight values of 9**.
* Sections for general but advanced info use weight value of 1***.
### Subdirectory structure
Each subdirectory contains topical subdirectories for each chapter in that section.
Each topical subdirectory contains:
* An *index.md* file that has the metadata discussed above plus the text for the section
* An *assets* subdirectory where graphical files for that topic are stored.
No *assets* subdirectory is present if the topic has no graphics.
Please check [Source File Structure](content/en/contribute/docs/source-file-structure/_index.md)..

## Guidelines for working on documentation in development versus already released documentation

Expand Down
2 changes: 1 addition & 1 deletion docs/config/_default/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,5 @@ menu:
- name: Keptn v1
params:
rel: external
url: https://keptn.sh/
url: https://v1.keptn.sh/
weight: 1
101 changes: 101 additions & 0 deletions docs/content/en/contribute/docs/linter-requirements/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
---
title: Linter Requirements
description: To maintain optimal code quality, this project employs linters which require a specific IDE configuration for effective utilization.
weight: 400
---

## Linter Requirements

This project uses a set of linters to ensure good code quality.
In order to make proper use of those linters inside an IDE,
the following configuration is required.

### Golangci-lint

Further information can also be found in
the [`golangci-lint` documentation](https://golangci-lint.run/usage/integrations/).

#### Visual Studio Code

In Visual Studio Code the
[Golang](https://marketplace.visualstudio.com/items?itemName=aldijav.golangwithdidi)
extension is required.

Adding the following lines to the `Golang` extension
configuration file enables all linters used in this project.

```json
"go.lintTool": {
"type": "string",
"default": "golangci-lint",
"description": "GolangGCI Linter",
"scope": "resource",
"enum": [
"golangci-lint",
]
},
"go.lintFlags": {
"type": "array",
"items": {
"type": "string"
},
"default": ["--fast", "--fix"],
"description": "Flags to pass to GCI Linter",
"scope": "resource"
},
```

#### GoLand / IntelliJ requirements

* Install either the **GoLand** or **IntelliJ** Integrated Development Environment
(IDE) for the Go programming language, plus the [Go Linter](https://plugins.jetbrains.com/plugin/12496-go-linter) plugin.

* The plugin can be installed via `Settings` >> `Plugins` >> `Marketplace`,
search for `Go Linter` and install it.
Once installed, make sure that the plugin is using the `.golangci.yml`
file from the root directory.

* The configuration of `Go Linter` can be found in the `Tools` section
of the settings.

If you are on Windows, you need to install **make** for the above process to complete.

> **Note**
When using the make command on Windows, you may receive an `unrecognized command` error for a command that is installed.
This usually indicates that `PATH` for the binary is not set correctly).

### Markdownlint

We are using [markdownlint](https://github.com/DavidAnson/markdownlint) to ensure consistent styling
within our Markdown files.
Specifically we are using [markdownlint-cli](https://github.com/igorshubovych/markdownlint-cli).

We are using `GNU MAKE` to ensure the same functionality locally and within our CI builds.
This should allow easier debugging and problem resolution.

#### Markdownlint execution

To verify that your markdown code conforms to the rules, run the following on your local branch:

```shell
make markdownlint
```

To use the auto-fix option, run:

```shell
make markdownlint-fix
```

#### Markdownlint Configuration

We use the default configuration values for `markdownlint`.

This means:

[.markdownlint-cli2.yaml](https://github.com/keptn/lifecycle-toolkit/blob/main/.markdownlint-cli2.yaml)
contains the rule configuration

We use the default values, so tools like
[markdownlint for VSCode](https://marketplace.visualstudio.com/items?itemName=DavidAnson.vscode-markdownlint)
can be used without additional configuration.
61 changes: 61 additions & 0 deletions docs/content/en/contribute/docs/source-file-structure/_index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: Source File Structure
description: Structure source files with Metadata
weight: 400
---

The source files for the [Keptn Lifecycle Toolkit](https://lifecycle.keptn.sh/docs) are stored under
the *docs/content/en/docs* directory in the repository.
The build strategy is to build everything except for files that are explicitly ignored
and files that include the `hidden: true` string in the file's metadata section

The order in which the files are displayed is determined by the value of the `weight` field
in the metadata section of *_index.md* and *index.md* files located throughout the directory tree.

The metadata section of these files contains at least three fields.
As an example, the metadata section for the *Concepts* section of the documentation includes the following fields:

```yaml
title: Concepts
description: Learn about underlying concepts of the keptn lifecycle toolkit.
icon: concepts
layout: quickstart
weight: 50
```
The meaning of these fields is:
* **title** -- title displayed for the section or file
* **description** -- subtext displayed for the section or subsection
* **weight** -- order in which section or subsection is displayed relative to other sections and
subsections at the same level.
In this case, the weight of 50 means that this section is displayed
after sections that have weights of 49 and lower
and before sections that have weights of 51 and higher.
If two files have the same weight,
their order is determined alphabetically,
but this is a bad practice.
Some other fields are sometimes used in the metadata.
### Top level structure
The current tools do not support versioning.
To work around this limitation, the docs are arranged with some general topics that generally apply to all releases and
then subsections for each release that is currently supported.
The system for assigning weights for the docs landing page is:
* General introductory material uses weight values under 100.
* Sections for individual releases use weight values of 9**.
* Sections for general but advanced info use weight value of 1***.
### Subdirectory structure
Each subdirectory contains topical subdirectories for each chapter in that section.
Each topical subdirectory contains:
* An *index.md* file that has the metadata discussed above plus the text for the section
* An *assets* subdirectory where graphical files for that topic are stored.
* No *assets* subdirectory is present if the topic has no graphics.

0 comments on commit 9b06901

Please sign in to comment.