简体   繁体   中英

Is there an official format for documenting macros in Jinja?

I want to document how my Jinja macros work. Is there an official format for documenting macros in Jinja, just like how there are various ways to format Python docstrings?
Maybe something like this:

{% macro my_macro(arg0, arg1, ...) -%}
    {#
    Does something. <- summary of macro

    Parameters:
    arg0: (summary of arg0)
    arg1: (summary of arg1)
    ...
    #}
{%- endmacro %}

Or is it just up to my personal preference?

A Jinja macro is just a Python function. Use the same format you use for documenting normal Python functions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM