crawlkit_plugin_sdk/lib.rs
1//! # crawlkit-plugin-sdk
2//!
3//! SDK for building crawlkit WASM plugins.
4//!
5//! ## Overview
6//!
7//! This crate provides the types and traits needed to create custom SEO analyzers
8//! that run as WASM plugins in crawlkit's sandboxed environment.
9//!
10//! ## Quick Start
11//!
12//! ```rust,no_run
13//! use crawlkit_plugin_sdk::{Analyzer, Finding, Severity, AnalysisContext};
14//!
15//! pub struct MyAnalyzer;
16//! impl MyAnalyzer { pub fn new() -> Self { Self } }
17//!
18//! impl Analyzer for MyAnalyzer {
19//! fn name(&self) -> &str { "my-analyzer" }
20//!
21//! fn analyze(&self, ctx: &AnalysisContext) -> Vec<Finding> {
22//! let mut findings = Vec::new();
23//! if ctx.html.contains("something") {
24//! findings.push(Finding {
25//! severity: Severity::Warning,
26//! category: "custom".into(),
27//! code: "CUSTOM001".into(),
28//! title: "Something detected".into(),
29//! description: "The page contains something".into(),
30//! url: ctx.url.clone(),
31//! recommendation: "Remove something".into(),
32//! });
33//! }
34//! findings
35//! }
36//! }
37//!
38//! // Export for WASM
39//! crawlkit_plugin_sdk::export_analyzer!(MyAnalyzer);
40//! ```
41
42mod analyzer;
43mod context;
44mod export;
45mod finding;
46
47pub use analyzer::Analyzer;
48pub use context::AnalysisContext;
49pub use finding::{Finding, Severity};