Pclanglais commited on
Commit
4fa44c7
1 Parent(s): 4512bf7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +17 -11
app.py CHANGED
@@ -23,25 +23,29 @@ css = """
23
  <style>
24
  .manuscript {
25
  display: flex;
26
- margin-bottom: 20px;
27
- align-items: flex-start; /* Align items to the top */
28
  }
29
  .annotation {
30
- width: 10%;
31
- padding-right: 20px;
32
- color: grey;
33
  font-style: italic;
34
- padding-top: 5px; /* Add some top padding to align with the title */
35
  }
36
  .content {
37
- width: 70%;
38
  }
39
  h2 {
40
- margin-top: 0;
41
- margin-bottom: 10px; /* Add some bottom margin for spacing */
42
  }
43
- .title-content {
44
- margin-top: -5px; /* Negative margin to offset the padding of annotation */
 
 
 
 
45
  }
46
  </style>
47
  """
@@ -116,6 +120,8 @@ def transform_chunks(marianne_segmentation):
116
 
117
  if entity_group == 'title':
118
  html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content title-content"><h2>{word}</h2></div></div>')
 
 
119
  else:
120
  html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content">{word}</div></div>')
121
 
 
23
  <style>
24
  .manuscript {
25
  display: flex;
26
+ margin-bottom: 10px;
27
+ align-items: baseline;
28
  }
29
  .annotation {
30
+ width: 20%;
31
+ padding-right: 10px;
32
+ color: grey !important;
33
  font-style: italic;
34
+ text-align: right;
35
  }
36
  .content {
37
+ width: 80%;
38
  }
39
  h2 {
40
+ margin: 0;
41
+ font-size: 1.5em;
42
  }
43
+ .title-content h2 {
44
+ font-weight: bold;
45
+ }
46
+ .bibliography-content {
47
+ color:darkgreen !important;
48
+ margin-top: -5px; /* Adjust if needed to align with annotation */
49
  }
50
  </style>
51
  """
 
120
 
121
  if entity_group == 'title':
122
  html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content title-content"><h2>{word}</h2></div></div>')
123
+ elif entity_group == 'bibliography':
124
+ html_output.append(f'<div class="manuscript"><div class="annotation">[{annotation}]</div><div class="content bibliography-content">{word}</div></div>')
125
  else:
126
  html_output.append(f'<div class="manuscript"><div class="annotation">{result_entity}</div><div class="content">{word}</div></div>')
127