Skip to content

Commit 0832c15

Browse files
authored
docs: update contribution guide (#110)
* docs: update contribution guide * Rename Content writing workflow to Writing content * docs: further update writing content
1 parent 7d58ee6 commit 0832c15

File tree

4 files changed

+87
-17
lines changed

4 files changed

+87
-17
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ If you want to contribute to this project, it would be nice to see the rendered
1515

1616
See also the Contribution Guide articles:
1717

18-
- [Content contribution workflow](./content/pages/contribution-guide/content-contrib-workflow/index.md)
19-
- [Content writing workflow](./content/pages/contribution-guide/content-writing-workflow/index.md)
18+
- [Contribution workflow](./content/pages/contribution-guide/contrib-workflow/index.md)
19+
- [Writing content](./content/pages/contribution-guide/writing-content/index.md)
2020

2121

2222
## Use pre-commit

content/pages/contribution-guide/_index.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@ title: "Contribution guide"
33
date: 2024-04-29T19:22:05+08:00
44
description: "This post covers all the aspects of contributing to the Espressif Developer Portal"
55
tags: ["Contribute"]
6+
67
---
78

89
For now, the Contribution Guide offers the following materials:
910

10-
- [Content contribution workflow](content-contrib-workflow "Content contribution workflow")
11-
- [Content writing workflow](content-writing-workflow "Content writing workflow")
11+
- [Contribution workflow](contrib-workflow "Contribution workflow")
12+
- [Writing content](writing-content "Writing content")
1213

1314
These workflows might be applicable partially or fully to the [contribution scenarios](#contribution-scenarios).
1415

content/pages/contribution-guide/content-contrib-workflow/index.md renamed to content/pages/contribution-guide/contrib-workflow/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
title: "Content contribution workflow"
2+
title: "Contribution workflow"
33
date: 2024-04-30T14:25:09+08:00
44
tags: ["Contribute"]
55
showAuthor: false
@@ -9,7 +9,7 @@ authors:
99

1010
## Overview
1111

12-
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.
12+
The 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.
1313

1414
[espressif / developer-portal]: https://github.com/espressif/developer-portal "Espressif Developer Portal"
1515

content/pages/contribution-guide/content-writing-workflow/index.md renamed to content/pages/contribution-guide/writing-content/index.md

Lines changed: 80 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
---
2-
title: "Content writing workflow"
2+
title: "Writing content"
33
date: 2024-04-29T14:25:01+08:00
44
tags: ["Contribute"]
5+
showTableOfContents: true
56
showAuthor: false
67
authors:
78
- "kirill-chalov"
@@ -11,7 +12,7 @@ authors:
1112

1213
There are the following prerequisites before you start writing content:
1314

14-
- 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
15+
- Decide how you want to contribute by choosing the [contribution workflow](../contrib-workflow "Contribution workflow") and get a copy of the [espressif / developer-portal][] repo
1516
- 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
1617

1718
[espressif / developer-portal]: https://github.com/espressif/developer-portal "Espressif Developer Portal"
@@ -62,7 +63,7 @@ This is totally up to you how you write the content as long as it is valuable fo
6263
6364
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.
6465
65-
### Prepare a featured image
66+
## Prepare a featured image
6667
6768
A featured image appears above the article's title. A nice and relevant image attracts readers like a magnet, that is why consider giving more thought to it.
6869
@@ -81,20 +82,88 @@ A featured image can be added in the following ways from the highest to lowest p
8182

8283
[blowfish-front-matter]: https://blowfish.page/docs/front-matter/
8384

84-
### Use additional content types
85+
## Use additional content types
8586

86-
Apart from the usual content types supported by markdown, such as visuals or code snippets, you can also include:
87-
88-
- [Diagrams as code](https://gohugo.io/content-management/diagrams/)
89-
- Mermaid diagrams are supported, for an example see the raw version of [this page](../content-contrib-workflow "Content contribution workflow")
90-
- Youtube videos using [Hugo shortcodes](https://gohugo.io/content-management/shortcodes/#youtube)
91-
- [asciinema casts](../asciinema-casts "asciinema casts")
87+
Apart from the usual content types supported by markdown, such as visuals or code blocks, you can use other content types enabled by Hugo shortcodes. This section briefly introduces them.
9288

9389
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!
9490

9591

92+
### Images
93+
94+
95+
96+
97+
### Code blocks with tabs
98+
99+
Tabbed code blocks look neat:
100+
101+
{{< tabs groupId="config" >}}
102+
{{% tab name="Linux" %}}
103+
```md
104+
Linux code block
105+
```
106+
{{% /tab %}}
107+
{{% tab name="macOS" %}}
108+
Update homebrew, then run:
109+
```md
110+
macOS code block
111+
```
112+
{{% /tab %}}
113+
{{< /tabs >}}
114+
115+
At the same time, the markup is very simple:
116+
117+
````md
118+
{{</* tabs groupId="config" */>}}
119+
{{%/* tab name="Linux" */%}}
120+
```md
121+
Linux code block
122+
```
123+
{{%/* /tab */%}}
124+
{{%/* tab name="macOS" */%}}
125+
Update homebrew, then run:
126+
```md
127+
macOS code block
128+
```
129+
{{%/* /tab */%}}
130+
{{</* /tabs */>}}
131+
````
132+
133+
Some explanations:
134+
135+
- Use the `tabs` shortcode to create a tabbed code block
136+
- Use the nested `tab` shortcode to create as many tabs as you need
137+
- Within a tab, place any markdown content you want, it will be rendered like any other markdown content
138+
139+
For a real example, see this [page](../../../blog/build-embedded-swift-application-for-esp32c6/#building-an-example-project).
140+
141+
As you can see, the `tabs` shortcode has **the parameter** `groupId`. It creates association between all tabbed code blocks bearing the same `groupId` on a webpage. Once you choose a certain tab, all associated code blocks will switch to the same tab. It can be useful in tutorials covering multiple operating systems, programming lanugages, etc.
142+
143+
You can also easily **indent a tabbed code block**, by preceding the `tabs` and `tab` shortcodes with the required number of spaces. This is exactly what was [done][indented-tabbed-code-block] in the linked example above.
144+
145+
[indented-tabbed-code-block]: https://github.com/espressif/developer-portal/blob/bfc7ee90bfc434bd1b1577a0fd1635a3923391d1/content/blog/build-embedded-swift-application-for-esp32c6/index.md?plain=1#L49-L65
146+
147+
### Diagrams as code
148+
149+
A number of [Diagrams as code](https://gohugo.io/content-management/diagrams/) formats are supported, including [Mermaid](https://mermaid.js.org/).
150+
151+
For example, a Mermaid diagram is used on [this page](../contrib-workflow "Contribution workflow") (see also the [raw version][contrib-workflow-raw]).
152+
153+
[contrib-workflow-raw]: https://github.com/espressif/developer-portal/blob/main/content/pages/contribution-guide/content-contrib-workflow/index.md?plain=1#L16-L41
154+
155+
### Asciinema casts
156+
157+
[asciinema casts](../asciinema-casts "asciinema casts")
158+
159+
160+
### Video
161+
162+
Youtube videos using [Hugo shortcodes](https://gohugo.io/content-management/shortcodes/#youtube)
163+
164+
96165
## Ask for review
97166

98167
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.
99168

100-
After the review is done, create a PR following the [content contribution workflow](../content-contrib-workflow "Content contribution workflow").
169+
After the review is done, create a PR following the [contribution workflow](../contrib-workflow "Contribution workflow").

0 commit comments

Comments
 (0)