Skip to content

Commit 2929a2e

Browse files
merge documentation
1 parent ca48aeb commit 2929a2e

39 files changed

+1682
-106
lines changed

README.md

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,7 @@ Documentation for the Invariant SDK.
55
To locally serve a live version of the documentation, run the following command in this directory:
66

77
```bash
8-
docker build -t invariant-docs .
9-
docker run -it -p 8000:8000 -e DEV_MODE=true -v .:/docs/ invariant-docs
8+
./dev serve
109
```
1110

12-
With `DEV_MODE=true` and the mounted volume, the documentation will reflect changes made to the markdown files in real-time.
13-
14-
For deployment, we build the Docker image and push it to the registry:
15-
16-
The actual documentation can be found in the subfolder `docs/`.
11+
**Requirements:** Docker

dev

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#!/usr/bin/python3
2+
# ./do build
3+
# docker build -t invariant-docs .
4+
# ./do serve
5+
# docker build -t invariant-docs . && docker run -it -p 8000:8000 -e DEV_MODE=true -v .:/docs/ invariant-docs
6+
7+
import sys
8+
import time
9+
import subprocess
10+
import webbrowser
11+
12+
if sys.argv[1] == 'build':
13+
print('Building image...')
14+
subprocess.run(['docker', 'build', '-t', 'invariant-docs', '.'])
15+
elif sys.argv[1] == 'serve':
16+
print('Building image...')
17+
p = subprocess.Popen(['docker', 'build', '-t', 'invariant-docs', '.'], stdout=subprocess.PIPE)
18+
p.wait()
19+
print('Starting server...')
20+
p = subprocess.Popen("docker run -it -p 8000:8000 -e DEV_MODE=true -v .:/docs/ invariant-docs", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
21+
time.sleep(1)
22+
webbrowser.open('http://localhost:8000')
23+
p.wait()
24+
else:
25+
print('Usage: ./do build | ./do serve')
26+
sys.exit(1)

docs/assets/invariant.css

Lines changed: 75 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,7 @@ blockquote {
213213
overflow: hidden;
214214
color: black;
215215
margin-top: 30pt !important;
216+
padding-top: 5pt;
216217
}
217218

218219
blockquote pre {
@@ -241,8 +242,8 @@ h2, h3, h4 {
241242

242243
h2 {
243244
border-top: 1pt solid #e5e5e58e;
244-
padding-top: 30pt;
245-
margin-top: 30pt !important;
245+
padding-top: 10pt;
246+
margin-top: 20pt !important;
246247
}
247248

248249
h5 {
@@ -279,13 +280,81 @@ h5 span.optional:after {
279280
display: inline-block;
280281
}
281282

282-
ul {
283-
margin-top: 0pt !important;
284-
list-style-type: none !important;
285-
}
286283

287284
/* p when preceded by h5 */
288285
h5 + p, h5 + p + p, h5 + p + p + p, h5 + p + p + p + p {
289286
font-size: 12pt !important;
290287
margin-top: -5pt !important;
288+
}
289+
290+
a {
291+
text-decoration: underline;
292+
}
293+
294+
.md-nav__list a, .tiles a {
295+
text-decoration: none;
296+
}
297+
298+
.jupyter-wrapper .jp-InputArea-editor {
299+
/* border-radius: 5pt; */
300+
border: none !important;
301+
}
302+
303+
.jupyter-wrapper .jp-InputArea-editor {
304+
padding: 5pt;
305+
}
306+
307+
.jupyter-wrapper .jp-InputArea-editor pre {
308+
font-size: 12pt;
309+
}
310+
311+
.jupyter-wrapper .jp-InputPrompt, .jupyter-wrapper .jp-CodeCell .jp-Cell-inputWrapper .jp-InputPrompt {
312+
display: none !important;
313+
}
314+
315+
.jupyter-wrapper .jp-Notebook .jp-Cell:not(.jp-mod-active) .jp-OutputPrompt {
316+
display: none !important;
317+
}
318+
319+
/* output font size larger */
320+
.jupyter-wrapper .jp-RenderedText.jp-OutputArea-output pre {
321+
font-size: 12pt;
322+
border-left: 4pt solid #3d3aff4d;
323+
padding-left: 8pt;
324+
}
325+
326+
.jupyter-wrapper .jp-Cell-inputArea, .jupyter-wrapper .jp-Cell-outputArea {
327+
margin-top: 10pt;
328+
}
329+
330+
/* do not show stderr */
331+
.jupyter-wrapper .jp-RenderedText.jp-OutputArea-output[data-mime-type="application/vnd.jupyter.stderr"] {
332+
display: none !important;
333+
}
334+
335+
div.highlight {
336+
font-size: 12pt !important;
337+
}
338+
339+
span.llm::before {
340+
content: "LLM-based";
341+
color: white;
342+
font-size: 8pt;
343+
position: relative;
344+
top: -3pt;
345+
margin-left: 3pt;
346+
background-color: rgb(199, 130, 199);
347+
display: inline-block;
348+
height: 10pt;
349+
350+
padding: 2pt 4pt;
351+
border-radius: 4pt;
352+
}
353+
354+
.jupyter-wrapper {
355+
margin-top: -20pt;
356+
}
357+
358+
label.md-nav__title {
359+
display: none;
291360
}

docs/Explorer_API/1_client_setup.md renamed to docs/explorer/Explorer_API/1_client_setup.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
The SDK exposes a `Client` class. To create an object of this type, you need two variables: the Invariant API endpoint URL and the API key.
44

55
## Getting the API Key
6-
Navigate to the <img class='inline-invariant' src="../assets/logo.svg"/> [Invariant Explorer](https://explorer.invariantlabs.ai) and create an account via GitHub Sign-In.
6+
Navigate to the <img class='inline-invariant' src="../../assets/logo.svg"/> [Invariant Explorer](https://explorer.invariantlabs.ai) and create an account via GitHub Sign-In.
77

88
Once you have created an account, go to your [User Settings](https://explorer.invariantlabs.ai/settings) and generate an API key.
99

File renamed without changes.

docs/Explorer_API/3_annotations.md renamed to docs/explorer/Explorer_API/3_annotations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Annotations provide additional context, facilitating collaboration and agent err
88

99
<figure class='wide'>
1010

11-
<img src="../assets/annotated-trace.png" alt="An annotated trace" style="width: 100%;">
11+
<img src="../../assets/annotated-trace.png" alt="An annotated trace" style="width: 100%;">
1212

1313
<figcaption>An annotated trace in Explorer</figcaption>
1414

docs/Explorer_API/Dataset_Metadata/get_dataset_metadata_api.md renamed to docs/explorer/Explorer_API/Dataset_Metadata/get_dataset_metadata_api.md

File renamed without changes.

docs/Explorer_API/Dataset_Metadata/update_dataset_metadata_api.md renamed to docs/explorer/Explorer_API/Dataset_Metadata/update_dataset_metadata_api.md

File renamed without changes.

docs/Explorer_API/Uploading_Traces/file_uploads.md renamed to docs/explorer/Explorer_API/Uploading_Traces/file_uploads.md

File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)