pub struct DocumentFormatter { /* private fields */ }Expand description
Document formatter for converting API references to various output formats
Implementations§
Source§impl DocumentFormatter
impl DocumentFormatter
Sourcepub fn new(config: GeneratorConfig) -> Self
pub fn new(config: GeneratorConfig) -> Self
Create a new document formatter
Sourcepub fn with_theme(config: GeneratorConfig, theme: ThemeConfig) -> Self
pub fn with_theme(config: GeneratorConfig, theme: ThemeConfig) -> Self
Create formatter with custom theme
Sourcepub fn format_json(&self, api_ref: &ApiReference) -> Result<String>
pub fn format_json(&self, api_ref: &ApiReference) -> Result<String>
Format API reference as JSON
Sourcepub fn format_html(&self, api_ref: &ApiReference) -> Result<String>
pub fn format_html(&self, api_ref: &ApiReference) -> Result<String>
Format API reference as HTML
Sourcepub fn format_markdown(&self, api_ref: &ApiReference) -> Result<String>
pub fn format_markdown(&self, api_ref: &ApiReference) -> Result<String>
Format API reference as Markdown
Sourcepub fn format_interactive(&self, api_ref: &ApiReference) -> Result<String>
pub fn format_interactive(&self, api_ref: &ApiReference) -> Result<String>
Format API reference as interactive HTML
Sourcepub fn format_openapi(&self, api_ref: &ApiReference) -> Result<String>
pub fn format_openapi(&self, api_ref: &ApiReference) -> Result<String>
Format API reference as OpenAPI specification
Sourcepub fn set_theme(&mut self, theme: ThemeConfig)
pub fn set_theme(&mut self, theme: ThemeConfig)
Set custom theme
Sourcepub fn add_template(&mut self, name: String, template: String)
pub fn add_template(&mut self, name: String, template: String)
Add custom template
Trait Implementations§
Source§impl Clone for DocumentFormatter
impl Clone for DocumentFormatter
Source§fn clone(&self) -> DocumentFormatter
fn clone(&self) -> DocumentFormatter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DocumentFormatter
impl Debug for DocumentFormatter
Auto Trait Implementations§
impl Freeze for DocumentFormatter
impl RefUnwindSafe for DocumentFormatter
impl Send for DocumentFormatter
impl Sync for DocumentFormatter
impl Unpin for DocumentFormatter
impl UnwindSafe for DocumentFormatter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more