feat(docs): initial interactive ckanaction docs web app

This commit is contained in:
rzmk 2025-10-12 16:26:21 -04:00
parent 945fc6dca1
commit 39c573a5a4
27 changed files with 1507 additions and 0 deletions

View file

@ -0,0 +1,38 @@
---
title: ckanaction docs
---
ckanaction is a Rust library crate that acts as an API wrapper for the CKAN Actions API (v3).
This means that instead of using generic request library crates such as `reqwest`, a developer can use `ckanaction` instead to make API calls to their CKAN instance.
For example the following code can be ran to send an HTTP GET request to the `/package_list` endpoint of a local CKAN instance's API by using the `ckanaction` crate:
```rust
use dotenvy::dotenv;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
// Load environment variables from .env file
dotenv()?;
// Initialize and build CKAN struct
let ckan = ckanaction::CKAN::builder()
.url("http://localhost:5000")
.token(dotenvy::var("CKAN_API_TOKEN")?)
.build();
// Send request to /package_list and print output
let result = ckan.package_list()
.limit(5) // <-- This is an optional parameter you can remove
.call()
.await?;
println!("{result:#?}");
Ok(())
}
```
The source code of ckanaction can be found at [github.com/dathere/ckanaction](https://github.com/ckanaction).
You may also explore this web app to view more code examples for each endpoint and also use an interactive GUI for sending HTTP requests to any local or remote CKAN instance.

View file

@ -0,0 +1,18 @@
---
title: /package_list
full: true
_openapi:
method: GET
route: /package_list
toc: []
structuredData:
headings: []
contents:
- content: This endpoint lists CKAN resources (limit 10).
---
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
This endpoint lists CKAN resources (limit 10).
<APIPage document={"./lib/openapi.yml"} operations={[{"path":"/package_list","method":"get"}]} webhooks={[]} hasHead={false} />

View file

@ -0,0 +1,18 @@
---
title: /status_show
full: true
_openapi:
method: GET
route: /status_show
toc: []
structuredData:
headings: []
contents:
- content: This endpoint shows information about the CKAN instance.
---
{/* This file was generated by Fumadocs. Do not edit this file directly. Any changes should be made by running the generation command again. */}
This endpoint shows information about the CKAN instance.
<APIPage document={"./lib/openapi.yml"} operations={[{"path":"/status_show","method":"get"}]} webhooks={[]} hasHead={false} />