-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎁 Use
commonDirectiveOptions
in all directives (#1650)
Co-authored-by: Franklin Koch <[email protected]>
- Loading branch information
Showing
26 changed files
with
346 additions
and
240 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,9 @@ | ||
--- | ||
"myst-ext-exercise": patch | ||
"myst-directives": patch | ||
"myst-ext-proof": patch | ||
"myst-ext-grid": patch | ||
"myst-ext-tabs": patch | ||
--- | ||
|
||
Add support for commonDirectiveOptions in all directives |
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 |
---|---|---|
@@ -1,18 +1,20 @@ | ||
import type { DirectiveSpec, DirectiveData, GenericNode } from 'myst-common'; | ||
import { addCommonDirectiveOptions, commonDirectiveOptions } from './utils.js'; | ||
|
||
export const bibliographyDirective: DirectiveSpec = { | ||
name: 'bibliography', | ||
options: { | ||
...commonDirectiveOptions('bibliography'), | ||
filter: { | ||
type: String, | ||
}, | ||
}, | ||
run(data: DirectiveData): GenericNode[] { | ||
return [ | ||
{ | ||
type: 'bibliography', | ||
filter: data.options?.filter, | ||
}, | ||
]; | ||
const bibliography = { | ||
type: 'bibliography', | ||
filter: data.options?.filter, | ||
}; | ||
addCommonDirectiveOptions(data, bibliography); | ||
return [bibliography]; | ||
}, | ||
}; |
Oops, something went wrong.