1
0
Fork 0

chore(markdown): Linting of dev docs

This commit is contained in:
Joost De Cock 2022-02-19 08:04:25 +01:00
parent 1d8beedd44
commit 265ad404da
317 changed files with 1281 additions and 1503 deletions

View file

@ -2,7 +2,6 @@
title: clone()
---
```js
Path path.clone()
```
@ -32,4 +31,3 @@ paths.clone = paths.example
.attr("class", "note lashed stroke-l")
.attr("style", "stroke-opacity: 0.5");
```

View file

@ -27,4 +27,3 @@ paths.line = new Path()
.attr("data-text", "Path._close()")
.attr("data-text-class", "text-sm right fill-note");
```

View file

@ -8,14 +8,14 @@ Point path.edge(string side)
Returns the Point object at the edge of the path you specify. Edge must be one of:
- `top`
- `bottom`
- `left`
- `right`
- `topLeft`
- `topRight`
- `bottomLeft`
- `bottomRight`
- `top`
- `bottom`
- `left`
- `right`
- `topLeft`
- `topRight`
- `bottomLeft`
- `bottomRight`
<Example part="path_edge">
Example of the Path.edge() method
@ -50,4 +50,3 @@ for (let i of [
"right"
]) snippets[i] = new Snippet("notch", paths.demo.edge(i));
```

View file

@ -3,7 +3,7 @@ title: Path
order: 30
---
A path represents an SVG path; The lines and curves on our pattern.
A path represents an SVG path; The lines and curves on our pattern.
The Path constructor takes no arguments:
@ -13,8 +13,8 @@ Path new Path();
A Path objects comes with the following properties:
- `render` : Set this to `false` to not render the path (exclude it from the output)
- `attributes` : An [Attributes](/reference/api/attributes) instance holding the path's attributes
- `render` : Set this to `false` to not render the path (exclude it from the output)
- `attributes` : An [Attributes](/reference/api/attributes) instance holding the path's attributes
In addition, a Path object exposes the following methods:

View file

@ -2,9 +2,7 @@
title: intersects()
---
```
array|false path.intersects(Path path)
```
array|false path.intersects(Path path)
Returns the Point object(s) where the path intersects with a path you pass it.
@ -57,4 +55,3 @@ for (let p of paths.demo1.intersects(paths.demo2)) {
snippets[part.getId()] = new Snippet("notch", p);
}
```

View file

@ -42,4 +42,3 @@ paths.joint = paths.path1
.attr("class", "note lashed stroke-l")
.attr("style", "stoke-opacity: 0.5");
```

View file

@ -6,19 +6,18 @@ title: move()
Path path.move(Point to)
```
Moves to a given point without drawing a line.
Moves to a given point without drawing a line.
<Tip>
###### Always start your path with a move
When drawing a path, you must always start with a `move()` call,
When drawing a path, you must always start with a `move()` call,
followed by your `line()` and/or `curve()` calls
and an optional `close()` call.
These calls are chainable, making your code easier to read:
```js
paths.example = new Path()
.move(points.a)
@ -29,7 +28,6 @@ paths.example = new Path()
</Tip>
<Example part="path_move">
Example of the Path.move() method
</Example>

View file

@ -1,12 +1,12 @@
---
title: noop()
---
```js
Path path.noop(string id)
```
Adds a placeholder path opertion.
Adds a placeholder path opertion.\
A `noop` operation does nothing, but is intended to be replaced later with [`Path.insop()`](#insop).
<Fixme>Add example</Fixme>

View file

@ -1,7 +1,7 @@
---
title: offset()
---
```js
Path path.offset(float distance)
```

View file

@ -10,7 +10,7 @@ Returns a path that is the reversed version of this path. As in, start becomes e
<Note>
The reversed path is a shallow copy.
The reversed path is a shallow copy.
It will in other words not inherit the attributes of the original path.
If you want a deep copy, including the attributes, use `Path.clone().reverse()`.

View file

@ -52,4 +52,3 @@ If you don't need that precision, you can pass a lower number.
But for most cases, you can just ignore it.
</Note>

View file

@ -1,7 +1,7 @@
---
title: split
---
```js
array path.split(Point splitPoint)
```

View file

@ -1,12 +1,12 @@
---
title: translate()
---
```js
Path path.translate(float deltaX, float deltaY)
```
Returns a path with
Returns a path with
[a translate transform](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/transform#Translate)
applied.

View file

@ -19,11 +19,11 @@ it on a long/complex path will be significant.
To limit the impact of path.trim(), follow this approach:
- construct a minimal path that contains the overlap
- trim it
- now join it to the rest of your path
- construct a minimal path that contains the overlap
- trim it
- now join it to the rest of your path
You can see an example of this
You can see an example of this
[in the front part of the Bruce pattern](https://github.com/freesewing/freesewing/blob/develop/packages/bruce/src/front.js#L195).
</Warning>