Skip to content

Commit 96554ae

Browse files
committed
Revert "Change docs structure v3.0 (viamrobotics#3722) (viamrobotics#3723)"
This reverts commit 028ab84.
1 parent 12ef19b commit 96554ae

File tree

600 files changed

+13418
-11788
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

+13418
-11788
lines changed

Diff for: .github/vale/styles/Viam/AvoidWithSubstitutionViam.yml

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

Diff for: .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/dev/reference/apis/{service}/index.html") as fp:
238+
with open(f"dist/appendix/apis/{service}/index.html") as fp:
239239
soup2 = BeautifulSoup(fp, 'html.parser')
240240
else:
241241
if service in services_page_mapping.keys():

Diff for: .github/workflows/docs.yml

+22-11
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,23 @@ 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+
5056
- name: Upload components models file
5157
uses: actions/upload-artifact@v4
5258
with:
5359
name: components-models-file
54-
path: ./public/operate/reference/components/typesense.json
60+
path: ./public/components/typesense.json
5561

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
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
6167

6268
deploy:
6369
environment:
@@ -107,6 +113,11 @@ jobs:
107113
with:
108114
python-version: "3.9"
109115
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"
110121
- name: Download the tutorials file
111122
uses: actions/download-artifact@v4
112123
with:
@@ -134,11 +145,11 @@ jobs:
134145
with:
135146
name: components-models-file
136147
path: "components"
137-
# - name: Download the services models file
138-
# uses: actions/download-artifact@v4
139-
# with:
140-
# name: services-models-file
141-
# path: "services"
148+
- name: Download the services models file
149+
uses: actions/download-artifact@v4
150+
with:
151+
name: services-models-file
152+
path: "services"
142153
- run: pip install -r .github/workflows/requirements.txt
143154
- name: "Update modular resources"
144155
run: python3 .github/workflows/get_modular_resources.py

Diff for: .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)

Diff for: .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": "/manage/reference/organize/",
439-
"image tags": "/data-ai/ai/create-dataset/#label-your-images",
438+
"organization settings page": "/cloud/organizations/",
439+
"image tags": "/fleet/dataset/#image-tags",
440440
"API key": "/fleet/cli/#authenticate",
441-
"board model": "/dev/reference/apis/components/board/"
441+
"board model": "/components/board/#configuration"
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/dev/reference/apis/data-client/#binarydatabyfilter)
620+
## (EXAMPLE: bolded DATA tab here: https://docs.viam.com/appendix/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 = '/dev/reference/apis/components/' + resource_adjusted + '/#' + proto_link
1833+
proto_anchor_link = '/appendix/apis/components/' + resource_adjusted + '/#' + proto_link
18341834
elif type == 'service' and resource in ['base_remote_control', 'motion', 'navigation', 'slam', 'vision']:
1835-
proto_anchor_link = '/dev/reference/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link
1835+
proto_anchor_link = '/appendix/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link
18361836
elif type == 'service' and resource == 'data_manager':
1837-
proto_anchor_link = '/dev/reference/apis/services/data/#' + proto_link
1837+
proto_anchor_link = '/appendix/apis/services/data/#' + proto_link
18381838
elif type == 'service' and resource == 'generic_service':
1839-
proto_anchor_link = '/dev/reference/apis/services/generic/#' + proto_link
1839+
proto_anchor_link = '/appendix/apis/services/generic/#' + proto_link
18401840
elif type == 'service' and resource == 'mlmodel':
1841-
proto_anchor_link = '/dev/reference/apis/services/ml/#' + proto_link
1841+
proto_anchor_link = '/appendix/apis/services/ml/#' + proto_link
18421842
elif type == 'app' and resource == 'app':
1843-
proto_anchor_link = '/dev/reference/apis/fleet/#' + proto_link
1843+
proto_anchor_link = '/appendix/apis/fleet/#' + proto_link
18441844
elif type == 'app' and resource in ["billing", "mltraining"]:
1845-
proto_anchor_link = '/dev/reference/apis/' + resource.replace('mltraining','ml-training') + '-client/#' + proto_link
1845+
proto_anchor_link = '/appendix/apis/' + resource.replace('mltraining','ml-training') + '-client/#' + proto_link
18461846
elif type == 'app' and resource in ["data", "dataset", "data_sync"]:
1847-
proto_anchor_link = '/dev/reference/apis/data-client/#' + proto_link
1847+
proto_anchor_link = '/appendix/apis/data-client/#' + proto_link
18481848
elif type == 'robot':
1849-
proto_anchor_link = '/dev/reference/apis/' + resource + '/#' + proto_link
1849+
proto_anchor_link = '/appendix/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')

Diff for: .github/workflows/upload_tutorials.py

+13
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,19 @@ 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+
3447
# Deleting documents that didn't get updated (presumably deleted)
3548
try:
3649
res = typesense_client.collections['tutorials'].documents.delete({'filter_by': 'last_updated: <' + str(time_now)})

Diff for: assets/build/program/sdks/log-level-info.png

-41.6 KB
Loading

Diff for: assets/icons/logo.svg

+2-2
Loading

Diff for: 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: "Control hardware", value: "core" },
101+
{ label: "Core", value: "core" },
102102
{ label: "Fleet Management", value: "fleet" },
103-
{ label: "Integrate other hardware", value: "registry" },
103+
{ label: "Registry", value: "registry" },
104104
{ label: "Mobility", value: "mobility" },
105105
],
106106
}),

Diff for: assets/js/index.js

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

66
function submenuToggle(menu, toggle) {
7-
console.log(menu)
87
let open = false;
98
if (toggle.children[0].className === "fas fa-chevron-right") {
109
open = true;
@@ -18,29 +17,16 @@ function submenuToggle(menu, toggle) {
1817
}
1918

2019
// add or remove collapse class to children
21-
let menuChildren = menu.querySelector("span>ul").children;
20+
let immediateChildren = menu.querySelector("ul").children;
2221
if (open) {
23-
for (let c of menuChildren) {
22+
for (let c of immediateChildren) {
2423
c.classList.remove("collapse");
2524
}
2625
} else {
27-
for (let c of menuChildren) {
26+
for (let c of immediateChildren) {
2827
c.classList.add("collapse");
2928
}
3029
}
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-
4430
}
4531

4632
for (let menu of siteMenuSubmenus) {

Diff for: assets/js/tutorials.js

+4
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,8 @@ 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>
8082
<li><p><strong>blogpost</strong>: Sample projects you can build.</p></li>
8183
<li><p><strong>codelab</strong>: Community projects and example project.</p></li>
8284
</ul>
@@ -213,6 +215,8 @@ search.addWidgets([
213215
sortBy: ["name:asc"],
214216
items: [
215217
{ label: "tutorial" },
218+
{ label: "how-to" },
219+
{ label: "quickstart" },
216220
{ label: "blogpost" },
217221
{ label: "codelab" },
218222
],

Diff for: assets/registry/restart-module.png

-10.1 KB
Binary file not shown.

Diff for: assets/scss/_sidebar-tree.scss

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

1110
@include media-breakpoint-up(md) {
1211
@supports (position: sticky) {
@@ -64,7 +63,7 @@
6463
a, .emptynode {
6564
display: inline-block;
6665
padding-bottom: 0.375rem;
67-
color: #333333;
66+
color: black;
6867
text-decoration: none;
6968

7069
&:hover {
@@ -97,7 +96,6 @@
9796

9897
li i { // Layout of icons
9998
padding-right: 0.5em;
100-
-webkit-text-stroke: 1px whitesmoke;
10199
&:before{
102100
display: inline-block;
103101
text-align: center;
@@ -114,7 +112,7 @@
114112

115113
.td-sidebar {
116114
@include media-breakpoint-up(md) {
117-
padding-top: 6rem;
115+
padding-top: 4rem;
118116
background-color: $td-sidebar-bg-color;
119117
padding-right: 1rem;
120118
border-right: 1px solid $td-sidebar-border-color;
@@ -172,15 +170,4 @@
172170
li .indent {
173171
font-size: 0.833rem;
174172
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-
}
186173
}

0 commit comments

Comments
 (0)