Add math stdlib with formulas/plots and polish the docs view.

Ship Num/Formula runtime, bilingual math libs, SVG plots with axes/grid, and view UX for collapsible folders plus centered plots.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
cflmyandCursor committed 2026-08-05 11:30:47 +08:00
1 parent a53ebb65ee
commit dcd0cdb8f7
40 files changed
+3553 -276

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
---
title: math formula chain
> lib/math.mq.md
---
# main
`f` =
$$
x^3
$$
*`df` = > diff formula=`f` var=x *
*`ty` = > type `df` *
> print text=`ty`
*`df2` = > diff formula=`df` var=x *
> print text=`df2`
*`y` = > eval formula=`df` var=x value=2 *
> print text=`y`
+27
View File
@@ -0,0 +1,27 @@
---
title: math formula pipeline
> lib/math.mq.md
---
# main
`f` =
$$
x^2 - 2
$$
*`ty` = > type `f` *
> print text=`ty`
*`df` = > diff formula=`f` var=x *
> print text=`df`
*`roots` = > solve formula=`f` var=x *
> print text=`roots`
*`y` = > eval formula=`f` var=x value=3 *
> print text=`y`
+17
View File
@@ -0,0 +1,17 @@
---
title: math plot svg
> lib/math.mq.md
---
# main
`f` =
$$
x^2
$$
*`svg` = > plot formula=`f` var=x min=-2 max=2 *
*`ok` = > type `svg` *
> print text=`ok`
+22
View File
@@ -0,0 +1,22 @@
---
title: math random seed
> lib/math.mq.md
---
# main
> seed value=42
*`a` = > random_int min=1 max=10 *
*`b` = > random_int min=1 max=10 *
> seed value=42
*`c` = > random_int min=1 max=10 *
> print text=`a`
> print text=`b`
> print text=`c`
+16
View File
@@ -0,0 +1,16 @@
---
title: math num + zh
> lib/数学.mq.md
---
# main
*`p` = > 圆周率 *
*`t` = > type `p` *
> print text=`t`
*`s` = > 正弦 value=0 *
> print text=`s`