File tree Expand file tree Collapse file tree 1 file changed +29
-2
lines changed
Expand file tree Collapse file tree 1 file changed +29
-2
lines changed Original file line number Diff line number Diff line change @@ -234,11 +234,38 @@ Using {term}`React` makes frontends fun again!
234234Using {term}` React ` makes frontends fun again!
235235
236236
237- #### Toggle paragraph (Exercises / FAQ)
237+ #### Toggle paragraph (Exercise solution / FAQ)
238238
239- ```` {admonition} This is a title
239+ Text snippets can be hidden with the option to show. Wrap it in an ` admonition ` and add the ` class ` ` toggle ` .
240+
241+ `````
242+ ````{admonition} f-strings can make your life easier
240243:class: toggle
241244
245+ To use formatted string literals, begin a string with f or F before the opening quotation mark or triple quotation mark.
246+ Inside this string, you can write a Python expression between { and } characters that can refer to variables or literal values.
247+
248+ ```{code-block} python
249+ :linenos:
250+ :emphasize-lines: 1, 3
251+
252+ a = 2
253+ print("my 1st line")
254+ print(f"my {a}nd line")
255+ ```
256+ ````
257+ `````
258+
259+ Be aware to increase the number of backticks if you include directives like a ` code-block ` .
260+
261+ This would be rendered as:
262+
263+ ```` {admonition} f-strings can make your life easier
264+ :class: toggle
265+
266+ To use formatted string literals, begin a string with f or F before the opening quotation mark or triple quotation mark.
267+ Inside this string, you can write a Python expression between { and } characters that can refer to variables or literal values.
268+
242269```{code-block} python
243270:linenos:
244271:emphasize-lines: 1, 3
You can’t perform that action at this time.
0 commit comments