More docs fixes (#6733)
* Fix various docs errors around std module Signed-off-by: Nick Cameron <nrc@ncameron.org> * remove KCL from lang docs titles and move settings docs Signed-off-by: Nick Cameron <nrc@ncameron.org> * Include functions declared in Rust in module docs Signed-off-by: Nick Cameron <nrc@ncameron.org> --------- Signed-off-by: Nick Cameron <nrc@ncameron.org>
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "KCL Known Issues"
|
||||
title: "Known Issues"
|
||||
excerpt: "Known issues with the KCL standard library for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "KCL Modules"
|
||||
title: "Modules"
|
||||
excerpt: "Documentation of modules for the KCL language for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "KCL Settings"
|
||||
title: "Settings"
|
||||
excerpt: "Documentation of settings for the KCL language and Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
@ -8,16 +8,16 @@ layout: manual
|
||||
|
||||
There are three levels of settings available in Zoo Design Studio:
|
||||
|
||||
1. [User Settings](/docs/kcl/settings-user): Global settings that apply to all projects, stored in `user.toml`
|
||||
2. [Project Settings](/docs/kcl/settings-project): Settings specific to a project, stored in `project.toml`
|
||||
1. [User Settings](/docs/kcl/settings/user): Global settings that apply to all projects, stored in `user.toml`
|
||||
2. [Project Settings](/docs/kcl/settings/project): Settings specific to a project, stored in `project.toml`
|
||||
3. Per-file Settings: Settings that apply to a single KCL file, specified using the `@settings` attribute
|
||||
|
||||
## Configuration Files
|
||||
|
||||
Zoo Design Studio uses TOML files for configuration:
|
||||
|
||||
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings-user)
|
||||
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings-project)
|
||||
* **User Settings**: `user.toml` - See [complete documentation](/docs/kcl/settings/user)
|
||||
* **Project Settings**: `project.toml` - See [complete documentation](/docs/kcl/settings/project)
|
||||
|
||||
## Per-file settings
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
---
|
||||
title: "KCL Types"
|
||||
title: "Types"
|
||||
excerpt: "Documentation of types for the KCL standard library for the Zoo Design Studio."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "END"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "Identifies the ending face of an extrusion. I.e., the new face created by an extrusion."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "START"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: "Identifies the starting face of an extrusion. I.e., the face which is extruded."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "X"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "XY"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "XZ"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Y"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "YZ"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Z"
|
||||
subtitle: "Constant in prelude"
|
||||
subtitle: "Constant in std"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "E"
|
||||
subtitle: "Constant in math"
|
||||
subtitle: "Constant in std::math"
|
||||
excerpt: "The value of Euler’s number `e`."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "PI"
|
||||
subtitle: "Constant in math"
|
||||
subtitle: "Constant in std::math"
|
||||
excerpt: "The value of `pi`, Archimedes’ constant (π)."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "TAU"
|
||||
subtitle: "Constant in math"
|
||||
subtitle: "Constant in std::math"
|
||||
excerpt: "The value of `tau`, the full circle constant (τ). Equal to 2π."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "turns::HALF_TURN"
|
||||
subtitle: "Constant in turns"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "turns::QUARTER_TURN"
|
||||
subtitle: "Constant in turns"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "turns::THREE_QUARTER_TURN"
|
||||
subtitle: "Constant in turns"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "turns::ZERO"
|
||||
subtitle: "Constant in turns"
|
||||
subtitle: "Constant in std::turns"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "helix"
|
||||
subtitle: "Function in prelude"
|
||||
subtitle: "Function in std"
|
||||
excerpt: "Create a helix."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "abs"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the absolute value of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "acos"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the arccosine of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "asin"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the arcsine of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "atan"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the arctangent of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "atan2"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the four quadrant arctangent of Y and X."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "ceil"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the smallest integer greater than or equal to a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "cos"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the cosine of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "floor"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the largest integer less than or equal to a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "ln"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the natural logarithm of the number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "log"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the logarithm of the number with respect to an arbitrary base."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "log10"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the base 10 logarithm of the number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "log2"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the base 2 logarithm of the number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "max"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the maximum of the given arguments."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "min"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the minimum of the given arguments."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "polar"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "pow"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the number to a power."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "rem"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "round"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Round a number to the nearest integer."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "sin"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the sine of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "sqrt"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the square root of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "tan"
|
||||
subtitle: "Function in math"
|
||||
subtitle: "Function in std::math"
|
||||
excerpt: "Compute the tangent of a number."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "offsetPlane"
|
||||
subtitle: "Function in prelude"
|
||||
subtitle: "Function in std"
|
||||
excerpt: "Offset a plane by a distance along its normal."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "circle"
|
||||
subtitle: "Function in sketch"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "revolve"
|
||||
subtitle: "Function in sketch"
|
||||
subtitle: "Function in std::sketch"
|
||||
excerpt: "Rotate a sketch around some provided axis, creating a solid from its extent."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "chamfer"
|
||||
subtitle: "Function in solid"
|
||||
subtitle: "Function in std::solid"
|
||||
excerpt: "Cut a straight transitional edge along a tagged path."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "fillet"
|
||||
subtitle: "Function in solid"
|
||||
subtitle: "Function in std::solid"
|
||||
excerpt: "Blend a transitional edge along a tagged path, smoothing the sharp edge."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "hollow"
|
||||
subtitle: "Function in solid"
|
||||
subtitle: "Function in std::solid"
|
||||
excerpt: "Make the inside of a 3D object hollow."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "shell"
|
||||
subtitle: "Function in solid"
|
||||
subtitle: "Function in std::solid"
|
||||
excerpt: ""
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "mirror2d"
|
||||
subtitle: "Function in transform"
|
||||
subtitle: "Function in std::transform"
|
||||
excerpt: "Mirror a sketch."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toCentimeters"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to centimeters from its current units."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toDegrees"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Converts a number to degrees from its current units."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toFeet"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to feet from its current units."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toInches"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to inches from its current units."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toMeters"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to meters from its current units."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toMillimeters"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Convert a number to millimeters from its current units."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toRadians"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Converts a number to radians from its current units."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "units::toYards"
|
||||
subtitle: "Function in units"
|
||||
subtitle: "Function in std::units"
|
||||
excerpt: "Converts a number to yards from its current units."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -10,4 +10,10 @@ layout: manual
|
||||
|
||||
|
||||
|
||||
## Functions and constants
|
||||
|
||||
* [`map`](/docs/kcl-std/map)
|
||||
* [`pop`](/docs/kcl-std/pop)
|
||||
* [`push`](/docs/kcl-std/push)
|
||||
* [`reduce`](/docs/kcl-std/reduce)
|
||||
|
||||
|
@ -23,6 +23,9 @@ layout: manual
|
||||
* [`ceil`](/docs/kcl-std/functions/std-math-ceil)
|
||||
* [`cos`](/docs/kcl-std/functions/std-math-cos)
|
||||
* [`floor`](/docs/kcl-std/functions/std-math-floor)
|
||||
* [`legAngX`](/docs/kcl-std/legAngX)
|
||||
* [`legAngY`](/docs/kcl-std/legAngY)
|
||||
* [`legLen`](/docs/kcl-std/legLen)
|
||||
* [`ln`](/docs/kcl-std/functions/std-math-ln)
|
||||
* [`log`](/docs/kcl-std/functions/std-math-log)
|
||||
* [`log10`](/docs/kcl-std/functions/std-math-log10)
|
||||
|
@ -12,6 +12,44 @@ layout: manual
|
||||
|
||||
## Functions and constants
|
||||
|
||||
* [`angledLine`](/docs/kcl-std/angledLine)
|
||||
* [`angledLineThatIntersects`](/docs/kcl-std/angledLineThatIntersects)
|
||||
* [`arc`](/docs/kcl-std/arc)
|
||||
* [`bezierCurve`](/docs/kcl-std/bezierCurve)
|
||||
* [`circle`](/docs/kcl-std/functions/std-sketch-circle)
|
||||
* [`circleThreePoint`](/docs/kcl-std/circleThreePoint)
|
||||
* [`close`](/docs/kcl-std/close)
|
||||
* [`extrude`](/docs/kcl-std/extrude)
|
||||
* [`getCommonEdge`](/docs/kcl-std/getCommonEdge)
|
||||
* [`getNextAdjacentEdge`](/docs/kcl-std/getNextAdjacentEdge)
|
||||
* [`getOppositeEdge`](/docs/kcl-std/getOppositeEdge)
|
||||
* [`getPreviousAdjacentEdge`](/docs/kcl-std/getPreviousAdjacentEdge)
|
||||
* [`involuteCircular`](/docs/kcl-std/involuteCircular)
|
||||
* [`lastSegX`](/docs/kcl-std/lastSegX)
|
||||
* [`lastSegY`](/docs/kcl-std/lastSegY)
|
||||
* [`line`](/docs/kcl-std/line)
|
||||
* [`loft`](/docs/kcl-std/loft)
|
||||
* [`patternCircular2d`](/docs/kcl-std/patternCircular2d)
|
||||
* [`patternTransform2d`](/docs/kcl-std/patternTransform2d)
|
||||
* [`polygon`](/docs/kcl-std/polygon)
|
||||
* [`profileStart`](/docs/kcl-std/profileStart)
|
||||
* [`profileStartX`](/docs/kcl-std/profileStartX)
|
||||
* [`profileStartY`](/docs/kcl-std/profileStartY)
|
||||
* [`revolve`](/docs/kcl-std/functions/std-sketch-revolve)
|
||||
* [`segAng`](/docs/kcl-std/segAng)
|
||||
* [`segEnd`](/docs/kcl-std/segEnd)
|
||||
* [`segEndX`](/docs/kcl-std/segEndX)
|
||||
* [`segEndY`](/docs/kcl-std/segEndY)
|
||||
* [`segLen`](/docs/kcl-std/segLen)
|
||||
* [`segStart`](/docs/kcl-std/segStart)
|
||||
* [`segStartX`](/docs/kcl-std/segStartX)
|
||||
* [`segStartY`](/docs/kcl-std/segStartY)
|
||||
* [`startProfile`](/docs/kcl-std/startProfile)
|
||||
* [`startSketchOn`](/docs/kcl-std/startSketchOn)
|
||||
* [`subtract2d`](/docs/kcl-std/subtract2d)
|
||||
* [`sweep`](/docs/kcl-std/sweep)
|
||||
* [`tangentToEnd`](/docs/kcl-std/tangentToEnd)
|
||||
* [`tangentialArc`](/docs/kcl-std/tangentialArc)
|
||||
* [`xLine`](/docs/kcl-std/xLine)
|
||||
* [`yLine`](/docs/kcl-std/yLine)
|
||||
|
||||
|
@ -15,5 +15,11 @@ layout: manual
|
||||
* [`chamfer`](/docs/kcl-std/functions/std-solid-chamfer)
|
||||
* [`fillet`](/docs/kcl-std/functions/std-solid-fillet)
|
||||
* [`hollow`](/docs/kcl-std/functions/std-solid-hollow)
|
||||
* [`intersect`](/docs/kcl-std/intersect)
|
||||
* [`patternCircular3d`](/docs/kcl-std/patternCircular3d)
|
||||
* [`patternLinear3d`](/docs/kcl-std/patternLinear3d)
|
||||
* [`patternTransform`](/docs/kcl-std/patternTransform)
|
||||
* [`shell`](/docs/kcl-std/functions/std-solid-shell)
|
||||
* [`subtract`](/docs/kcl-std/subtract)
|
||||
* [`union`](/docs/kcl-std/union)
|
||||
|
||||
|
@ -13,4 +13,7 @@ layout: manual
|
||||
## Functions and constants
|
||||
|
||||
* [`mirror2d`](/docs/kcl-std/functions/std-transform-mirror2d)
|
||||
* [`rotate`](/docs/kcl-std/rotate)
|
||||
* [`scale`](/docs/kcl-std/scale)
|
||||
* [`translate`](/docs/kcl-std/translate)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "prelude"
|
||||
subtitle: "Module in "
|
||||
title: "std"
|
||||
subtitle: "Module in std::"
|
||||
excerpt: "The KCL standard library "
|
||||
layout: manual
|
||||
---
|
||||
@ -30,6 +30,11 @@ Contains frequently used constants, functions for interacting with the KittyCAD
|
||||
* [`Y`](/docs/kcl-std/consts/std-Y)
|
||||
* [`YZ`](/docs/kcl-std/consts/std-YZ)
|
||||
* [`Z`](/docs/kcl-std/consts/std-Z)
|
||||
* [`appearance`](/docs/kcl-std/appearance)
|
||||
* [`assert`](/docs/kcl-std/assert)
|
||||
* [`assertIs`](/docs/kcl-std/assertIs)
|
||||
* [`clone`](/docs/kcl-std/clone)
|
||||
* [`helix`](/docs/kcl-std/functions/std-helix)
|
||||
* [`offsetPlane`](/docs/kcl-std/functions/std-offsetPlane)
|
||||
* [`patternLinear2d`](/docs/kcl-std/patternLinear2d)
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Axis2d"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "An infinite line in 2d space."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Axis3d"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "An infinite line in 3d space."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Edge"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "The edge of a solid."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Face"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A face."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Helix"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A helix."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Plane"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A plane."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Point2d"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A point in two dimensional space."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Point3d"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A point in three dimensional space."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Sketch"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A sketch is a collection of paths."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "Solid"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A solid is a collection of extrude surfaces."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "any"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Any value."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "bool"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A boolean value."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "number"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A number"
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "string"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "A sequence of characters"
|
||||
layout: manual
|
||||
---
|
||||
|
@ -1,6 +1,6 @@
|
||||
---
|
||||
title: "tag"
|
||||
subtitle: "Type in types"
|
||||
subtitle: "Type in std::types"
|
||||
excerpt: "Tags are used to give a name (tag) to a specific path."
|
||||
layout: manual
|
||||
---
|
||||
|
@ -273,7 +273,7 @@ fn generate_type_from_kcl(ty: &TyData, file_name: String, example_name: String)
|
||||
|
||||
let data = json!({
|
||||
"name": ty.preferred_name,
|
||||
"module": ty.module_name,
|
||||
"module": mod_name_std(&ty.module_name),
|
||||
"definition": ty.alias.as_ref().map(|t| format!("type {} = {t}", ty.preferred_name)),
|
||||
"summary": ty.summary,
|
||||
"description": ty.description,
|
||||
@ -288,14 +288,38 @@ fn generate_type_from_kcl(ty: &TyData, file_name: String, example_name: String)
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn generate_mod_from_kcl(m: &ModData, file_name: String) -> Result<()> {
|
||||
fn list_items(m: &ModData, namespace: &str) -> Vec<gltf_json::Value> {
|
||||
fn generate_mod_from_kcl(m: &ModData, file_name: String, combined: &IndexMap<String, Box<dyn StdLibFn>>) -> Result<()> {
|
||||
fn list_items(
|
||||
m: &ModData,
|
||||
namespace: &str,
|
||||
combined: &IndexMap<String, Box<dyn StdLibFn>>,
|
||||
) -> Vec<gltf_json::Value> {
|
||||
let mut items: Vec<_> = m
|
||||
.children
|
||||
.iter()
|
||||
.filter(|(k, _)| k.starts_with(namespace))
|
||||
.map(|(_, v)| (v.preferred_name(), v.file_name()))
|
||||
.map(|(_, v)| (v.preferred_name().to_owned(), v.file_name()))
|
||||
.collect();
|
||||
|
||||
if namespace == "I:" {
|
||||
// Add in functions declared in Rust
|
||||
items.extend(
|
||||
combined
|
||||
.values()
|
||||
.filter(|f| {
|
||||
if f.unpublished() || f.deprecated() {
|
||||
return false;
|
||||
}
|
||||
|
||||
let tags = f.tags();
|
||||
let module = tags.first().map(|s| format!("std::{s}")).unwrap_or("std".to_owned());
|
||||
|
||||
module == m.qual_name
|
||||
})
|
||||
.map(|f| (f.name(), f.name())),
|
||||
)
|
||||
}
|
||||
|
||||
items.sort();
|
||||
items
|
||||
.into_iter()
|
||||
@ -309,14 +333,13 @@ fn generate_mod_from_kcl(m: &ModData, file_name: String) -> Result<()> {
|
||||
}
|
||||
let hbs = init_handlebars()?;
|
||||
|
||||
// TODO for prelude, items from Rust
|
||||
let functions = list_items(m, "I:");
|
||||
let modules = list_items(m, "M:");
|
||||
let types = list_items(m, "T:");
|
||||
let functions = list_items(m, "I:", combined);
|
||||
let modules = list_items(m, "M:", combined);
|
||||
let types = list_items(m, "T:", combined);
|
||||
|
||||
let data = json!({
|
||||
"name": m.name,
|
||||
"module": m.module_name,
|
||||
"module": mod_name_std(&m.module_name),
|
||||
"summary": m.summary,
|
||||
"description": m.description,
|
||||
"modules": modules,
|
||||
@ -330,6 +353,15 @@ fn generate_mod_from_kcl(m: &ModData, file_name: String) -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn mod_name_std(name: &str) -> String {
|
||||
assert_ne!(name, "prelude");
|
||||
if name == "std" {
|
||||
name.to_owned()
|
||||
} else {
|
||||
format!("std::{name}")
|
||||
}
|
||||
}
|
||||
|
||||
fn generate_function_from_kcl(
|
||||
function: &FnData,
|
||||
file_name: String,
|
||||
@ -351,7 +383,7 @@ fn generate_function_from_kcl(
|
||||
|
||||
let data = json!({
|
||||
"name": function.preferred_name,
|
||||
"module": function.module_name,
|
||||
"module": mod_name_std(&function.module_name),
|
||||
"summary": function.summary,
|
||||
"description": function.description,
|
||||
"deprecated": function.properties.deprecated,
|
||||
@ -395,7 +427,7 @@ fn generate_const_from_kcl(cnst: &ConstData, file_name: String, example_name: St
|
||||
|
||||
let data = json!({
|
||||
"name": cnst.preferred_name,
|
||||
"module": cnst.module_name,
|
||||
"module": mod_name_std(&cnst.module_name),
|
||||
"summary": cnst.summary,
|
||||
"description": cnst.description,
|
||||
"deprecated": cnst.properties.deprecated,
|
||||
@ -685,10 +717,10 @@ fn test_generate_stdlib_markdown_docs() {
|
||||
DocData::Fn(f) => generate_function_from_kcl(f, d.file_name(), d.example_name(), &kcl_std).unwrap(),
|
||||
DocData::Const(c) => generate_const_from_kcl(c, d.file_name(), d.example_name()).unwrap(),
|
||||
DocData::Ty(t) => generate_type_from_kcl(t, d.file_name(), d.example_name()).unwrap(),
|
||||
DocData::Mod(m) => generate_mod_from_kcl(m, d.file_name()).unwrap(),
|
||||
DocData::Mod(m) => generate_mod_from_kcl(m, d.file_name(), &combined).unwrap(),
|
||||
}
|
||||
}
|
||||
generate_mod_from_kcl(&kcl_std, "modules/std".to_owned()).unwrap();
|
||||
generate_mod_from_kcl(&kcl_std, "modules/std".to_owned(), &combined).unwrap();
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -718,7 +750,11 @@ fn test_generate_stdlib_json_schema() {
|
||||
async fn test_code_in_topics() {
|
||||
let mut join_set = JoinSet::new();
|
||||
for entry in fs::read_dir("../../docs/kcl-lang").unwrap() {
|
||||
let path = entry.unwrap().path();
|
||||
let entry = entry.unwrap();
|
||||
if entry.file_type().unwrap().is_dir() {
|
||||
continue;
|
||||
}
|
||||
let path = entry.path();
|
||||
let text = std::fs::read_to_string(&path).unwrap();
|
||||
|
||||
for (i, (eg, attr)) in find_examples(&text, &path).into_iter().enumerate() {
|
||||
|
@ -117,8 +117,10 @@ fn visit_module(name: &str, preferred_prefix: &str, names: WalkForNames) -> Resu
|
||||
}
|
||||
let qual = format!("{}::", &result.qual_name);
|
||||
let mut dd = match var.kind {
|
||||
VariableKind::Fn => DocData::Fn(FnData::from_ast(var, qual, preferred_prefix, name)),
|
||||
VariableKind::Const => DocData::Const(ConstData::from_ast(var, qual, preferred_prefix, name)),
|
||||
VariableKind::Fn => DocData::Fn(FnData::from_ast(var, qual, preferred_prefix, &result.name)),
|
||||
VariableKind::Const => {
|
||||
DocData::Const(ConstData::from_ast(var, qual, preferred_prefix, &result.name))
|
||||
}
|
||||
};
|
||||
let key = format!("I:{}", dd.qual_name());
|
||||
if result.children.contains_key(&key) {
|
||||
@ -138,7 +140,7 @@ fn visit_module(name: &str, preferred_prefix: &str, names: WalkForNames) -> Resu
|
||||
continue;
|
||||
}
|
||||
let qual = format!("{}::", &result.qual_name);
|
||||
let mut dd = DocData::Ty(TyData::from_ast(ty, qual, preferred_prefix, name));
|
||||
let mut dd = DocData::Ty(TyData::from_ast(ty, qual, preferred_prefix, &result.name));
|
||||
let key = format!("T:{}", dd.qual_name());
|
||||
if result.children.contains_key(&key) {
|
||||
continue;
|
||||
@ -452,10 +454,10 @@ pub struct ModData {
|
||||
|
||||
impl ModData {
|
||||
fn new(name: &str, preferred_prefix: &str) -> Self {
|
||||
let (qual_name, module_name) = if name == "prelude" {
|
||||
("std".to_owned(), String::new())
|
||||
let (name, qual_name, module_name) = if name == "prelude" {
|
||||
("std", "std".to_owned(), String::new())
|
||||
} else {
|
||||
(format!("std::{}", name), "std".to_owned())
|
||||
(name, format!("std::{}", name), "std".to_owned())
|
||||
};
|
||||
Self {
|
||||
preferred_name: format!("{preferred_prefix}{name}"),
|
||||
|
4
rust/kcl-lib/src/docs/templates/module.hbs
vendored
4
rust/kcl-lib/src/docs/templates/module.hbs
vendored
@ -1,6 +1,10 @@
|
||||
---
|
||||
title: "{{name}}"
|
||||
{{#if module}}
|
||||
subtitle: "Module in {{module}}"
|
||||
{{else}}
|
||||
subtitle: "Module"
|
||||
{{/if}}
|
||||
excerpt: "{{safe_yaml summary}}"
|
||||
layout: manual
|
||||
---
|
||||
|
@ -39,8 +39,8 @@ base_unit = "mm"
|
||||
text_wrapping = false
|
||||
"#;
|
||||
|
||||
const PROJECT_SETTINGS_DOC_PATH: &str = "../../docs/kcl-lang/settings-project.md";
|
||||
const USER_SETTINGS_DOC_PATH: &str = "../../docs/kcl-lang/settings-user.md";
|
||||
const PROJECT_SETTINGS_DOC_PATH: &str = "../../docs/kcl-lang/settings/project.md";
|
||||
const USER_SETTINGS_DOC_PATH: &str = "../../docs/kcl-lang/settings/user.md";
|
||||
|
||||
fn init_handlebars() -> handlebars::Handlebars<'static> {
|
||||
let mut hbs = handlebars::Handlebars::new();
|
||||
|
Reference in New Issue
Block a user