Skip to content

Commit

Permalink
docs: rename /api to /guide/vpic, update all links
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaggyTech committed Nov 8, 2023
1 parent add36ce commit bb494aa
Show file tree
Hide file tree
Showing 87 changed files with 333 additions and 323 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ WMIs, get all makes for a certain year, and more.
- [Install](https://vpic.shaggytech.com/guide/install)
- [Node Quick Start](https://vpic.shaggytech.com//guide/getting-started#node-quick-start)
- [Browser Quick Start](https://vpic.shaggytech.com/guide/getting-started#browser-quick-start)
- [API Reference](https://vpic.shaggytech.com/api/)
- [API Reference](https://vpic.shaggytech.com/guide/vpic/)

## Mono Repo Structure

Expand Down Expand Up @@ -129,9 +129,9 @@ const { Results } = await DecodeVinValues("WA1A4AFY2J2008189");
const decodedVehicle = Results[0]; // equals an object of type DecodeVinValuesResults
```

For a full example response see: [DecodeVinValues](https://vpic.shaggytech.com/api/endpoints/decode-vin-values#returns)
For a full example response see: [DecodeVinValues](https://vpic.shaggytech.com/guide/vpic/endpoints/decode-vin-values#returns)

All available endpoints can be found here: [VPIC API Endpoints](https://vpic.shaggytech.com/api/#vpic-api-endpoints)
All available endpoints can be found here: [VPIC API Endpoints](https://vpic.shaggytech.com/guide/vpic/#vpic-api-endpoints)

## Browser Install

Expand Down
108 changes: 62 additions & 46 deletions apps/docs/.vitepress/menu-links.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,74 +3,86 @@ import { type DefaultTheme } from 'vitepress'
type SidebarItem = DefaultTheme.SidebarItem

const vpicEndpointLinks = [
{ text: 'DecodeVin', link: '/api/endpoints/decode-vin' },
{ text: 'DecodeVinExtended', link: '/api/endpoints/decode-vin-extended' },
{ text: 'DecodeVinValues', link: '/api/endpoints/decode-vin-values' },
{ text: 'DecodeVin', link: '/guide/vpic/endpoints/decode-vin' },
{
text: 'DecodeVinExtended',
link: '/guide/vpic/endpoints/decode-vin-extended',
},
{ text: 'DecodeVinValues', link: '/guide/vpic/endpoints/decode-vin-values' },
{
text: 'DecodeVinValuesBatch',
link: '/api/endpoints/decode-vin-values-batch',
link: '/guide/vpic/endpoints/decode-vin-values-batch',
},
{
text: 'DecodeVinValuesExtended',
link: '/api/endpoints/decode-vin-values-extended',
link: '/guide/vpic/endpoints/decode-vin-values-extended',
},
{ text: 'DecodeWMI', link: '/guide/vpic/endpoints/decode-wmi' },
{ text: 'GetAllMakes', link: '/guide/vpic/endpoints/get-all-makes' },
{
text: 'GetAllManufacturers',
link: '/guide/vpic/endpoints/get-all-manufacturers',
},
{ text: 'DecodeWMI', link: '/api/endpoints/decode-wmi' },
{ text: 'GetAllMakes', link: '/api/endpoints/get-all-makes' },
{ text: 'GetAllManufacturers', link: '/api/endpoints/get-all-manufacturers' },
{
text: 'GetCanadianVehicleSpecifications',
link: '/api/endpoints/get-canadian-vehicle-specifications',
link: '/guide/vpic/endpoints/get-canadian-vehicle-specifications',
},
{
text: 'GetEquipmentPlantCodes',
link: '/api/endpoints/get-equipment-plant-codes',
link: '/guide/vpic/endpoints/get-equipment-plant-codes',
},
{
text: 'GetMakeForManufacturer',
link: '/api/endpoints/get-make-for-manufacturer',
link: '/guide/vpic/endpoints/get-make-for-manufacturer',
},
{
text: 'GetMakesForManufacturerAndYear',
link: '/api/endpoints/get-makes-for-manufacturer-and-year',
link: '/guide/vpic/endpoints/get-makes-for-manufacturer-and-year',
},
{
text: 'GetMakesForVehicleType',
link: '/api/endpoints/get-makes-for-vehicle-type',
link: '/guide/vpic/endpoints/get-makes-for-vehicle-type',
},
{
text: 'GetManufacturerDetails',
link: '/api/endpoints/get-manufacturer-details',
link: '/guide/vpic/endpoints/get-manufacturer-details',
},
{
text: 'GetModelsForMake',
link: '/guide/vpic/endpoints/get-models-for-make',
},
{
text: 'GetModelsForMakeId',
link: '/guide/vpic/endpoints/get-models-for-make-id',
},
{ text: 'GetModelsForMake', link: '/api/endpoints/get-models-for-make' },
{ text: 'GetModelsForMakeId', link: '/api/endpoints/get-models-for-make-id' },
{
text: 'GetModelsForMakeIdYear',
link: '/api/endpoints/get-models-for-make-id-year',
link: '/guide/vpic/endpoints/get-models-for-make-id-year',
},
{
text: 'GetModelsForMakeYear',
link: '/api/endpoints/get-models-for-make-year',
link: '/guide/vpic/endpoints/get-models-for-make-year',
},
{ text: 'GetParts', link: '/api/endpoints/get-parts' },
{ text: 'GetParts', link: '/guide/vpic/endpoints/get-parts' },
{
text: 'GetVehicleTypesForMake',
link: '/api/endpoints/get-vehicle-types-for-make',
link: '/guide/vpic/endpoints/get-vehicle-types-for-make',
},
{
text: 'GetVehicleTypesForMakeId',
link: '/api/endpoints/get-vehicle-types-for-make-id',
link: '/guide/vpic/endpoints/get-vehicle-types-for-make-id',
},
{
text: 'GetVehicleVariableList',
link: '/api/endpoints/get-vehicle-variable-list',
link: '/guide/vpic/endpoints/get-vehicle-variable-list',
},
{
text: 'GetVehicleVariableValuesList',
link: '/api/endpoints/get-vehicle-variable-values-list',
link: '/guide/vpic/endpoints/get-vehicle-variable-values-list',
},
{
text: 'GetWMIsForManufacturer',
link: '/api/endpoints/get-wmis-for-manufacturer',
link: '/guide/vpic/endpoints/get-wmis-for-manufacturer',
},
]

Expand Down Expand Up @@ -217,12 +229,12 @@ const typedocLinks = [
],
},
{
text: 'Types Index',
text: 'Types',
link: '/typedoc/types',
},
]

export type LinkGroup = 'guide' | 'api' | 'typedocs'
export type LinkGroup = 'guide' | 'typedocs'

const groupLinks: Record<LinkGroup, SidebarItem[]> = {
guide: [
Expand All @@ -231,12 +243,19 @@ const groupLinks: Record<LinkGroup, SidebarItem[]> = {
{ text: 'Getting Started', link: '/guide/getting-started' },
{ text: 'Typescript', link: '/guide/typescript' },
{
text: 'Bring Your Own Fetch (BYOF)',
link: '/guide/bring-your-own-fetch',
},
{
text: 'Support for Node Versions < 18',
link: '/guide/native-fetch',
text: 'VPIC',
items: [
{ text: 'Overview', link: '/guide/vpic/' },
{
text: 'VPIC Response',
link: '/guide/vpic/vpic-api-response',
},
{
text: 'VPIC Functions',
items: vpicEndpointLinks,
collapsed: true,
},
],
},
{
text: 'Examples',
Expand All @@ -256,17 +275,18 @@ const groupLinks: Record<LinkGroup, SidebarItem[]> = {
{ text: 'useNHTSA', link: '/utils/use-nhtsa' },
],
},
],
api: [
{ text: 'Overview', link: '/api/' },
{
text: 'VPIC Response',
link: '/api/vpic-api-response',
},
{
text: 'VPIC Functions',
items: vpicEndpointLinks,
collapsed: false,
text: 'Misc',
items: [
{
text: 'Bring Your Own Fetch (BYOF)',
link: '/guide/bring-your-own-fetch',
},
{
text: 'Support for Node Versions < 18',
link: '/guide/native-fetch',
},
],
},
],
typedocs: [{ text: 'Index', link: '/typedoc/' }, ...typedocLinks],
Expand All @@ -277,10 +297,6 @@ const linkGroups: Record<LinkGroup, SidebarItem> = {
text: 'Guide',
items: groupLinks.guide,
},
api: {
text: 'API',
items: groupLinks.api,
},
typedocs: {
text: 'Typedocs',
items: groupLinks.typedocs,
Expand Down
2 changes: 0 additions & 2 deletions apps/docs/.vitepress/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ const pkg = require('@shaggytools/nhtsa-api-wrapper/package.json')
function nav() {
return [
{ text: 'Guide', link: '/guide/', activeMatch: '/guide|utils/' },
{ text: 'API', link: '/api/', activeMatch: '/api/' },
{ text: 'Typedocs', link: '/typedoc/', activeMatch: '/typedoc/' },
{
text: pkg.version,
Expand All @@ -25,7 +24,6 @@ function sidebar() {
return {
'/guide/': sidebarLinks(['guide']),
'/utils/': sidebarLinks(['guide']),
'/api/': sidebarLinks(['api']),
'/typedoc/': sidebarLinks(['typedocs']),
}
}
Expand Down
39 changes: 0 additions & 39 deletions apps/docs/src/api/index.md

This file was deleted.

6 changes: 3 additions & 3 deletions apps/docs/src/guide/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ Further Reading:
- A more in depth explanation of how to decode a VIN and parse the data can be found on the
[Decoding a VIN](../guide/vin-decoding) page.

- For a full example response see [DecodeVinValues](../api/endpoints/decode-vin-values#returns)
- For a full example response see [DecodeVinValues](../guide/vpic/endpoints/decode-vin-values#returns)
documentation.

- The structure of `Results[0]` in the above example can be seen on the
Expand Down Expand Up @@ -200,5 +200,5 @@ import {

- [VIN Decoding](../guide/vin-decoding)
- [Offline VIN Validation](../guide/offline-vin-validation)
- [VPIC API Response](../api/vpic-api-response)
- [VPIC API Endpoints](../api/endpoints/#vpic-api-endpoints)
- [VPIC API Response](../guide/vpic/vpic-api-response)
- [VPIC API Endpoints](../guide/vpic/endpoints/#vpic-api-endpoints)
6 changes: 3 additions & 3 deletions apps/docs/src/guide/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

✔️ A thin Javascript client for the [NHTSA VPIC API](https://vpic.nhtsa.dot.gov/api/)

✔️ 24 helper functions to retrieve data from each of the [VPIC API endpoints](../api/index#vpic-api-endpoints)
✔️ 24 helper functions to retrieve data from each of the [VPIC API endpoints](../guide/vpic/index#vpic-api-endpoints)

✔️ Works in Node.js via package managers and in browser scripts via CDN.

Expand All @@ -29,7 +29,7 @@ make interacting with the API and retrieving data less of a chore.

- Provides a set of 24 helper functions to interact with each of the 24 endpoints, so you
don't have to worry about the url structure, query parameters, formatting, or fetching the data.
See the [VPIC API](/api/) section for more info.
See the [VPIC API](/guide/vpic/) section for more info.

- Use the built in `fetch` functionionality or provide your own. The endpoint functions can be used
to build full VPIC URLs for you to use your own fetch implentation such as Axios or a polyfill.
Expand All @@ -56,7 +56,7 @@ It can also be used to get all models of a make, to decode WMIs, get all makes f
and more.

A list of all 24 VPIC endpoints can be found in the
[NHTSA API Endpoints](../api/index#vpic-api-endpoints) section.
[NHTSA API Endpoints](../guide/vpic/index#vpic-api-endpoints) section.

::: tip :bulb: TIP

Expand Down
Loading

0 comments on commit bb494aa

Please sign in to comment.