changes code examples in the tutorial to align with the currently generated file
This commit is contained in:
parent
98dcb5301b
commit
ba4b77cb42
4 changed files with 47 additions and 15 deletions
|
@ -16,8 +16,8 @@ So let's add it as a required measurement.
|
|||
|
||||
## Adding required measurements
|
||||
|
||||
In our `bib.mjs` file, on the `bib` object, we'll add a new key called
|
||||
`measurements` that will hold a list (an array) of all required measurements
|
||||
In our `bib.mjs` file, on the `bib` object, there is a key called
|
||||
`measurements` (line 121) that will hold a list (an array) of all required measurements
|
||||
for this part.
|
||||
|
||||
We are going to use *the official name* of the measurement. For head
|
||||
|
@ -31,10 +31,19 @@ function draftBib({ part }) {
|
|||
|
||||
export const bib = {
|
||||
name: 'tutorial.bib',
|
||||
draft: draftBib,
|
||||
// highlight-start
|
||||
draft: draftBib,[],
|
||||
from: false,
|
||||
hide: {
|
||||
self: false,
|
||||
from: false,
|
||||
after: false
|
||||
},
|
||||
options: {},
|
||||
// start-highlight
|
||||
measurements: ['head'],
|
||||
// highlight-end
|
||||
// end-highlight
|
||||
optionalMeasurements: [],
|
||||
plugins: []
|
||||
}
|
||||
```
|
||||
|
||||
|
|
|
@ -29,15 +29,25 @@ function draftBib({ part }) {
|
|||
}
|
||||
|
||||
export const bib = {
|
||||
|
||||
name: 'tutorial.bib',
|
||||
draft: draftBib,
|
||||
measurements: ['head'],
|
||||
draft: draftBib,[],
|
||||
from: false,
|
||||
hide: {
|
||||
self: false,
|
||||
from: false,
|
||||
after: false
|
||||
},
|
||||
// highlight-start
|
||||
options: {
|
||||
neckRatio: { pct: 80, min: 70, max: 90, menu: 'fit' },
|
||||
},
|
||||
// highlight-end
|
||||
measurements: [],
|
||||
optionalMeasurements: [],
|
||||
plugins: []
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
Can you guess what it means?
|
||||
|
|
|
@ -7,7 +7,8 @@ Time to turn our attention to the draft method of our part.
|
|||
Inside our `design/src/bib.js` file, this is what it currently looks like:
|
||||
|
||||
```design/src/bib.mjs
|
||||
function draftBib({ part }) {
|
||||
function draftBib({ part
|
||||
}) {
|
||||
|
||||
return part
|
||||
}
|
||||
|
|
|
@ -17,17 +17,30 @@ and approachable code base.
|
|||
The previous step has already set everything up for us. Our design's main file
|
||||
lives in `design/src/index.mjs`, and our part lives in `design/src/bib.mjs`.
|
||||
|
||||
This `bib.mjs` is where we'll do all our work. It currently looks like this:
|
||||
This `bib.mjs` is where we'll do all our work. The file includes a basic guide on how to use it. We removed it for clarity in our example. It currently looks like this:
|
||||
|
||||
```design/src/bib.mjs
|
||||
function draftBib({ part }) {
|
||||
|
||||
function draftBib ({
|
||||
part, // Your draft method must return this
|
||||
})
|
||||
{
|
||||
// Work your magic here
|
||||
return part
|
||||
}
|
||||
|
||||
export const bib = {
|
||||
|
||||
name: 'tutorial.bib',
|
||||
draft: draftBib,
|
||||
draft: draftBib,[],
|
||||
from: false,
|
||||
hide: {
|
||||
self: false,
|
||||
from: false,
|
||||
after: false
|
||||
},
|
||||
options: {},
|
||||
measurements: [],
|
||||
optionalMeasurements: [],
|
||||
plugins: []
|
||||
}
|
||||
```
|
||||
|
||||
|
@ -117,7 +130,6 @@ const Pattern = new Design({
|
|||
* typically add a name and version here
|
||||
*/
|
||||
data: {
|
||||
version: "0.0.1",
|
||||
name: "Tutorial",
|
||||
},
|
||||
/*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue