correctly handle multiline descriptions for enums

This commit is contained in:
OMGeeky
2024-05-16 23:58:52 +02:00
parent 85b2802dac
commit e7fd8e36b7

View File

@@ -76,7 +76,9 @@ impl Default for Scope {
// region ${enum_type}
#[derive(Clone, Copy, Eq, Hash, Debug, PartialEq, Serialize, Deserialize)]
% if e.get('description'):
/// ${e.description}
% for line in e.description.splitlines():
/// ${line}
% endfor
% endif
pub enum ${enum_type} {
<%
@@ -93,8 +95,9 @@ if not enum_descriptions:
<% #print(variant_name, '=>', description)
%>
% if description:
/// ${description}
% for line in e.description.splitlines():
/// ${line}
% endfor
///
% endif\
/// value: