utkarshkukreti / markup.rs

A blazing fast, type-safe template engine for Rust.
Apache License 2.0
350 stars 14 forks source link

Allow template arguments to be documented #21

Closed ssokolow closed 2 years ago

ssokolow commented 2 years ago

Currently, if I attempt to attach a doc comment to a template argument, like this:

        /// Used for CSS/JS cache-busting
        build_timestamp: &'static str,

...I get the following error:

error: expected identifier
  --> src/templates.rs:58:9
   |
58 |         /// Used for CSS/JS cache-busting
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

I'm left having to manually add an Arguments section containing a bulleted list to the documentation block for the template as a whole, resulting in this needlessly redundant and typo-prone output:

Screenshot 2022-05-06 at 05-22-16 HttpError

utkarshkukreti commented 2 years ago

I've implemented this in https://github.com/utkarshkukreti/markup.rs/commit/45327272008c74090fa701ee26ff52d55fca9301, please let me know if it works for you.

ssokolow commented 2 years ago

Looks good. :)

Screenshot 2022-05-11 at 05-59-08 HttpError