Skip to content

Commit 76bec9a

Browse files
docs: add workspace docs to book
Signed-off-by: Andrius Pukšta <andrius.puksta@sensmetry.com>
1 parent 5de5994 commit 76bec9a

4 files changed

Lines changed: 112 additions & 0 deletions

File tree

docs/book.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@ language = "en"
55

66
[build]
77
build-dir = "book"
8+
create-missing = false
9+
10+
[output.html]
11+
additional-css = ["theme/style.css"]
12+
git-repository-url = "https://github.com/sensmetry/sysand"

docs/src/SUMMARY.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- [Installation](getting_started/installation.md)
55
- [Tutorial](getting_started/tutorial.md)
66
- [Project metadata](metadata.md)
7+
- [Workspaces](workspaces.md)
78
- [Commands](commands.md)
89
- [sysand init](commands/init.md)
910
- [sysand add](commands/add.md)

docs/src/workspaces.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Workspaces
2+
3+
<div class="warning">
4+
5+
Warning:
6+
Workspace support is experimental and may change or be removed in any release.
7+
See [workspaces tracking issue](https://github.com/sensmetry/sysand/issues/101)
8+
for planned functionality and changes
9+
10+
</div>
11+
12+
## Introduction
13+
14+
It is common to have multiple related projects that are all developed together
15+
and that usually use each other's functionality.
16+
17+
Sysand supports such uses with workspaces. A workspace is a collection of
18+
projects, commonly structured like this:
19+
20+
```plain
21+
workspace
22+
├──project_1
23+
├──project_2
24+
└──project_3
25+
```
26+
27+
Such a structure is not a requirement, though. Projects can be anywhere
28+
under the workspace root directory.
29+
30+
## Defining a workspace
31+
32+
A workspace is defined by `.workspace.json` file in the root directory of
33+
the workspace.
34+
35+
`.workspace.json` contains a JSON object. The only currently permitted key
36+
is `projects`, for which the value is an array of objects having two keys:
37+
38+
- `path`: A Unix-style path relative to workspace root, specifying the
39+
project's directory
40+
- `iris`: An array of IRIs identifying the project. The IRIs can be freely
41+
chosen, but reasonable care has to be taken to make them not clash with
42+
possible IRIs of third party projects. Any of the included IRIs can be
43+
used to refer to the project from other projects in the workspace
44+
instead of using `file://` URLs
45+
46+
## Example
47+
48+
An example `.workspace.json` file:
49+
50+
```json
51+
{
52+
"projects": [
53+
{
54+
"path": "projectGroup1/project1",
55+
"iris": [
56+
"urn:local:project1"
57+
]
58+
},
59+
{
60+
"path": "projectGroup1/project2",
61+
"iris": [
62+
"urn:local:project2"
63+
]
64+
},
65+
{
66+
"path": "project3",
67+
"iris": [
68+
"urn:local:project3"
69+
]
70+
}
71+
]
72+
}
73+
```

docs/theme/style.css

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
/*
2+
Taken from Rust reference.
3+
Warnings and notes:
4+
Write the <div>s on their own line. E.g.
5+
<div class="warning">
6+
Warning: This is bad!
7+
</div>
8+
*/
9+
main .warning p {
10+
padding: 10px 20px;
11+
margin: 20px 0;
12+
}
13+
14+
main .warning p::before {
15+
content: "⚠️ ";
16+
}
17+
18+
.light main .warning p,
19+
.rust main .warning p {
20+
border: 2px solid red;
21+
background: #ffcece;
22+
}
23+
24+
.rust main .warning p {
25+
/* overrides previous declaration */
26+
border-color: #961717;
27+
}
28+
29+
.coal main .warning p,
30+
.navy main .warning p,
31+
.ayu main .warning p {
32+
background: #542626
33+
}

0 commit comments

Comments
 (0)