Skip to content

Support markdown in C++ doc comments. #800

Closed
@emilio

Description

@emilio

Followup from #426, and #791.

Right now if you are generating bindings to a C/C++ library that happens to use markdown blocks in its comments, will make rustdoc complain (because the comment probably isn't valid rust).

Right now the workaround is avoiding generating comments, but that's not ideal.

Testcase:

/**
 * Example usage:
 *
 * ```
 * struct Foo* my_foo = make_foo();
 * foo->random_member++;
 * ```
 */
struct Foo {
  int random_member;
};

Options I can think off-hand:

  • Make the generated comments non-doc comments.
  • Try to preprocess comments in the same way rustdoc does (presumably just looking at three backticks at the beginning of the line?) and annotate them (for markdown at least this would work).

Any other ideas @jethrogb?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions