Skip to content
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

Update docs guide #29

Merged
merged 8 commits into from
May 22, 2024
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
2 changes: 1 addition & 1 deletion docs/configure/google-analytics.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The plugins are installed by default in this template repository.

## Set up Google Tag Manager and GTag

Join the [**#documentation**](https://consensys.slack.com/archives/C0272B5P1CY) channel on ConsenSys
Join the [**#documentation**](https://consensys.slack.com/archives/C0272B5P1CY) channel on Consensys
Slack and request your Google Analytics tags.
Provide information about your project in your request.

Expand Down
4 changes: 2 additions & 2 deletions docs/configure/search.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ sidebar_position: 2
Docusaurus has [official support for Algolia](https://docusaurus.io/docs/search#using-algolia-docsearch)
as the primary method of integrating search into documentation.

ConsenSys has an [open-source account](https://docsearch.algolia.com/docs/who-can-apply/) with
Consensys has an [open-source account](https://docsearch.algolia.com/docs/who-can-apply/) with
[Algolia](https://www.algolia.com/) to hold the indexes for our documentation, but it's limited to
only open-source projects (not just the docs but also the originating source code).
If your project doesn't have any source code (general guidelines or tutorials), then it satisfies
Expand All @@ -22,7 +22,7 @@ and [closed-source](#source-code-is-not-open-source) projects.

Follow these steps to configure Algolia in your project:

1. Join the [**#documentation**](https://consensys.slack.com/archives/C0272B5P1CY) channel on ConsenSys
1. Join the [**#documentation**](https://consensys.slack.com/archives/C0272B5P1CY) channel on Consensys
Slack and ask for Algolia search integration for your doc site.
Provide details of your project so we can determine whether you're eligible for the Algolia account.

Expand Down
2 changes: 1 addition & 1 deletion docs/configure/versioning/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ presets: [
docs: {
sidebarPath: require.resolve("./sidebars.js"),
// Set a base path separate from default /docs
editUrl: "https://github.com/ConsenSys/doc.teku/tree/master/",
editUrl: "https://github.com/consensys/doc.teku/tree/master/",
routeBasePath: "/",
path: "./docs",
includeCurrentVersion: true,
Expand Down
12 changes: 6 additions & 6 deletions docs/contribute/add-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import TabItem from '@theme/TabItem';

# Add images

You can add [screenshots](#screenshots) and [diagrams](#diagrams) to the ConsenSys documentation.
You can add [screenshots](#screenshots) and [diagrams](#diagrams) to the Consensys documentation.

Add your image to an `assets` or `images` folder within the documentation folder, and link to it in
your doc content using [Markdown syntax](https://docusaurus.io/docs/markdown-features/assets#images).
Expand Down Expand Up @@ -42,8 +42,8 @@ For example:

## Screenshots

Follow the [Rackspace screenshot guidelines](https://docs.rackspace.com/docs/style-guide/screenshots/screenshot-guidelines)
when adding screenshots to the ConsenSys docs.
Follow the [Archbee screenshot guidelines](https://www.archbee.com/blog/screenshots-in-technical-documentation)
when adding screenshots to the Consensys docs.

You might need to re-size your screenshots to make them easy to view and to minimize the file size
for faster page loading:
Expand All @@ -53,8 +53,8 @@ for faster page loading:

## Diagrams

ConsenSys doc sites contain diagrams created using [Figma](https://figma.com/).
You must have access to the ConsenSys **Quorum Diagrams** template files on Figma to create a diagram.
Consensys doc sites contain diagrams created using [Figma](https://figma.com/).
You must have access to the Consensys **Quorum Diagrams** template files on Figma to create a diagram.

Diagrams can illustrate:

Expand All @@ -72,7 +72,7 @@ The following video demonstrates creating a diagram for the GoQuorum documentati

### Create your Figma diagram

Use the following general guidelines when creating ConsenSys diagrams on Figma.
Use the following general guidelines when creating Consensys diagrams on Figma.
Refer to the [Figma help website](https://help.figma.com/hc/en-us) for more information on getting started with Figma,
Figma design elements, and more.

Expand Down
96 changes: 65 additions & 31 deletions docs/contribute/format-markdown.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Guidelines for formatting Markdown help writers and reviewers navigate the docum
and review changes.
They also ensure that Markdown features render properly on the doc site.

Refer to the following guidelines when formatting Markdown in ConsenSys docs.
Refer to the following guidelines when formatting Markdown in Consensys docs.

:::tip note
The Markdown syntax for [admonitions](#admonitions) and [tabs](#tabs) is specific to Docusaurus.
Expand Down Expand Up @@ -159,14 +159,10 @@ sign data using an unsupported method, in which case we recommend using your sta
</TabItem>
</Tabs>

## Code blocks
## Code samples

Use [code blocks](https://docusaurus.io/docs/markdown-features/code-blocks) to present code samples.

:::tip
Remember to provide [developer-friendly code samples](style-guide.md#3-write-for-developers).
:::

A basic code block uses triple back ticks (`` ` ``) and the language name to enable
[syntax highlighting](https://docusaurus.io/docs/markdown-features/code-blocks#syntax-highlighting).
For example:
Expand All @@ -177,8 +173,8 @@ For example:

````markdown
```javascript
if (typeof window.ethereum !== 'undefined') {
console.log('MetaMask is installed!');
if (typeof window.ethereum !== "undefined") {
console.log("MetaMask is installed!");
}
```
````
Expand All @@ -187,71 +183,109 @@ if (typeof window.ethereum !== 'undefined') {
<TabItem value="Rendered" label="Rendered">

```javascript
if (typeof window.ethereum !== 'undefined') {
console.log('MetaMask is installed!');
if (typeof window.ethereum !== "undefined") {
console.log("MetaMask is installed!");
}
```

</TabItem>
</Tabs>

## Tabs
### Code sample style guide

Make sure to provide developer-friendly code samples.
The following are some rules used throughout the Consensys docs:

- Use double quotes (`"`) instead of single quotes (`'`).
- Indent lines using two spaces instead of four.
- Write code samples that can be easily copied and pasted, and work as expected.
- Follow the style guide of the programming language used in the code sample.

:::info example

❌ *To start Teku, run the following command:*
alexandratran marked this conversation as resolved.
Show resolved Hide resolved

```bash
// Set --ee-endpoint to the URL of your execution engine and
// --ee-jwt-secret-file to the path to your JWT secret file.
user@mycomputer Develop % teku --ee-endpoint=http://localhost:8550 --ee-jwt-secret-file=my-jwt-secret.hex --metrics-enabled=true --rest-api-enabled=true
```

✅ *To start Teku, run the following command:*

```bash
teku \
--ee-endpoint=<URL of execution engine> \
--ee-jwt-secret-file=<path to JWT secret file> \
--metrics-enabled=true \
--rest-api-enabled=true
```

:::

See the
[Microsoft Writing Style Guide](https://learn.microsoft.com/en-us/style-guide/developer-content/code-examples)
for more guidelines for writing code examples.

The [`remark-docusaurus-tabs`](https://github.com/mccleanp/remark-docusaurus-tabs) plugin allows you
to add content in [tabs](https://docusaurus.io/docs/markdown-features/tabs) using simplified syntax.
## Tabs

For example, add code blocks to tabs as follows:
Use [tabs](https://docusaurus.io/docs/markdown-features/tabs) to display certain content, such as
code samples in different languages.
For example:

````jsx
<Tabs>
import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

<TabItem value="HTML" label="HTML" default>
<Tabs>
<TabItem value="HTML">

```html
<!-- HTML code block -->
```

</TabItem>
<TabItem value="JavaScript" label="JavaScript">
</TabItem>
<TabItem value="JavaScript">

```javascript
// JavaScript code block
```

</TabItem>
<TabItem value="Markdown" label="Markdown">
</TabItem>
<TabItem value="Markdown">

- This is an example Markdown list.
- This is **bold** and *italicized* text.
```markdown
- This is an example Markdown list.
- This is **bold** and *italicized* text.
```

</TabItem>
</TabItem>
</Tabs>
````

It renders as the following:
This renders as the following:

<Tabs>

<TabItem value="HTML" label="HTML" default>
<TabItem value="HTML">

```html
<!-- HTML code block -->
```

</TabItem>
<TabItem value="JavaScript" label="JavaScript">
</TabItem>
<TabItem value="JavaScript">

```javascript
// JavaScript code block
```

</TabItem>
<TabItem value="Markdown" label="Markdown">
</TabItem>
<TabItem value="Markdown">

```markdown
- This is an example Markdown list.
- This is **bold** and *italicized* text.
```

</TabItem>
</TabItem>
</Tabs>
10 changes: 5 additions & 5 deletions docs/contribute/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ sidebar_position: 2

# Style guide

Style guidelines help keep the ConsenSys documentation consistent, concise, and readable.
Style guidelines help keep the Consensys documentation consistent, concise, and readable.
Refer to the following guides when writing, editing, or reviewing doc content:

- [**Microsoft Writing Style Guide**](https://learn.microsoft.com/en-us/style-guide/welcome/) -
Refer to this guide for style, voice, grammar, and text formatting guidelines.
- [**Diátaxis framework**](https://diataxis.fr/) - Refer to this guide for information about
function-based docs.
- [**ConsenSys Editorial Style Guide**](https://docs.google.com/document/d/1smRdw4TUIpz9re_o0_0DKdH_nK6cSPMJOK6BcbhjJ7Y/edit?usp=sharing) -
- [**Consensys Editorial Style Guide**](https://docs.google.com/document/d/1smRdw4TUIpz9re_o0_0DKdH_nK6cSPMJOK6BcbhjJ7Y/edit?usp=sharing) -
Refer to this guide for spelling and usage of blockchain-related terms.
This guide is only available to internal ConsenSys contributors.
This guide is only available to internal Consensys contributors.

The following section also highlights the top five style tips from these guides.

Expand Down Expand Up @@ -72,8 +72,8 @@ Write for a [developer audience](https://learn.microsoft.com/en-us/style-guide/d
that quickly.
- List prerequisites and suggest good practices.
For example, instruct readers to secure private keys and protect RPC endpoints in production environments.
- Write [code samples](https://learn.microsoft.com/en-us/style-guide/developer-content/code-examples)
that are readable, can be easily copied and pasted, and work as expected.
- Write [code samples](format-markdown.md#code-sample-style-guide) that are readable, can be easily
copied and pasted, and work as expected.

:::info example

Expand Down
32 changes: 19 additions & 13 deletions docs/contribute/submit-a-contribution.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sidebar_position: 1

# Submit a contribution

The ConsenSys documentation uses a [docs-as-code](https://www.writethedocs.org/guide/docs-as-code/)
The Consensys documentation uses a [docs-as-code](https://www.writethedocs.org/guide/docs-as-code/)
approach, meaning documentation is created using the same tools as code.
The contribution workflow involves proposing changes to the docs by creating [forks and pull
requests (PRs)](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/getting-started/about-collaborative-development-models#fork-and-pull-model)
Expand All @@ -17,7 +17,7 @@ This facilitates open contributions, testing, and review.
To contribute changes:

1. Choose the repository you'd like to contribute to.
See the [list of ConsenSys documentation repositories](../index.md#list-of-documentation-sites).
See the [list of Consensys documentation repositories](../index.md#list-of-documentation-sites).

:::note
These steps only apply to the doc sites that use Docusaurus.
Expand All @@ -34,7 +34,7 @@ To contribute changes:
to your personal account.

:::note
For repositories that don't allow forking, such as Infura, you can skip steps 3–5 and clone the
For repositories that don't allow forking, such as Infura, you can skip steps 3–6 and clone the
original repository instead.
:::

Expand All @@ -44,14 +44,20 @@ To contribute changes:
```bash
git clone <FORKED-REPO-URL>
```

5. [Add an upstream remote.](https://docs.github.com/en/get-started/quickstart/fork-a-repo#configuring-git-to-sync-your-fork-with-the-upstream-repository)

5. Change directories into the cloned forked repository.

```bash
cd <FORKED-REPO-NAME>
```

6. [Add an upstream remote.](https://docs.github.com/en/get-started/quickstart/fork-a-repo#configuring-git-to-sync-your-fork-with-the-upstream-repository)

```bash
git remote add upstream <ORIGINAL-REPO-URL>
```

6. [Create and checkout a topic branch](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging),
7. [Create and checkout a topic branch](https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging),
naming it appropriately.
We recommend including the issue number and a short description in the branch name (for example,
`183-doc-cli-option`), which is a reminder to fix only one issue in a PR.
Expand All @@ -64,7 +70,7 @@ To contribute changes:
You can use a Git client such as [Fork](https://fork.dev/) instead of the command line.
:::

7. Open the repository in a text editor of your choice (for example, [VS Code](https://code.visualstudio.com/))
8. Open the repository in a text editor of your choice (for example, [VS Code](https://code.visualstudio.com/))
and make your documentation changes.
Make sure to [follow the style guidelines](style-guide.md) and [format your Markdown correctly](./format-markdown.md).

Expand All @@ -73,9 +79,9 @@ To contribute changes:
[redirect](../create/configure-docusaurus.md#redirects).
:::

8. [Preview your changes locally](preview.md) to check that the changes render correctly.
9. [Preview your changes locally](preview.md) to check that the changes render correctly.

9. Add and commit your changes, briefly describing your changes in the commit message.
10. Add and commit your changes, briefly describing your changes in the commit message.
Push your changes to the remote origin.

```bash
Expand All @@ -84,22 +90,22 @@ To contribute changes:
git push origin
```

10. On the original repository on GitHub, you’ll see a banner prompting you to create a PR with your
11. On the original repository on GitHub, you’ll see a banner prompting you to create a PR with your
recent changes.
Create a PR, describing your changes in detail.
[Link the issue](https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue)
that your PR fixes by adding `fixes #<ISSUE-NUM>` to the PR description.

11. If your PR fails any checks, displayed at the bottom of the PR page, fix those errors.
12. If your PR fails any checks, displayed at the bottom of the PR page, fix those errors.
If you want to include a new word that causes a [spell check](../configure/spell-check.md) error,
you can add that word to the [`project-words.txt`](../create/repo-structure.md#-project-wordstxt) file.

12. For most doc repositories, specific reviewers are automatically requested when you submit a PR.
13. For most doc repositories, specific reviewers are automatically requested when you submit a PR.
You can request additional reviewers in the right sidebar of your PR – for example, the original
issue raiser.
Make any required changes to your PR based on reviewer feedback, repeating steps 7–9.

13. After your PR is approved by two reviewers, all checks have passed, and your branch has no
14. After your PR is approved by two reviewers, all checks have passed, and your branch has no
conflicts with the main branch, you can merge your PR.
If you don't have merge access, a maintainer will merge your PR for you.
You can delete the topic branch after your PR is merged.
Expand Down
Loading
Loading