Coverage for khufu/typography/descriptionLists.py : 100%

Hot-keys on this page
r m x p toggle line displays
j k next/prev highlighted chunk
0 (zero) top of page
1 (one) first highlighted chunk
1# encoding: utf-8
2from . import *
5def descriptionLists(
6 orderedDictionary={},
7 sideBySide=False):
8 """
9 *A list of definitions.*
11 **Key Arguments**
13 - ``orderedDictionary`` -- the ordered dictionary of the terms and their definitions
14 - ``sideBySide`` -- Make terms and descriptions in `<dl>` line up side-by-side.
17 **Return**
19 - ``descriptionLists``
21 """
23 termList = ""
24 for k, v in list(orderedDictionary.items()):
25 termList = """%(termList)s
26 <dt>%(k)s</dt>
27 <dd>%(v)s</dd>
28 """ % locals()
30 if sideBySide:
31 sideBySide = "dl-horizontal"
32 else:
33 sideBySide = ""
35 descriptionLists = """
36 <dl class="%(sideBySide)s">
37 %(termList)s
38 </dl>
39 """ % locals()
41 return descriptionLists