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:
+14
-2
@@ -102,7 +102,13 @@ function getCopyChild(
|
||||
docPath: string
|
||||
) {
|
||||
const copyPath = getCopyPath(version, doc, docPath);
|
||||
return parseMarkdown(copyPath);
|
||||
const child = parseMarkdown(copyPath);
|
||||
|
||||
if (React.isValidElement(child)) {
|
||||
return React.cloneElement(child, { key: 'copy' });
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
function getExampleChild(
|
||||
@@ -111,7 +117,13 @@ function getExampleChild(
|
||||
docPath: string
|
||||
) {
|
||||
const examplePath = getExamplePath(version, doc, docPath);
|
||||
return parseMarkdown(examplePath);
|
||||
const child = parseMarkdown(examplePath);
|
||||
|
||||
if (React.isValidElement(child)) {
|
||||
return React.cloneElement(child, { key: 'example' });
|
||||
}
|
||||
|
||||
return child;
|
||||
}
|
||||
|
||||
export function loadSections(
|
||||
|
||||
Reference in New Issue
Block a user