Skip to content

Add add-repo doc #1443

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 26, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/_docset.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
project: 'doc-builder'

Check notice on line 1 in docs/_docset.yml

View workflow job for this annotation

GitHub Actions / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.

Check notice on line 1 in docs/_docset.yml

View workflow job for this annotation

GitHub Actions / build

Irregular whitespace character detected: U+2009 (Thin Space). This may impair Markdown rendering.
max_toc_depth: 2
# indicates this documentation set is not linkable by assembler.
# relaxes a few restrictions around toc building and file placement
Expand Down Expand Up @@ -31,6 +31,7 @@
- file: on-the-web.md
- file: move.md
- file: redirects.md
- file: add-repo.md
- folder: migration
children:
- file: index.md
Expand Down
83 changes: 83 additions & 0 deletions docs/contribute/add-repo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# Add a new repository to the docs

Elastic documentation is built from many assembled repositories using `docs-assembler`. Adding a new repository requires making the assembly process aware of its existence.

Follow these instructions to add a new docs repository.

## Prerequisites

The new docs repository needs to satisfy these requirements:

- The repository must have a `docs` folder in the root.
- The `docs` folder must contain a valid [`docset.yml` file](../configure/content-set/navigation.md) and Markdown files.
- Markdown files within the `docs` folder that follow the V3 format. Refer to [Syntax](../syntax/index.md).
- The repository must be within the Elastic organization on `GitHub` and public.

## Add the repository

Follow these instructions to add a new repository to the docs.

:::::{stepper}

::::{step} Add the repo to docs-infra

Add the repo to the list of repositories that can upload to the Link index by editing the [repositories.yml](https://github.com/elastic/docs-infra/blob/main/modules/aws-github-actions-oidc-roles/repositories.yml) file.

For example, to add the fictitious `elastic/yadda-docs` repository:

```yaml
repositories:
- name: elastic/yadda-docs # Added for testing purposes
```

::::

::::{step} Add the workflow actions to the repository

Add the following actions to the `.github/workflows` directory of your repo:

- https://github.com/elastic/docs-builder/blob/main/.github%2Fworkflows%2Fpreview-build.yml
- https://github.com/elastic/docs-builder/blob/main/.github/workflows/preview-cleanup.yml

Then, successfully run a docs build on the `main` branch. This is a requirement. For example, you can merge a docs pull request to `main` after adding the workflow actions.

::::

::::{step} Add the repository to the assembler and navigation configs

Edit the [assembler.yml](https://github.com/elastic/docs-builder/blob/main/src/tooling/docs-assembler/assembler.yml) file to add the repository. Refer to [assembler.yml](../configure/site/content.md) for more information.

For example, to add the `elastic/yadda-docs` repository:

```yaml
references:
yadda-docs:
```

Then, edit the [navigation.yml](https://github.com/elastic/docs-builder/blob/main/src/tooling/docs-assembler/navigation.yml) file to add the repository to the navigation.

For example, to add the `elastic/yadda-docs` repository under **Reference**:

```yaml
#############
# REFERENCE #
#############
- toc: reference
path_prefix: reference
children:
# Yadda
# ✅ https://github.com/elastic/yadda-docs/blob/main/docs/toc.yml
- toc: yadda-docs://
path_prefix: reference/yadda
```

::::
:::::

## Add .artifacts to .gitignore

For a more comfortable local `docs-builder` experience, add the following line to the `.gitignore` file of the repo:

```
docs/.artifacts
```
Loading