Skip to content

Commit

Permalink
Revert "Change docs structure v3.0 (viamrobotics#3722) (viamrobotics#…
Browse files Browse the repository at this point in the history
…3723)"

This reverts commit 028ab84.
  • Loading branch information
npentrel committed Jan 21, 2025
1 parent 12ef19b commit 96554ae
Show file tree
Hide file tree
Showing 600 changed files with 13,418 additions and 11,788 deletions.
1 change: 1 addition & 0 deletions .github/vale/styles/Viam/AvoidWithSubstitutionViam.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ action:
name: replace
swap:
in the website: on the website
web app: Viam app or Viam platform
user of an org: member of an org
compute parts: Computer
microprocessor: Raspberry Pi or Jetson or another specific term
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_python_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ def parse(type, names):
# Parse the Docs site's service page
if args.local:
if type == "app" or type == "robot":
with open(f"dist/dev/reference/apis/{service}/index.html") as fp:
with open(f"dist/appendix/apis/{service}/index.html") as fp:
soup2 = BeautifulSoup(fp, 'html.parser')
else:
if service in services_page_mapping.keys():
Expand Down
33 changes: 22 additions & 11 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,23 @@ jobs:
name: tutorials-file
path: ./public/tutorials/typesense.json

- name: Upload how-tos search file
uses: actions/upload-artifact@v4
with:
name: howtos-file
path: ./public/how-tos/typesense.json

- name: Upload components models file
uses: actions/upload-artifact@v4
with:
name: components-models-file
path: ./public/operate/reference/components/typesense.json
path: ./public/components/typesense.json

# - name: Upload services models file
# uses: actions/upload-artifact@v4
# with:
# name: services-models-file
# path: ./public/operate/reference/services/typesense.json
- name: Upload services models file
uses: actions/upload-artifact@v4
with:
name: services-models-file
path: ./public/services/typesense.json

deploy:
environment:
Expand Down Expand Up @@ -107,6 +113,11 @@ jobs:
with:
python-version: "3.9"
cache: "pip" # caching pip dependencies
- name: Download the how-tos file
uses: actions/download-artifact@v4
with:
name: howtos-file
path: "how-tos"
- name: Download the tutorials file
uses: actions/download-artifact@v4
with:
Expand Down Expand Up @@ -134,11 +145,11 @@ jobs:
with:
name: components-models-file
path: "components"
# - name: Download the services models file
# uses: actions/download-artifact@v4
# with:
# name: services-models-file
# path: "services"
- name: Download the services models file
uses: actions/download-artifact@v4
with:
name: services-models-file
path: "services"
- run: pip install -r .github/workflows/requirements.txt
- name: "Update modular resources"
run: python3 .github/workflows/get_modular_resources.py
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/get_modular_resources.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,19 +101,19 @@ async def main():
print("INSERTED")
print(insert_resp)

# # Get built-in resources from services/typesense.json
# with open('services/typesense.json') as f:
# resources = json.load(f)
# for r in resources:
# print("RESOURCE")
# print(r)
# r["last_updated"] = time_now
# r["total_organization_usage"] = int(r["total_organization_usage"])
# r["total_robot_usage"] = int(r["total_robot_usage"])
# print(r)
# insert_resp = typesense_client.collections['resources'].documents.upsert(r)
# print("INSERTED")
# print(insert_resp)
# Get built-in resources from services/typesense.json
with open('services/typesense.json') as f:
resources = json.load(f)
for r in resources:
print("RESOURCE")
print(r)
r["last_updated"] = time_now
r["total_organization_usage"] = int(r["total_organization_usage"])
r["total_robot_usage"] = int(r["total_robot_usage"])
print(r)
insert_resp = typesense_client.collections['resources'].documents.upsert(r)
print("INSERTED")
print(insert_resp)

# Create a request to list registry items and get the response from the app
request = ListRegistryItemsRequest(organization_id=cloud._organization_id)
Expand Down
26 changes: 13 additions & 13 deletions .github/workflows/update_sdk_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,10 +435,10 @@
"SLAM service": "/services/slam/",
"frame": "/services/frame-system/",
"Viam app": "https://app.viam.com/",
"organization settings page": "/manage/reference/organize/",
"image tags": "/data-ai/ai/create-dataset/#label-your-images",
"organization settings page": "/cloud/organizations/",
"image tags": "/fleet/dataset/#image-tags",
"API key": "/fleet/cli/#authenticate",
"board model": "/dev/reference/apis/components/board/"
"board model": "/components/board/#configuration"
}

## Language-specific resource name overrides:
Expand Down Expand Up @@ -617,7 +617,7 @@ def link_data_types(sdk, data_type_string):

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

## Supports 'md' link styling or 'html' link styling.
Expand Down Expand Up @@ -1830,23 +1830,23 @@ def write_markdown(type, names, methods):
if type == 'component':
## Replace underscores, and convert generic_component to just generic:
resource_adjusted = resource.replace('generic_component', 'generic').replace('_','-')
proto_anchor_link = '/dev/reference/apis/components/' + resource_adjusted + '/#' + proto_link
proto_anchor_link = '/appendix/apis/components/' + resource_adjusted + '/#' + proto_link
elif type == 'service' and resource in ['base_remote_control', 'motion', 'navigation', 'slam', 'vision']:
proto_anchor_link = '/dev/reference/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link
proto_anchor_link = '/appendix/apis/services/' + resource.replace('base_remote_control', 'base-rc') + '/#' + proto_link
elif type == 'service' and resource == 'data_manager':
proto_anchor_link = '/dev/reference/apis/services/data/#' + proto_link
proto_anchor_link = '/appendix/apis/services/data/#' + proto_link
elif type == 'service' and resource == 'generic_service':
proto_anchor_link = '/dev/reference/apis/services/generic/#' + proto_link
proto_anchor_link = '/appendix/apis/services/generic/#' + proto_link
elif type == 'service' and resource == 'mlmodel':
proto_anchor_link = '/dev/reference/apis/services/ml/#' + proto_link
proto_anchor_link = '/appendix/apis/services/ml/#' + proto_link
elif type == 'app' and resource == 'app':
proto_anchor_link = '/dev/reference/apis/fleet/#' + proto_link
proto_anchor_link = '/appendix/apis/fleet/#' + proto_link
elif type == 'app' and resource in ["billing", "mltraining"]:
proto_anchor_link = '/dev/reference/apis/' + resource.replace('mltraining','ml-training') + '-client/#' + proto_link
proto_anchor_link = '/appendix/apis/' + resource.replace('mltraining','ml-training') + '-client/#' + proto_link
elif type == 'app' and resource in ["data", "dataset", "data_sync"]:
proto_anchor_link = '/dev/reference/apis/data-client/#' + proto_link
proto_anchor_link = '/appendix/apis/data-client/#' + proto_link
elif type == 'robot':
proto_anchor_link = '/dev/reference/apis/' + resource + '/#' + proto_link
proto_anchor_link = '/appendix/apis/' + resource + '/#' + proto_link

## Fetch just the first sentence from the proto_override_file (first text string terminated by '.\n'), ignoring hugo
## shortcodes like alerts ('{{%.*%}}.*{{% \[a-b].* %}}'), which precede some override files' (proto descriptions')
Expand Down
13 changes: 13 additions & 0 deletions .github/workflows/upload_tutorials.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,19 @@ async def main():
print("INSERTED")
print(insert_resp)

# Get how-tos from how-tos/typesense.json
with open('how-tos/typesense.json') as f:
resources = json.load(f)
for r in resources:
print("RESOURCE")
r["date"] = int(r["date"])
print(r)
r["last_updated"] = time_now
print(r)
insert_resp = typesense_client.collections['tutorials'].documents.upsert(r)
print("INSERTED")
print(insert_resp)

# Deleting documents that didn't get updated (presumably deleted)
try:
res = typesense_client.collections['tutorials'].documents.delete({'filter_by': 'last_updated: <' + str(time_now)})
Expand Down
Binary file modified assets/build/program/sdks/log-level-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/icons/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions assets/js/howtos.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ let refinementLists = [customRefinementList({
items: [
{ label: "Data Management", value: "data" },
{ label: "Machine Learning", value: "ml" },
{ label: "Control hardware", value: "core" },
{ label: "Core", value: "core" },
{ label: "Fleet Management", value: "fleet" },
{ label: "Integrate other hardware", value: "registry" },
{ label: "Registry", value: "registry" },
{ label: "Mobility", value: "mobility" },
],
}),
Expand Down
20 changes: 3 additions & 17 deletions assets/js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ var siteMenuSubmenus = document.getElementsByClassName(
);

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

// add or remove collapse class to children
let menuChildren = menu.querySelector("span>ul").children;
let immediateChildren = menu.querySelector("ul").children;
if (open) {
for (let c of menuChildren) {
for (let c of immediateChildren) {
c.classList.remove("collapse");
}
} else {
for (let c of menuChildren) {
for (let c of immediateChildren) {
c.classList.add("collapse");
}
}
let pageChildren = menu.querySelector("span>div>ul").children;
if (pageChildren) {
if (open) {
for (let c of pageChildren) {
c.classList.remove("collapse");
}
} else {
for (let c of pageChildren) {
c.classList.add("collapse");
}
}
}

}

for (let menu of siteMenuSubmenus) {
Expand Down
4 changes: 4 additions & 0 deletions assets/js/tutorials.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ const customRefinementList = instantsearch.connectors.connectRefinementList(
</ul>
<ul class="pill-explainer">
<li><p><strong>tutorial</strong>: Projects that show you how to use different parts of Viam.</p></li>
<li><p><strong>how-to</strong>: Step-by-step guides to complete tasks.</p></li>
<li><p><strong>quickstart</strong>: <5 min step-by-step guide to complete tasks.</p></li>
<li><p><strong>blogpost</strong>: Sample projects you can build.</p></li>
<li><p><strong>codelab</strong>: Community projects and example project.</p></li>
</ul>
Expand Down Expand Up @@ -213,6 +215,8 @@ search.addWidgets([
sortBy: ["name:asc"],
items: [
{ label: "tutorial" },
{ label: "how-to" },
{ label: "quickstart" },
{ label: "blogpost" },
{ label: "codelab" },
],
Expand Down
Binary file removed assets/registry/restart-module.png
Binary file not shown.
17 changes: 2 additions & 15 deletions assets/scss/_sidebar-tree.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
margin-right: -15px;
margin-left: -15px;
font-size: 1rem;
font-weight: 300;

@include media-breakpoint-up(md) {
@supports (position: sticky) {
Expand Down Expand Up @@ -64,7 +63,7 @@
a, .emptynode {
display: inline-block;
padding-bottom: 0.375rem;
color: #333333;
color: black;
text-decoration: none;

&:hover {
Expand Down Expand Up @@ -97,7 +96,6 @@

li i { // Layout of icons
padding-right: 0.5em;
-webkit-text-stroke: 1px whitesmoke;
&:before{
display: inline-block;
text-align: center;
Expand All @@ -114,7 +112,7 @@

.td-sidebar {
@include media-breakpoint-up(md) {
padding-top: 6rem;
padding-top: 4rem;
background-color: $td-sidebar-bg-color;
padding-right: 1rem;
border-right: 1px solid $td-sidebar-border-color;
Expand Down Expand Up @@ -172,15 +170,4 @@
li .indent {
font-size: 0.833rem;
padding-left: 0.75rem;
}

@media (min-width: 768px) {
.header-only > span > span.emptynode:hover {
color: #aaa;
}

.ul-2 > li:not(:last-child) {
padding-bottom: 8px;
border-bottom: 1px solid #ccc;
}
}
Loading

0 comments on commit 96554ae

Please sign in to comment.