From ba4b77cb426a182ba94c957df69ab19472813fc4 Mon Sep 17 00:00:00 2001 From: Zee Date: Sun, 6 Aug 2023 14:00:10 +0000 Subject: [PATCH] changes code examples in the tutorial to align with the currently generated file --- .../pattern-design/adding-measurements/en.md | 19 ++++++++++---- .../pattern-design/adding-options/en.md | 14 ++++++++-- .../pattern-design/draft-method/en.md | 3 ++- .../pattern-design/our-first-part/en.md | 26 ++++++++++++++----- 4 files changed, 47 insertions(+), 15 deletions(-) diff --git a/markdown/dev/tutorials/pattern-design/adding-measurements/en.md b/markdown/dev/tutorials/pattern-design/adding-measurements/en.md index 2245ea1abf0..6b0cacc85c7 100644 --- a/markdown/dev/tutorials/pattern-design/adding-measurements/en.md +++ b/markdown/dev/tutorials/pattern-design/adding-measurements/en.md @@ -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: [] } ``` diff --git a/markdown/dev/tutorials/pattern-design/adding-options/en.md b/markdown/dev/tutorials/pattern-design/adding-options/en.md index b7f95d740da..314805f9cae 100644 --- a/markdown/dev/tutorials/pattern-design/adding-options/en.md +++ b/markdown/dev/tutorials/pattern-design/adding-options/en.md @@ -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? diff --git a/markdown/dev/tutorials/pattern-design/draft-method/en.md b/markdown/dev/tutorials/pattern-design/draft-method/en.md index 7cd8371d0a6..cd96fe91c2f 100644 --- a/markdown/dev/tutorials/pattern-design/draft-method/en.md +++ b/markdown/dev/tutorials/pattern-design/draft-method/en.md @@ -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 } diff --git a/markdown/dev/tutorials/pattern-design/our-first-part/en.md b/markdown/dev/tutorials/pattern-design/our-first-part/en.md index 84dc5c9d51b..b45e6e5fe88 100644 --- a/markdown/dev/tutorials/pattern-design/our-first-part/en.md +++ b/markdown/dev/tutorials/pattern-design/our-first-part/en.md @@ -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,8 +130,7 @@ const Pattern = new Design({ * typically add a name and version here */ data: { - version: "0.0.1", - name: "Tutorial", + name: "Tutorial", }, /* * This `parts` key is the most important thing