You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/pages/contribution-guide/asciinema-casts/index.md
+19-7Lines changed: 19 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,14 +2,15 @@
2
2
title: "asciinema casts"
3
3
date: 2024-03-18T10:55:37+01:00
4
4
tags: ["Contribute"]
5
+
showTableOfContents: true
5
6
showAuthor: false
6
7
authors:
7
8
- "kirill-chalov"
8
9
---
9
10
10
11
## Overview
11
12
12
-
You can easily embed asciinema casts on the Developer Portal. asciinema allows you to record terminal sessions using a lightweight text-based format.
13
+
[asciinema](https://asciinema.org/)allows you to record terminal sessions using a lightweight text-based format. You can easily embed asciinema casts on the Developer Portal.
13
14
14
15
### Notable features
15
16
@@ -28,15 +29,26 @@ Use asciinema casts for output logs or to demonstrate things in action. Avoid us
28
29
29
30
1. Install asciinema and record a terminal session following the [Quick start](https://docs.asciinema.org/manual/cli/quick-start/) guide.
30
31
2. Edit the `.cast` file if required.
31
-
3. Add the .cast file in the same directory as your page.
- See also the [asciinema player options](https://docs.asciinema.org/manual/player/options/)
32
+
3. Add the .cast file in the same directory as your article.
33
+
4. Embed a Hugo shortcode in your article.<br>
34
+
For example, the shortcode below embeds the file `demo.cast` and adjusts some [asciinema player options](https://docs.asciinema.org/manual/player/options/):
Copy file name to clipboardExpand all lines: content/pages/contribution-guide/writing-content/index.md
+84-8Lines changed: 84 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -63,7 +63,7 @@ This is totally up to you how you write the content as long as it is valuable fo
63
63
64
64
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.
65
65
66
-
## Prepare a featured image
66
+
### Prepare a featured image
67
67
68
68
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.
69
69
@@ -80,18 +80,74 @@ A featured image can be added in the following ways from the highest to lowest p
80
80
featureAsset: "img/featured/image.webp"
81
81
```
82
82
83
+
Please have your featured image converted to WebP as requested in [Use WebP for raster images](#use-webp-for-raster-images).
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.
89
+
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 the most relevant shortcodes implemented on the Espressif Developer Portal.
90
+
91
+
In addition to that, you can also use the standard Hugo [embedded shortcodes](https://gohugo.io/content-management/shortcodes/#embedded-shortcodes) and [Blowfish theme shortcodes](https://blowfish.page/docs/shortcodes/).
88
92
89
-
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!
93
+
If you need other content types or shortcodes implemented, either create a discussion on GitHub or offer a PR with the required functionality. It will be very much appreciated!
90
94
91
95
92
96
### Images
93
97
98
+
#### Adding images
99
+
100
+
You can add an image using a standard markdown syntax:
However, the Blowfish theme used on this website provides the [figure](https://blowfish.page/docs/shortcodes/#figure) shortcode that offers more control over image display and render. An example of a shortcode is given below, but more parameters are available:
107
+
108
+
```md
109
+
{{</* figure
110
+
src="image.webp"
111
+
alt=""
112
+
caption=""
113
+
*/>}}
114
+
```
115
+
116
+
By default, the Blowfish theme optimizes the images for different device resolutions. For some images, the processing **adds grey background**. To fix it, disable the processing of such images by adding the parameter `default="false"` to the figure shortcode.
117
+
118
+
119
+
#### Use WebP for raster images
120
+
121
+
For raster images, please use the WebP format only. The Developer Portal's CI blocks the images in PNG anf JPEG format.
122
+
123
+
The WebP format was chosen for the following reasons:
94
124
125
+
- The images in WebP are comparable in quality to PNG and JPEG but are 5-7 times smaller in size
126
+
- Smaller image size is important
127
+
- It prevents the git repo from growing out of proportion very fast
128
+
- It allows serving web pages faster
129
+
130
+
To convert your images to WebP, use one of the following ways:
131
+
132
+
- Use [imagemagick](https://imagemagick.org/script/download.php):
133
+
134
+
```sh
135
+
convert image.jpg -quality 60 image.webp
136
+
```
137
+
- Use [cwebp](https://developers.google.com/speed/webp/download):
138
+
139
+
```sh
140
+
cwebp -q 60 image.jpg -o image.webp
141
+
```
142
+
143
+
The quality value `60` usually yields good results. For very good quality, you can use the value `80`.
144
+
145
+
146
+
### Asciinema casts
147
+
148
+
[Asciinema](https://asciinema.org/) allows you to record terminal sessions using a lightweight text-based format.
149
+
150
+
If you want to use an asciinema cast in your article, see [asciinema casts](../asciinema-casts "asciinema casts").
95
151
96
152
97
153
### Code blocks with tabs
@@ -144,22 +200,42 @@ You can also easily **indent a tabbed code block**, by preceding the `tabs` and
0 commit comments