-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🎁 Use commonDirectiveOptions
in all directives
#1650
Merged
Merged
Changes from 11 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
0400744
feat: use commonDirectiveOptions everywhere
agoose77 c245b95
feat: more directives
agoose77 425eefe
chore: add changeset
agoose77 8b51b2d
Update packages/myst-ext-exercise/src/exercise.ts
agoose77 361195e
Update packages/myst-ext-proof/src/proof.ts
agoose77 0de8f98
docs: update plugin to find all directives/roles
agoose77 e7d866a
docs: use myst:directive in directive docs
agoose77 8abd747
fix: respect enumerated
agoose77 80b3394
docs: remove use of `nonumber`
agoose77 9239e42
docs: drop reference to sphinx-exercise
agoose77 728b252
fix: set default for enumerated
agoose77 db70a29
Typo in solution directive docs
fwkoch ed4e864
Fix up exercise nonumber logic
fwkoch 826df5b
Use common directive options for solution directive
fwkoch File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
import type { DirectiveSpec, DirectiveData, GenericNode } from 'myst-common'; | ||
import type { Aside } from 'myst-spec-ext'; | ||
import type { FlowContent, ListContent, PhrasingContent } from 'myst-spec'; | ||
import { addCommonDirectiveOptions, labelDirectiveOption } from './utils.js'; | ||
import { addCommonDirectiveOptions, commonDirectiveOptions } from './utils.js'; | ||
|
||
export const asideDirective: DirectiveSpec = { | ||
name: 'aside', | ||
|
@@ -11,11 +11,7 @@ export const asideDirective: DirectiveSpec = { | |
doc: 'An optional title', | ||
}, | ||
options: { | ||
...labelDirectiveOption('aside'), | ||
// TODO: Add enumeration in future | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This gets added to the node now too! |
||
class: { | ||
type: String, | ||
}, | ||
...commonDirectiveOptions('aside'), | ||
}, | ||
body: { | ||
type: 'myst', | ||
|
@@ -34,7 +30,6 @@ export const asideDirective: DirectiveSpec = { | |
kind: | ||
data.name == 'aside' || data.name == 'margin' ? undefined : (data.name as Aside['kind']), | ||
children, | ||
class: data.options?.class as string | undefined, | ||
}; | ||
addCommonDirectiveOptions(data, aside); | ||
return [aside]; | ||
|
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.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to be using this here now! Thank you!!