-
-
Notifications
You must be signed in to change notification settings - Fork 28
WIP: Math ml tag defs #105
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 21 commits
Commits
Show all changes
31 commits
Select commit
Hold shift + click to select a range
7bcae7e
Math ml tag defs
Quafadas e9ac70f
poke ci
Quafadas fc40d3f
Fixy fixy
Quafadas 0cdc50f
.
Quafadas 96a8792
Test types
Quafadas 993aceb
claim they are HTML elements
Quafadas 3cf76ff
MathTagTrait
Quafadas bfb3186
.
Quafadas eb7c473
hail mary
Quafadas a9d8eed
urgh
Quafadas deb0e92
Update MathML tag type. Seems to pass tests with my local scalaJSDom...
Quafadas dbd4aa8
conv
Quafadas cb9c9df
sbt has defeated me
Quafadas 12bfa0e
ahha!
Quafadas 5d0f668
Fix codegen, more tags
Quafadas 2cce9c8
.
Quafadas 4d06121
.
Quafadas d5fc281
.
Quafadas 504da4d
.
Quafadas 6d50a05
Remove settings.json
Quafadas e16ac7a
try to resolve converastions
Quafadas 14b5ac6
Also add a compile check
Quafadas 4269c7a
see if this fixes IC
Quafadas 597d497
ba
Quafadas 9fd7063
.
Quafadas c78fb96
.
Quafadas c87332b
.
Quafadas 78b0142
so lost.
Quafadas a116848
.
Quafadas 2b1847e
.
Quafadas b7ca170
.
Quafadas 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,8 @@ js/yarn.lock | |
.idea | ||
|
||
.DS_Store | ||
|
||
.vscode/settings.json | ||
.bloop | ||
.metals | ||
metals.sbt |
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,17 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"label": "Run sbt", | ||
"type": "shell", | ||
"command": "sbt", | ||
"presentation": { | ||
"reveal": "always", | ||
"panel": "new" | ||
}, | ||
"runOptions": { | ||
"runOn": "folderOpen" | ||
} | ||
} | ||
] | ||
} |
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
161 changes: 161 additions & 0 deletions
161
js/src/test/scala/com/thirdparty/defs/tags/MathMLTags.scala
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,161 @@ | ||
package com.thirdparty.defs.tags | ||
|
||
import com.thirdparty.tags.MathMlTag | ||
import org.scalajs.dom | ||
|
||
// #NOTE: GENERATED CODE | ||
// - This file is generated at compile time from the data in Scala DOM Types | ||
// - See `GeneratorSpec.scala` for code generation params | ||
// - Contribute to https://github.com/raquo/scala-dom-types to add missing tags / attrs / props / etc. | ||
|
||
trait MathMLTags { | ||
|
||
|
||
def mathMLTag[El <: dom.MathMLElement](name: String): MathMlTag[El] = new MathTag(name) | ||
|
||
|
||
/** | ||
* The top-level element in MathML, representing a mathematical expression. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math math @ MDN]] | ||
*/ | ||
lazy val math: MathMlTag[dom.MathMLElement] = mathMLTag("math") | ||
|
||
|
||
/** | ||
* Represents a mathematical identifier, such as a variable name. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mi mi @ MDN]] | ||
*/ | ||
lazy val mi: MathMlTag[dom.MathMLElement] = mathMLTag("mi") | ||
|
||
|
||
/** | ||
* Represents a mathematical operator. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo mo @ MDN]] | ||
*/ | ||
lazy val mo: MathMlTag[dom.MathMLElement] = mathMLTag("mo") | ||
|
||
|
||
/** | ||
* Represents a number in a mathematical expression. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mn mn @ MDN]] | ||
*/ | ||
lazy val mn: MathMlTag[dom.MathMLElement] = mathMLTag("mn") | ||
|
||
|
||
/** | ||
* Represents a superscript expression. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msup msup @ MDN]] | ||
*/ | ||
lazy val msup: MathMlTag[dom.MathMLElement] = mathMLTag("msup") | ||
|
||
|
||
/** | ||
* Represents a subscript expression. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msub msub @ MDN]] | ||
*/ | ||
lazy val msub: MathMlTag[dom.MathMLElement] = mathMLTag("msub") | ||
|
||
|
||
/** | ||
* Represents a fraction. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfrac mfrac @ MDN]] | ||
*/ | ||
lazy val mfrac: MathMlTag[dom.MathMLElement] = mathMLTag("mfrac") | ||
|
||
|
||
/** | ||
* Represents a square root. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msqrt msqrt @ MDN]] | ||
*/ | ||
lazy val msqrt: MathMlTag[dom.MathMLElement] = mathMLTag("msqrt") | ||
|
||
|
||
/** | ||
* Represents a root expression with a specified degree. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mroot mroot @ MDN]] | ||
*/ | ||
lazy val mroot: MathMlTag[dom.MathMLElement] = mathMLTag("mroot") | ||
|
||
|
||
/** | ||
* Represents text within a mathematical expression. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtext mtext @ MDN]] | ||
*/ | ||
lazy val mtext: MathMlTag[dom.MathMLElement] = mathMLTag("mtext") | ||
|
||
|
||
/** | ||
* The <munder> MathML element is used to attach an accent or a limit under an expression. It uses the following syntax: <munder> base underscript </munder> | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/munderover munderover @ MDN]] | ||
*/ | ||
lazy val munderover: MathMlTag[dom.MathMLElement] = mathMLTag("munderover") | ||
|
||
|
||
/** | ||
* The <mtr> MathML element represents a row in a table or a matrix. It may only appear in a <mtable> element and its children are <mtd> elements representing cells. This element is similar to the <tr> element of HTML. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtr mtr @ MDN]] | ||
*/ | ||
lazy val mtr: MathMlTag[dom.MathMLElement] = mathMLTag("mtr") | ||
|
||
|
||
/** | ||
* The <mtd> MathML element represents a cell in a table or a matrix. It may only appear in an <mtr> element. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtd mtd @ MDN]] | ||
*/ | ||
lazy val mtd: MathMlTag[dom.MathMLElement] = mathMLTag("mtd") | ||
|
||
|
||
/** | ||
* The <mtable> MathML element allows you to create tables or matrices. Its children are <mtr> elements (representing rows), each of them having <mtd> elements as its children (representing cells). These elements are similar to <table>, <tr> and <td> elements of HTML. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable mtable @ MDN]] | ||
*/ | ||
lazy val mtable: MathMlTag[dom.MathMLElement] = mathMLTag("mtable") | ||
|
||
|
||
/** | ||
* Represents a base with both a subscript and a superscript. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msubsup msubsup @ MDN]] | ||
*/ | ||
lazy val msubsup: MathMlTag[dom.MathMLElement] = mathMLTag("msubsup") | ||
|
||
|
||
/** | ||
* The <mstyle> MathML element is used to change the style of its contents. It is similar to the <style> element in HTML. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle mstyle @ MDN]] | ||
*/ | ||
lazy val mstyle: MathMlTag[dom.MathMLElement] = mathMLTag("mstyle") | ||
|
||
|
||
/** | ||
* The <mspace> MathML element is used to display a blank space, whose size is set by its attributes. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mspace mspace @ MDN]] | ||
*/ | ||
lazy val mspace: MathMlTag[dom.MathMLElement] = mathMLTag("mspace") | ||
|
||
|
||
/** | ||
* Represents a string literal. | ||
* | ||
* [[https://developer.mozilla.org/en-US/docs/Web/MathML/Element/ms ms @ MDN]] | ||
*/ | ||
lazy val ms: MathMlTag[dom.MathMLElement] = mathMLTag("ms") | ||
|
||
|
||
} |
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
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
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
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 |
---|---|---|
@@ -1 +1 @@ | ||
sbt.version = 1.9.7 | ||
sbt.version = 1.10.6 |
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
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
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
22 changes: 22 additions & 0 deletions
22
shared/src/main/scala/com/raquo/domtypes/defs/attrs/MathMLDefs.scala
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,22 @@ | ||
package com.raquo.domtypes.defs.attrs | ||
|
||
import com.raquo.domtypes.common.MathMLTagType | ||
import com.raquo.domtypes.common.AttrDef | ||
|
||
object MathMlAttrDefs { | ||
|
||
// @nikita: Wasn't this the part we concluded didn't work? | ||
/** | ||
* If you break open the browser tools and noodle around with mathml elements, you'll see that they have a bunch of attributes., | ||
* you may find they have little effect or are "undefined" in the browser. | ||
* | ||
* This would appear to be because they aren't part of the browser API? | ||
* | ||
* We take a pass on these here. | ||
* | ||
*/ | ||
val defs: List[AttrDef] = List( | ||
|
||
|
||
) | ||
} | ||
Quafadas marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
Uh oh!
There was an error while loading. Please reload this page.