Skip to main content

Crate plissken_core

Crate plissken_core 

Source
Expand description

plissken-core: Documentation extraction for Rust-Python hybrid projects

This crate provides the core functionality for parsing Rust and Python source code and extracting documentation into a unified model.

§API Structure

The public API is organized into tiers:

  • Core API (root): Essential types for typical usage
  • Detail API (detail): Advanced types for fine-grained control
  • Modules (config, parser, render, etc.): Full module access

§Quick Start

use plissken_core::{Config, RustParser, PythonParser, DocModel};

// Load configuration
let config = Config::from_file("plissken.toml")?;

// Parse source files
let mut rust_parser = RustParser::new();
let rust_module = rust_parser.parse_file("src/lib.rs")?;

// Build documentation model
let model = DocModel::test("my-project")
    .with_rust_module(rust_module);

Re-exports§

pub use config::Config;
pub use config::ConfigError;
pub use config::ConfigWarning;
pub use config::ValidationResult;
pub use config::CARGO_MANIFEST;
pub use config::DEFAULT_CRATES;
pub use config::DEFAULT_DOCS_RS_URL;
pub use config::DEFAULT_OUTPUT_FORMAT;
pub use config::DEFAULT_OUTPUT_PATH;
pub use config::DEFAULT_TEMPLATE;
pub use config::PLISSKEN_CONFIG;
pub use config::PYPROJECT_MANIFEST;
pub use config::TEMPLATE_MDBOOK;
pub use config::TEMPLATE_MKDOCS_MATERIAL;
pub use config::VERSION_SOURCE_CARGO;
pub use config::VERSION_SOURCE_PYPROJECT;
pub use error::PlisskenError;
pub use error::Result;
pub use model::CrossRef;
pub use model::CrossRefKind;
pub use model::DocModel;
pub use model::ProjectMetadata;
pub use model::SourceType;
pub use model::PythonModule;
pub use model::RustModule;
pub use parser::Module as ParsedModule;
pub use parser::Parser;
pub use parser::ParserLanguage;
pub use parser::create_parser;
pub use parser::parser_for_extension;
pub use parser::PythonParser;
pub use parser::RustParser;
pub use render::ModuleRenderer;
pub use render::RenderedPage;
pub use render::Renderer;
pub use render::ThemeAdapter;
pub use render::get_theme_adapter;
pub use model::ParsedDocstring;
pub use model::PythonClass;
pub use model::PythonFunction;
pub use model::PythonItem;
pub use model::PythonParam;
pub use model::PythonVariable;
pub use model::RustEnum;
pub use model::RustField;
pub use model::RustFunction;
pub use model::RustImpl;
pub use model::RustItem;
pub use model::RustItemRef;
pub use model::RustParam;
pub use model::RustStruct;
pub use model::RustTrait;
pub use model::SourceLocation;
pub use model::SourceSpan;
pub use model::Visibility;
pub use discover::DiscoveredModule;
pub use discover::discover_python_modules;
pub use discover::merge_modules;
pub use manifest::CargoManifest;
pub use manifest::InferredConfig;
pub use manifest::PyProjectManifest;
pub use crossref::build_cross_refs;
pub use crossref::synthesize_python_from_rust;
pub use crossref::synthesize_python_modules_from_rust;
pub use docstring::parse_docstring;
pub use docstring::parse_rust_doc;
pub use render::Language;
pub use render::render_docstring;
pub use render::render_examples;
pub use render::render_params_table;
pub use render::render_python_exposure_details;
pub use render::render_raises_table;
pub use render::render_returns;
pub use render::render_rust_impl_details;

Modules§

config
Configuration for plissken projects
crossref
Cross-reference builder for linking Python and Rust items
detail
Advanced types for users who need fine-grained control over documentation.
discover
Python module auto-discovery
docstring
Docstring parser for Google, NumPy, and Rust doc comment styles
error
Unified error types for plissken-core.
manifest
Manifest file parsing for Cargo.toml and pyproject.toml
model
Unified documentation model for Rust and Python items
parser
Parsing infrastructure for Rust and Python source code
render
Rendering module for documentation output