Coverage for pyquickhelper/helpgen/style_css_template.py: 100%

3 statements  

« prev     ^ index     » next       coverage.py v7.2.7, created at 2023-06-03 02:21 +0200

1""" 

2@file 

3@brief Custom style for the documentation. 

4""" 

5 

6#: style for thumbnails 

7style_figure_notebook = "style_notebook_snippet.css", """ 

8div.sphx-pyq-thumb { 

9 box-shadow: none; 

10 background: #FFF; 

11 margin: 5px; 

12 padding-top: 5px; 

13 min-height: 230px; 

14 border: solid white 1px; 

15 -webkit-border-radius: 5px; 

16 -moz-border-radius: 5px; 

17 border-radius: 5px; 

18 float: left; 

19 position: relative; 

20} 

21 

22div.sphx-pyq-thumb:hover { 

23 box-shadow: 0 0 15px rgba(142, 176, 202, 0.5); 

24 border: solid #B4DDFC 1px; } 

25 div.sphx-pyq-thumb a.internal { 

26 display: block; 

27 position: absolute; 

28 padding: 150px 10px 0px 10px; 

29 top: 0px; 

30 right: 0px; 

31 bottom: 0px; 

32 left: 0px; 

33} 

34 

35div.sphx-pyq-thumb p { 

36 margin: 0 0 .1em 0; 

37} 

38 

39div.sphx-pyq-thumb .figure { 

40 margin: 10px; 

41 width: 160px; 

42} 

43 

44div.sphx-pyq-thumb img { 

45 max-width: 100%; 

46 max-height: 160px; 

47 display: inline; 

48} 

49 

50div.sphx-pyq-thumb[tooltip]:hover:after { 

51 background: rgba(0, 0, 0, 0.8); 

52 -webkit-border-radius: 5px; 

53 -moz-border-radius: 5px; 

54 border-radius: 5px; 

55 color: white; 

56 content: attr(tooltip); 

57 left: 95%; 

58 padding: 5px 15px; 

59 position: absolute; 

60 z-index: 98; 

61 width: 220px; 

62 bottom: 52%; 

63} 

64 

65div.sphx-pyq-thumb[tooltip]:hover:before { 

66 content: ""; 

67 position: absolute; 

68 z-index: 99; 

69 border: solid; 

70 border-color: #333 transparent; 

71 border-width: 18px 0px 0px 20px; 

72 left: 85%; 

73 bottom: 58%; 

74} 

75 

76.sphx-pyq-download { 

77 background-color: #ffc; 

78 border: 1px solid #c2c22d; 

79 border-radius: 4px; 

80 margin: 1em auto 1ex auto; 

81 max-width: 45ex; 

82 padding: 1ex; 

83} 

84 

85.sphx-pyq-download a { 

86 color: #4b4600; 

87} 

88""" 

89 

90 

91#: base string for creating the thumbnail, layout=classic 

92THUMBNAIL_TEMPLATE = """ 

93.. raw:: html 

94 

95 <div class="sphx-pyq-thumb" tooltip="{snippet}"> 

96 

97.. only:: html 

98 

99 .. figure:: /{thumbnail} 

100 

101 :ref:`{ref_name}` 

102 

103.. raw:: html 

104 

105 </div> 

106""" 

107 

108#: base string for creating the thumbnail, layout=table 

109THUMBNAIL_TEMPLATE_TABLE = """ * - .. image:: /{thumbnail} 

110 :target: {nb_name} 

111 - :ref:`{ref_name}` 

112 - {snippet}"""