mirror of
https://github.com/nature-of-code/noc-book-2
synced 2024-09-29 05:36:56 +02:00
update test and docs
This commit is contained in:
parent
d1c4d01d2a
commit
f0ce98063b
2 changed files with 25 additions and 8 deletions
|
@ -208,7 +208,7 @@ Bookmark links that pointed to p5 web editor (with hostname of `editor.p5js.org`
|
|||
|
||||
Sketches will be downloaded and referenced relatively with path as `examples/{chapter}/{sketch_name}/`
|
||||
|
||||
If an `screenshot.png` file exist in the sketch, it will be inserted as an image figure under that `div`and appear in the pdf build.
|
||||
If an `screenshot.png` file exist in the sketch, it will be inserted as an image under that `div` and appear in the pdf build.
|
||||
|
||||
### Example
|
||||
|
||||
|
@ -219,11 +219,10 @@ If an `screenshot.png` file exist in the sketch, it will be inserted as an image
|
|||
### Output
|
||||
|
||||
```html
|
||||
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/NOC_I_01_RandomWalkTraditional" data-example-path="examples/00_7_introduction/noc_i_01_random_walk_traditional">
|
||||
<figure class="screenshot">
|
||||
<img src="examples/00_7_introduction/noc_i_01_random_walk_traditional/screenshot.png">
|
||||
</figure>
|
||||
</div>
|
||||
<figure>
|
||||
<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/5C69XyrlsR" data-example-path="examples/00_7_introduction/example_i_01_random_walk_traditional"><img src="examples/00_7_introduction/example_i_01_random_walk_traditional/screenshot.png"></div>
|
||||
<figcaption></figcaption>
|
||||
</figure>
|
||||
```
|
||||
|
||||
## 10. Column List & Column
|
||||
|
|
|
@ -7,12 +7,30 @@ test('Embedded Sketch', (t) => {
|
|||
{
|
||||
type: 'bookmark',
|
||||
bookmark: {
|
||||
caption: [],
|
||||
caption: [
|
||||
{
|
||||
type: 'text',
|
||||
text: {
|
||||
content: 'Figure 1.2',
|
||||
link: null,
|
||||
},
|
||||
annotations: {
|
||||
bold: false,
|
||||
italic: false,
|
||||
strikethrough: false,
|
||||
underline: false,
|
||||
code: false,
|
||||
color: 'default',
|
||||
},
|
||||
plain_text: 'Figure 1.2',
|
||||
href: null,
|
||||
},
|
||||
],
|
||||
url: 'https://editor.p5js.org/natureofcode/sketches/5C69XyrlsR',
|
||||
},
|
||||
},
|
||||
]),
|
||||
'<div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/5C69XyrlsR"></div>',
|
||||
'<figure><div data-type="embed" data-p5-editor="https://editor.p5js.org/natureofcode/sketches/5C69XyrlsR"></div><figcaption>Figure 1.2</figcaption></figure>',
|
||||
'should return an embedded example sketch',
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in a new issue