Hide keyboard shortcuts

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 * 

3 

4 

5def descriptionLists( 

6 orderedDictionary={}, 

7 sideBySide=False): 

8 """ 

9 *A list of definitions.* 

10 

11 **Key Arguments** 

12 

13 - ``orderedDictionary`` -- the ordered dictionary of the terms and their definitions 

14 - ``sideBySide`` -- Make terms and descriptions in `<dl>` line up side-by-side. 

15 

16 

17 **Return** 

18 

19 - ``descriptionLists`` 

20 

21 """ 

22 

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() 

29 

30 if sideBySide: 

31 sideBySide = "dl-horizontal" 

32 else: 

33 sideBySide = "" 

34 

35 descriptionLists = """ 

36 <dl class="%(sideBySide)s"> 

37 %(termList)s 

38 </dl> 

39 """ % locals() 

40 

41 return descriptionLists