Skip to content

Commit

Permalink
Test AutoTypeTable
Browse files Browse the repository at this point in the history
  • Loading branch information
joao-vasconcelos committed Jan 2, 2025
1 parent 633ccd0 commit bab6e2b
Show file tree
Hide file tree
Showing 26 changed files with 361 additions and 9 deletions.
5 changes: 4 additions & 1 deletion app/[[...slug]]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* * */

import { source } from '@/lib/source';
import { createTypeTable } from 'fumadocs-typescript/ui';
import defaultMdxComponents from 'fumadocs-ui/mdx';
import { DocsBody, DocsDescription, DocsPage, DocsTitle } from 'fumadocs-ui/page';
import { notFound } from 'next/navigation';
Expand Down Expand Up @@ -33,6 +34,8 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>

const MDX = page.data.body;

const { AutoTypeTable } = createTypeTable();

return (
<DocsPage
full={page.data.full}
Expand All @@ -43,7 +46,7 @@ export default async function Page(props: { params: Promise<{ slug?: string[] }>
<DocsTitle>{page.data.title}</DocsTitle>
<DocsDescription>{page.data.description}</DocsDescription>
<DocsBody>
<MDX components={{ ...defaultMdxComponents }} />
<MDX components={{ ...defaultMdxComponents, AutoTypeTable }} />
</DocsBody>
</DocsPage>
);
Expand Down
6 changes: 2 additions & 4 deletions content/api/meta.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
{
"pages": [
"index",
"network",
"facilities",
"locations",
"metrics"
"v2",
"v1"
]
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
21 changes: 21 additions & 0 deletions content/api/v1/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Version 1
description: Administrative divisions of amL.
---

## Data source

Locations are fetched from the GTFS and are not georeferenced. We plan to improve this in the future.


## Available locations

The API provides in JSON format the following locations:

| Type | Description |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Regions | Regions are the top-level division in the API. At the moment there are 3 regions: `amL`, `Àlentejo Central` and `Oeste`. Regions are identified by their NUTS-III code. |
| Districts | Districts belong to a region and are identified by their DICOFRE code. |
| Municipalities | Municipalities belong to a district and are identified by their DICOFRE code. All geographical data points in the API are identified by at least one Municipality. It is the "primary key" for the location types. |
| Parishes | Parishes are optional and represent the administrative division known as "freguesia". They are identified by their DICOFRE code. At the moment, not many objects are identified with this location type. We plan to improve this in the future. |
| Localities | Localities are informal places known to local populations. We use this to diferentiate the location of similarly named objects. Objects may not have localities. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions content/api/v2/facilities/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: facilities
description: Places Carris Metropolitana serves.
---

## Data sources

The data source for all endpoints in this collection is the [datasets repo](https://github.com/carrismetropolitana/datasets), where we provide georeferenced data in CSV format. [Learn more about Datasets](/datasets)


## Available facilities

The API provides the following facilities in JSON format. The facility name links to its dataset page with more information.

| Facility | Description |
|-----------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [stores](/datasets/facilities/stores) | navegante® stores where you can take care of any public transit related matter, such as buying a card, recharding, activate discounts, etc. This endpoint also returns how many people are queueing in realtime. |
| [helpdesks](/datasets/facilities/helpdesks) | All help points for all public transit operators in amL. |
| [schools](/datasets/facilities/schools) | All schools in amL, georeferenced. Updated regularly. |
| [boat_station](/datasets/facilities/boat_stations) | All public transit boat stations in amL. |
| [light_rail_stations](/datasets/facilities/light_rail_stations) | All public transit light rail stations in amL. |
| [subway_stations](/datasets/facilities/subway_stations) | All public transit subway stations in amL. |
| [train_stations](/datasets/facilities/train_stations) | All public transit train stations in amL. |
| [pips](/datasets/facilities/pips) | All Carris Metropolitana public information panels and their status. |
17 changes: 17 additions & 0 deletions content/api/v2/facilities/patterns.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Lines, Routes & Patterns
description: Carris Metropolitana bus network endpoints.
---

## Code Block

```js
console.log('Hello World');
```

## Cards

<Cards>
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
</Cards>
17 changes: 17 additions & 0 deletions content/api/v2/facilities/stops.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Stops
description: Carris Metropolitana bus network endpoints.
---

## Code Block

```js
console.log('Hello World');
```

## Cards

<Cards>
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
</Cards>
21 changes: 21 additions & 0 deletions content/api/v2/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: Version 2 (latest)
description: Administrative divisions of amL.
---

## Data source

<AutoTypeTable path="./node_modules/@carrismetropolitana/api-types/src/api/alerts.ts" name="Alert" />


## Available locations

The API provides in JSON format the following locations:

| Type | Description |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Regions | Regions are the top-level division in the API. At the moment there are 3 regions: `amL`, `Àlentejo Central` and `Oeste`. Regions are identified by their NUTS-III code. |
| Districts | Districts belong to a region and are identified by their DICOFRE code. |
| Municipalities | Municipalities belong to a district and are identified by their DICOFRE code. All geographical data points in the API are identified by at least one Municipality. It is the "primary key" for the location types. |
| Parishes | Parishes are optional and represent the administrative division known as "freguesia". They are identified by their DICOFRE code. At the moment, not many objects are identified with this location type. We plan to improve this in the future. |
| Localities | Localities are informal places known to local populations. We use this to diferentiate the location of similarly named objects. Objects may not have localities. |
21 changes: 21 additions & 0 deletions content/api/v2/locations.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
title: locations
description: Administrative divisions of amL.
---

## Data source

Locations are fetched from the GTFS and are not georeferenced. We plan to improve this in the future.


## Available locations

The API provides in JSON format the following locations:

| Type | Description |
|----------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Regions | Regions are the top-level division in the API. At the moment there are 3 regions: `amL`, `Àlentejo Central` and `Oeste`. Regions are identified by their NUTS-III code. |
| Districts | Districts belong to a region and are identified by their DICOFRE code. |
| Municipalities | Municipalities belong to a district and are identified by their DICOFRE code. All geographical data points in the API are identified by at least one Municipality. It is the "primary key" for the location types. |
| Parishes | Parishes are optional and represent the administrative division known as "freguesia". They are identified by their DICOFRE code. At the moment, not many objects are identified with this location type. We plan to improve this in the future. |
| Localities | Localities are informal places known to local populations. We use this to diferentiate the location of similarly named objects. Objects may not have localities. |
17 changes: 17 additions & 0 deletions content/api/v2/metrics/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: metrics
description: Carris Metropolitana bus network endpoints.
---

## Code Block

```js
console.log('Hello World');
```

## Cards

<Cards>
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
</Cards>
17 changes: 17 additions & 0 deletions content/api/v2/metrics/patterns.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Lines, Routes & Patterns
description: Carris Metropolitana bus network endpoints.
---

## Code Block

```js
console.log('Hello World');
```

## Cards

<Cards>
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
</Cards>
17 changes: 17 additions & 0 deletions content/api/v2/metrics/stops.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Stops
description: Carris Metropolitana bus network endpoints.
---

## Code Block

```js
console.log('Hello World');
```

## Cards

<Cards>
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
</Cards>
17 changes: 17 additions & 0 deletions content/api/v2/network/index.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: network
description: Carris Metropolitana bus network endpoints.
---

## Code Block

```js
console.log('Hello World');
```

## Cards

<Cards>
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
</Cards>
17 changes: 17 additions & 0 deletions content/api/v2/network/patterns.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Lines, Routes & Patterns
description: Carris Metropolitana bus network endpoints.
---

## Code Block

```js
console.log('Hello World');
```

## Cards

<Cards>
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
</Cards>
17 changes: 17 additions & 0 deletions content/api/v2/network/stops.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Stops
description: Carris Metropolitana bus network endpoints.
---

## Code Block

```js
console.log('Hello World');
```

## Cards

<Cards>
<Card title="Learn more about Next.js" href="https://nextjs.org/docs" />
<Card title="Learn more about Fumadocs" href="https://fumadocs.vercel.app" />
</Cards>
Loading

0 comments on commit bab6e2b

Please sign in to comment.