1
0
Fork 0
mirror of https://github.com/shouptech/synthale.git synced 2026-02-03 07:29:42 +00:00

Append line breaks to style and details

This commit is contained in:
Emma 2018-12-27 16:31:13 -07:00
parent 57b3a32f76
commit a8cb7a3d69
2 changed files with 16 additions and 15 deletions

View file

@ -66,8 +66,8 @@ class MarkdownRecipe:
@property @property
def style(self): def style(self):
"""Return markdown for the recipe's style.""" """Return markdown for the recipe's style."""
return '\n'.join(( heading = markdown.setext_heading('Style', 2) + '\n'
markdown.setext_heading('Style', 2), return heading + '\\\n'.join((
'{}: {}'.format(markdown.strong('Style guide'), '{}: {}'.format(markdown.strong('Style guide'),
self.recipe.style.style_guide), self.recipe.style.style_guide),
'{}: {}{}'.format(markdown.strong('Style category'), '{}: {}{}'.format(markdown.strong('Style category'),
@ -87,8 +87,9 @@ class MarkdownRecipe:
boil_size = convert.liters(self.recipe.boil_size, '.1f') boil_size = convert.liters(self.recipe.boil_size, '.1f')
batch_size = convert.liters(self.recipe.batch_size, '.1f') batch_size = convert.liters(self.recipe.batch_size, '.1f')
return '\n'.join(( heading = markdown.setext_heading('Details', 2) + '\n'
markdown.setext_heading('Details', 2),
return heading + '\\\n'.join((
'{}: {}'.format(markdown.strong('Type'), self.recipe.type), '{}: {}'.format(markdown.strong('Type'), self.recipe.type),
'{}: {:.1f} %'.format(markdown.strong('Batch efficiency'), '{}: {:.1f} %'.format(markdown.strong('Batch efficiency'),
self.recipe.efficiency), self.recipe.efficiency),

View file

@ -56,8 +56,8 @@ def test_markdown_recipe_style():
assert recipe.style == ( assert recipe.style == (
'Style\n' 'Style\n'
'-----\n' '-----\n'
'**Style guide**: BJCP\n' '**Style guide**: BJCP\\\n'
'**Style category**: 13E\n' '**Style category**: 13E\\\n'
'**Style name**: American Stout' '**Style name**: American Stout'
) )
@ -68,15 +68,15 @@ def test_recipe_details(md_weizen):
assert md_weizen.details == ( assert md_weizen.details == (
'Details\n' 'Details\n'
'-------\n' '-------\n'
'**Type**: All Grain\n' '**Type**: All Grain\\\n'
'**Batch efficiency**: 72.0 %\n' '**Batch efficiency**: 72.0 %\\\n'
'**Boil size**: 6.3 gal\n' '**Boil size**: 6.3 gal\\\n'
'**Boil length**: 60 min\n' '**Boil length**: 60 min\\\n'
'**Batch size**: 5.5 gal\n' '**Batch size**: 5.5 gal\\\n'
'**Estimated OG**: 1.051\n' '**Estimated OG**: 1.051\\\n'
'**Estimated FG**: 1.015\n' '**Estimated FG**: 1.015\\\n'
'**Estimated IBU**: 15\n' '**Estimated IBU**: 15\\\n'
'**Estimated SRM**: 3.0\n' '**Estimated SRM**: 3.0\\\n'
'**Estimated ABV**: 4.7 %' '**Estimated ABV**: 4.7 %'
) )