Revert "chore: Linting for markdown and js"
This reverts commit 1c92e0f655
.
This commit is contained in:
parent
994874fa72
commit
cba1ab19c8
6627 changed files with 25791 additions and 24211 deletions
|
@ -1,22 +1,19 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Design guide
|
||||
order: 300
|
||||
for: developers
|
||||
icons:
|
||||
|
||||
* thumbup
|
||||
* pattern
|
||||
about: "There's often many different ways to do things. Learn about our conventions and best practices"
|
||||
goals:
|
||||
* Re-using measurement and options names
|
||||
* Re-using CSS classes
|
||||
* Respecting draft settings
|
||||
* Using percentage options where possible
|
||||
* Using translation keys for text
|
||||
* Constructing paths counter-clockwise
|
||||
|
||||
***
|
||||
icons:
|
||||
- thumbup
|
||||
- pattern
|
||||
about: "There's often many different ways to do things. Learn about our conventions and best practices"
|
||||
goals:
|
||||
- Re-using measurement and options names
|
||||
- Re-using CSS classes
|
||||
- Respecting draft settings
|
||||
- Using percentage options where possible
|
||||
- Using translation keys for text
|
||||
- Constructing paths counter-clockwise
|
||||
---
|
||||
|
||||
Here is a list of best practices when designing patterns:
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Construct paths counter-clockwise
|
||||
order: 70
|
||||
---------
|
||||
---
|
||||
|
||||
Construct your paths counter-clockwise. You have to pick a direction anyway, and going
|
||||
counter-clockwise is a bit of a convention.
|
||||
|
@ -14,12 +13,13 @@ Obviously, the order in which you add points to your code needs to take a backse
|
|||
to the logic of your code. But typically what you're doing is constructing an outline
|
||||
of (a part of) a garment.
|
||||
|
||||
So pick a point, and make your way around counter-clockwise.
|
||||
So pick a point, and make your way around counter-clockwise.
|
||||
|
||||
When naming control points for curves, re-use the name of the point they are attached to
|
||||
and add `Cp1` to the control point before and `Cp2` to the control point after the point if
|
||||
, once again, you'd follow your path counter-clockwise.
|
||||
|
||||
|
||||
For example:
|
||||
|
||||
```js
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Respect draft settings
|
||||
order: 40
|
||||
---------
|
||||
---
|
||||
|
||||
Apart from the pattern options that you configure for your pattern,
|
||||
all FreeSewing patterns have a set of [draft settings](/reference/settings/) that can be tweaked
|
||||
|
@ -20,7 +19,7 @@ Its goal is to determine whether we should draft a *complete* pattern, or merely
|
|||
|
||||
The [paperless](/reference/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.
|
||||
|
||||
## Seam allowance
|
||||
|
@ -63,3 +62,4 @@ export default function(part) {
|
|||
return part
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Re-use CSS classes
|
||||
order: 30
|
||||
---------
|
||||
---
|
||||
|
||||
While you can style your pattern however you want, try to re-use the CSS class names that
|
||||
are in use in our default [theme plugin](/reference/packages/plugin-theme/).
|
||||
|
|
|
@ -1,8 +1,7 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Re-use measurements
|
||||
order: 10
|
||||
---------
|
||||
---
|
||||
|
||||
When designing patterns, re-use the measurements that are already in use as much as possible.
|
||||
Nobody wins when every pattern requires its own set of measurements, or names
|
||||
|
@ -10,9 +9,10 @@ certain measurements differently.
|
|||
|
||||
<Tip>
|
||||
|
||||
###### See our models packages for standard measurement names
|
||||
###### See our models packages for standard measurement names
|
||||
|
||||
The [@freesewing/models](/reference/packages/models/)
|
||||
package contains all our standard measurement names.
|
||||
|
||||
</Tip>
|
||||
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Re-use options
|
||||
order: 20
|
||||
---------
|
||||
---
|
||||
|
||||
The same arguments for re-using measurements are also (somewhat) true for options.
|
||||
The same arguments for re-using measurements are also (somewhat) true for options.
|
||||
|
||||
While your pattern may require some very specific
|
||||
options, there's probably a bunch that are similar to other patterns. Re-use those names.
|
||||
|
||||
As in, `bicepsEase` exists. So don't go creating an `upperArmEase` option.
|
||||
|
||||
|
|
|
@ -1,27 +1,26 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Use percentage options where possible
|
||||
order: 50
|
||||
---------
|
||||
---
|
||||
|
||||
When designing patterns, you should refrain from using absolute values.
|
||||
|
||||
That 6cm ease you add might be fine for all scenarios you tested,
|
||||
but then somebody comes around who is twice your size, or who is making clothes for a doll,
|
||||
That 6cm ease you add might be fine for all scenarios you tested,
|
||||
but then somebody comes around who is twice your size, or who is making clothes for a doll,
|
||||
and things will go off the rails.
|
||||
|
||||
Don't be tempted to add absolute values to your patterns, as they don't scale.
|
||||
Don't be tempted to add absolute values to your patterns, as they don't scale.
|
||||
Instead, embrace percentages as options.
|
||||
|
||||
<Tip>
|
||||
|
||||
##### Use the antperson tests
|
||||
|
||||
To check how well your pattern scales, you can
|
||||
To check how well your pattern scales, you can
|
||||
use the *antperson* test by sampling the pattern for 2 models:
|
||||
|
||||
* A model with measurements of avarage person (the person)
|
||||
* A model with measurements 1/10th of an average person (the ant)
|
||||
- A model with measurements of avarage person (the person)
|
||||
- A model with measurements 1/10th of an average person (the ant)
|
||||
|
||||
A well-designed pattern will scale a factor 10 down and hold its shape.
|
||||
If your pattern makes assumptions about size, this test will show that.
|
||||
|
@ -30,3 +29,4 @@ FreeSewing's development environment provides these tests out of the box,
|
|||
so you can see their results at the click of a button.
|
||||
|
||||
</Tip>
|
||||
|
||||
|
|
|
@ -1,19 +1,18 @@
|
|||
***
|
||||
|
||||
---
|
||||
title: Use translation keys, not text
|
||||
order: 60
|
||||
---------
|
||||
---
|
||||
|
||||
Don't insert literal text in your patterns. Instead, insert a key that can then be translated.
|
||||
|
||||
For example, if you want to put *Finish with bias tape* on your pattern, don't be
|
||||
For example, if you want to put *Finish with bias tape* on your pattern, don't be
|
||||
tempted to do this:
|
||||
|
||||
```js
|
||||
path.seam.attr("data-text", "Finish with bias tape");
|
||||
```
|
||||
|
||||
That (English) string is now hard-coded in your pattern. As freesewing supports
|
||||
That (English) string is now hard-coded in your pattern. As freesewing supports
|
||||
translation out of the box, it would be a real shame not to make use of it.
|
||||
|
||||
Instead, insert a key to identify the string:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue