feat: add Rust code examples and support for Rust syntax highlighting
- Added Rust syntax highlighting to the Fence component. - Updated Markdoc functions to clone React elements with unique keys for copy and example sections. - Included Rust code examples for various API endpoints in documentation: - `get_app_by_id` - `get_apps` - `get_apps_by_ids` - `connectivity` - `get_field_by_id` - `get_fields_by_app` - `get_fields_by_ids` - `add_file` - `delete_file_by_id` - `get_file_by_id` - `get_file_info_by_id` - `delete_list_value_by_id` - `save_list_value` - `delete_record_by_id` - `delete_records_by_ids` - `get_record_by_id` - `get_records_by_app` - `get_records_by_ids` - `get_records_by_query` - `save_record` - `get_report_by_id` - `get_reports_by_app`
This commit is contained in:
@@ -56,6 +56,23 @@ print(f'Name: {response.data.app.name}')
|
||||
print(f'href: {response.data.app.href}')
|
||||
```
|
||||
|
||||
```rust
|
||||
use onspring::OnspringClient;
|
||||
|
||||
let client = OnspringClient::builder(
|
||||
"000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000"
|
||||
)
|
||||
.build();
|
||||
|
||||
let app = client.get_app(195).await?;
|
||||
|
||||
println!(
|
||||
"{}, {}",
|
||||
app.id,
|
||||
app.name.unwrap_or_default()
|
||||
);
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
{% code heading="RESPONSE" defaultLanguage="json" %}
|
||||
|
||||
@@ -66,6 +66,30 @@ for app in response.data.apps:
|
||||
print(f'href: {app.href}')
|
||||
```
|
||||
|
||||
```rust
|
||||
use onspring::{OnspringClient, PagingRequest};
|
||||
|
||||
let client = OnspringClient::builder(
|
||||
"000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000"
|
||||
)
|
||||
.build();
|
||||
|
||||
let paging = PagingRequest {
|
||||
page_number: 1,
|
||||
page_size: 10,
|
||||
};
|
||||
|
||||
let response = client.list_apps(Some(paging)).await?;
|
||||
|
||||
for app in response.items.unwrap_or_default() {
|
||||
println!(
|
||||
"{}, {}",
|
||||
app.id,
|
||||
app.name.unwrap_or_default()
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
{% code heading="RESPONSE" defaultLanguage="json" %}
|
||||
|
||||
@@ -67,6 +67,26 @@ for app in response.data.apps:
|
||||
print(f'href: {app.href}')
|
||||
```
|
||||
|
||||
```rust
|
||||
use onspring::OnspringClient;
|
||||
|
||||
let client = OnspringClient::builder(
|
||||
"000000ffffff000000ffffff/00000000-ffff-0000-ffff-000000000000"
|
||||
)
|
||||
.build();
|
||||
|
||||
let ids = vec![8, 79, 137, 193, 183];
|
||||
let response = client.batch_get_apps(&ids).await?;
|
||||
|
||||
for app in response.items.unwrap_or_default() {
|
||||
println!(
|
||||
"{}, {}",
|
||||
app.id,
|
||||
app.name.unwrap_or_default()
|
||||
);
|
||||
}
|
||||
```
|
||||
|
||||
{% /code %}
|
||||
|
||||
{% code heading="RESPONSE" defaultLanguage="json" %}
|
||||
|
||||
Reference in New Issue
Block a user