From f18ebbdf280df5832e1b4bc7f24342182fd77318 Mon Sep 17 00:00:00 2001 From: rocky Date: Tue, 11 Jul 2023 02:35:22 -0400 Subject: [PATCH] Preserve summary text to non-guide Django sections Also start regularizing section summary text here. --- mathics/builtin/graphics.py | 46 ++++++++++++++++++++---------------- mathics/builtin/layout.py | 2 +- mathics/builtin/optiondoc.py | 28 ++++++++++++---------- mathics/doc/common_doc.py | 9 +++++-- 4 files changed, 50 insertions(+), 35 deletions(-) diff --git a/mathics/builtin/graphics.py b/mathics/builtin/graphics.py index ea8588b32..f1ba9993b 100644 --- a/mathics/builtin/graphics.py +++ b/mathics/builtin/graphics.py @@ -5,9 +5,6 @@ Drawing Graphics """ -# This following line tells documentation how to sort this module -sort_order = "mathics.builtin.drawing-graphics" - from math import sqrt from mathics.builtin.base import Builtin @@ -52,6 +49,9 @@ ) from mathics.eval.nevaluator import eval_N +# This following line tells documentation how to sort this module +sort_order = "mathics.builtin.drawing-graphics" + GRAPHICS_OPTIONS = { "AspectRatio": "Automatic", "Axes": "False", @@ -431,7 +431,7 @@ class AbsoluteThickness(_Thickness): = -Graphics- """ - summary_text = "graphics directive be specifying absolute line thickness" + summary_text = "graphics directive for the absolute line thickness" def get_thickness(self): return self.graphics.translate_absolute((self.value, 0))[0] @@ -485,7 +485,7 @@ class PointSize(_Size): = {-Graphics3D-, -Graphics3D-, -Graphics3D-} """ - summary_text = "graphics directive specifying relative sizes of points" + summary_text = "graphics directive for relative sizes of points" def get_absolute_size(self): if self.graphics.view_width is None: @@ -592,7 +592,8 @@ class Polygon(Builtin): Notice that there is a line connecting from the last point to the first one. - A point is an element of the polygon if a ray from the point in any direction in the plane crosses the boundary line segments an odd number of times. + A point is an element of the polygon if a ray from the point in any direction in \ + the plane crosses the boundary line segments an odd number of times. >> Graphics[Polygon[{{150,0},{121,90},{198,35},{102,35},{179,90}}]] = -Graphics- @@ -600,7 +601,7 @@ class Polygon(Builtin): = -Graphics3D- """ - summary_text = "a polygon in 2D or 3D" + summary_text = "graphics primitive for a polygon in 2D or 3D" class RegularPolygon(Builtin): @@ -628,7 +629,7 @@ class RegularPolygon(Builtin): = -Graphics- """ - summary_text = "a regular polygon in 2D" + summary_text = "graphics primitve for a regular polygon in 2D" class Arrow(Builtin): @@ -645,10 +646,12 @@ class Arrow(Builtin):
represents a line with arrow that keeps a distance of $s$ from $p1$ and $p2$.
'Arrow[{$point_1$, $point_2$}, {$s1$, $s2$}]' -
represents a line with arrow that keeps a distance of $s1$ from $p1$ and a distance of $s2$ from $p2$. +
represents a line with arrow that keeps a distance of $s1$ from $p1$ and a \ + distance of $s2$ from $p2$.
'Arrow[{$point_1$, $point_2$}, {$s1$, $s2$}]' -
represents a line with arrow that keeps a distance of $s1$ from $p1$ and a distance of $s2$ from $p2$. +
represents a line with arrow that keeps a distance of $s1$ from $p1$ and a \ + distance of $s2$ from $p2$. >> Graphics[Arrow[{{0,0}, {1,1}}]] @@ -668,7 +671,7 @@ class Arrow(Builtin): = {-Graphics-, -Graphics-, -Graphics-, -Graphics-, -Graphics-} """ - summary_text = "graphics primitive to specify arbitrary graphical arrows" + summary_text = "graphics primitive for arbitrary graphical arrows" class Arrowheads(_GraphicsDirective): @@ -680,19 +683,24 @@ class Arrowheads(_GraphicsDirective):
'Arrowheads[$s$]' -
specifies that Arrow[] draws one arrow of size $s$ (relative to width of image, defaults to 0.04). +
specifies that Arrow[] draws one arrow of size $s$ (relative to width of \ + image, defaults to 0.04).
'Arrowheads[{$spec1$, $spec2$, ..., $specn$}]' -
specifies that Arrow[] draws n arrows as defined by $spec1$, $spec2$, ... $specn$. +
specifies that Arrow[] draws n arrows as defined by $spec1$, $spec2$, \ + ... $specn$.
'Arrowheads[{{$s$}}]'
specifies that one arrow of size $s$ should be drawn.
'Arrowheads[{{$s$, $pos$}}]' -
specifies that one arrow of size $s$ should be drawn at position $pos$ (for the arrow to be on the line, $pos$ has to be between 0, i.e. the start for the line, and 1, i.e. the end of the line). +
specifies that one arrow of size $s$ should be drawn at position $pos$ (for \ + the arrow to be on the line, $pos$ has to be between 0, i.e. the start for \ + the line, and 1, i.e. the end of the line).
'Arrowheads[{{$s$, $pos$, $g$}}]' -
specifies that one arrow of size $s$ should be drawn at position $pos$ using Graphics $g$. +
specifies that one arrow of size $s$ should be drawn at position $pos$ \ + using Graphics $g$.
Arrows on both ends can be achieved using negative sizes: @@ -711,9 +719,7 @@ class Arrowheads(_GraphicsDirective): default_size = 0.04 - summary_text = ( - "graphics directive specifying the form and placement of an arrowhead" - ) + summary_text = "graphics directive for the form and placement of an arrowhead" symbolic_sizes = { "System`Tiny": 3, @@ -1232,7 +1238,7 @@ class Circle(Builtin): """ rules = {"Circle[]": "Circle[{0, 0}]"} - summary_text = "empty circle, ellipse, or arc graphics primitive" + summary_text = "graphics primitive for an empty circle, ellipse, or arc" class Disk(Builtin): @@ -1493,7 +1499,7 @@ class Thickness(_Thickness): = -Graphics- """ - summary_text = "graphics directive to specify line thicknesses" + summary_text = "graphics directive for line thicknesses" def get_thickness(self): return self.graphics.translate_relative(self.value) diff --git a/mathics/builtin/layout.py b/mathics/builtin/layout.py index 7d01543f9..0397b09b3 100644 --- a/mathics/builtin/layout.py +++ b/mathics/builtin/layout.py @@ -420,7 +420,7 @@ class Style(Builtin): """ - summary_text = "wrapper specifying styles and style options to apply" + summary_text = "wrapper for styles and style options to apply" options = {"ImageSizeMultipliers": "Automatic"} rules = { diff --git a/mathics/builtin/optiondoc.py b/mathics/builtin/optiondoc.py index e4db6c5fb..a4d3592f1 100644 --- a/mathics/builtin/optiondoc.py +++ b/mathics/builtin/optiondoc.py @@ -3,13 +3,11 @@ """ Drawing Options and Option Values -The various common Plot and Graphics options, along with the meaning of specific option values are described here. +The various common Plot and Graphics options, along with the meaning of specific \ +option values are described here. """ -# This tells documentation how to sort this module -sort_order = "mathics.builtin.drawing-options-and-option-values" - # Until we have a better documentation system in place, we define classes for # options. They are Builtins, even though they largely aren't. # @@ -19,6 +17,9 @@ from mathics.builtin.base import Builtin +# This tells documentation how to sort this module +sort_order = "mathics.builtin.drawing-options-and-option-values" + class Automatic(Builtin): """ @@ -99,14 +100,15 @@ class ChartLabels(Builtin):
'ChartLabels' -
is a charting option that specifies what labels should be used for chart elements. +
is a charting option that specifies what labels should be used for chart \ + elements.
>> PieChart[{30, 20, 10}, ChartLabels -> {Dogs, Cats, Fish}] = -Graphics- """ - summary_text = "charting option specifying whether to label chart" + summary_text = "charting option for whether to label chart" class ChartLegends(Builtin): @@ -115,11 +117,12 @@ class ChartLegends(Builtin):
'ChartLegends' -
is an option for charting functions that specifies the legends to be used for chart elements. +
is an option for charting functions that specifies the legends to be used \ + for chart elements.
""" - summary_text = "chart option giving legends to a chart" + summary_text = "chart option for giving legends to a chart" class Filling(Builtin): @@ -173,7 +176,7 @@ class ImageSize(Builtin): = -Graphics- """ - summary_text = "image option specifying the size of the final picture" + summary_text = "image option for the size of the final picture" class Joined(Builtin): @@ -211,7 +214,7 @@ class MaxRecursion(Builtin): """ summary_text = ( - "function option specifying the maximum number of recursive " + "function option for the maximum number of recursive " "subdivisions the function can perform" ) @@ -298,7 +301,8 @@ class TicksStyle(Builtin):
'TicksStyle' -
is an option for graphics functions which specifies how ticks should be rendered. +
is an option for graphics functions which specifies how ticks should be \ + rendered.