-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
👯♀️ Add directive option
alias
(#608)
You can now use `label` or `name` for all directives
- Loading branch information
Showing
13 changed files
with
135 additions
and
18 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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
'myst-directives': patch | ||
'myst-common': patch | ||
'myst-parser': patch | ||
--- | ||
|
||
Allow alias field for directive options. |
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,7 @@ | ||
--- | ||
'myst-directives': patch | ||
'myst-parser': patch | ||
'myst-cli': patch | ||
--- | ||
|
||
All instances of `name` options in directives can also use `label`. (e.g. in a figure or equation). |
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
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
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
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
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
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,68 @@ | ||
title: label alias tests | ||
cases: | ||
- title: figure label works | ||
markdown: |- | ||
```{figure} my_image.png | ||
:label: my-fig | ||
``` | ||
mdast: | ||
type: root | ||
children: | ||
- type: mystDirective | ||
name: figure | ||
args: my_image.png | ||
options: | ||
label: my-fig | ||
children: | ||
- type: container | ||
kind: figure | ||
identifier: my-fig | ||
label: my-fig | ||
children: | ||
- type: image | ||
url: my_image.png | ||
- title: figure name works | ||
markdown: |- | ||
```{figure} my_image.png | ||
:name: my-fig | ||
``` | ||
mdast: | ||
type: root | ||
children: | ||
- type: mystDirective | ||
name: figure | ||
args: my_image.png | ||
options: | ||
name: my-fig | ||
children: | ||
- type: container | ||
kind: figure | ||
identifier: my-fig | ||
label: my-fig | ||
children: | ||
- type: image | ||
url: my_image.png | ||
- title: figure name/label warns and takes label | ||
warnings: 1 | ||
markdown: |- | ||
```{figure} my_image.png | ||
:label: my-fig | ||
:name: not-used | ||
``` | ||
mdast: | ||
type: root | ||
children: | ||
- type: mystDirective | ||
name: figure | ||
args: my_image.png | ||
options: | ||
label: my-fig | ||
name: not-used | ||
children: | ||
- type: container | ||
kind: figure | ||
identifier: my-fig | ||
label: my-fig | ||
children: | ||
- type: image | ||
url: my_image.png |