Contribute to this guide
Anyone can contribute to the best practices guide. The EKS Best Practices Guide is written in the AsciiDoc format on GitHub.
Summary for existing contributors
-
Open the
bpg-docs.code-workspace
with VS Code to automatically install the AsciiDoc extension. -
Learn more about the AsciiDoc Extension
on the Visual Studio Marketplace.
-
-
The source files for the AWS Docs website are stored in
latest/bpg
-
The syntax is highly similar to markdown.
-
Review the Syntax Reference
in the AsciiDoctor docs.
-
-
The docs platform only deploys
latest/bpg/images
. Each of the guide sections has a symbolic link back to this directory. For example,latest/bpg/networking/images
points tolatest/bpg/images
.
Setup a local editing environment
If you plan to edit the guide frequently, setup a local editing environment.
Fork and clone the repo
You need to be familiar with git
, github
, and text editors. For information on getting started with git
and github
, see Getting started with your GitHub account
-
View the EKS Best Practices Guide on GitHub
. -
Create a fork of the project repo. Learn how to fork a repository
in the GitHub docs. -
Clone your fork of the project repo. Learn how to clone your forked repository
.
Open the VS Code Workspace
AWS recommends using Visual Studio Code from Microsoft to edit the guide. For more information about VS Code, see Download Visual Studio Code
-
Open VS Code.
-
Open the
bpg-docs.code-workspace
file from the cloned repo. -
If this is your first time opening this workspace, accept the prompt to install the AsciiDoc extension. This extension checks the syntax of AsciiDoc files and generates a live preview.
-
Browse to the
latest/bpg
directory. This directory holds the source files that deploy to the AWS documentation site. The source files are organized by guide section, such as "security" or "networking".
Edit a file
-
Open a file in the editor.
-
View the AsciiDoc Syntax to learn how to create headings, links, and lists.
-
You can use Markdown syntax to format text, create lists, and headings. You cannot use Markdown syntax to create links.
-
-
Open a live preview of the page.
-
First, press
ctrl-k
orcmd-k
(depending on keyboard). Second, pressv
. This opens a preview in split view.
-
AWS suggests using feature branches to organize your changes. Learn how to create branches with git.
Submit a Pull Request
You can create a pull request from the GitHub website or the GitHub cli.
Learn how to create a pull request from a fork
Learn how to create a pull request
Use the github.dev web-based editor
The github.dev
web-based editor is based on VS Code. This is a great way to edit multiple files and preview content without any setup.
It has support for the AsciiDoc extension. You can do git operations by using the GUI. The web-based editor does not have a shell or terminal for running commands.
You must have a GitHub account. You will be prompted to login if required.
🚀 Launch the GitHub web-based editor.
Edit a single page
You can rapidly update individual pages by using GitHub. Each page contains an "📝 Edit this page on GitHub" link at the bottom.
-
Navigate to the page in this guide you want to edit
-
Click the "Edit this page on GitHub" link at the bottom
-
Click the edit pencil icon on the top right of the GitHub file viewer, or press
e
-
Edit the file
-
Submit your changes using the "Commit changes…" button. This button creates a GitHub pull request. The guide maintainers will review this pull request. A reviewer will approve the pull request, or request changes.
View and set the ID for a page
This page explains how to view and set page ID.
The page ID is a unique string that identifies each page on the documentation site. You can view the page ID in the address bar of your browser when you’re on a specific page. The page ID is used for the URL, the filename, and to create cross-reference links.
For example, if you’re viewing this page, the URL in your browser’s address bar will look similar to:
https://docs.aws.amazon.com/view-set-page-id.html
The last part of the URL (view-set-page-id
) is the page ID.
Set the page ID
When creating a new page, you need to set the page ID in the source file. The page ID should be a concise, hyphenated string that describes the page content.
-
Open the source file for your new page in a text editor.
-
At the top of the file, add the following line. It should be above the first heading.
[#my-new-page]
Replace
my-new-page
with the page ID for your new page. -
Save the file.
Note
Page IDs must be unique across the entire documentation site. If you try to use an existing page ID, you’ll get a build error.
Create a new page
Learn how create a new page and update the guide table of contents.
Create page metadata
-
Determine the page title, and page short title. The page short title is optional, but recommended if the page title is more than a few words.
-
Determine the ID of the page. This must be unique within the EKS Best Practices Guide. The convention is to use all lowercase, and separate words with
-
. -
Create a new asciidoc file, in a folder if needed, and add the following text to the file:
[."topic"] [#<page-id>] = <page-title> :info_titleabbrev: <page-short-title>
For example,
[."topic"] [#scalability] = EKS Scalability best practices :info_titleabbrev: Scalability
Add to table of contents
-
Open the file for the parent page in the table of contents. For new top level guide sections, the parent file is
book.adoc
. -
At the bottom of the parent file, update and insert the following directive:
include::<new-filename>[leveloffset=+1]
For Example,
include::dataplane.adoc[leveloffset=+1]
Insert an image
-
Find the image prefix for the page you are editing. Review the
:imagesdir:
property in the heading of the file. For examples,`:imagesdir: images/reliability/
-
Place your image in this path, such as
latest/bpg/images/reliability
-
Determine appropriate alt-text for you image. Write a short high-level description of the image. For example, "diagram of VPC with three availability zones" is appropriate alt-text.
-
Update the following example with the alt-text and image filename. Insert at the desired location.
image::<image-filename>[<image-alt-text>]
For example,
image::eks-data-plane-connectivity.jpeg[Network diagram]
Check style with Vale
-
Run
vale sync
-
Install the Vale Extension
from the Visual Studio Marketplace. -
Restart VS Code, and open an AsciiDoc file
-
VS Code underlines problematic text. Learn how to work with Errors and Warnings
in the VS Code docs.
Build a local preview
-
Install the
asciidoctor
tool usingbrew
on Linux or MacOS-
Learn how to install asciidoctor cli
in the AsciiDoctor docs. -
Learn how install the brew package manager
.
-
-
Open a terminal, and navigate to
latest/bpg/
-
Run
asciidoctor book.adoc
-
Review any syntax warnings and errors
-
-
Open the
book.html
output file.-
On MacOS, you can run
open book.html
to open the preview in your default browser.
-
AsciiDoc Cheat Sheet
Basic Formatting
*bold text*
_italic text_
`monospace text`
Headers
= Document Title (Header 1)
== Header 2
=== Header 3
==== Header 4
===== Header 5
====== Header 6
Lists
Unordered Lists:
- Item 1
- Item 2
-- Subitem 2.1
-- Subitem 2.2
- Item 3
Ordered Lists:
. First item
. Second item
.. Subitem 2.1
.. Subitem 2.2
. Third item
Links
External link: https://example.com[Link text]
Internal link: <<page-id>>
Internal link: xref:page-id[Link text]
Images
image::image-file.jpg[Alt text]
Code Blocks
[source,python]
----
def hello_world():
print("Hello, World!")
----
Tables
Learn how to build a basic table.
[cols="1,1"]
|===
|Cell in column 1, row 1
|Cell in column 2, row 1
|Cell in column 1, row 2
|Cell in column 2, row 2
|Cell in column 1, row 3
|Cell in column 2, row 3
|===
Admonitions
NOTE: This is a note admonition.
WARNING: This is a warning admonition.
TIP: This is a tip admonition.
IMPORTANT: This is an important admonition.
CAUTION: This is a caution admonition.
Preview:
Note
This is a note admonition.
Includes
include::filename.adoc[]