Skip to main content

Module doc_emission

Module doc_emission 

Source
Expand description

Language-native documentation comment emission. Provides standardized functions for emitting doc comments in different languages.

Structs§

RustdocSections
A parsed rustdoc comment broken out into the sections binding emitters care about.

Functions§

doc_first_paragraph_joined
Return the first paragraph of a doc comment as a single joined line.
emit_csharp_doc
Emit C# XML documentation comments (/// ) Used for C# classes, structs, methods, and properties.
emit_dartdoc
Emit Dartdoc-style documentation comments (///) Used for Dart classes, methods, and properties.
emit_elixir_doc
Emit Elixir documentation comments (@doc) Used for Elixir modules and functions.
emit_gleam_doc
Emit Gleam documentation comments (///) Used for Gleam functions and types.
emit_javadoc
Emit Javadoc-style documentation comments (/** … */) Used for Java classes, methods, and fields. Handles XML escaping and Javadoc tag formatting.
emit_kdoc
Emit KDoc-style documentation comments (/** … */) Used for Kotlin classes, methods, and properties.
emit_phpdoc
Emit PHPDoc-style comments (/** … */) Used for PHP classes, methods, and properties.
emit_roxygen
Emit R roxygen2-style documentation comments (#’) Used for R functions.
emit_rustdoc
Emit Rust /// documentation comments.
emit_swift_doc
Emit Swift-style documentation comments (///) Used for Swift structs, enums, and functions.
emit_zig_doc
Emit Zig documentation comments (///) Used for Zig functions, types, and declarations.
parse_arguments_bullets
Parse # Arguments body into (name, description) pairs.
parse_rustdoc_sections
Parse a rustdoc string into RustdocSections.
render_csharp_xml_sections
Render RustdocSections as a C# XML doc comment body (without the /// line prefixes — the emitter adds those).
render_doxygen_sections
Render RustdocSections as a Doxygen comment body for the C header.
render_javadoc_sections
Render RustdocSections as a JavaDoc comment body.
render_jsdoc_sections
Render RustdocSections as a JSDoc comment body (without the /** / */ wrappers — those are added by the caller’s emitter, which knows the indent/escape conventions).
render_phpdoc_sections
Render RustdocSections as a PHPDoc comment body.
replace_fence_lang
Strip a single ```lang fence pair from body, returning the inner code lines. Replaces the leading ```rust (or any other tag) with lang_replacement, leaving the rest of the body unchanged.