libruskel 0.0.2

Generates skeletonized outlines of Rust crates
Documentation

Ruskel

Crates.io Documentation License: MIT

Ruskel is a tool for generating skeletonized outlines of Rust crates. It consists of two parts:

  1. ruskel: A command-line interface for easy use.
  2. libruskel: A library that can be integrated into other Rust projects.

Both produce a single-page, syntactically valid Rust code representation of a crate, with all implementations omitted. This provides a clear overview of the crate's structure and public API.

Features

  • Generate a skeletonized view of any Rust crate
  • Support for local crates and remote crates from crates.io
  • Syntax highlighting for terminal output
  • Option to output raw JSON data for further processing
  • Configurable to include private items and auto-implemented traits
  • Support for custom feature flags

Installation

CLI Tool

Install the Ruskel CLI tool using Cargo:

cargo install ruskel

Library

To use libruskel in your Rust project, add it to your Cargo.toml:

[dependencies]
libruskel = "0.1.0"

Usage

CLI

Basic usage:

ruskel [TARGET]

Where TARGET can be a directory, file path, or a module name. If omitted, it defaults to the current directory.

Options

  • --raw: Output raw JSON instead of rendered Rust code
  • --auto-impls: Render auto-implemented traits
  • --private: Render private items
  • --no-default-features: Disable default features
  • --all-features: Enable all features
  • --features <FEATURES>: Specify features to enable (comma-separated)
  • --highlight: Force enable syntax highlighting
  • --no-highlight: Disable syntax highlighting

For more details, run:

ruskel --help

Library

Here's a basic example of using libruskel in your Rust code:

use libruskel::Ruskel;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let rs = Ruskel::new(".")?;
    let rendered = rs.render(false, false)?;
    println!("{}", rendered);
    Ok(())
}

Check the API documentation for more details on using the library.

Examples

Generate a skeleton for the current project:

ruskel

Generate a skeleton for a specific crate from crates.io:

ruskel serde

Output raw JSON data:

ruskel --raw tokio

Include private items and auto-implemented traits:

ruskel --private --auto-impls

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

License

This project is licensed under the MIT License - see the LICENSE file for details.