# Arcana Mathematica

##### Online mathematical toolkit made by the Hornet's Nest
Editing algorithm: Integral
ui.xml
code.py
wikium.md
Editing guides
ui.xml
ui.xml is the xml file defining how a widget will look and its structure, as well as the names of the math expression when they are put into the python code.
In an algorithm calculator widget, it can have the following xml tags:
<title>
Attributes:
text: the text that shows up as the widget's title
<field>
Creates a math input field in the widget for users to type math expressions that will be fed into the python code. Attributes:
name: the name(dict key) of this math input field's content when it is being fed into the python function.
desc: the optional description that will show up above the math input field that shows the user what it is for.
<hint>
Inner XML:
A plain string of latex text. it can also contain shorthand reference to the contents of a field such as \frac{d}{d{%dvari%}}, where the {%dvari%} part will be updated to the content of the math field with name dvari whenever it is changed.
It smoothens the interface as it can update in real time to show the user some critical and changeable parts of the math expression.
Attributes:
name: the name of this hint box.
<row>
A row holds multiple elemental widgets such as fields and hints in a horizontal formation, allowing items to be laid out side by side for a better presentation.
Inner XML:
Any number of field or hint element.
<array>
An array element is like a row element, except it lets user add an arbritary amount of identical rows of math entries, and ships its content to the python code as a list, hence the name 'array'
It lets users input an array of entries, which is useful for things like data points or variable substitutions of an expression.
Inner XML:
Any number of field or hint element. However, hint elements with a reference to another field will not work inside an array.
Attributes:
name: the name(dict key) of this input array's content when it is being fed into the python function.
code.py
code.py dictates what an algorithm calculator will do once the 'compute' button is pressed.
It is a python source file usually consist of a single function headed def calculate(context): of which the python intrepreter will call.
Inside it, one can use almost all functions provided by the sympy library with the exeption of sympify() or lambdify() because of security reasons.
In addition, you can also use the semi-oficial function process_sympy(latex) to convert the latex text in variable latex to a sympy expression object.
Also, the security function does not really like the math operation shorthands +=, -=, *=, and /=. So instead of a += b please use the prefered a = a + b.

The calculate function can return a value one of the two following ways:
1. A single latex text string
This will be rendered directly as a math expression in the white box for results.
2. A list consisting of of one or more dicts in the following format
{"type": type, "title": title, "content": content}
Where
type is the rendering type of the item, which currently can only have "latex" as an accepted value
title is a string as title of the item that will show up above the math expression, and
content is the content of this item, which is usually the latext text
If a list is returned, the widget page will render its contents as a list of plain text title and math equation content pairs.
wikium.md
wikium.md defines a wiki-styled editable article that, while not affecting the widget's behaviour, helps users understands the topic of what's the current widget is about by explaining topics such as the math foundation needed to understand the algorithm, the logic behind it, and how to use it.
The file is just written out in CommonMark markdown format with some MathJax added to it.

Simple guide
Official termYou write in the fileIt show up as

# Foo

Italic*foo*foo
Bold**foo**foo
Italic bold***foo***foo
Horizontal ruler***
Inline blockquote
code
code
Unordered list- a
- b
• a
• b
Latex math equation\$$e^{2x} \$$$$e^{2x}$$