Crate doxygen_rs

source ·
Expand description

Simple Doxygen to Rustdoc translation.

Provides a simple and straightforward API to translate raw Doxygen comments to Rustdoc comments. Purely experimental right now, maybe practical in a future?

Examples

use doxygen_rs::transform;

let rustdoc = transform("@brief Example Doxygen brief");
assert_eq!(rustdoc, "Example Doxygen brief\n\n");

Supported commands

See the tracking issue for the exhaustive list

And the following flavours are soported:

  • \brief
  • \\brief
  • @brief

Inner workings

When the transform function is called, 3 other functions are called:

  1. The input is parsed to a Vec of parser::Value (parser::parse_comment)
  2. The values are used to generate an AST (ast::generate_ast)
  3. The AST is used to generate the Rustdoc (generator::generate_rustdoc)

transform [parse_comment -> generate_ast -> generate_rustdoc]

Modules

This module contains functions that generate ASTs from Vec of crate::parser::Value
Generate raw Rustdoc comments from a given crate::ast::ParsedDoxygen
This module contains functions to generate a Vec of Value from a given input

Functions

Transforms raw Doxygen comments to raw Rustdoc comments