Skip to content

Commit ec13962

Browse files
authored
Merge pull request #230 from Tedoshiii/teodor-website-graphic-captions
WoT Tutorial Website - Formatting Changes
2 parents 0896a0f + f998b72 commit ec13962

File tree

14 files changed

+140
-57
lines changed

14 files changed

+140
-57
lines changed

Tutorials/whatiswot/website/docs/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Tutorial Introduction
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/fk6Il38SybI?si=1J9X3muwlZ5HWYjE" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/1-WoT/1-WoT.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/1-WoT/1-WoT.mp4">click here to watch from our GitHub repository.</a>
1010

1111
<br />
1212
<br />

Tutorials/whatiswot/website/docs/preliminary/json-schema/intro.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Introduction
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/BPqDBu6fT-0?si=L-sz7baJzoAqjo3b" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/5-JSON_Schema/5-JSON-Schema.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/5-JSON_Schema/5-JSON-Schema.mp4">click here to watch from our GitHub repository.</a>
1010

1111
<br />
1212
<br />
@@ -29,7 +29,9 @@ JSON Schema serves as a JSON document that describes and validates the structure
2929

3030
Its main purpose is to provide guidance to senders, such as clients, on the expected format of their requests, while enabling receivers to automatically validate incoming payloads. Despite being JSON itself, JSON Schema serves as metadata.
3131

32-
![json schema diagram](/img/tutorial/JSON-Schema/schema.png)
32+
<figure id="fig-json-schema">
33+
<img src="/img/tutorial/JSON-Schema/schema.png" alt="JSON Schema overview" />
34+
<figcaption><strong>Figure 1.</strong> JSON Schema overview.</figcaption> </figure>
3335

3436
For instance, a basic JSON Schema like "type": "array" specifies that it accepts an array type in other JSON documents. Similar specifications can be defined for other data types in JSON, such as:
3537

@@ -38,9 +40,11 @@ For instance, a basic JSON Schema like "type": "array" specifies that it accepts
3840
- boolean
3941
- null
4042

41-
During the validation process on the receiver's end, this schema ensures that the incoming data conforms to the specified structure. Below is an example of how such validation can be implemented in JavaScript:
43+
During the validation process on the receiver's end, this schema ensures that the incoming data conforms to the specified structure. [Figure 2](#fig-json-schema-validation) serves as an example of how such validation can be implemented in JavaScript:
4244

43-
![js-schema](/img/5-JSON-Schema/js-schema.png)
45+
<figure id="fig-json-schema-validation">
46+
<img src="/img/tutorial/JSON-Schema/schema.png" alt="Example of JSON Schema Validation" />
47+
<figcaption><strong>Figure 2.</strong> JSON Schema validation in JavaScript.</figcaption> </figure>
4448

4549
It can look different in other programming languages.
4650
For instance in Python:

Tutorials/whatiswot/website/docs/preliminary/json-schema/practice-advanced.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: JSON Schema in Practice - Advanced Topics
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/gZa2vxmrm4Q?si=6SVnfrqxF-H_dQhB" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/7-JSON_Schema_in_Practice_2/7-JSON-Schema-Demo.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/7-JSON_Schema_in_Practice_2/7-JSON-Schema-Demo.mp4">click here to watch from our GitHub repository.</a>
1010

1111
<br />
1212
<br />

Tutorials/whatiswot/website/docs/preliminary/json-schema/practice-validators.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: JSON Schema in Practice - Validators
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/ZKoWLyaWuaw?si=Qo-mBPkp8-J33o7C" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/8-JSON_Schema_in_Practice_3/8-JSON-Schema-3.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/8-JSON_Schema_in_Practice_3/8-JSON-Schema-3.mp4">click here to watch from our GitHub repository.</a>
1010

1111
<br />
1212
<br />
@@ -57,10 +57,12 @@ However, numerous other validators exist. For further information, you can check
5757

5858
## Basic Validation Flow
5959

60-
This is the basic validation flow that all libraries follow.
60+
[Figure 1](#fig-basic-validation-flow) shows the basic validation flow that all libraries follow.
6161
The library takes a schema for your JSON data and validates your data according to the schema. Outputs the validation result as a boolean.
6262

63-
![basic validation flow](/img/8-JSON-Schema-3/basic-validation.png)
63+
<figure id="fig-basic-validation-flow">
64+
<img src="/img/8-JSON-Schema-3/basic-validation.png" alt="Basic Validation Flow" />
65+
<figcaption><strong>Figure 1.</strong> Basic validation flow.</figcaption> </figure>
6466

6567
## Javascript AJV
6668

Tutorials/whatiswot/website/docs/preliminary/json-schema/practice.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: JSON Schema in Practice
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/c_gD0hYaavA?si=bPp5w0o7YIXvjZ1G" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/6-JSON_Schema_in_Practice/6-JSON-Schema-in-Practice.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/6-JSON_Schema_in_Practice/6-JSON-Schema-in-Practice.mp4">click here to watch from our GitHub repository.</a>
1010

1111
<br />
1212
<br />

Tutorials/whatiswot/website/docs/preliminary/json/intro.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Introduction
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/7wzzwdrGFZw?si=mpDrp9FKdNywXDFf" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/3-JSON/3-JSON.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/3-JSON/3-JSON.mp4">click here to watch from our GitHub repository.</a>
1010

1111
<br />
1212
<br />

Tutorials/whatiswot/website/docs/preliminary/json/practice.md

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: JSON in Practice
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/bfvo4DAZG78?si=3NvJK6TDwLv82K3t" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/4-JSON_in_Practice/4-JSON_in_Practice.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/4-JSON_in_Practice/4-JSON_in_Practice.mp4">click here to watch from our GitHub repository.</a>
1010

1111
<br />
1212
<br />
@@ -28,7 +28,10 @@ Accepted types:
2828
- Boolean
2929
- Null
3030

31-
![json array](/img/4-JSON-In-Practice/json-array.png)
31+
<figure id="fig-json-array">
32+
<img src="/img/4-JSON-In-Practice/json-array.png" alt="Example of a JSON array" />
33+
<figcaption><strong>Figure 1.</strong> Example of a JSON array.</figcaption>
34+
</figure>
3235

3336
### Nested objects
3437

@@ -37,11 +40,17 @@ Nested objects are allowed in JSON. The “measurement” keyword is an example
3740
Objects start and end with curly brackets. We are essentially defining keywords and mapping these keywords to values.
3841
In this example, we define the name and value pairs to describe the data sent by sensors.
3942

40-
![nested object](/img/4-JSON-In-Practice/nested-object.png)
43+
<figure id="fig-nested-object">
44+
<img src="/img/4-JSON-In-Practice/nested-object.png" alt="Example of a nested JSON object" />
45+
<figcaption><strong>Figure 2.</strong> Example of a nested JSON object.</figcaption>
46+
</figure>
4147

4248
Here is a JSON array in which all of its items are JSON objects:
4349

44-
![json object array](/img/4-JSON-In-Practice/json-object-array.png)
50+
<figure id="fig-json-object-array">
51+
<img src="/img/4-JSON-In-Practice/json-object-array.png" alt="JSON array containing multiple JSON objects" />
52+
<figcaption><strong>Figure 3.</strong> JSON array containing multiple JSON objects.</figcaption>
53+
</figure>
4554

4655
## Common Mistakes
4756

@@ -78,13 +87,19 @@ We should always pay attention to the type we want to use and use quotation mark
7887

7988
Putting comments inside JSON documents is not valid in contrast to most of the programming languages.
8089

81-
![comment](/img/4-JSON-In-Practice/comment.png)
90+
<figure id="fig-json-comment">
91+
<img src="/img/4-JSON-In-Practice/comment.png" alt="Invalid JSON example showing a comment" />
92+
<figcaption><strong>Figure 4.</strong> Invalid JSON comment.</figcaption>
93+
</figure>
8294

8395
### Trailing Commas
8496

85-
Commas should not be used at the final name-value pair - that is why the left example is not valid. This is more difficult to see if you are using it inside of a Javascript editor rather than a JSON editor.
97+
Commas should not be used at the final name-value pair - that is why the left example of [Figure 5](#fig-json-js) is not valid. This is more difficult to see if you are using it inside of a Javascript editor rather than a JSON editor.
8698

87-
![json js](/img/4-JSON-In-Practice/json-js.png)
99+
<figure id="fig-json-js">
100+
<img src="/img/4-JSON-In-Practice/json-js.png" alt="Trailing comma example in JSON vs JavaScript" />
101+
<figcaption><strong>Figure 5.</strong> Trailing comma example in JSON vs JavaScript.</figcaption>
102+
</figure>
88103

89104
### Programming Language Syntax
90105

Tutorials/whatiswot/website/docs/preliminary/osi-layers.md

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: OSI Layers and Network Topologies
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/QMNkZidA3UY?si=aB2BfW7BFBmAy34F" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/9-OSI_Layers/9-OSI-Layers.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/9-OSI_Layers/9-OSI-Layers.mp4">click here to watch from our GitHub repository.</a>
1010

1111
<br />
1212
<br />
@@ -76,7 +76,8 @@ Performing this, we were able to send the temperature data.
7676

7777
In order for the thermometer to receive the data, it has to go through all the OSI layers but in reverse order. At the end of the process, we can observe the temperature change on the indicator.
7878

79-
![layers](/img/tutorial/OSI-Layers/layers.png)
79+
<figure id="fig-osi-layers-summary">
80+
<img src="/img/tutorial/OSI-Layers/layers.png" alt="OSI layers overview from application to physical layer" /> <figcaption><strong>Figure 1.</strong> Summary of OSI layers.</figcaption></figure>
8081

8182
## Different Network Topologies
8283

@@ -90,9 +91,11 @@ In all of these models, the underlying network technology remains largely consis
9091

9192
### Client-Server Model
9293

93-
One of the most widely used topologies is the Client-Server Model. It consists of one server and one or more clients. In this model, the server is reactive, waiting for requests and responding to clients. Clients, on the other hand, are proactive in initiating requests.
94+
One of the most widely used topologies is the Client-Server Model shown in [Figure 2](#fig-server-client-model). It consists of one server and one or more clients. In this model, the server is reactive, waiting for requests and responding to clients. Clients, on the other hand, are proactive in initiating requests.
9495

95-
![server-client-model](/img/9-OSI-Layers/server-client-model.png)
96+
<figure id="fig-server-client-model">
97+
<img src="/img/9-OSI-Layers/server-client-model.png" alt="Client-Server Model" />
98+
<figcaption><strong>Figure 2.</strong> Client–Server Model.</figcaption> </figure>
9699

97100
Common protocols used in the Server-Client Model include HTTP, WebSocket, and CoAP.
98101

@@ -102,7 +105,9 @@ If server and client are very tightly coupled, it is very hard one to evolve ind
102105

103106
The Broker-Client Model is another significant topology. In this model, multiple clients connect to a central broker. While it's often referred to as Publisher-Subscriber, the term Broker-Client is more precise as PubSub can exist without a broker.
104107

105-
![broker-client-model](/img/9-OSI-Layers/broker-client-model.png)
108+
<figure id="fig-broker-client-model">
109+
<img src="/img/9-OSI-Layers/broker-client-model.png" alt="Broker-Client Model" />
110+
<figcaption><strong>Figure 3.</strong> Broker–Client Model.</figcaption> </figure>
106111

107112
The broker does not contain any application logic, it is simply a router that receives messages and sends them to clients that are listening.
108113

@@ -112,8 +117,10 @@ Alternatively, multiple clients can send data to the broker, which then distribu
112117

113118
### Peer-to-Peer Model
114119

115-
Lastly, we have the Peer-to-Peer Model, a true distributed system where there's no central point to retrieve data from. Each node in this model has equal functionality.
120+
Lastly, we have the Peer-to-Peer Model, a true distributed system where there's no central point to retrieve data from. As seen in [Figure 4](#fig-peer-to-peer-model), each node in this model has equal functionality.
116121

117122
Examples of this model include BitTorrent and Bitcoin.
118123

119-
![peer-to-peer-model](/img/9-OSI-Layers/peer-to-peer-model.png)
124+
<figure id="fig-peer-to-peer-model">
125+
<img src="/img/9-OSI-Layers/peer-to-peer-model.png" alt="Peer-to-peer topology" />
126+
<figcaption><strong>Figure 4.</strong> Peer-to-Peer Model.</figcaption> </figure>

Tutorials/whatiswot/website/docs/preliminary/payloads.md

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ sidebar_label: Payloads and Headers
66

77
<iframe width="100%" height="400" src="https://www.youtube.com/embed/uooaqTpNtNw?si=vCoRygpQYoy3CXBe" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen></iframe>
88

9-
<a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/2-Payloads_and_Headers/2-Payloads_and_Headers.mp4">Click here if YouTube does not work go to our GitHub.</a>
9+
If YouTube does not work, <a href = "https://github.com/w3c/wot-cg/blob/main/Tutorials/whatiswot/2-Payloads_and_Headers/2-Payloads_and_Headers.mp4">click here to watch from our GitHub repository.</a>
1010

1111

1212
<br />
@@ -18,7 +18,10 @@ This is an introductory series that presents technologies and standards relevant
1818

1919
In the Web of Things, smart devices typically exchange data with each other. Such data is sent via payloads, therefore it is essential to understand what payloads are and the headers that describe them. Thus, in this section, we will cover the topics of headers and the different types of payloads - including JSON, the most used one in the scope of WoT, and its importance.
2020

21-
![payloads and headers](/img/tutorial/Payloads-And-Headers/payloadsandheaders.png)
21+
<figure id="fig-payloads-headers-overview">
22+
<img src="/img/tutorial/Payloads-And-Headers/payloadsandheaders.png" alt="Relationship between payloads and headers" />
23+
<figcaption><strong>Figure 1.</strong> Relationship between payloads and headers.</figcaption>
24+
</figure>
2225

2326
## What is a payload?
2427

@@ -30,25 +33,34 @@ In computing, the payload is the part of transmitted data that is the actual int
3033

3134
The header is part of a message that can and should be understood by the protocol stack. All the information that the payload should not contain, goes to the header.
3235

33-
> Let's go back to our truck example. In that example, the header would be the label on the goods - indicating where they are being transported, what they are and etc.
36+
> Let's go back to our truck example. As seen in [Figure 2](#fig-truck-example), the header would be the label on the goods - indicating where they are being transported, what they are and etc.
3437
35-
![truck with parcels example](/img/tutorial/Payloads-And-Headers/truck.png)
38+
<figure id="fig-truck-example">
39+
<img src="/img/tutorial/Payloads-And-Headers/truck.png" alt="Truck and parcel header analogy" />
40+
<figcaption><strong>Figure 2.</strong> Analogy showing headers as labels on transported goods.</figcaption>
41+
</figure>
3642

3743
## Header Example
3844

3945
This is what an HTTP header can look like. A header can contain information like request context, response context, status and it can indicate payload type.
4046

41-
![http header example](/img/tutorial/Payloads-And-Headers/httpheader.png)
47+
<figure id="fig-http-header-example">
48+
<img src="/img/tutorial/Payloads-And-Headers/httpheader.png" alt="Example contents of an HTTP header" />
49+
<figcaption><strong>Figure 3.</strong> Example contents of an HTTP header.</figcaption>
50+
</figure>
4251

4352
## Payload Types
4453

4554
There are different payload types: JSON, XML, CBOR, text and audio to name a few.
4655

4756
So let us show you an example of a **JSON payload**.
4857

49-
![json payload example](/img/tutorial/Payloads-And-Headers/jsonexample.png)
58+
<figure id="fig-json-payload-example">
59+
<img src="/img/tutorial/Payloads-And-Headers/jsonexample.png" alt="Example of a JSON payload with sensor values" />
60+
<figcaption><strong>Figure 4.</strong> Example of a JSON payload used by a temperature sensor.</figcaption>
61+
</figure>
5062

51-
For this example we will take a look at a temperature sensor. The diagram helps to illustrate the payloads and their relationship to the sensor. The temperature payload is a single number and is being sent from the sensor. The configuration payload is a JSON object consisting of key/value pairs desiredUnit and updateInterval and is sent to the sensor.
63+
For this example we will take a look at a temperature sensor. [Figure 4](#fig-json-payload-example) helps to illustrate the payloads and their relationship to the sensor. The temperature payload is a single number and is being sent from the sensor. The configuration payload is a JSON object consisting of key/value pairs desiredUnit and updateInterval and is sent to the sensor.
5264

5365
Temparature payload:
5466

0 commit comments

Comments
 (0)