1
0
Fork 0

fix: Broken links to the API reference

This commit is contained in:
nikhil 2022-08-20 18:07:26 -04:00
parent f0761cecf9
commit c83d618ad3
21 changed files with 33 additions and 33 deletions

View file

@ -12,19 +12,19 @@ that you should take into account while developing your pattern. They are:
## Complete ## Complete
The [complete](/reference/api/settings#complete) setting is a boolean that is either true or false. The [complete](/reference/api/settings/complete) setting is a boolean that is either true or false.
Its goal is to determine whether we should draft a _complete_ pattern, or merely the outline. Its goal is to determine whether we should draft a _complete_ pattern, or merely the outline.
## Paperless ## Paperless
The [paperless](/reference/api/settings#paperless) setting is a boolean that is either true or false. The [paperless](/reference/api/settings/paperless) setting is a boolean that is either true or false.
A _paperless_ pattern is a pattern that has extra dimensions so users can trace the A _paperless_ pattern is a pattern that has extra dimensions so users can trace the
paper on fabric or paper without having the need to print it. paper on fabric or paper without having the need to print it.
## Seam allowance ## Seam allowance
The [sa](/reference/api/settings#sa) setting is a number that controls the seam allowance. The [sa](/reference/api/settings/sa) setting is a number that controls the seam allowance.
Unless `sa` is zero, you should add the requested seam allowance to your pattern. Unless `sa` is zero, you should add the requested seam allowance to your pattern.

View file

@ -5,13 +5,13 @@ order: 60
A **hook** is a lifecycle event. The available hooks are: A **hook** is a lifecycle event. The available hooks are:
- [preRender](/reference/api/hooks/prerender/): Called at the start of [`Pattern.render()`](/reference/api/pattern#render) - [preRender](/reference/api/hooks/prerender/): Called at the start of [`Pattern.render()`](/reference/api/pattern/render)
- [postRender](/reference/api/hooks/postrender/): Called at the end of [`Pattern.render()`](/reference/api/pattern#render) - [postRender](/reference/api/hooks/postrender/): Called at the end of [`Pattern.render()`](/reference/api/pattern/render)
- [insertText](/reference/api/hooks/inserttext/): Called when inserting text - [insertText](/reference/api/hooks/inserttext/): Called when inserting text
- [preDraft](/reference/api/hooks/predraft/): Called at the start of [`Pattern.draft()`](/reference/api/pattern#draft) - [preDraft](/reference/api/hooks/predraft/): Called at the start of [`Pattern.draft()`](/reference/api/pattern/draft)
- [postDraft](/reference/api/hooks/postdraft/): Called at the end of [`Pattern.draft()`](/reference/api/pattern#draft) - [postDraft](/reference/api/hooks/postdraft/): Called at the end of [`Pattern.draft()`](/reference/api/pattern/draft)
- [preSample](/reference/api/hooks/presample/): Called at the start of [`Pattern.sample()`](/reference/api/pattern#sample) - [preSample](/reference/api/hooks/presample/): Called at the start of [`Pattern.sample()`](/reference/api/pattern/sample)
- [postSample](/reference/api/hooks/postsample/): Called at the end of [`Pattern.sample()`](/reference/api/pattern#sample) - [postSample](/reference/api/hooks/postsample/): Called at the end of [`Pattern.sample()`](/reference/api/pattern/sample)
You can register a method for a hook. When the hook is triggered, your method will be You can register a method for a hook. When the hook is triggered, your method will be
called. It will receive two parameters: called. It will receive two parameters:

View file

@ -4,7 +4,7 @@ order: 20
--- ---
Build-time plugins are loaded at build time, by passing them to Build-time plugins are loaded at build time, by passing them to
the [`freesewing.Design`](/reference/api/#design) constructor: the [`freesewing.Design`](/reference/api/design) constructor:
```js ```js
import freesewing from "@freesewing/core" import freesewing from "@freesewing/core"

View file

@ -4,12 +4,12 @@ for: developers
about: Shows you how to use our shorthand method and notation about: Shows you how to use our shorthand method and notation
--- ---
The [Part.shorthand()](/reference/api/part/#shorthand) method will become your best friend. The [Part.shorthand()](/reference/api/part/shorthand) method will become your best friend.
By using [object destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Object_destructuring) you'll get access to a bunch By using [object destructuring](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment#Object_destructuring) you'll get access to a bunch
of handy variables to make your code more concise and readable. of handy variables to make your code more concise and readable.
[Part.shorthand()](/reference/api/part/#shorthand) provides a lot of things, and you typically [Part.shorthand()](/reference/api/part/shorthand) provides a lot of things, and you typically
don't need all of them, but here's everything it has to offer: don't need all of them, but here's everything it has to offer:
```js ```js

View file

@ -6,9 +6,9 @@ The `preSample` hook runs just before your pattern is sampled.
It is triggered at the very start of either: It is triggered at the very start of either:
- the [Pattern.sampleOption()](/reference/api/pattern/#sampleoption) method - the [Pattern.sampleOption()](/reference/api/pattern/sampleoption) method
- the [Pattern.sampleMeasurement()](/reference/api/pattern/#samplemeasurement) method - the [Pattern.sampleMeasurement()](/reference/api/pattern/samplemeasurement) method
- the [Pattern.sampleModels()](/reference/api/pattern/#samplemodels) method - the [Pattern.sampleModels()](/reference/api/pattern/samplemodels) method
Your plugin will receive the Pattern object. Your plugin will receive the Pattern object.

View file

@ -11,7 +11,7 @@ a string that includes the user's units.
###### This method is available as shorthand ###### This method is available as shorthand
You can access this units method from the [Part.shorthand](#shorthand) method: You can access this units method from the [Part.shorthand](/reference/api/part/shorthand) method:
```js ```js
let { units } = part.shorthand(); let { units } = part.shorthand();

View file

@ -8,7 +8,7 @@ Path path.trim()
Returns a new Path that is this path with overlapping parts removed. Returns a new Path that is this path with overlapping parts removed.
This method is typically used when [Path.offset()](#offset) caused some overlap. This method is typically used when [Path.offset()](/reference/api/path/offset) caused some overlap.
<Warning> <Warning>

View file

@ -14,7 +14,7 @@ Point point.clone()
###### Copy vs clone ###### Copy vs clone
The [`Point.copy()`](reference/api/point/copy/) method will only copy the point's coordinates, whereas this The [`Point.copy()`](/reference/api/point/copy/) method will only copy the point's coordinates, whereas this
`Point.clone()` method will also copy its attributes. `Point.clone()` method will also copy its attributes.
</Note> </Note>

View file

@ -16,7 +16,7 @@ Point point.copy()
###### Copy vs clone ###### Copy vs clone
this `Point.copy()` method will only copy the point's coordinates. this `Point.copy()` method will only copy the point's coordinates.
To also copy the attributes, use [`Point.clone()`](reference/api/point/clone/) instead. To also copy the attributes, use [`Point.clone()`](/reference/api/point/clone/) instead.
</Note> </Note>

View file

@ -5,7 +5,7 @@ title: Point.rotate()
A point's `rotate()` method returns a new `Point` that has been rotated by `angle` degrees A point's `rotate()` method returns a new `Point` that has been rotated by `angle` degrees
around the point (`center`) that you pass it. around the point (`center`) that you pass it.
Just like the result of the [`Point.angle()`](reference/api/point/angle/) method, an angle of 0° points right, and the angle increases counterclockwise. Just like the result of the [`Point.angle()`](/reference/api/point/angle/) method, an angle of 0° points right, and the angle increases counterclockwise.
## Point.rotate() signature ## Point.rotate() signature

View file

@ -8,7 +8,7 @@ point and the target.
This method accepts values larger than 1 to go beyond the target point, or negative values to shift the This method accepts values larger than 1 to go beyond the target point, or negative values to shift the
point in the opposite direction. point in the opposite direction.
If you need to move a point by a specific distance instead of a percentage, use [`Point.shiftTowards()`](\(reference/api/point/shifttowards/\)) or [`Point.shiftOutwards()`](reference/api/point/shiftoutwards/) instead. If you need to move a point by a specific distance instead of a percentage, use [`Point.shiftTowards()`](/reference/api/point/shifttowards/) or [`Point.shiftOutwards()`](/reference/api/point/shiftoutwards/) instead.
## Point.shiftFractionTowards() signature ## Point.shiftFractionTowards() signature

View file

@ -4,7 +4,7 @@ title: Point.shiftTowards()
Returns a new `Point` that is shifted `distance` (mm) in the direction of the `target`. Returns a new `Point` that is shifted `distance` (mm) in the direction of the `target`.
If you need to move a point a percentage instead of a specific distance, use [`Point.shiftFractionTowards()`](reference/api/point/shiftfractiontowards/) instead. If you need to move a point a percentage instead of a specific distance, use [`Point.shiftFractionTowards()`](/reference/api/point/shiftfractiontowards/) instead.
## Point.shiftTowards() signature ## Point.shiftTowards() signature

View file

@ -15,7 +15,7 @@ const pattern = new Brian({
<Note> <Note>
This is ignored if [settings.complete](#complete) is `false` This is ignored if [settings.complete](/reference/api/settings/complete) is `false`
<Comment by="joost"> <Comment by="joost">
Is it though? Is it though?

View file

@ -9,7 +9,7 @@ SVG `defs` section, and rendered with the SVG `use` tag.
The snippet constructor takes two arguments: The snippet constructor takes two arguments:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section - `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](#point) on which to anchor the snippet - `anchor` : A [`Point`](./point) on which to anchor the snippet
```js ```js
Snippet new Snippet(def, Point); Snippet new Snippet(def, Point);
@ -18,8 +18,8 @@ Snippet new Snippet(def, Point);
A Snippet object comes with the following properties: A Snippet object comes with the following properties:
- `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section - `def` : The `xlink:href` id that links to the relevant entry in the SVG `defs` section
- `anchor` : A [`Point`](../point) on which to anchor the snippet - `anchor` : A [`Point`](./point) on which to anchor the snippet
- `attributes` : An [`Attributes`](../attributes) instance holding the snippet's attributes - `attributes` : An [`Attributes`](./attributes) instance holding the snippet's attributes
In addition, a Snippet object exposes the following methods: In addition, a Snippet object exposes the following methods:

View file

@ -11,7 +11,7 @@ Point | false utils.beamsIntersect(
) )
``` ```
Finds the intersection between two endless lines (beams). Returns a [Point](#point) object Finds the intersection between two endless lines (beams). Returns a [Point](../point) object
for the intersection, or `false` if the lines don't intersect. for the intersection, or `false` if the lines don't intersect.
<Example part="utils_beamsintersect"> <Example part="utils_beamsintersect">

View file

@ -14,7 +14,7 @@ array | Point | false utils.curveIntersectsX(
Finds the point(s) where a curve intersects a given X-value. Finds the point(s) where a curve intersects a given X-value.
This is a low-level variant This is a low-level variant
of [`Path.intersectsX()`](/reference/api/path/#pathintersectsx). of [`Path.intersectsX()`](/reference/api/path#intersectsx).
Instead of a path, you describe a single curve by passing the four Instead of a path, you describe a single curve by passing the four
points that describes it. points that describes it.

View file

@ -14,7 +14,7 @@ array | Point | false utils.curveIntersectsY(
Finds the point(s) where a curve intersects a given Y-value. Finds the point(s) where a curve intersects a given Y-value.
This is a low-level variant This is a low-level variant
of [`Path.intersectsY()`](/reference/api/path/#pathintersectsy). of [`Path.intersectsY()`](/reference/api/path#intersectsy).
Instead of a path, you describe a single curve by passing the four Instead of a path, you describe a single curve by passing the four
points that describes it. points that describes it.

View file

@ -11,7 +11,7 @@ Point | false utils.linesIntersect(
) )
``` ```
Finds the intersection between two line segments. Returns a [Point](#point) object Finds the intersection between two line segments. Returns a [Point](../point) object
for the intersection, or `false` if the lines don't intersect. for the intersection, or `false` if the lines don't intersect.
<Example part="utils_linesintersect"> <Example part="utils_linesintersect">

View file

@ -13,7 +13,7 @@ bool utils.pointOnLine(
Returns `true` if the point `check` lies on a line segment from point `from` to point `to`. Returns `true` if the point `check` lies on a line segment from point `from` to point `to`.
The fourth parameter controls the precision. See [pointOnBeam](#utilspointonbeam). The fourth parameter controls the precision. See [pointOnBeam](/reference/api/utils/pointonbeam).
<Example part="utils_pointonline"> <Example part="utils_pointonline">
A Utils.pointOnLine() example A Utils.pointOnLine() example

View file

@ -84,7 +84,7 @@ For now, we only need these so that the pattern skeleton compiles properly.
<Note> <Note>
This will all become clear, but if you're curious, the API docs have all the details This will all become clear, but if you're curious, the API docs have all the details
on [the Part.shorthand() method](/reference/api/part/#shorthand). on [the Part.shorthand() method](/reference/api/part/shorthand).
</Note> </Note>

View file

@ -31,7 +31,7 @@ You have a number of ways to test your pattern:
- Test measurements - Test measurements
- Test models - Test models
The [API docs on sampling](/reference/api/pattern/#sample) have all the details on how this works, but The [API docs on sampling](/reference/api/pattern/sample) have all the details on how this works, but
for now we'll just look at the end result of each of these. for now we'll just look at the end result of each of these.
## Testing pattern options ## Testing pattern options