-
-
Notifications
You must be signed in to change notification settings - Fork 133
Add MathML Core elements #399
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
Merged
Merged
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8ce851f
:sparkles: Add MathML Core elements.
SaphiraKai 134f881
move `mathml.math()` back to `html.math()`
SaphiraKai 3acfc03
make `mathml` code and comments more consistent with `svg`
SaphiraKai 8ebe804
remove `mathml.math()` now that it has been moved to `html`
SaphiraKai b44a5e3
simplify arguments where possible
SaphiraKai 659e119
Merge branch 'lustre-labs:main' into main
SaphiraKai 29a0d27
Merge branch 'lustre-labs:main' into main
SaphiraKai b397a20
remove deprecated maction
SaphiraKai 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 hidden or 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
yoshi-monster marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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,232 @@ | ||
| // IMPORTS --------------------------------------------------------------------- | ||
|
|
||
| import lustre/attribute.{type Attribute} | ||
| import lustre/element.{type Element, namespaced} | ||
|
|
||
| // CONSTANTS ------------------------------------------------------------------- | ||
|
|
||
| /// The MathML namespace URI: `"http://www.w3.org/1998/Math/MathML"`. You might use this | ||
| /// with [`element.namespaced`](../element.html#namespaced) to create elements | ||
| /// in the MathML namespace not provided here. | ||
| /// | ||
| pub const namespace = "http://www.w3.org/1998/Math/MathML" | ||
|
|
||
| // The doc comments (and order) for functions in this module are taken from the | ||
| // MathML Core W3C technical report: | ||
| // | ||
| // https://www.w3.org/TR/mathml-core/#mathml-elements-and-attributes | ||
| // | ||
|
|
||
| // MATHML ELEMENTS: GROUPING --------------------------------------------------- | ||
|
|
||
| /// | ||
| pub fn merror( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "merror", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mphantom( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mphantom", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mprescripts( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mprescripts", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mrow( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mrow", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mstyle( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mstyle", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn semantics( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "semantics", attrs, children) | ||
| } | ||
|
|
||
| // MATHML ELEMENTS: SCRIPTED --------------------------------------------------- | ||
|
|
||
| /// | ||
| pub fn mmultiscripts( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mmultiscripts", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mover( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mover", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn msub( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "msub", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn msubsup( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "msubsup", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn msup( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "msup", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn munder( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "munder", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn munderover( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "munderover", attrs, children) | ||
| } | ||
|
|
||
| // MATHML ELEMENTS: RADICAL ---------------------------------------------------- | ||
|
|
||
| /// | ||
| pub fn mroot( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mroot", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn msqrt( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "msqrt", attrs, children) | ||
| } | ||
|
|
||
| // MATHML ELEMENTS: OTHER ------------------------------------------------------ | ||
|
|
||
| /// | ||
| pub fn annotation( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "annotation", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn annotation_xml( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "annotation-xml", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mfrac( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mfrac", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mn(attrs: List(Attribute(msg)), text: String) -> Element(msg) { | ||
| namespaced(namespace, "mn", attrs, [element.text(text)]) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mo(attrs: List(Attribute(msg)), text: String) -> Element(msg) { | ||
| namespaced(namespace, "mo", attrs, [element.text(text)]) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mi(attrs: List(Attribute(msg)), text: String) -> Element(msg) { | ||
| namespaced(namespace, "mi", attrs, [element.text(text)]) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mpadded( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mpadded", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn ms(attrs: List(Attribute(msg)), text: String) -> Element(msg) { | ||
| namespaced(namespace, "ms", attrs, [element.text(text)]) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mspace(attrs: List(Attribute(msg))) -> Element(msg) { | ||
| namespaced(namespace, "mspace", attrs, []) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mtable( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mtable", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mtd( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mtd", attrs, children) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mtext(attrs: List(Attribute(msg)), text: String) -> Element(msg) { | ||
| namespaced(namespace, "mtext", attrs, [element.text(text)]) | ||
| } | ||
|
|
||
| /// | ||
| pub fn mtr( | ||
| attrs: List(Attribute(msg)), | ||
| children: List(Element(msg)), | ||
| ) -> Element(msg) { | ||
| namespaced(namespace, "mtr", attrs, children) | ||
| } |
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.
Uh oh!
There was an error while loading. Please reload this page.