Skip to content

Commit a41e286

Browse files
committed
minor update to docs
1 parent cd044bb commit a41e286

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

docs/source/syntax.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,17 @@ _Source:_ [QuantEcon](https://python-programming.quantecon.org/functions.html#Ex
5858

5959
### Referencing Exercises
6060

61-
You can refer to an exercise using the `{ref}` role like ```{ref}`my-exercise` ```, which will display the title of the exercise directive. In the event that directive does not have a title, the title will default to "Exercise" like so: {ref}`my-exercise`.
61+
You can refer to an exercise using the `{ref}` role like ```{ref}`my-exercise` ```, which will display the title of the exercise directive. In the event that directive does not have a title, the title will be the default "Exercise" or "Exercise {number}" like so: {ref}`my-exercise`.
6262

63-
Enumerable directives can also be referenced through the `numref` role like ```{numref}`my-exercise` ```, which will display the number of the exercise directive. Referencing the above directive will display {numref}`my-exercise`. Furthermore, `numref` can take in three additional placeholders: _%s_ and _{number}_ which get replaced by the exercise number and _name_ by the exercise title.[^note]
63+
Enumerable directives can also be referenced through the `numref` role like ```{numref}`my-exercise` ```, which will display the number of the exercise directive. Referencing the above directive will display {numref}`my-exercise`. In this case it displays the same result as the `{ref}` role as `exerise` notes are (by default) enumerated.
64+
65+
Furthermore, `numref` can take in three additional placeholders for more customized titles:
66+
67+
1. _%s_
68+
2. _{number}_ which get replaced by the exercise number, and
69+
3. _{name}_ by the exercise title.[^note]
70+
71+
An example ```{numref}`My custom {number} title and {name}` ``` would resolve to {numref}`My custom {number} title and {name} <my-exercise>`
6472

6573
[^note]: If the exercise directive does not have a title, an `invalid numfig format` warning will be displayed during build if the user tries to use the _{name}_ placeholder.
6674

0 commit comments

Comments
 (0)