-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #20 from f-hollow/docs/add_contribution_guide
Docs/add contribution guide
- Loading branch information
Showing
10 changed files
with
237 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
# developer-portal | ||
# Developer Portal | ||
|
||
This project stores the files for the [Espressif Developer Portal][] website. GitHub Actions statically generate the website using Hugo and pushes it to a web server for online hosting. | ||
|
||
[Espressif Developer Portal]: https://developer.espressif.com/ | ||
|
||
If you want to contribute to this project, it would be nice to see the rendered version. The website can be easily rendered on your local machine using the following steps: | ||
|
||
1. Clone this repository using `git clone --recursive`. | ||
2. Install Hugo following the [instructions](https://gohugo.io/installation/). | ||
3. In the project folder, run `hugo server` and open the provided local web address, usually http://localhost:1313/. | ||
|
||
See also the Contribution Guide articles: | ||
|
||
- [Content contribution workflow](./content/pages/contribution_guide/content-contrib-workflow/index.md) | ||
- [Content writing workflow](./content/pages/contribution_guide/content-writing-workflow/index.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: "Contribution guide" | ||
date: 2024-04-29T19:22:05+08:00 | ||
draft: false | ||
description: "Aspects of contributing to the Espressif Developer Portal" | ||
tags: ["Contribute"] | ||
--- | ||
|
||
This post covers all the aspects of contributing to the Espressif Developer Portal. | ||
|
||
The major parts are: | ||
|
||
- [Content contribution workflow](content-contrib-workflow "Content contribution workflow") | ||
- [Content writing workflow](content-writing-workflow "Content writing workflow") |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
107 changes: 107 additions & 0 deletions
107
content/pages/contribution_guide/content-contrib-workflow/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
--- | ||
title: "Content contribution workflow" | ||
date: 2024-04-30T14:25:09+08:00 | ||
draft: false | ||
tags: ["Contribute"] | ||
--- | ||
|
||
## Overview | ||
|
||
The content contribution diagram below shows how contributions can be done to [espressif / developer-portal][], marked as **Public Upstream**. It is Developer Portal's public GitHub repo. | ||
|
||
[espressif / developer-portal]: https://github.com/espressif/developer-portal "Espressif Developer Portal" | ||
|
||
```mermaid | ||
flowchart RL | ||
id1[Public \nUpstream] | ||
id2[Private \nmirror] | ||
id3[Public \nFork] | ||
id4[Private \nmirror] | ||
id5[Public \nFork] | ||
subgraph sg1 [GitHub] | ||
id1 | ||
id3 | ||
id5 | ||
end | ||
subgraph sg2 [Espressif GitLab] | ||
id2 | ||
end | ||
subgraph sg3 [Anywhere] | ||
id4 | ||
end | ||
id2 -- Internal \ncontributions \n(private) ---> id1 | ||
id3 -. External \ncontributions \n(public) .-> id1 | ||
id4 -. External \ncontributions \n(private) .-> id5 | ||
id5 -.-> id1 | ||
style id1 fill:#99f | ||
classDef dashedStyle stroke-width:1px,stroke-dasharray: 5 5; | ||
class id3,id4,id5 dashedStyle; | ||
``` | ||
|
||
The **internal contributions** from Espressif will be prepared in the private mirror on Espressif's GitLab, because during writing and editing, some sensitive information might be mentioned, such as the details of the upcoming products, speculations about future plans, etc. | ||
|
||
The **external contributions** can be done in the following ways: | ||
|
||
- **Public**: External contributors create a fork of `espressif / developer-portal` and offer a PR. | ||
- **Private**: External contributors create a private mirror anywhere they want, prepare the material to contribute, and either invite Espressif's reviewers to their private mirror or offer a PR via a fork and have the review done publicly. | ||
|
||
## Usage | ||
|
||
The workflows for contributions are as follows: | ||
|
||
- For public contributions from a forked repo to `espressif / developer-portal`, follow the standard GitHub procedures. | ||
- For private contributions, see | ||
- [How to contribute from Espressif GitLab](#how-to-contribute-from-espressif-gitlab) | ||
- [How to contribute from Anywhere](#how-to-contribute-from-anywhere) | ||
- [How to set up a private mirror](#how-to-set-up-a-private-mirror) | ||
|
||
### How to contribute from Espressif GitLab | ||
|
||
To contribute from the private mirror on Espressif GitLab to `espressif / developer-portal`, do the following: | ||
|
||
- In GitLab mirror, create a new branch and make the desired updates | ||
- Invite Espressif's reviewers to do the review | ||
- Once the private work on the new branch is done, do the following in the GitLab mirror: | ||
```sh | ||
# Pull latest updates from upstream main if any | ||
git fetch upstream main && git pull upstream main | ||
# ! Replace <new-branch> with your branch name | ||
git rebase upstream/main <new-branch> | ||
# Push the branch with contributions to the public repo | ||
git push upstream <new-branch> | ||
``` | ||
- In `espressif / developer-portal`, create a PR from your `<new-branch>` to `main` | ||
- Remove the merged branch in GitLab mirror | ||
|
||
|
||
### How to contribute from Anywhere | ||
|
||
For private contributions from anywhere, do the following: | ||
|
||
- Create a private mirror as described in [How to create a private mirror](#how-to-create-a-private-mirror) | ||
- In your private mirror, create a new branch and make the desired updates | ||
- Invite Espressif's reviewers to your private mirror to do the review | ||
- Once the private work on the new branch is finished, do the following in the private mirror: | ||
```sh | ||
# Pull latest updates from upstream main if any | ||
git fetch upstream main && git pull upstream main | ||
# ! Replace <new-branch> with your branch name | ||
git rebase upstream/main <new-branch> | ||
# Push the branch with contributions to the public repo | ||
git push upstream <new-branch> | ||
``` | ||
- After that, fork `espressif / developer-portal` and create a PR from your `<new-branch>` to `main` of `espressif / developer-portal` (public review will be done at this stage) | ||
### How to set up a private mirror | ||
To set up a private mirror of `espressif / developer-portal`, do the following: | ||
- Create a private [mirror][create a mirror] of [espressif / developer-portal][] | ||
- (GitHub only) In the private mirror, consider [disabling][disable a workflow] the existing GitHub workflows as no developer portal deployment can be done from a mirror anyway | ||
- On GitHub, create a fork of `espressif / developer-portal` | ||
- In the private mirror, [add][configure a fork] your fork from the previous step as the upstream remote; you will want to push your contributions upstream to create a PR to `espressif / developer-portal` | ||
[create a mirror]: https://docs.github.com/en/repositories/creating-and-managing-repositories/duplicating-a-repository#mirroring-a-repository | ||
[disable a workflow]: https://docs.github.com/en/actions/using-workflows/disabling-and-enabling-a-workflow#disabling-a-workflow | ||
[configure a fork]: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-repository-for-a-fork |
57 changes: 57 additions & 0 deletions
57
content/pages/contribution_guide/content-writing-workflow/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
--- | ||
title: "Content writing workflow" | ||
date: 2024-04-29T14:25:01+08:00 | ||
draft: false | ||
tags: ["Contribute"] | ||
--- | ||
|
||
## Before you start writing | ||
|
||
There are the following prerequisites before you start writing content: | ||
|
||
- Decide how you want to contribute by choosing the [content contribution workflow](../content-contrib-workflow "Content contribution workflow") and get a copy of the [espressif / developer-portal][] repo | ||
- To view the built version of the website, [install](https://gohugo.io/installation/) Hugo in your environment and go through [Getting started](https://gohugo.io/getting-started/) if required | ||
|
||
[espressif / developer-portal]: https://github.com/espressif/developer-portal "Espressif Developer Portal" | ||
|
||
|
||
### Create and view an article | ||
|
||
See also the official [docs](https://gohugo.io/getting-started/quick-start/#add-content). | ||
|
||
- To create a new article, determine the path and run | ||
```sh | ||
hugo new content <path/index.md> | ||
# Example | ||
hugo new content blog/contribution_guide/index.md | ||
``` | ||
This assumes that you want to organize the content as a leaf bundle (the usual way). You can also use the [branch bundle](https://gohugo.io/content-management/page-bundles/#comparison). | ||
- In the created file, change `draft: true` to `draft: false` to make the article visible in the build. | ||
- To view the changes, in your project folder run | ||
```sh | ||
hugo server | ||
``` | ||
|
||
## Write the content | ||
|
||
This is totally up to you how you write the content as long as it is valuable for the community. | ||
|
||
For writing and formatting conventions, the contributors at Espressif usually follow the [Espressif Manual of Style](https://mos.espressif.com/) and the *Chicago Manual of Style*. You might find these guidelines useful, but you are not required to follow them. | ||
|
||
### Use additional content types | ||
|
||
Apart from the usual content types supported by markdown, such as visuals or code snippets, you can also include: | ||
|
||
- [Diagrams as code](https://gohugo.io/content-management/diagrams/) | ||
- Mermaid diagrams are supported, for an example see the raw version of [this page](../content-contrib-workflow "Content contribution workflow") | ||
- Youtube videos using [Hugo shortcodes](https://gohugo.io/content-management/shortcodes/#youtube) | ||
- [asciinema casts](../asciinema_casts "asciinema casts") | ||
|
||
If you need other types of content, either create a discussion on GitHub or offer a PR with the required functionality. It will be very much appreciated! | ||
|
||
|
||
## Ask for review | ||
|
||
To publish your content on the Espressif Developer Portal, please create a discussion in [espressif / developer-portal][] invite reviewers from Espressif so that they can make sure your content is in-line with Espressif's writing conventions. | ||
After the review is done, create a PR following the [content contribution workflow](../content-contrib-workflow "Content contribution workflow"). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<pre class="mermaid"> | ||
{{- .Inner | safeHTML }} | ||
</pre> | ||
{{ .Page.Store.Set "hasMermaid" true }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<div | ||
class="min-w-[220px] py-2 border-dotted border-neutral-300 ltr:-ml-5 ltr:border-l ltr:pl-5 rtl:-mr-5 rtl:border-r rtl:pr-5 dark:border-neutral-600"> | ||
{{ with .Parent }} | ||
<a href="{{ .RelPermalink }}">Back to {{ .Title }}</a> | ||
{{ end }} | ||
</div> |