Skip to content
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

normalizing linebreaks after </dl> #1055

Merged
merged 1 commit into from
Aug 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions mathics/builtin/arithfns/basic.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ class Divide(BinaryOperator):
<dt>'$a$ / $b$'
<dd>represents the division of $a$ by $b$.
</dl>

>> 30 / 5
= 6
>> 1 / 8
Expand Down Expand Up @@ -579,6 +580,7 @@ class Times(BinaryOperator, SympyFunction):
<dt>'$a$ $b$ ...'
<dd>represents the product of the terms $a$, $b$, ...
</dl>

>> 10 * 2
= 20
>> 10 2
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/arithmetic.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ class Assuming(Builtin):
<dt>'Assuming[$cond$, $expr$]'
<dd>Evaluates $expr$ assuming the conditions $cond$.
</dl>

>> $Assumptions = { x > 0 }
= {x > 0}
>> Assuming[y>0, ConditionalExpression[y x^2, y>0]//Simplify]
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/assignments/assignment.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class LoadModule(Builtin):
<dt>'LoadModule[$module$]'
<dd>'Load Mathics definitions from the python module $module$
</dl>

>> LoadModule["nomodule"]
: Python import errors with: No module named 'nomodule'.
= $Failed
Expand Down
2 changes: 2 additions & 0 deletions mathics/builtin/assignments/clear.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ class Remove(Builtin):
<dt>'Remove[$x$]'
<dd>removes the definition associated to $x$.
</dl>

>> a := 2
>> Names["Global`a"]
= {a}
Expand Down Expand Up @@ -214,6 +215,7 @@ class Unset(PostfixOperator):
<dt>'$x$=.'
<dd>removes any value belonging to $x$.
</dl>

>> a = 2
= 2
>> a =.
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/atomic/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,7 @@ class InterpretedBox(PrefixOperator):
<dt>'InterpretedBox[$box$]'
<dd>is the ad hoc fullform for \! $box$. just for internal use...
</dl>

>> \! \(2+2\)
= 4
"""
Expand Down
2 changes: 2 additions & 0 deletions mathics/builtin/binary/system.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class ByteOrdering(Predefined):
that specifies what ordering of bytes should be assumed for your \
computer system..
</dl>

"""

name = "ByteOrdering"
Expand All @@ -34,6 +35,7 @@ class ByteOrdering_(Predefined):
<dt>'$ByteOrdering'
<dd>returns the native ordering of bytes in binary data on your computer system.
</dl>

"""

name = "$ByteOrdering"
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/binary/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ class Byte(Builtin):
<dt>'Byte'
<dd>is a data type for 'Read'.
</dl>

"""

summary_text = "single byte of data, returned as an integer"
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/datentime.py
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ class DateObject(_DateFormat, ImmutableValueMixin):
<dt>'DateObject[...]'
<dd> Returns an object codifiyng DateList....
</dl>

>> DateObject[{2020, 4, 15}]
= [...]
"""
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/directories/system_directories.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ class InstallationDirectory(Predefined):
<dt>'$InstallationDirectory'
<dd>returns the top-level directory in which \\Mathics was installed.
</dl>

>> $InstallationDirectory
= ...
"""
Expand Down
3 changes: 3 additions & 0 deletions mathics/builtin/drawing/drawing_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@ class ChartLegends(Builtin):
<dd>is an option for charting functions that specifies the legends to be used \
for chart elements.
</dl>

"""

summary_text = "chart option for giving legends to a chart"
Expand Down Expand Up @@ -175,6 +176,7 @@ class Full(Builtin):
<dt>'Full'
<dd>is a possible value for the 'Mesh' and 'PlotRange' options.
</dl>

"""

summary_text = "graph option value for Mesh and PlotRange"
Expand Down Expand Up @@ -301,6 +303,7 @@ class PlotRange(Builtin):
<dd>is a charting option, such as for 'Plot', 'BarChart', 'PieChart', \
etc. that gives the range of coordinates to include in a plot.
</dl>

<ul>
<li>All all points are included.
<li>Automatic - outlying points are dropped.
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/drawing/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,7 @@ class ColorDataFunction(Builtin):
<dt>'ColorDataFunction[range, ...]'
<dd> is a function that represents a color scheme.
</dl>

"""

summary_text = "color scheme object"
Expand Down
3 changes: 3 additions & 0 deletions mathics/builtin/evaluation.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ class Hold(Builtin):
<dt>'Hold[$expr$]'
<dd>prevents $expr$ from being evaluated.
</dl>

>> Attributes[Hold]
= {HoldAll, Protected}
"""
Expand All @@ -136,6 +137,7 @@ class HoldComplete(Builtin):
<dd>prevents $expr$ from being evaluated, and also prevents
'Sequence' objects from being spliced into argument lists.
</dl>

>> Attributes[HoldComplete]
= {HoldAllComplete, Protected}
"""
Expand Down Expand Up @@ -253,6 +255,7 @@ class ReleaseHold(Builtin):
<dd>removes any 'Hold', 'HoldForm', 'HoldPattern' or
'HoldComplete' head from $expr$.
</dl>

>> x = 3;
>> Hold[x]
= Hold[x]
Expand Down
6 changes: 6 additions & 0 deletions mathics/builtin/fileformats/htmlformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,7 @@ class DataImport(_DataImport):
<dt>'HTML`DataImport["filename"]'
<dd> imports data from a HTML file.
</dl>

>> Import["ExampleData/PrimeMeridian.html", "Data"][[1, 1, 2, 3]]
= {Washington, D.C., 77...03′56.07″ W (1897) or 77...04′02.24″ W (NAD 27) or 77...04′01.16″ W (NAD 83), New Naval Observatory meridian}

Expand Down Expand Up @@ -344,6 +345,7 @@ class ImageLinksImport(_LinksImport):
<dt>'HTML`ImageLinksImport["filename"]'
<dd> imports links to the images included in a HTML file.
</dl>

>> Import["ExampleData/PrimeMeridian.html", "ImageLinks"][[6]]
= //upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Prime_meridian.jpg/180px-Prime_meridian.jpg
"""
Expand All @@ -366,6 +368,7 @@ class PlaintextImport(_TagImport):
<dt>'HTML`PlaintextImport["filename"]'
<dd> imports plane text from a HTML file.
</dl>

>> DeleteDuplicates[StringCases[Import["ExampleData/PrimeMeridian.html"], RegularExpression["Wiki[a-z]+"]]]
= {Wikipedia, Wikidata, Wikibase, Wikimedia}
"""
Expand All @@ -391,6 +394,7 @@ class SourceImport(_HTMLBuiltin):
<dt>'HTML`SourceImport["filename"]'
<dd> imports source code from a HTML file.
</dl>

>> DeleteDuplicates[StringCases[Import["ExampleData/PrimeMeridian.html", "Source"], RegularExpression["<t[a-z]+>"]]]
= {<title>, <tr>, <th>, <td>}
"""
Expand All @@ -417,6 +421,7 @@ class TitleImport(_TagImport):
<dt>'HTML`TitleImport["filename"]'
<dd> imports the title string from a HTML file.
</dl>

>> Import["ExampleData/PrimeMeridian.html", "Title"]
= Prime meridian - Wikipedia
"""
Expand All @@ -438,6 +443,7 @@ class XMLObjectImport(_HTMLBuiltin):
<dt>'HTML`XMLObjectImport["filename"]'
<dd> imports XML objects from a HTML file.
</dl>

>> Part[Import["ExampleData/PrimeMeridian.html", "XMLObject"], 2, 3, 1, 3, 2]
= XMLElement[title, {}, {Prime meridian - Wikipedia}]
"""
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/fileformats/xmlformat.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,7 @@ class XMLGetString(_Get):
<dt>'XML`Parser`XMLGetString["string"]'
<dd>parses "string" as XML code, and returns an XMLObject.
</dl>

>> Head[XML`Parser`XMLGetString["<a></a>"]]
= XMLObject[Document]

Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/files_io/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -721,6 +721,7 @@ class Read(Builtin):
<dd>reads the input stream for an Expression and puts it inside 'Hold'.

</dl>

$type$ is one of:
<ul>
<li>Byte
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/functional/composition.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ class Identity(Builtin):
<dt>'Identity[$x$]'
<dd>is the identity function, which returns $x$ unchanged.
</dl>

X> Identity[x]
= x
X> Identity[x, y]
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/graphics.py
Original file line number Diff line number Diff line change
Expand Up @@ -1339,6 +1339,7 @@ class EdgeForm(Builtin):
<dt> 'EdgeForm[$g$]'
<dd> is a graphics directive that specifies that edges of filled graphics objects are to be drawn using the graphics directive or list of directives $g$.
</dl>

>> Graphics[{EdgeForm[{Thick, Green}], Disk[]}]
= -Graphics-

Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/kernel_sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,5 +98,6 @@ class Exit(Quit):
<dt>'Exit[$n$]'
<dd> Terminates the mathics session with exit code $n$.
</dl>

'Exit' is the same thing as 'Quit'.
"""
1 change: 1 addition & 0 deletions mathics/builtin/list/associations.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,7 @@ class Missing(Builtin):
<dd>'Missing[]'
<dt> represents a data that is missing.
</dl>

>> ElementData["Meitnerium","MeltingPoint"]
= Missing[NotAvailable]
"""
Expand Down
3 changes: 3 additions & 0 deletions mathics/builtin/mainloop.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ class HistoryLength(Builtin):
<dt>'$HistoryLength'
<dd>specifies the maximum number of 'In' and 'Out' entries.
</dl>

>> $HistoryLength
= 100
>> $HistoryLength = 1;
Expand Down Expand Up @@ -68,6 +69,7 @@ class In(Builtin):
<dt>'In[$k$]'
<dd>gives the $k$th line of input.
</dl>

>> x = 1
= 1
>> x = x + 1
Expand Down Expand Up @@ -207,6 +209,7 @@ class Line(Builtin):
<dt>'$Line'
<dd>holds the current input line number.
</dl>

>> $Line
= 1
>> $Line
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/numbers/algebra.py
Original file line number Diff line number Diff line change
Expand Up @@ -1671,6 +1671,7 @@ class FullSimplify(Simplify):
<dt>'FullSimplify[$expr$, $assump$]'
<dd>simplifies $expr$ assuming $assump$ instead of $Assumptions$.
</dl>

TODO: implement the extension. By now, this does the same than Simplify...

>> FullSimplify[2*Sin[x]^2 + 2*Cos[x]^2]
Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/numbers/constants.py
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ class Degree(_MPMathConstant, _NumpyConstant, _SympyConstant):
<dt>'Degree'
<dd>is the number of radians in one degree. It has a numerical value of \u03c0 / 180.
</dl>

>> Cos[60 Degree]
= 1 / 2

Expand Down
1 change: 1 addition & 0 deletions mathics/builtin/numbers/randomnumbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ class Random(Builtin):
$type$, in the specified interval $range$. Possible types are \
'Integer', 'Real' or 'Complex'.
</dl>

Legacy function. Superseded by RandomReal, RandomInteger and RandomComplex.

"""
Expand Down
3 changes: 3 additions & 0 deletions mathics/builtin/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@ class N(Builtin):
<dt>'N[$expr$, $prec$]'
<dd>evaluates $expr$ numerically with a precision of $prec$ digits.
</dl>

>> N[Pi, 50]
= 3.1415926535897932384626433832795028841971693993751

Expand Down Expand Up @@ -553,6 +554,7 @@ class RealAbs(Builtin):
<dt>'RealAbs[$x$]'
<dd>returns the absolute value of a real number $x$.
</dl>

'RealAbs' is also known as modulus. It is evaluated if $x$ can be compared \
with $0$.

Expand Down Expand Up @@ -595,6 +597,7 @@ class RealSign(Builtin):
<dd>returns -1, 0 or 1 depending on whether $x$ is negative,
zero or positive.
</dl>

'RealSign' is also known as $sgn$ or $signum$ function.

>> RealSign[-3.]
Expand Down
2 changes: 2 additions & 0 deletions mathics/builtin/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -1490,6 +1490,7 @@ class Longest(Builtin):
<dd>is a pattern object that matches the longest sequence consistent \
with the pattern $p$.
</dl>

>> StringCases["aabaaab", Longest["a" ~~ __ ~~ "b"]]
= {aabaaab}

Expand Down Expand Up @@ -1716,6 +1717,7 @@ class DispatchAtom(AtomBuiltin):
In the future, it should return an optimized DispatchRules atom, \
containing an optimized set of rules.
</dl>

>> rules = {{a_,b_}->a^b, {1,2}->3., F[x_]->x^2};
>> F[2] /. rules
= 4
Expand Down
4 changes: 4 additions & 0 deletions mathics/builtin/procedural.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class Abort(Builtin):
<dt>'Abort[]'
<dd>aborts an evaluation completely and returns '$Aborted'.
</dl>

>> Print["a"]; Abort[]; Print["b"]
| a
= $Aborted
Expand All @@ -70,6 +71,7 @@ class Break(Builtin):
<dt>'Break[]'
<dd>exits a 'For', 'While', or 'Do' loop.
</dl>

>> n = 0;
>> While[True, If[n>10, Break[]]; n=n+1]
>> n
Expand Down Expand Up @@ -245,6 +247,7 @@ class Do(IterationFunction):
<dd>evaluates $expr$ for each $j$ from $jmin$ to $jmax$, for each $i$ from $imin$
to $imax$, etc.
</dl>

>> Do[Print[i], {i, 2, 4}]
| 2
| 3
Expand Down Expand Up @@ -392,6 +395,7 @@ class Interrupt(Builtin):
<dt>'Interrupt[]'
<dd>Interrupt an evaluation and returns '$Aborted'.
</dl>

>> Print["a"]; Interrupt[]; Print["b"]
| a
= $Aborted
Expand Down
2 changes: 2 additions & 0 deletions mathics/builtin/specialfns/gamma.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Beta(MPMathMultiFunction):
<dt>'Beta[$z$, $a$, $b$]'
<dd>gives the incomplete Beta function.
</dl>

The Beta function satisfies the property
Beta[x, y] = Integrate[t^(x-1)(1-t)^(y-1),{t,0,1}] = Gamma[a] Gamma[b] / Gamma[a + b]
>> Beta[2, 3]
Expand Down Expand Up @@ -174,6 +175,7 @@ class Factorial2(PostfixOperator, MPMathFunction):
<dt>'$n$!!'
<dd>computes the double factorial of $n$.
</dl>

The double factorial or semifactorial of a number $n$, is the product of all the \
integers from 1 up to n that have the same parity (odd or even) as $n$.

Expand Down
Loading