Coverage for /pythoncovmergedfiles/medio/medio/usr/local/lib/python3.8/site-packages/rich/_export_format.py: 100%

4 statements  

« prev     ^ index     » next       coverage.py v7.0.1, created at 2022-12-25 06:11 +0000

1CONSOLE_HTML_FORMAT = """\ 

2<!DOCTYPE html> 

3<head> 

4<meta charset="UTF-8"> 

5<style> 

6{stylesheet} 

7body {{ 

8 color: {foreground}; 

9 background-color: {background}; 

10}} 

11</style> 

12</head> 

13<html> 

14<body> 

15 <code> 

16 <pre style="font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace">{code}</pre> 

17 </code> 

18</body> 

19</html> 

20""" 

21 

22CONSOLE_SVG_FORMAT = """\ 

23<svg class="rich-terminal" viewBox="0 0 {width} {height}" xmlns="http://www.w3.org/2000/svg"> 

24 <!-- Generated with Rich https://www.textualize.io --> 

25 <style> 

26 

27 @font-face {{ 

28 font-family: "Fira Code"; 

29 src: local("FiraCode-Regular"), 

30 url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Regular.woff2") format("woff2"), 

31 url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Regular.woff") format("woff"); 

32 font-style: normal; 

33 font-weight: 400; 

34 }} 

35 @font-face {{ 

36 font-family: "Fira Code"; 

37 src: local("FiraCode-Bold"), 

38 url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff2/FiraCode-Bold.woff2") format("woff2"), 

39 url("https://cdnjs.cloudflare.com/ajax/libs/firacode/6.2.0/woff/FiraCode-Bold.woff") format("woff"); 

40 font-style: bold; 

41 font-weight: 700; 

42 }} 

43 

44 .{unique_id}-matrix {{ 

45 font-family: Fira Code, monospace; 

46 font-size: {char_height}px; 

47 line-height: {line_height}px; 

48 font-variant-east-asian: full-width; 

49 }} 

50 

51 .{unique_id}-title {{ 

52 font-size: 18px; 

53 font-weight: bold; 

54 font-family: arial; 

55 }} 

56 

57 {styles} 

58 </style> 

59 

60 <defs> 

61 <clipPath id="{unique_id}-clip-terminal"> 

62 <rect x="0" y="0" width="{terminal_width}" height="{terminal_height}" /> 

63 </clipPath> 

64 {lines} 

65 </defs> 

66 

67 {chrome} 

68 <g transform="translate({terminal_x}, {terminal_y})" clip-path="url(#{unique_id}-clip-terminal)"> 

69 {backgrounds} 

70 <g class="{unique_id}-matrix"> 

71 {matrix} 

72 </g> 

73 </g> 

74</svg> 

75""" 

76 

77_SVG_FONT_FAMILY = "Rich Fira Code" 

78_SVG_CLASSES_PREFIX = "rich-svg"