##// END OF EJS Templates
minirst: pull admonition titles out formatblock function
Martin Geisler -
r12652:3c31c0e4 default
parent child Browse files
Show More
@@ -317,23 +317,23 b' def findadmonitions(blocks):'
317 317 i = i + 1
318 318 return blocks
319 319
320 _admonitiontitles = {'attention': _('Attention:'),
321 'caution': _('Caution:'),
322 'danger': _('!Danger!') ,
323 'error': _('Error:'),
324 'hint': _('Hint:'),
325 'important': _('Important:'),
326 'note': _('Note:'),
327 'tip': _('Tip:'),
328 'warning': _('Warning!')}
329
320 330 def formatblock(block, width):
321 331 """Format a block according to width."""
322 332 if width <= 0:
323 333 width = 78
324 334 indent = ' ' * block['indent']
325 335 if block['type'] == 'admonition':
326 titles = {'attention': _('Attention:'),
327 'caution': _('Caution:'),
328 'danger': _('!Danger!') ,
329 'error': _('Error:'),
330 'hint': _('Hint:'),
331 'important': _('Important:'),
332 'note': _('Note:'),
333 'tip': _('Tip:'),
334 'warning': _('Warning!')}
335
336 admonition = titles[block['admonitiontitle']]
336 admonition = _admonitiontitles[block['admonitiontitle']]
337 337 hang = len(block['lines'][-1]) - len(block['lines'][-1].lstrip())
338 338
339 339 defindent = indent + hang * ' '
General Comments 0
You need to be logged in to leave comments. Login now