Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions assets/scss/_styles_project.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4090,3 +4090,78 @@ footer {
}

/* Feedback System Styles END */

/* API overview grid START */

.api-overview-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
gap: 1.25rem;
margin: 1.5rem 0 2rem;
/* default align-items: stretch — every card in a row shares the row height */
}

.api-overview-card {
display: flex;
flex-direction: column;
background: #fff;
border: 1px solid #dee2e6;
border-radius: 4px;
overflow: hidden;
}

.api-overview-card-header {
padding: 0.7rem 1rem;
background: #f8f9fa;
border-bottom: 1px solid #eceef0;
}

.api-overview-card-title {
margin: 0;
font-family: "Space Grotesk", sans-serif;
font-size: 1.05rem;
font-weight: 600;
}

.api-overview-card-title a {
color: #1b1b1f;
text-decoration: none;
}

.api-overview-card-title a:hover {
color: #3176d9;
}

.api-method-list {
list-style: none;
margin: 0;
padding: 0.4rem;
}

.api-method-list li {
margin: 0;
}

.api-method-list li a {
display: block;
padding: 0.16rem 0.5rem;
border-radius: 3px;
font-size: 0.82rem;
line-height: 1.6;
text-decoration: none;
transition: background-color 0.15s ease;
}

.api-method-list li a:hover {
background-color: #eef2fb;
}

/* The rendered method is <a><code>Method</code></a>; cancel the global
inline-code background/padding so it reads as a plain monospace link. */
.api-method-list code {
background: none;
padding: 0;
font-size: inherit;
}

/* API overview grid END */
59 changes: 59 additions & 0 deletions data/component_apis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# Drives /reference/apis/components/overview/ via the `api-overview` shortcode.
# The `table` paths point at method-table includes auto-generated by
# .github/workflows/update_sdk_methods.py (movement-sensor is the exception: its
# table is maintained manually). If that script renames or removes a -table.md
# file, update the matching `table` path here or the Hugo build will fail.
- title: "Arm"
link: "/reference/apis/components/arm/"
table: "/static/include/components/apis/generated/arm-table.md"
- title: "Audio in"
link: "/reference/apis/components/audio-in/"
table: "/static/include/components/apis/generated/audio_in-table.md"
- title: "Audio out"
link: "/reference/apis/components/audio-out/"
table: "/static/include/components/apis/generated/audio_out-table.md"
- title: "Base"
link: "/reference/apis/components/base/"
table: "/static/include/components/apis/generated/base-table.md"
- title: "Board"
link: "/reference/apis/components/board/"
table: "/static/include/components/apis/generated/board-table.md"
- title: "Button"
link: "/reference/apis/components/button/"
table: "/static/include/components/apis/generated/button-table.md"
- title: "Camera"
link: "/reference/apis/components/camera/"
table: "/static/include/components/apis/generated/camera-table.md"
- title: "Encoder"
link: "/reference/apis/components/encoder/"
table: "/static/include/components/apis/generated/encoder-table.md"
- title: "Gantry"
link: "/reference/apis/components/gantry/"
table: "/static/include/components/apis/generated/gantry-table.md"
- title: "Generic"
link: "/reference/apis/components/generic/"
table: "/static/include/components/apis/generated/generic_component-table.md"
- title: "Gripper"
link: "/reference/apis/components/gripper/"
table: "/static/include/components/apis/generated/gripper-table.md"
- title: "Input controller"
link: "/reference/apis/components/input-controller/"
table: "/static/include/components/apis/generated/input_controller-table.md"
- title: "Motor"
link: "/reference/apis/components/motor/"
table: "/static/include/components/apis/generated/motor-table.md"
- title: "Movement sensor"
link: "/reference/apis/components/movement-sensor/"
table: "/static/include/components/apis/movement-sensor.md"
- title: "Power sensor"
link: "/reference/apis/components/power-sensor/"
table: "/static/include/components/apis/generated/power_sensor-table.md"
- title: "Sensor"
link: "/reference/apis/components/sensor/"
table: "/static/include/components/apis/generated/sensor-table.md"
- title: "Servo"
link: "/reference/apis/components/servo/"
table: "/static/include/components/apis/generated/servo-table.md"
- title: "Switch"
link: "/reference/apis/components/switch/"
table: "/static/include/components/apis/generated/switch-table.md"
28 changes: 28 additions & 0 deletions data/service_apis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Drives /reference/apis/services/overview/ via the `api-overview` shortcode.
# The `table` paths point at method-table includes auto-generated by
# .github/workflows/update_sdk_methods.py. If that script renames or removes a
# -table.md file, update the matching `table` path here or the Hugo build will fail.
- title: "Data management"
link: "/reference/apis/services/data/"
table: "/static/include/services/apis/generated/data_manager-table.md"
- title: "Vision"
link: "/reference/apis/services/vision/"
table: "/static/include/services/apis/generated/vision-table.md"
- title: "ML model"
link: "/reference/apis/services/ml/"
table: "/static/include/services/apis/generated/mlmodel-table.md"
- title: "Motion"
link: "/reference/apis/services/motion/"
table: "/static/include/services/apis/generated/motion-table.md"
- title: "Generic"
link: "/reference/apis/services/generic/"
table: "/static/include/services/apis/generated/generic_service-table.md"
- title: "Base remote control"
link: "/reference/apis/services/base-rc/"
table: "/static/include/services/apis/generated/base_remote_control-table.md"
- title: "Discovery"
link: "/reference/apis/services/discovery/"
table: "/static/include/services/apis/generated/discovery-table.md"
- title: "World state store"
link: "/reference/apis/services/world-state-store/"
table: "/static/include/services/apis/generated/world_state_store-table.md"
16 changes: 16 additions & 0 deletions docs/reference/apis/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ Manage sessions, heartbeats, and safety timeouts for connected clients.

These APIs provide interfaces for controlling and getting information from the {{< glossary_tooltip term_id="component" text="components" >}} of a machine:

{{< cards >}}
{{% manualcard link="/reference/apis/components/overview/" title="Component APIs overview" %}}

See every component API and its methods at a glance in one compact grid.

{{% /manualcard %}}
{{< /cards >}}

{{< cards >}}
{{< card link="/reference/apis/components/arm/" customTitle="Arm API" noimage="True" >}}
{{< card link="/reference/apis/components/audio-in/" customTitle="Audio in API" noimage="True" >}}
Expand All @@ -90,6 +98,14 @@ These APIs provide interfaces for controlling and getting information from the {

These APIs provide interfaces for controlling and getting information from the services you configured on a machine.

{{< cards >}}
{{% manualcard link="/reference/apis/services/overview/" title="Service APIs overview" %}}

See every service API and its methods at a glance in one compact grid.

{{% /manualcard %}}
{{< /cards >}}

{{< cards >}}
{{% card link="/reference/apis/services/data/" customTitle="Data management service API" noimage="True" %}}
{{% card link="/reference/apis/services/vision/" customTitle="Vision service API" noimage="True" %}}
Expand Down
12 changes: 12 additions & 0 deletions docs/reference/apis/components/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Component APIs overview"
linkTitle: "Overview"
weight: 1
type: "docs"
description: "Scan every Viam component API and its methods at a glance, with links to each method's reference."
---

The following grid lists every {{< glossary_tooltip term_id="component" text="component" >}} API and its methods.
Select an API name to open its full reference, or select a method to jump straight to that method.

{{< api-overview "component_apis" >}}
12 changes: 12 additions & 0 deletions docs/reference/apis/services/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
title: "Service APIs overview"
linkTitle: "Overview"
weight: 1
type: "docs"
description: "Scan every Viam service API and its methods at a glance, with links to each method's reference."
---

The following grid lists every {{< glossary_tooltip term_id="service" text="service" >}} API and its methods.
Select an API name to open its full reference, or select a method to jump straight to that method.

{{< api-overview "service_apis" >}}
43 changes: 43 additions & 0 deletions layouts/shortcodes/api-overview.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{{- /*
api-overview: renders a compact overview of every API in a data file and its
methods. One positional arg: the data-file key (component_apis or
service_apis, from data/<key>.yaml).

Method lists are read at build time from the per-API method-table includes
(the same -table.md files the detail pages render), so the grid never goes
stale. Each table row's first cell is a `[`Method`](url#anchor)` link; we keep
only data rows (those starting with "| ["), take that first cell, and pull the
method name + URL from it. APIs and methods are both listed alphabetically.
*/ -}}
{{- $entries := index site.Data (.Get 0) -}}
{{- if not $entries -}}
{{- errorf "api-overview: no data file found for key %q" (.Get 0) -}}
{{- end -}}
<div class="api-overview-grid">
{{- range (sort $entries "title") -}}
{{- if not (fileExists .table) -}}
{{- errorf "api-overview: table file %q not found for %q" .table .title -}}
{{- end -}}
{{- $raw := os.ReadFile .table -}}
{{- $methods := slice -}}
{{- range (split $raw "\n") -}}
{{- /* keep only data rows: "| [`Method`](url) | ... |" */ -}}
{{- if hasPrefix . "| [" -}}
{{- $cell := index (split . "|") 1 -}}
{{- range findRESubmatch `\[\x60([^\x60]+)\x60\]\(([^)]+)\)` $cell -}}
{{- $methods = $methods | append (dict "name" (index . 1) "url" (index . 2)) -}}
{{- end -}}
{{- end -}}
{{- end -}}
<div class="api-overview-card">
<div class="api-overview-card-header">
<h3 class="api-overview-card-title"><a href="{{ .link | relLangURL }}">{{ .title }}</a></h3>
</div>
<ul class="api-method-list">
{{- range (sort $methods "name") -}}
<li><a href="{{ .url | relLangURL }}"><code>{{ .name }}</code></a></li>
{{- end -}}
</ul>
</div>
{{- end -}}
</div>
Loading