Atelier: crate atelier_describe

Provides the ability to write documentation for Smithy models.

crates.io docs.rs

This crate provides two mechanisms for generating human-readable documentation for a Smithy model using the crate somedoc.

Firstly, the DocumentationWriter structure implements the atelier_core::io::ModelWriter trait and so may be used in the same manner as other model writers. The ModelWriter::new function takes an argument that will denote the format to produce, but provides little other control over the generation. Internally this writer implementation calls the following function.

The function describe_model will produce a somedoc::model::Document instance from a atelier_core::modrel::Model. This instance may then be rendered according to the writers provided by somedoc. This provides complete control over the actual formatting step, and the same generated Document may be written multiple times if required.

Examples

The following demonstrates how to use the describe_model function.

```rust use ateliercore::model::Model; use atelierdescribe::describemodel; use somedoc::write::{writedocumenttostring, OutputFormat};

let model = make_model();

let documentation = describe_model(&model).unwrap();

let docstring = writedocumenttostring(&documentation, OutputFormat::Html).unwrap(); ```

The following example demonstrates the ModelWriter trait and outputs the documentation, in CommonMark format, to stdout.

```rust use ateliercore::model::Model; use ateliercore::io::ModelWriter; use atelier_describe::DocumentationWriter; use std::io::stdout;

let model = make_model();

let mut writer = DocumentationWriter::default();

let documentation = writer.write(&mut stdout(), &model).unwrap(); ```

Changes

Version 0.1.10

Version 0.1.9

Version 0.1.8

Version 0.1.7

Version 0.1.6

Version 0.1.5

Version 0.1.4

Version 0.1.3

Version 0.1.1

Version 0.1.1

Version 0.1.0

This initial version is reasonably usable, although incomplete.

TODO

  1. Complete both prelude, and custom, trait output.
  2. Test cases.