Expand description
Codoc - Unified code documentation parser for Ruby and TypeScript.
This library provides parsers for extracting documentation from Ruby (Yardoc-compatible) and TypeScript (TypeDoc-compatible) source code, outputting a unified JSON format.
§Example
use codoc::{RubyParser, Parser, ParserConfig, ParseContext, Language};
use std::path::Path;
let mut parser = RubyParser::new().expect("Failed to create parser");
let config = ParserConfig::new("MyProject", Language::Ruby);
let mut ctx = ParseContext::new(config);
let content = std::fs::read_to_string("lib/my_class.rb").unwrap();
let entities = parser.parse_file(Path::new("lib/my_class.rb"), &content).unwrap();
ctx.entities.extend(entities);
let document = ctx.into_document();Re-exports§
pub use error::Error;pub use error::Result;pub use parser::ruby::RubyParser;pub use parser::typescript::TypeScriptParser;pub use parser::ParseContext;pub use parser::Parser;pub use parser::ParserConfig;pub use schema::Document;pub use schema::Entity;pub use schema::Language;pub use schema::Metadata;
Modules§
- error
- Error types for the Codoc parser.
- parser
- Source code parsers for Ruby and TypeScript.
- schema
- Schema types for the Codoc unified documentation format.
Constants§
- SCHEMA_
VERSION - Schema version identifier used in generated documents.