Skip to content

Commit 028ab84

Browse files
npentrelsguequierreJessamyT
authored
Change docs structure v3.0 (#3722) (#3723)
Co-authored-by: Sierra Guequierre <[email protected]> Co-authored-by: JessamyT <[email protected]>
1 parent bd30e3c commit 028ab84

File tree

600 files changed

+11788
-13418
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

600 files changed

+11788
-13418
lines changed

.github/vale/styles/Viam/AvoidWithSubstitutionViam.yml

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ action:
77
name: replace
88
swap:
99
in the website: on the website
10-
web app: Viam app or Viam platform
1110
user of an org: member of an org
1211
compute parts: Computer
1312
microprocessor: Raspberry Pi or Jetson or another specific term

.github/workflows/check_python_methods.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ def parse(type, names):
235235
# Parse the Docs site's service page
236236
if args.local:
237237
if type == "app" or type == "robot":
238-
with open(f"dist/appendix/apis/{service}/index.html") as fp:
238+
with open(f"dist/dev/reference/apis/{service}/index.html") as fp:
239239
soup2 = BeautifulSoup(fp, 'html.parser')
240240
else:
241241
if service in services_page_mapping.keys():

.github/workflows/docs.yml

+11-22
Original file line numberDiff line numberDiff line change
@@ -47,23 +47,17 @@ jobs:
4747
name: tutorials-file
4848
path: ./public/tutorials/typesense.json
4949

50-
- name: Upload how-tos search file
51-
uses: actions/upload-artifact@v4
52-
with:
53-
name: howtos-file
54-
path: ./public/how-tos/typesense.json
55-
5650
- name: Upload components models file
5751
uses: actions/upload-artifact@v4
5852
with:
5953
name: components-models-file
60-
path: ./public/components/typesense.json
54+
path: ./public/operate/reference/components/typesense.json
6155

62-
- name: Upload services models file
63-
uses: actions/upload-artifact@v4
64-
with:
65-
name: services-models-file
66-
path: ./public/services/typesense.json
56+
# - name: Upload services models file
57+
# uses: actions/upload-artifact@v4
58+
# with:
59+
# name: services-models-file
60+
# path: ./public/operate/reference/services/typesense.json
6761

6862
deploy:
6963
environment:
@@ -113,11 +107,6 @@ jobs:
113107
with:
114108
python-version: "3.9"
115109
cache: "pip" # caching pip dependencies
116-
- name: Download the how-tos file
117-
uses: actions/download-artifact@v4
118-
with:
119-
name: howtos-file
120-
path: "how-tos"
121110
- name: Download the tutorials file
122111
uses: actions/download-artifact@v4
123112
with:
@@ -145,11 +134,11 @@ jobs:
145134
with:
146135
name: components-models-file
147136
path: "components"
148-
- name: Download the services models file
149-
uses: actions/download-artifact@v4
150-
with:
151-
name: services-models-file
152-
path: "services"
137+
# - name: Download the services models file
138+
# uses: actions/download-artifact@v4
139+
# with:
140+
# name: services-models-file
141+
# path: "services"
153142
- run: pip install -r .github/workflows/requirements.txt
154143
- name: "Update modular resources"
155144
run: python3 .github/workflows/get_modular_resources.py

.github/workflows/get_modular_resources.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -101,19 +101,19 @@ async def main():
101101
print("INSERTED")
102102
print(insert_resp)
103103

104-
# Get built-in resources from services/typesense.json
105-
with open('services/typesense.json') as f:
106-
resources = json.load(f)
107-
for r in resources:
108-
print("RESOURCE")
109-
print(r)
110-
r["last_updated"] = time_now
111-
r["total_organization_usage"] = int(r["total_organization_usage"])
112-
r["total_robot_usage"] = int(r["total_robot_usage"])
113-
print(r)
114-
insert_resp = typesense_client.collections['resources'].documents.upsert(r)
115-
print("INSERTED")
116-
print(insert_resp)
104+
# # Get built-in resources from services/typesense.json
105+
# with open('services/typesense.json') as f:
106+
# resources = json.load(f)
107+
# for r in resources:
108+
# print("RESOURCE")
109+
# print(r)
110+
# r["last_updated"] = time_now
111+
# r["total_organization_usage"] = int(r["total_organization_usage"])
112+
# r["total_robot_usage"] = int(r["total_robot_usage"])
113+
# print(r)
114+
# insert_resp = typesense_client.collections['resources'].documents.upsert(r)
115+
# print("INSERTED")
116+
# print(insert_resp)
117117

118118
# Create a request to list registry items and get the response from the app
119119
request = ListRegistryItemsRequest(organization_id=cloud._organization_id)

.github/workflows/update_sdk_methods.py

+13-13
Original file line numberDiff line numberDiff line change
@@ -435,10 +435,10 @@
435435
"SLAM service": "/services/slam/",
436436
"frame": "/services/frame-system/",
437437
"Viam app": "https://app.viam.com/",
438-
"organization settings page": "/cloud/organizations/",
439-
"image tags": "/fleet/dataset/#image-tags",
438+
"organization settings page": "/manage/reference/organize/",
439+
"image tags": "/data-ai/ai/create-dataset/#label-your-images",
440440
"API key": "/fleet/cli/#authenticate",
441-
"board model": "/components/board/#configuration"
441+
"board model": "/dev/reference/apis/components/board/"
442442
}
443443

444444
## Language-specific resource name overrides:
@@ -617,7 +617,7 @@ def link_data_types(sdk, data_type_string):
617617

618618
## Link matching text, used in write_markdown():
619619
## NOTE: Currently does not support formatting for link titles
620-
## (EXAMPLE: bolded DATA tab here: https://docs.viam.com/appendix/apis/data-client/#binarydatabyfilter)
620+
## (EXAMPLE: bolded DATA tab here: https://docs.viam.com/dev/reference/apis/data-client/#binarydatabyfilter)
621621
def link_description(format_type, full_description, link_text, link_url):
622622

623623
## Supports 'md' link styling or 'html' link styling.
@@ -1830,23 +1830,23 @@ def write_markdown(type, names, methods):
18301830
if type == 'component':
18311831
## Replace underscores, and convert generic_component to just generic:
18321832
resource_adjusted = resource.replace('generic_component', 'generic').replace('_','-')
1833-
proto_anchor_link = '/appendix/apis/components/' + resource_adjusted + '/#' + proto_link
1833+
proto_anchor_link = '/dev/reference/apis/components/' + resource_adjusted + '/#' + proto_link
18341834
elif type == 'service' and resource in ['base_remote_control', 'motion', 'navigation', 'slam', 'vision']:
1835-
proto_anchor_link = '/appendix/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link
1835+
proto_anchor_link = '/dev/reference/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link
18361836
elif type == 'service' and resource == 'data_manager':
1837-
proto_anchor_link = '/appendix/apis/services/data/#' + proto_link
1837+
proto_anchor_link = '/dev/reference/apis/services/data/#' + proto_link
18381838
elif type == 'service' and resource == 'generic_service':
1839-
proto_anchor_link = '/appendix/apis/services/generic/#' + proto_link
1839+
proto_anchor_link = '/dev/reference/apis/services/generic/#' + proto_link
18401840
elif type == 'service' and resource == 'mlmodel':
1841-
proto_anchor_link = '/appendix/apis/services/ml/#' + proto_link
1841+
proto_anchor_link = '/dev/reference/apis/services/ml/#' + proto_link
18421842
elif type == 'app' and resource == 'app':
1843-
proto_anchor_link = '/appendix/apis/fleet/#' + proto_link
1843+
proto_anchor_link = '/dev/reference/apis/fleet/#' + proto_link
18441844
elif type == 'app' and resource in ["billing", "mltraining"]:
1845-
proto_anchor_link = '/appendix/apis/' + resource.replace('mltraining','ml-training') + '-client/#' + proto_link
1845+
proto_anchor_link = '/dev/reference/apis/' + resource.replace('mltraining','ml-training') + '-client/#' + proto_link
18461846
elif type == 'app' and resource in ["data", "dataset", "data_sync"]:
1847-
proto_anchor_link = '/appendix/apis/data-client/#' + proto_link
1847+
proto_anchor_link = '/dev/reference/apis/data-client/#' + proto_link
18481848
elif type == 'robot':
1849-
proto_anchor_link = '/appendix/apis/' + resource + '/#' + proto_link
1849+
proto_anchor_link = '/dev/reference/apis/' + resource + '/#' + proto_link
18501850

18511851
## Fetch just the first sentence from the proto_override_file (first text string terminated by '.\n'), ignoring hugo
18521852
## shortcodes like alerts ('{{%.*%}}.*{{% \[a-b].* %}}'), which precede some override files' (proto descriptions')

.github/workflows/upload_tutorials.py

-13
Original file line numberDiff line numberDiff line change
@@ -31,19 +31,6 @@ async def main():
3131
print("INSERTED")
3232
print(insert_resp)
3333

34-
# Get how-tos from how-tos/typesense.json
35-
with open('how-tos/typesense.json') as f:
36-
resources = json.load(f)
37-
for r in resources:
38-
print("RESOURCE")
39-
r["date"] = int(r["date"])
40-
print(r)
41-
r["last_updated"] = time_now
42-
print(r)
43-
insert_resp = typesense_client.collections['tutorials'].documents.upsert(r)
44-
print("INSERTED")
45-
print(insert_resp)
46-
4734
# Deleting documents that didn't get updated (presumably deleted)
4835
try:
4936
res = typesense_client.collections['tutorials'].documents.delete({'filter_by': 'last_updated: <' + str(time_now)})
41.6 KB
Loading

assets/icons/logo.svg

+2-2
Loading

assets/js/howtos.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -98,9 +98,9 @@ let refinementLists = [customRefinementList({
9898
items: [
9999
{ label: "Data Management", value: "data" },
100100
{ label: "Machine Learning", value: "ml" },
101-
{ label: "Core", value: "core" },
101+
{ label: "Control hardware", value: "core" },
102102
{ label: "Fleet Management", value: "fleet" },
103-
{ label: "Registry", value: "registry" },
103+
{ label: "Integrate other hardware", value: "registry" },
104104
{ label: "Mobility", value: "mobility" },
105105
],
106106
}),

assets/js/index.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ var siteMenuSubmenus = document.getElementsByClassName(
44
);
55

66
function submenuToggle(menu, toggle) {
7+
console.log(menu)
78
let open = false;
89
if (toggle.children[0].className === "fas fa-chevron-right") {
910
open = true;
@@ -17,16 +18,29 @@ function submenuToggle(menu, toggle) {
1718
}
1819

1920
// add or remove collapse class to children
20-
let immediateChildren = menu.querySelector("ul").children;
21+
let menuChildren = menu.querySelector("span>ul").children;
2122
if (open) {
22-
for (let c of immediateChildren) {
23+
for (let c of menuChildren) {
2324
c.classList.remove("collapse");
2425
}
2526
} else {
26-
for (let c of immediateChildren) {
27+
for (let c of menuChildren) {
2728
c.classList.add("collapse");
2829
}
2930
}
31+
let pageChildren = menu.querySelector("span>div>ul").children;
32+
if (pageChildren) {
33+
if (open) {
34+
for (let c of pageChildren) {
35+
c.classList.remove("collapse");
36+
}
37+
} else {
38+
for (let c of pageChildren) {
39+
c.classList.add("collapse");
40+
}
41+
}
42+
}
43+
3044
}
3145

3246
for (let menu of siteMenuSubmenus) {

assets/js/tutorials.js

-4
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,6 @@ const customRefinementList = instantsearch.connectors.connectRefinementList(
7777
</ul>
7878
<ul class="pill-explainer">
7979
<li><p><strong>tutorial</strong>: Projects that show you how to use different parts of Viam.</p></li>
80-
<li><p><strong>how-to</strong>: Step-by-step guides to complete tasks.</p></li>
81-
<li><p><strong>quickstart</strong>: <5 min step-by-step guide to complete tasks.</p></li>
8280
<li><p><strong>blogpost</strong>: Sample projects you can build.</p></li>
8381
<li><p><strong>codelab</strong>: Community projects and example project.</p></li>
8482
</ul>
@@ -215,8 +213,6 @@ search.addWidgets([
215213
sortBy: ["name:asc"],
216214
items: [
217215
{ label: "tutorial" },
218-
{ label: "how-to" },
219-
{ label: "quickstart" },
220216
{ label: "blogpost" },
221217
{ label: "codelab" },
222218
],

assets/registry/restart-module.png

10.1 KB
Loading

assets/scss/_sidebar-tree.scss

+15-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
margin-right: -15px;
77
margin-left: -15px;
88
font-size: 1rem;
9+
font-weight: 300;
910

1011
@include media-breakpoint-up(md) {
1112
@supports (position: sticky) {
@@ -63,7 +64,7 @@
6364
a, .emptynode {
6465
display: inline-block;
6566
padding-bottom: 0.375rem;
66-
color: black;
67+
color: #333333;
6768
text-decoration: none;
6869

6970
&:hover {
@@ -96,6 +97,7 @@
9697

9798
li i { // Layout of icons
9899
padding-right: 0.5em;
100+
-webkit-text-stroke: 1px whitesmoke;
99101
&:before{
100102
display: inline-block;
101103
text-align: center;
@@ -112,7 +114,7 @@
112114

113115
.td-sidebar {
114116
@include media-breakpoint-up(md) {
115-
padding-top: 4rem;
117+
padding-top: 6rem;
116118
background-color: $td-sidebar-bg-color;
117119
padding-right: 1rem;
118120
border-right: 1px solid $td-sidebar-border-color;
@@ -170,4 +172,15 @@
170172
li .indent {
171173
font-size: 0.833rem;
172174
padding-left: 0.75rem;
175+
}
176+
177+
@media (min-width: 768px) {
178+
.header-only > span > span.emptynode:hover {
179+
color: #aaa;
180+
}
181+
182+
.ul-2 > li:not(:last-child) {
183+
padding-bottom: 8px;
184+
border-bottom: 1px solid #ccc;
185+
}
173186
}

0 commit comments

Comments
 (0)