Skip to content

Commit

Permalink
Improve documentation for plugin + better overall structure
Browse files Browse the repository at this point in the history
  • Loading branch information
tolauwae committed Jan 5, 2024
1 parent 7379b18 commit 330a087
Show file tree
Hide file tree
Showing 19 changed files with 291 additions and 191 deletions.
1 change: 1 addition & 0 deletions warduino/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ config.local.js
basement_dist
.idea
*.sh
.obsidian
86 changes: 33 additions & 53 deletions warduino/.vitepress/components/home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,47 +21,14 @@ const {frontmatter: fm} = useData()
</div>
</div>

<!-- features -->
<!-- projects -->
<!--
<div class="features">
<div class="container">
<div class="grid column-3">
<div class="item">
<feature icon="rocket_launch"
header="Get started"
tagline="Start developing programs with WARDuino."
link="/guide/get-started"/>
</div>
<div class="item">
<feature icon="terminal"
header="IDE support"
tagline="Manual for the WARDuino VS Code plugin."
link="/guide/plugin"/>
</div>
<div class="item">
<feature icon="check_box"
header="Testing"
tagline="Get started with the Latch testing framework."
link="/guide/latch"/>
</div>
<div class="item">
<feature icon="school"
header="Examples & Tutorials"
tagline="A selection of examples to get you started with WARDuino."
link="/guide/examples/"/>
</div>
<div class="item">
<feature icon="menu_book"
header="Developer's guide"
tagline="Documentation of the WARDuino virtual machine implementation."
link="/reference/"/>
</div>
<div class="item">
<feature icon="diversity_3"
header="Research"
tagline="Research articles published around the WARDuino project."
link="/articles/"/>
</div>
<div class="grow divider">
<h4 class="center">WARDuino</h4>
<h4 class="center">EDWARD</h4>
<h4 class="center">Latch</h4>
</div>
</div>
</div>
Expand All @@ -71,6 +38,7 @@ const {frontmatter: fm} = useData()
<div class="details">
<div class="container">
<div class="vp-doc grow">
<!-- <h2></h2>-->

<div style="display: flex; flex-flow: column nowrap; gap: 24px; justify-content: space-between">
<div class="grow divider">
Expand All @@ -85,8 +53,8 @@ const {frontmatter: fm} = useData()
</div>
<p><a href="./guide/get-started.html">-&gt; Get started</a></p>
<p><a href="./guide/examples/index.html">-&gt; Examples</a></p>
<p><a href="./guide/plugin/">-&gt; VS Code plugin</a></p>
<p><a href="./guide/latch.html">-&gt; Automated testing</a></p>
<p><a href="./guide/plugin.html">-&gt; Debugging in VS Code</a></p>
</article>
<article class="list">
<div class="heading">
Expand All @@ -97,24 +65,24 @@ const {frontmatter: fm} = useData()
<h4>References</h4>
</div>
</div>
<p><a href="./reference/primitives.html">-&gt; WARDuino primitives</a></p>
<p><a href="./reference/debug-protocol.html">-&gt; Debug protocol</a></p>
<p><a href="./reference/architecture.html">-&gt; WARDuino architecture</a></p>
<p><a href="./reference/primitives.html">-&gt; Built-in primitives</a></p>
<p><a href="./reference/debug-protocol.html">-&gt; Remote debug protocol</a></p>
<p><a href="./reference/edward/index.html">-&gt; EDWARD debugger</a></p>
<p><a href="./latch/index.html">-&gt; Latch reference</a></p>
<p><a href="./latch/index.html">-&gt; Latch testing</a></p>
</article>
<article class="list">
<div class="heading">
<div class="icon">
<span class="material-symbols-rounded">school</span>
</div>
<div>
<h4>Examples & Tutorials</h4>
<h4>Tutorials</h4>
</div>
</div>
<p><a href="./guide/examples/analog.html">-&gt; Analog Read Serial</a></p>
<p><a href="./guide/examples/blink.html">-&gt; Blinking LED</a></p>
<p><a href="./guide/examples/button.html">-&gt; Button</a></p>
<p><a href="./guide/examples/index.html">-&gt; More ...</a></p>
<p><a href="./guide/examples/index.html">-&gt; Example programs</a></p>
<p><a href="./guide/plugin/tutorial.html">-&gt; Debugging with VS Code</a></p>
<p><a href="./reference/edward/concurrency.html">-&gt; Debugging concurrency issues</a></p>
</article>

</div>
Expand All @@ -129,8 +97,11 @@ const {frontmatter: fm} = useData()
<h4>Developer's guide</h4>
</div>
</div>
<p><a style="font-size: 14px" href="./reference/development.html">-&gt; Development</a></p>
<p><a style="font-size: 14px" href="./reference/contributing.html">-&gt; Contributing</a></p>
<p><a style="font-size: 14px" href="./reference/development.html">-&gt; Debugging the debugger</a></p>
<p><a href="./reference/platforms.html">-&gt; Supported platforms</a></p>
<p><a href="https://github.com/orgs/TOPLLab/projects/1" target="_blank">-&gt; Roadmap <span
class="material-symbols-rounded">open_in_new</span></a></p>
</article>
<article class="list">
<div class="heading">
Expand All @@ -141,7 +112,8 @@ const {frontmatter: fm} = useData()
<h4>Templates</h4>
</div>
</div>
<p><a href="https://github.com/TOPLLab/as-warduino-template">-&gt; AssemblyScript</a></p>
<p><a href="https://github.com/TOPLLab/as-warduino-template" target="_blank">-&gt; AssemblyScript <span
class="material-symbols-rounded">open_in_new</span></a></p>
</article>
<div></div>
</div>
Expand All @@ -152,7 +124,8 @@ const {frontmatter: fm} = useData()
<h4 class="center">Research</h4>
<p class="center">
WARDuino and the related projects documented here, are being developed as part of active research projects.
The principle investigators at Ghent University and the VUB, maintain this documentation website and the associated software.
The principle investigators at Ghent University and the VUB, maintain this documentation website and the
associated software.
You can find out more about the research on the <i>published articles</i> page.
</p>
<p class="center"><a href="./articles/index.html">-&gt; Published articles</a></p>
Expand Down Expand Up @@ -365,7 +338,7 @@ const {frontmatter: fm} = useData()
.icon {
box-sizing: border-box;
margin-right: 8px;
margin-top: 5px;
vertical-align: text-bottom;
}
.icon > span {
Expand All @@ -384,12 +357,14 @@ h4.center {
p.center {
max-width: 688px;
margin: 0 auto;
margin: 0 auto;
}
@media (max-width: 640px) {
max-width: 100%;
p.center {
max-width: 100%;
}
}
.divider {
Expand Down Expand Up @@ -422,4 +397,9 @@ p {
line-height: 24px;
font-weight: 400;
}
a > span {
font-size: inherit;
font-weight: inherit;
}
</style>
47 changes: 31 additions & 16 deletions warduino/.vitepress/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,22 +59,38 @@ export default defineConfig({
{ text: 'MQTT Smartlamp', link: '/guide/examples/smartlamp' },
]
},
{ text: 'VS Code Plugin', link: '/guide/plugin' },
{ text: 'VS Code Plugin',
collapsed: true,
items: [
{ text: 'Installation', link: '/guide/plugin/' },
{ text: 'Getting Started', link: '/guide/plugin/get-started' },
{ text: 'Debugging Hardware', link: '/guide/plugin/tutorial' },
]
},
{ text: 'Testing on Hardware', link: '/guide/latch' }
]
},

{
text: 'WARDuino Reference',
text: "Developer's Guide",
collapsed: true,
items: [
{ text: 'Overview', link: '/reference/' },
{ text: 'Contributing', link: '/reference/contributing' },
{ text: 'Development', link: '/reference/development' },
{ text: 'Platform Support', link: '/reference/platforms' },
]
},

{
text: 'Technical Reference',
collapsed: true,
items: [
{ text: 'Overview', link: '/reference/' },
{ text: 'Architecture', link: '/reference/architecture' },
{ text: 'Primitives', link: '/reference/primitives' },
{ text: 'Remote Debugger', link: '/reference/debugger' },
{ text: 'Debug Protocol', link: '/reference/debug-protocol' },
{
text: 'EDWARD Reference',
text: 'EDWARD',
collapsed: true,
items: [
{ text: 'Overview', link: '/reference/edward/' },
Expand All @@ -87,21 +103,20 @@ export default defineConfig({
},
]
},
{ text: 'Platform Support', link: '/reference/platforms' }
]
},

{
text: 'Latch Reference',
collapsed: true,
items: [
{ text: 'Overview', link: '/latch/' },
{ text: 'Latch API', link: '/latch/api' }
{
text: 'Latch',
collapsed: true,
items: [
{ text: 'Overview', link: '/latch/' },
{ text: 'Latch API', link: '/latch/api' },
]
},
{ text: 'VS Code Plugin', link: '/reference/plugin' }
]
},

{
text: 'Research Articles',
text: 'Published Articles',
collapsed: true,
items: [
{ text: 'Overview', link: '/articles/' },
Expand Down
2 changes: 1 addition & 1 deletion warduino/articles/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import citation from '../.vitepress/components/citation.vue'
</script>

# Research Articles
# Published Articles

## EDWARD (2022)

Expand Down
3 changes: 3 additions & 0 deletions warduino/guide/examples/smartlamp.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
---
next: VS Code Plugin
---
# Smartlamp App with MQTT


Expand Down
8 changes: 5 additions & 3 deletions warduino/guide/latch.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
title: Latch
next: WARDuino Reference
next: Developer's Guide
---
# Testing: Latch framework

**<span style="font-variant: small-caps;">Latch</span> (Large-scale Automated Testing on Constraint Hardware)** is a novel testing framework for running large scale unit and integration tests in constrained environments.

::: tip Open source

You can find the open source code on [github](https://github.com/TOPLLab/latch).

:::

## Getting Started



47 changes: 47 additions & 0 deletions warduino/guide/plugin/get-started.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Getting Started

## Launch the Plugin {#launch}

Open your local plugin repository (see [install step](./index.md)), and click on `Run Extension` under the _Run and Debug_ tab.
This will launch the plugin in a new VS Code window.

In this new window, open your project folder.
If you don't have a project yet, you can use the [AssemblyScript template](https://github.com/TOPLLab/as-warduino-template) for WARDuino to get started quickly.

## Project Configuration {#vscode-config}

::: tip Add `launch.json` file
If you use any of our templates, you can skip this configuration step.
The template contains the correct launch file.
:::

To use the WARDuino plugin to debug your project, you need to create a `launch.json` file in the `.vscode` subfolder of your project root directory [<sup>\[1\]</sup>](https://code.visualstudio.com/docs/editor/debugging).
The file should look like this:

```json
{
"version": "0.4.1",
"configurations": [
{
"type": "WARDuinoDBG",
"request": "launch",
"name": "Debug WARDuino",
"program": "${workspaceFolder}/src/main.ts",
"stopOnEntry": true,
"trace": false
}
]
}
```

The `program` key within the JSON file specifies the application's entry file that needs to be debugged.

Depending on the file extension pointed by the `program` entry, the plugin will load the required WebAssembly compiler and create source mappers accordingly.

## Start Debugging

By default, the plugin will debug using a local running instance of WARDuino (emulator).
This means you don't need any further configuration.
Navigate to the _Run and Debug_ tab, and click on `Debug WARDuino`.

The next tutorial goes through the steps needed to debug on real hardware.
51 changes: 51 additions & 0 deletions warduino/guide/plugin/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
# VS Code Plugin

::: tip WARDuino VS Code 0.4.1

This page describes the VS Code plugin [version 0.4.1](https://github.com/TOPLLab/WARDuino-VSCode/releases/tag/v0.4.1), which works with WARDuino [version 0.4.2](https://github.com/TOPLLab/WARDuino/releases/tag/v0.4.2).

:::

::: warning Unstable prerelease

The plugin is still in experimental phase.
The following describes the current state of the VS Code plugin, which is not yet fully stable.
Consequently, the plugin may crash unexpectedly or become unresponsive.

:::

The WARDuino plugin is a VS Code extension designed for debugging applications running on the WARDuino VM. The plugin offers two debugging techniques:

1. [remote debugging](/reference/architecture.md#classic) and
2. [event-based out-of-place debugging](/reference/edward/index).

Noteworthy functionality of the plugin:

- On-demand switching from [remote debugging](/reference/architecture.md#classic) to [event-based out-of-place debugging](/reference/edward/index).
- Access to classic debug operations: add a breakpoint, remove a breakpoint, step, step-over, run, and more.
- Access to advanced debug operations: step back debug operations to view past state. (experimental)
- A view on the whole debugging history to easily jump back to a previous state. (experimental)
- Upload new source code on the device once a fault has been fixed.
- Debug on a board
- Debug on an emulator.
- Control over interrupts (e.g., button press, incoming MQTT message) and the handling of it.

## Manual Installation {#installation}

::: warning Soon to be released!

The VS Code plugin has not been published yet. Look out for it in the VS Code Marketplace!
:::

Before installing the plugin, make sure that you followed the [installation guide](/guide/get-started.md#installation) for the needed development software.

Once the installation is completed follow these steps:

- Install VS Code (version 1.63.2 or higher)

- (Optional) In case you plan to debug Textual WebAssembly source files make sure to install this [VS Code WebAssembly Syntax Highlight plugin](https://github.com/AlanCezarAraujo/vscode-webassembly-syntax-highlight).

- Change the VS Code settings to enable allow `Allow Breakpoints Everywhere`.
For this, navigate to the VS Code settings and search for `Allow Breakpoints Everywhere` in the search bar.
- Download the [WARDuino VS Code plugin](https://github.com/TOPLLab/WARDuino-VSCode) repo and execute the installation bash script named `install.sh`.
This script downloads and builds the essential libraries such as the WARDuino VM.
Loading

0 comments on commit 330a087

Please sign in to comment.