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

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

#!/usr/local/bin/python 

# encoding: utf-8 

""" 

_dryxTBS_code 

============================= 

:Summary: 

    Code partial for dryxTwitterBootstrap 

 

:Author: 

    David Young 

 

:Date Created: 

    April 16, 2013 

 

:dryx syntax: 

    - ``xxx`` = come back here and do some more work 

    - ``_someObject`` = a 'private' object that should only be changed for debugging 

 

:Notes: 

    - If you have any questions requiring this script please email me: d.r.young@qub.ac.uk 

""" 

 

################################################################### 

# CLASSES                                                         # 

################################################################### 

 

################################################################### 

# PUBLIC FUNCTIONS                                                # 

################################################################### 

## LAST MODIFIED : April 16, 2013 

## CREATED : April 16, 2013 

## AUTHOR : DRYX 

def code( 

        content="", 

        inline=True, 

        scroll=False): 

    """Generate a code section 

 

    **Key Arguments:** 

        - ``content`` -- the content of the code block 

        - ``inline`` -- inline or block? 

        - ``scroll`` -- give the block a scroll bar on y-axis? 

 

    **Return:** 

        - ``code`` -- the code section 

    """ 

    ################ > IMPORTS ################ 

    ## STANDARD LIB ## 

    ## THIRD PARTY ## 

    ## LOCAL APPLICATION ## 

 

    ################ >ACTION(S) ################ 

    if scroll: 

        scroll = "pre-scrollable" 

    else: 

        scroll = "" 

 

    if inline: 

        code = """<code>%s</code>""" % (content,) 

    else: 

        code = """ 

            <pre class="%s"> 

                %s 

            </pre>""" % (scroll, content,) 

 

    return code 

################################################################### 

# PRIVATE (HELPER) FUNCTIONS                                      # 

################################################################### 

 

################################################################### 

# TEMPLATE FUNCTIONS                                              # 

###################################################################