diff --git a/docs/args/draw.rst b/docs/args/draw.rst new file mode 100644 index 0000000..c954974 --- /dev/null +++ b/docs/args/draw.rst @@ -0,0 +1,34 @@ +fill_color + default: ``'#0000'`` (fully transparent) + + the color or gradient to fill with. See :doc:`/colors`. + + +stroke_color + default: ``:black`` + + the color with which to stroke the outside of the rectangle. See :docs:`/colors`. + + +stroke_width + default: ``2`` + + the width of the outside stroke. Supports :doc:`/units`. + + +stroke_strategy + default: ``:fill_first`` + + Specify whether the stroke is done before (thinner) or after (thicker) filling the shape. + + Must be either ``:fill_first`` or ``:stroke_first`` (or their string equivalents). + +dash + default: ``''`` (no dash pattern set) + + Define a dash pattern for the stroke. This is a special string with space-separated numbers that define the pattern of on-and-off alternating strokes, measured in pixels or units. For example, ``'0.02in 0.02in'`` will be an equal on-and-off dash pattern. Supports :doc:`/units`. + +cap + default: ``:butt`` + + Define how the end of the stroke is drawn. Options are ``:square``, ``:butt``, and ``:round`` (or string equivalents of those). diff --git a/docs/args/expansion.rst b/docs/args/expansion.rst new file mode 100644 index 0000000..10e0234 --- /dev/null +++ b/docs/args/expansion.rst @@ -0,0 +1 @@ +All of these options support arrays and singleton expansion (except for **range**). See :doc:`/arrays` for deeper explanation. diff --git a/docs/args/layout.rst b/docs/args/layout.rst new file mode 100644 index 0000000..6b74366 --- /dev/null +++ b/docs/args/layout.rst @@ -0,0 +1,4 @@ +layout + default: ``nil`` + + entry in the layout to use as defaults for this command. See :doc:`/layouts`. diff --git a/docs/args/range.rst b/docs/args/range.rst new file mode 100644 index 0000000..f74a63d --- /dev/null +++ b/docs/args/range.rst @@ -0,0 +1,4 @@ +range + default: ``:all`` + + the range of cards over which this will be rendered. See :ref:`using_ranges` diff --git a/docs/args/wh.rst b/docs/args/wh.rst new file mode 100644 index 0000000..f25f219 --- /dev/null +++ b/docs/args/wh.rst @@ -0,0 +1,10 @@ +width + default: ``:deck`` (the width of the deck) + + the width of the box. Supports :doc:`/units`. + + +height + default: ``:deck`` (the height of the deck) + + the height of the box. Supports :doc:`/units`. diff --git a/docs/args/xy.rst b/docs/args/xy.rst new file mode 100644 index 0000000..2d27a93 --- /dev/null +++ b/docs/args/xy.rst @@ -0,0 +1,10 @@ +x + default: ``0`` + + the x-coordinate to place, relative to the upper-left corner of the card and moving right as it increases. Supports :doc:`/units`. + + +y + default: ``0`` + + the y-coordinate to place, relative to the upper-left corner of the card and moving downward as it increases. Supports :doc:`/units`. diff --git a/docs/dsl/background.rst b/docs/dsl/background.rst index f475e8d..c573768 100644 --- a/docs/dsl/background.rst +++ b/docs/dsl/background.rst @@ -6,17 +6,14 @@ Fills the background with the given color Options ^^^^^^^ -All options support arrays and singleton expansion. See :doc:`/arrays` +.. include:: /args/expansion.rst -range - default: ``:all`` - - the range of cards over which this will be rendered. See :ref:`using_ranges` +.. include:: /args/range.rst color default: ``:black`` - the color to fill the background with. See :doc:`/colors`. + the color or gradient to fill the background with. See :doc:`/colors`. Examples diff --git a/docs/dsl/circle.rst b/docs/dsl/circle.rst index 21a76f3..5d60d45 100644 --- a/docs/dsl/circle.rst +++ b/docs/dsl/circle.rst @@ -1,2 +1,22 @@ circle ------ + +Draw a circle centered at the given coordinates + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +.. include:: /args/xy.rst + +radius + default: ``100`` + + radius of the circle. Supports :doc:`/units`. + +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + +Examples +^^^^^^^^ diff --git a/docs/dsl/curve.rst b/docs/dsl/curve.rst index 2ebfd4c..eae5d89 100644 --- a/docs/dsl/curve.rst +++ b/docs/dsl/curve.rst @@ -1,2 +1,63 @@ curve ----- + +Draw a bezier curve using the given coordinates, from x1,y1 to x2,y2. The curvature is set by the control points cx1,cy2 and cx2,cy2. + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +x1 + default: ``0`` + + the x-coordinate of the first endpoint. Supports :doc:`/units`. + + +y1 + default: ``0`` + + the y-coordinate of the first endpoint. Supports :doc:`/units`. + + +x2 + default: ``5`` + + the x-coordinate of the second endpoint. Supports :doc:`/units`. + + +y2 + default: ``5`` + + the y-coordinate of the second endpoint. Supports :doc:`/units`. + + +cx1 + default: ``0`` + + the x-coordinate of the first control point. Supports :doc:`/units`. + + +cy1 + default: ``0`` + + the y-coordinate of the first control point. Supports :doc:`/units`. + + +cx2 + default: ``5`` + + the x-coordinate of the second control point. Supports :doc:`/units`. + + +cy2 + default: ``5`` + + the y-coordinate of the second control point. Supports :doc:`/units`. + + +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + +Examples +^^^^^^^^ diff --git a/docs/dsl/ellipse.rst b/docs/dsl/ellipse.rst index 85e5611..7effb12 100644 --- a/docs/dsl/ellipse.rst +++ b/docs/dsl/ellipse.rst @@ -1,2 +1,17 @@ ellipse ------- + +Draw an ellipse at the given coordinates. + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +.. include:: /args/xy.rst +.. include:: /args/wh.rst +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + +Examples +^^^^^^^^ diff --git a/docs/dsl/grid.rst b/docs/dsl/grid.rst index 5bc23ef..af0fbe3 100644 --- a/docs/dsl/grid.rst +++ b/docs/dsl/grid.rst @@ -1,2 +1,31 @@ grid ---- + +Draw an unlimited square grid of lines on the deck, starting with x,y and extending off the end of the deck. + + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +.. include:: /args/xy.rst + + +width + default: ``:deck`` (the width of the deck) + + the spacing between vertical gridlines. Supports :doc:`/units`. + + +height + default: ``:deck`` (the height of the deck) + + the spacing between horizontal gridlines. Supports :doc:`/units`. + + +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + +Examples +^^^^^^^^ diff --git a/docs/dsl/line.rst b/docs/dsl/line.rst index e0389ad..dc8cb21 100644 --- a/docs/dsl/line.rst +++ b/docs/dsl/line.rst @@ -1,2 +1,52 @@ line ---- + +Draw a line from x1,y1 to x2,y2. + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +x1 + default: ``0`` + + the x-coordinate to place. Supports :doc:`/units/` + + +y1 + default: ``0`` + + the y-coordinate to place. Supports :doc:`/units/` + + +x2 + default: ``50`` + + the x-coordinate to place. Supports :doc:`/units/` + + +y2 + default: ``50`` + + the y-coordinate to place. Supports :doc:`/units/` + + +x3 + default: ``0`` + + the x-coordinate to place. Supports :doc:`/units/` + + +y3 + default: ``50`` + + the y-coordinate to place. Supports :doc:`/units/` + + + +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + +Examples +^^^^^^^^ diff --git a/docs/dsl/polygon.rst b/docs/dsl/polygon.rst index f8e7bf0..cb158d0 100644 --- a/docs/dsl/polygon.rst +++ b/docs/dsl/polygon.rst @@ -1,2 +1,28 @@ -polygon -------- +star +---- + +Draw an n-sided regular polygon, centered at x,y. + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +.. include:: /args/xy.rst + +radius + default: 0 + + the distance from the center of the star to the inner circle of its points. Supports :doc:`/units`. + +angle + default: 0 + + the angle at which to rotate the star + + +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + +Examples +^^^^^^^^ diff --git a/docs/dsl/rect.rst b/docs/dsl/rect.rst index 9be8ad9..0c5f03b 100644 --- a/docs/dsl/rect.rst +++ b/docs/dsl/rect.rst @@ -1,2 +1,18 @@ rect ---- + +Draw a rounded rectangle + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +.. include:: /args/xy.rst +.. include:: /args/wh.rst +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + + +Examples +^^^^^^^^ diff --git a/docs/dsl/star.rst b/docs/dsl/star.rst index a97b04f..09815e8 100644 --- a/docs/dsl/star.rst +++ b/docs/dsl/star.rst @@ -1,2 +1,35 @@ star ---- + +Draw an n-pointed star, centered at x,y. + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +.. include:: /args/xy.rst + +inner_radius + default: 0 + + the distance from the center of the star to the inner circle of its points. Supports :doc:`/units`. + + +outer_radius + default: 0 + + the distance from the center of the star to the outer circle of its points. Supports :doc:`/units`. + + +angle + default: 0 + + the angle at which to rotate the star + + +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + +Examples +^^^^^^^^ diff --git a/docs/dsl/triangle.rst b/docs/dsl/triangle.rst index e4bc07d..ccadd3e 100644 --- a/docs/dsl/triangle.rst +++ b/docs/dsl/triangle.rst @@ -1,2 +1,38 @@ triangle -------- + +Draw a triangle at the given coordinates. + +Options +^^^^^^^ +.. include:: /args/expansion.rst + +x1 + default: ``0`` + + the x-coordinate to place. Supports :doc:`/units/` + + +y1 + default: ``0`` + + the y-coordinate to place. Supports :doc:`/units/` + + +x2 + default: ``50`` + + the x-coordinate to place. Supports :doc:`/units/` + + +y2 + default: ``50`` + + the y-coordinate to place. Supports :doc:`/units/` + +.. include:: /args/draw.rst +.. include:: /args/range.rst +.. include:: /args/layout.rst + +Examples +^^^^^^^^ diff --git a/docs/index.rst b/docs/index.rst index c6aabc0..4a879fc 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -11,6 +11,7 @@ Contents: learning parameters arrays + layouts units colors dsl/index.rst diff --git a/docs/layouts.rst b/docs/layouts.rst new file mode 100644 index 0000000..577a3a9 --- /dev/null +++ b/docs/layouts.rst @@ -0,0 +1,2 @@ +Layouts Group Things Logically +==============================