Source File Structure
The source files for the Keptn documentation are stored in the same github repository as the source code. This page explains how the documentation source files are organized.
Note The structure of the documentation and the source code for the documentation is evolving. You may find small discrepencies between what is documented here and what is currently implemented.
Primary documentation set
The source for the Keptn Lifecycle Toolkit documentation is stored under the docs/content/en/docs directory in the repository.
The subdirectories correspond to the contents listed in the right frame. In the order they appear in the rendered docs, the subdirectories are:
- intro (Introduction to the Keptn Lifecycle Toolkit): A brief overview of Keptn, its features and use cases, and its history
- getting-started (Getting started): A hands-on exercise that demonstrates the capabilities of Keptn
- tutorials (Tutorials): Additional hands-on exercises to introduce new users to Keptn
- install (Installation and Upgrade): Requirements and instructions for installing and enabling Keptn
- operate (Operate Keptn): Guides about running and managing the Keptn cluster
- implementing (Implementing Keptn applications): This is currently a catch-all section for guides and how-to material about implementing Keptn features. It needs to be restructured and subdivided
- troubleshooting.md (Troubleshooting Guide): How to diagnose and solve common problems with Keptn
- architecture (Architecture): Information about how Keptn actually works
- crd-ref (API Reference): Comprehensive information about all the APIs that define the Keptn CRDs. This section is auto-generated from source code and should never be modified in the docs directory. The source for the authored text can be modified in the source code files for the APIs
- yaml-crd-ref (CRD Reference): Reference pages for the CRs that users must populate. This is a subset of the CRDs documented in the API Reference section
- migrate (Migrating to the Keptn Lifecycle Toolkit): Information to help users who are migrating to Keptn from Keptn v1
The source for the Contributing to Keptn guides (which are accessed from the Contributing tab on the documentation page) is stored under the docs/content/en/contribute directory.
The subdirectories correspond to the contents listed in the right frame. In the order they appear, the subdirectories are:
general (General information about contributing): Information that is applicable to all contributors, whether contributing software or documentation
software (Software contributions): Information that is specific to software contributions
docs (Documentation contributions): Information that is specific to documentation contributions.
We also have CONTRIBUTING.md files located in the home directory of the lifecycle-toolkit repository (general and software development information) and in the lifecycle-toolkit/docs directory (documentation development information only). These are the traditional locations for contributing information but the amount of content we have was making them unwieldy so we are in the process of moving most content from these files into the Contributing guide, leaving links to the various sections in the CONTRIBUTING.md guides.
All files in the directories are built
except for files that are explicitly
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
in the metadata section of _index.md, index.md,
and topic.md files that are located throughout the directory tree.
The metadata section of these files contains at least three fields. As an example, the metadata section for the Installation and upgrade section of the documentation includes the following fields:
--- title: Installation and Upgrade description: Learn how to install and upgrade the Keptn Lifecycle Toolkit weight: 30 ---
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 30 means that this section is displayed after sections that have weights of 29 and lower and before sections that have weights of 31 and higher. If two files have the same weight, their order is determined alphabetically, but this is a bad practice. When you create a new section or a new page, be sure to check the weight of the files that immediately precede and follow this file to be sure that you are not assigning the same weight to your new file.
The system for assigning weights for the docs landing page allows for maximum flexibility as we create new sections:
- General introductory material uses weight values under 100.
- Guide material about using specific Keptn features use weight value of 2**.
- Reference material uses weight values of 5**.
- Other documents use weight values of 7**.
Some other fields are sometimes used in the metadata, including:
- icon – optional field specifying an icon associated with the section
- layout – layout template to be used for rendering the section
- hidden – if set to
true, this page is not included in the documentation set that is built
- hidechildren – if set to
true, the listing in the right margin of subsections of this page is omitted. In most cases, that listing is a convenient navigational aid for the reader but it can be omitted in special cases.
You can use these fields if you need them but check the rendering carefully to ensure that they are playing out as they should.
Each subdirectory contains topical subdirectories for each chapter in that section. Each topical subdirectory may contain:
- An _index.md or index.md file that has the metadata discussed above plus the text for the section. If this is a subdirectory that contains subdirectories for other pages, the _index.md or index.md file contains introductory content 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.