Skip to content

Commit adb89b0

Browse files
docs: MathML README
1 parent 027273f commit adb89b0

File tree

2 files changed

+73
-2
lines changed

2 files changed

+73
-2
lines changed

Commands/Get-MathML.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ function Get-MathML
77
Gets MathML from a file or page
88
.EXAMPLE
99
MathML https://dlmf.nist.gov/2.1
10+
.EXAMPLE
11+
MathML 'https://en.wikipedia.org/wiki/Rose_(mathematics)'
1012
.EXAMPLE
1113
MathML "<math xmlns='http://www.w3.org/1998/Math/MathML'>
1214
<semantics>
@@ -25,7 +27,7 @@ function Get-MathML
2527
# A url or file path that hopefully contains MathML
2628
# The response from this URL will be cached.
2729
[Parameter(ValueFromPipelineByPropertyName)]
28-
[Alias('Uri','FilePath','Fullname','Xml','Text')]
30+
[Alias('Uri','FilePath','Fullname')]
2931
[string]
3032
$Url,
3133

README.md

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,71 @@
11
# MathML
2-
PowerShell and MathML
2+
3+
MathML is an XML stanard for representing mathematics, and a part of HTML5.
4+
5+
## MathML Module
6+
7+
This module allows you to get MathML from anywhere and work with it as an object.
8+
9+
### Installing and Importing
10+
11+
MathML can be installed from the PowerShell gallery
12+
13+
~~~PowerShell
14+
Install-Module MathML
15+
~~~
16+
17+
After installation, you can import it like any module:
18+
19+
~~~PowerShell
20+
Import-Module MathML
21+
~~~
22+
23+
### Getting MathML
24+
25+
We can use `Get-MathML` (alias `MathML`) to extract MathML from a source
26+
27+
~~~PowerShell
28+
MathML https://dlmf.nist.gov/2.1
29+
~~~
30+
31+
This works for Wikipedia as well:
32+
33+
~~~PowerShell
34+
$roseMath = MathML 'https://en.wikipedia.org/wiki/Rose_(mathematics)'
35+
$roseMath
36+
~~~
37+
38+
We can also pass MathML directly in
39+
40+
~~~PowerShell
41+
MathML "<math xmlns='http://www.w3.org/1998/Math/MathML'>
42+
<semantics>
43+
<mrow>
44+
<mn>1</mn>
45+
<mo>+</mo>
46+
<mn>1</mn>
47+
<mo>=</mo>
48+
<mn>2</mn>
49+
</mrow>
50+
</semantics>
51+
</math>"
52+
~~~
53+
54+
55+
We can get any previously loaded MathML by running Get-MathML with no parameters
56+
57+
~~~PowerShell
58+
MathML
59+
~~~
60+
61+
## Future Goals
62+
63+
MathML offers a unique opportunity for metaprogramming.
64+
65+
In theory, expressions in most programming languages, including PowerShell, could be written as MathML.
66+
67+
Thus one future goal is to provide translation from languages to MathML.
68+
69+
More interestingly, MathML could also represent a "base language" used to reconstruct expressions in other languages.
70+
71+
Thus the other major future goal is provide translation from MathML into various programming languages.

0 commit comments

Comments
 (0)